Numworks Epsilon  1.4.1
Graphing Calculator Operating System
nvic.h
Go to the documentation of this file.
1 #ifndef REGS_NVIC_H
2 #define REGS_NVIC_H
3 
4 #include "register.h"
5 
6 // http://www.st.com/content/ccc/resource/technical/document/programming_manual/6c/3a/cb/e7/e4/ea/44/9b/DM00046982.pdf/files/DM00046982.pdf/jcr:content/translations/en.DM00046982.pdf
7 class NVIC {
8 public:
10  public:
11  bool get(int index) { return (bool)getBitRange(index, index); }
12  void set(int index, bool state) volatile { setBitRange(index, index, state); }
13  };
14 
15  class NVIC_ISER0 : public MaskRegister { };
16  class NVIC_ISER1 : public MaskRegister { };
17  class NVIC_ISER2 : public MaskRegister { };
18  class NVIC_ICER0 : public MaskRegister { };
19  class NVIC_ICER1 : public MaskRegister { };
20  class NVIC_ICER2 : public MaskRegister { };
21 
22  constexpr NVIC() {};
23  REGS_REGISTER_AT(NVIC_ISER0, 0x00);
24  REGS_REGISTER_AT(NVIC_ISER1, 0x04);
25  REGS_REGISTER_AT(NVIC_ISER2, 0x08);
26  REGS_REGISTER_AT(NVIC_ICER0, 0x80);
27  REGS_REGISTER_AT(NVIC_ICER1, 0x84);
28  REGS_REGISTER_AT(NVIC_ICER2, 0x88);
29 private:
30  constexpr uint32_t Base() const {
31  return 0xE000E100;
32  }
33 };
34 
35 constexpr NVIC NVIC;
36 
37 #endif
Definition: nvic.h:7
REGS_REGISTER_AT(NVIC_ISER0, 0x00)
unsigned int uint32_t
Definition: stdint.h:6
void setBitRange(uint8_t high, uint8_t low, T value) volatile
Definition: register.h:21
constexpr NVIC NVIC
Definition: nvic.h:35
constexpr NVIC()
Definition: nvic.h:22
T getBitRange(uint8_t high, uint8_t low) volatile
Definition: register.h:24