HWA
Bare metal programming with style
gpb_1.h
Go to the documentation of this file.
1 
2 /* This file is part of the HWA project.
3  * Copyright (c) 2021 Christophe Duparquet.
4  * All rights reserved. Read LICENSE.TXT for details.
5  */
6 
12 /* Load pins implementation definitions
13  */
14 #include "iob_1.h"
15 
16 #define hw_class__gpb
17 
31 #define hw__gpb_ , _hw_gpb_
32 #define _hw_gpb_(o,n,a) HW_BX(_hw_gpb_,_hw_isa_4bn_,n)(o,n)
33 #define _hw_gpb_1(o,n) _iob,o##_1_##n,(o,1,n)
34 #define _hw_gpb_0(o,n) ,(o,n),HW_EM(o has no relative n)
35 
36 
37 /* Class registers class, address, rwm, rfm
38  */
39 #define hw__gpb_mode _r32, 0x00, 0xffffffff, 0
40 #define hw__gpb_otype _r32, 0x04, 0xffffffff, 0
41 #define hw__gpb_ospeed _r32, 0x08, 0xffffffff, 0
42 #define hw__gpb_pupd _r32, 0x0C, 0xffffffff, 0
43 #define hw__gpb_idr _r32, 0x10, 0x00000000, 0
44 #define hw__gpb_odr _r32, 0x14, 0x0000ffff, 0
45 #define hw__gpb_bsrr _r32, 0x18, 0xffffffff, 0xffffffff
46 #define hw__gpb_lckr _r32, 0x1C, 0x0001ffff, 0
47 #define hw__gpb_afrl _r32, 0x20, 0xffffffff, 0
48 #define hw__gpb_afrh _r32, 0x24, 0xffffffff, 0
49 
50 
51 #if !defined __ASSEMBLER__
52 
53 typedef struct {
54  hwa_r32_t mode ;
55  hwa_r32_t otype ;
56  hwa_r32_t ospeed ;
57  hwa_r32_t pupd ;
58  hwa_r32_t odr ;
59  hwa_r32_t bsrr ;
60  hwa_r32_t lckr ;
61  hwa_r32_t afrl ;
62  hwa_r32_t afrh ;
63 
64  uint32_t toggles ;
65 } hwa_gpb_t ;
66 
67 #endif
iob_1.h
I/O.