HWA
Bare metal programming with style
afioa_1.h
Go to the documentation of this file.
1 
2 /* This file is part of the HWA project.
3  * Copyright (c) 2019 Christophe Duparquet.
4  * All rights reserved. Read LICENSE.TXT for details.
5  */
6 
17 #define hw_class__afioa
18 
19 /* Hardware registers // Reset value
20  */
21 /* #define hw__afioa_evcr _r32, 0x00, 0x0000001F, 0 // 0 */
22 #define hw__afioa_mapr _r32, 0x04, 0x071FFFFF, 0 // 0
23 /* #define hw__afioa_exticr1 _r32, 0x08, 0x0000FFFF, 0 // 0 */
24 /* #define hw__afioa_exticr2 _r32, 0x0C, 0x000003FF, 0 // 0 */
25 /* #define hw__afioa_exticr3 _r32, 0x10, 0x00007F6F, 0 // 0 */
26 /* #define hw__afioa_exticr4 _r32, 0x14, 0x000007FF, 0 // 0 */
27 /* #define hw__afioa_mapr2 _r32, 0x1C, 0x0000FFFF, 0 // 0 */
28 
29 /* Logical registers
30  */
31 /* #define hw__afioa_evoe _cb1, evcr, 1, 7 */
32 /* #define hw__afioa_port _cb1, evcr, 3, 4 */
33 /* #define hw__afioa_pin _cb1, evcr, 4, 0 */
34 
35 #define hw__afioa_swj_cfg _cb1, mapr, 3, 24
36 #define hw__afioa_adc2_etrgreg_remap _cb1, mapr, 1, 20
37 #define hw__afioa_adc2_etrging_remap _cb1, mapr, 1, 19
38 #define hw__afioa_adc1_etrgreg_remap _cb1, mapr, 1, 18
39 #define hw__afioa_adc1_etrging_remap _cb1, mapr, 1, 17
40 /* To be continued */
41 //#define hw__afioa_tim2_remap _cb1, mapr, 2, 8
42 #define hw__afioa_counter2_remap _cb1, mapr, 2, 8
43 //#define hw__afioa_counter2_remap (tim2_remap)
44 /* To be continued */
45 #define hw__afioa_usart1_remap _cb1, mapr, 1, 2
46 /* To be continued */
47 
48 
49 #if !defined __ASSEMBLER__
50 
51 typedef struct {
52  /* hwa_r32_t evcr ; */
53  hwa_r32_t mapr ;
54  /* hwa_r32_t exticr1 ; */
55  /* hwa_r32_t exticr2 ; */
56  /* hwa_r32_t exticr3 ; */
57  /* hwa_r32_t exticr4 ; */
58  /* hwa_r32_t mapr2 ; */
59  /* struct { */
60  /* uint32_t usart1_tx, usart1_rx ; */
61  /* uint32_t counter2_channel1 ; */
62  /* uint32_t wkup ; */
63  /* } map ; */
64 } hwa_afioa_t ;
65 
66 
67 /* Table of signals mapping for alternate pin functions
68  *
69  * Each signal name gets the address of the pin that must be configured for
70  * this alternate function.
71  */
72 typedef struct {
73  uint8_t error ;
74 
75  int8_t counter2_remap ;
76  uint32_t counter2_etr ;
77  uint32_t counter2_channel1 ;
78  uint32_t counter2_channel2 ;
79  uint32_t counter2_channel3 ;
80  uint32_t counter2_channel4 ;
81 } hwa_map_t ;
82 
83 
84 #endif