HWA
Bare metal programming with style
ahba_2.h
Go to the documentation of this file.
1
2
/* This file is part of the HWA project.
3
* Copyright (c) 2017 Christophe Duparquet.
4
* All rights reserved. Read LICENSE.TXT for details.
5
*/
6
12
#define _hw_actions__ahba , (clock)
13
#define _hwa_actions__ahba , (clock)
14
32
#define hw_clock__ahba , _hw_ckahba
33
#define _hw_ckahba(o,a,v,...) do{ HW_BV(_hwx_ckahba,ckahba_,v,_hw,v,__VA_ARGS__) }while(0)
34
35
#define hwa_clock__ahba , _hwa_ckahba
36
#define _hwa_ckahba(o,a,v,...) do{ HW_BV(_hwx_ckahba,ckahba_,v,_hwa,v,__VA_ARGS__) }while(0)
37
38
#define _hw_ckahba_sysclk , 1
39
40
#define _hwx_ckahba0(v,...) HW_E(HW_EM_XNIL(v,(sysclk)))
41
#define _hwx_ckahba1(r,h,v,...) \
42
if ( r == 1 ) h##_write(rcc,hpre, 0); \
43
else if ( 2*r == 1 ) h##_write(rcc,hpre, 8); \
44
else if ( 4*r == 1 ) h##_write(rcc,hpre, 9); \
45
else if ( 8*r == 1 ) h##_write(rcc,hpre,10); \
46
else if ( 16*r == 1 ) h##_write(rcc,hpre,11); \
47
else if ( 64*r == 1 ) h##_write(rcc,hpre,12); \
48
else if ( 128*r == 1 ) h##_write(rcc,hpre,13); \
49
else if ( 256*r == 1 ) h##_write(rcc,hpre,14); \
50
else if ( 512*r == 1 ) h##_write(rcc,hpre,15); \
51
else HWA_E(HW_EM_VAL(v,clock,(1, 2, 4, 8, 16, 64, 128, 256, 512))); \
52
HW_EOL(__VA_ARGS__)
Generated for HWA by
1.8.6