6663b6c9
adorian
projet complet av...
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
#ifndef REGS_EXTI_H
#define REGS_EXTI_H
#include "register.h"
class EXTI {
public:
class MaskRegister : Register32 {
public:
bool get(int index) { return (bool)getBitRange(index, index); }
void set(int index, bool state) volatile { setBitRange(index, index, state); }
};
class IMR : public MaskRegister { };
class EMR : public MaskRegister { };
class RTSR : public MaskRegister { };
class FTSR : public MaskRegister { };
class PR : public MaskRegister { };
constexpr EXTI() {};
REGS_REGISTER_AT(IMR, 0x00);
REGS_REGISTER_AT(EMR, 0x04);
REGS_REGISTER_AT(RTSR, 0x08);
REGS_REGISTER_AT(FTSR, 0x0C);
REGS_REGISTER_AT(PR, 0x14);
private:
constexpr uint32_t Base() const {
return 0x40013C00;
}
};
constexpr EXTI EXTI;
#endif
|