summaryrefslogtreecommitdiffstats
path: root/reg/port.h
blob: 23cf77f5f5b1216740d22b30ca78e65d2d5a2b7d (plain)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/* Port control and interrupts (PORT) (Chapter 11) */
#ifndef MK20DX256_REG_PORT_H
#define MK20DX256_REG_PORT_H

#include <reg/regdefs.h>

// Pin Control Register n
#define PORTA_PCR(n) REG_32(0x40049000 + 4 * (n))
// Pin Control Register n
#define PORTB_PCR(n) REG_32(0x4004A000 + 4 * (n))
// Pin Control Register n
#define PORTC_PCR(n) REG_32(0x4004B000 + 4 * (n))
// Pin Control Register n
#define PORTD_PCR(n) REG_32(0x4004C000 + 4 * (n))
// Pin Control Register n
#define PORTE_PCR(n) REG_32(0x4004D000 + 4 * (n))
enum {
	PCR_ISF = 24, // Interrupt Status Flag
	PCR_IRQC = 16, // Interrupt Configuration
	PCR_IRQC_M = REG_32_M(PCR_IRQC, 4),
	PCR_LK = 15, // Lock Register
	PCR_MUX = 8, // Pin Mux Control
	PCR_MUX_M = REG_32_M(PCR_MUX, 3),
	PCR_DSE = 6, // Drive Strength Enable
	PCR_ODE = 5, // Open Drain Enable
	PCR_PFE = 4, // Passive Filter Enable
	PCR_SRE = 2, // Slew Rate Enable
	PCR_PE = 1, // Pull Enable
	PCR_PS = 0, // Pull Select
};

// Global Pin Control Low Register
#define PORTA_GPCLR REG_32(0x40049080)
// Global Pin Control Low Register
#define PORTB_GPCLR REG_32(0x4004A080)
// Global Pin Control Low Register
#define PORTC_GPCLR REG_32(0x4004B080)
// Global Pin Control Low Register
#define PORTD_GPCLR REG_32(0x4004C080)
// Global Pin Control Low Register
#define PORTE_GPCLR REG_32(0x4004D080)

// Global Pin Control High Register
#define PORTA_GPCHR REG_32(0x40049084)
// Global Pin Control High Register
#define PORTB_GPCHR REG_32(0x4004A084)
// Global Pin Control High Register
#define PORTC_GPCHR REG_32(0x4004B084)
// Global Pin Control High Register
#define PORTD_GPCHR REG_32(0x4004C084)
// Global Pin Control High Register
#define PORTE_GPCHR REG_32(0x4004D084)

// Interrupt Status Flag Register
#define PORTA_ISFR REG_32(0x400490A0)
// Interrupt Status Flag Register
#define PORTB_ISFR REG_32(0x4004A0A0)
// Interrupt Status Flag Register
#define PORTC_ISFR REG_32(0x4004B0A0)
// Interrupt Status Flag Register
#define PORTD_ISFR REG_32(0x4004C0A0)
// Interrupt Status Flag Register
#define PORTE_ISFR REG_32(0x4004D0A0)

#endif /* MK20DX256_REG_PORT_H */