Numworks Epsilon  1.4.1
Graphing Calculator Operating System
itm.h
Go to the documentation of this file.
1 #ifndef REGS_ITM_H
2 #define REGS_ITM_H
3 
4 #include "register.h"
5 
6 // See ARM Cortex M4 TRM
7 
8 class ITM {
9 public:
10  class STIM : public Register8 {
11  };
12 
13  // http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0314h/Chdbicac.html
14  class TER : Register32 {
15  public:
16  bool get(int index) volatile { return (bool)getBitRange(index, index); }
17  };
18 
19  constexpr ITM() {};
20  volatile STIM * STIM(int i) const {
21  return (class STIM *)(Base() + 4*i);
22  };
23  REGS_REGISTER_AT(TER, 0xE00);
24 private:
25  constexpr uint32_t Base() const {
26  return 0xE0000000;
27  }
28 };
29 
30 constexpr ITM ITM;
31 
32 #endif
Definition: itm.h:8
Definition: itm.h:10
Definition: itm.h:14
constexpr ITM()
Definition: itm.h:19
REGS_REGISTER_AT(TER, 0xE00)
unsigned int uint32_t
Definition: stdint.h:6
constexpr ITM ITM
Definition: itm.h:30
volatile STIM * STIM(int i) const
Definition: itm.h:20
T getBitRange(uint8_t high, uint8_t low) volatile
Definition: register.h:24