HWA
Bare metal programming with style
ctb_1.h
Go to the documentation of this file.
1 
2 /* This file is part of the HWA project.
3  * Copyright (c) 2012,2015 Christophe Duparquet.
4  * All rights reserved. Read LICENSE.TXT for details.
5  */
6 
33 #define hw_class__ctb
34 
35 #define HW_BITS__ctb , _hw_bits_ctb
36 #define _hw_bits_ctb(o,a,...) 8
37 
38 #define hw__ctb_bits , _hw_bits_ctb
39 
40 
41 /* Return the counting register of a _ctb
42  */
43 #define hw__ctb_reg , _hw_ctb_reg
44 #define _hw_ctb_reg(o,a) HW_XOR(o,count) /* HW_CODR is blued */
45 
46 
47 #if !defined __ASSEMBLER__
48 
49 /* Context
50  */
51 typedef struct {
52 
53  /* Hardware registers
54  */
55  hwa_r8_t ccr ;
56  hwa_r8_t count ;
57  hwa_r8_t ocr0 ;
58  hwa_r8_t ocr1 ;
59  hwa_r8_t ocr2 ;
60  hwa_r8_t dta ;
61  hwa_r8_t dtb ;
62  hwa_r8_t dtps ;
63 
64  hwa_ocb_t compare0 ;
65  hwa_ocb_t compare1 ;
66 } hwa_ctb_t ;
67 
68 #endif