ATmega2560
Hardware definitions
Loading...
Searching...
No Matches
Pin.h
Go to the documentation of this file.
1
5
6#ifndef ATMEGA2560_DEFINITIONS_PIN_H
7#define ATMEGA2560_DEFINITIONS_PIN_H
8
9#include <stdint.h>
10#include "Config.h"
11
13namespace atmega2560
14{
16 namespace pin
17 {
19 enum class Port : uint8_t
20 {
21 A = 0,
22 B = 1,
23 C = 2,
24 D = 3,
25 E = 4,
26 F = 5,
27 G = 6,
28 H = 7,
29 J = 8,
30 K = 9,
31 L = 10,
32 };
33
34 enum class Pin : uint8_t
35 {
36 PA0 = 0x00,
37 PA1 = 0x01,
38 PA2 = 0x02,
39 PA3 = 0x03,
40 PA4 = 0x04,
41 PA5 = 0x05,
42 PA6 = 0x06,
43 PA7 = 0x07,
44 PB0 = 0x10,
45 PB1 = 0x11,
46 PB2 = 0x12,
47 PB3 = 0x13,
48 PB4 = 0x14,
49 PB5 = 0x15,
50 PB6 = 0x16,
51 PB7 = 0x17,
52 PC0 = 0x20,
53 PC1 = 0x21,
54 PC2 = 0x22,
55 PC3 = 0x23,
56 PC4 = 0x24,
57 PC5 = 0x25,
58 PC6 = 0x26,
59 PC7 = 0x27,
60 PD0 = 0x30,
61 PD1 = 0x31,
62 PD2 = 0x32,
63 PD3 = 0x33,
64 PD4 = 0x34,
65 PD5 = 0x35,
66 PD6 = 0x36,
67 PD7 = 0x37,
68 PE0 = 0x40,
69 PE1 = 0x41,
70 PE2 = 0x42,
71 PE3 = 0x43,
72 PE4 = 0x44,
73 PE5 = 0x45,
74 PE6 = 0x46,
75 PE7 = 0x47,
76 PF0 = 0x50,
77 PF1 = 0x51,
78 PF2 = 0x52,
79 PF3 = 0x53,
80 PF4 = 0x54,
81 PF5 = 0x55,
82 PF6 = 0x56,
83 PF7 = 0x57,
84 PG0 = 0x60,
85 PG1 = 0x61,
86 PG2 = 0x62,
87 PG3 = 0x63,
88 PG4 = 0x64,
89 PG5 = 0x65,
90 PH0 = 0x70,
91 PH1 = 0x71,
92 PH2 = 0x72,
93 PH3 = 0x73,
94 PH4 = 0x74,
95 PH5 = 0x75,
96 PH6 = 0x76,
97 PH7 = 0x77,
98 PJ0 = 0x80,
99 PJ1 = 0x81,
100 PJ2 = 0x82,
101 PJ3 = 0x83,
102 PJ4 = 0x84,
103 PJ5 = 0x85,
104 PJ6 = 0x86,
105 PJ7 = 0x87,
106 PK0 = 0x90,
107 PK1 = 0x91,
108 PK2 = 0x92,
109 PK3 = 0x93,
110 PK4 = 0x94,
111 PK5 = 0x95,
112 PK6 = 0x96,
113 PK7 = 0x97,
114 PL0 = 0xA0,
115 PL1 = 0xA1,
116 PL2 = 0xA2,
117 PL3 = 0xA3,
118 PL4 = 0xA4,
119 PL5 = 0xA5,
120 PL6 = 0xA6,
121 PL7 = 0xA7,
122 };
123
124 enum : uint8_t
125 {
127 port_mask = 0xF0,
128 bit_mask = 0x0F,
130 };
132 enum : uint8_t
133 {
145 };
147 enum : uint8_t
148 {
160 };
161 }
162 using pin::Pin;
163 using pin::Port;
164}
165
166#endif
Device, package and operating-grade selection.
Logical pin and alternate function identifiers definitions.
Definition Pin.h:17
Pin
Package-independent logical GPIO pins.
Definition Pin.h:35
@ PA6
Port A bit 6.
Definition Pin.h:42
@ PJ3
Port J bit 3.
Definition Pin.h:101
@ PC6
Port C bit 6.
Definition Pin.h:58
@ PB5
Port B bit 5.
Definition Pin.h:49
@ PJ0
Port J bit 0.
Definition Pin.h:98
@ PL3
Port L bit 3.
Definition Pin.h:117
@ PL6
Port L bit 6.
Definition Pin.h:120
@ PD4
Port D bit 4.
Definition Pin.h:64
@ PK6
Port K bit 6.
Definition Pin.h:112
@ PH1
Port H bit 1.
Definition Pin.h:91
@ PH3
Port H bit 3.
Definition Pin.h:93
@ PG4
Port G bit 4.
Definition Pin.h:88
@ PH6
Port H bit 6.
Definition Pin.h:96
@ PC3
Port C bit 3.
Definition Pin.h:55
@ PH4
Port H bit 4.
Definition Pin.h:94
@ PF3
Port F bit 3.
Definition Pin.h:79
@ PL5
Port L bit 5.
Definition Pin.h:119
@ PL2
Port L bit 2.
Definition Pin.h:116
@ PC0
Port C bit 0.
Definition Pin.h:52
@ PB7
Port B bit 7.
Definition Pin.h:51
@ PC2
Port C bit 2.
Definition Pin.h:54
@ PL1
Port L bit 1.
Definition Pin.h:115
@ PB3
Port B bit 3.
Definition Pin.h:47
@ PG3
Port G bit 3.
Definition Pin.h:87
@ PL0
Port L bit 0.
Definition Pin.h:114
@ PF5
Port F bit 5.
Definition Pin.h:81
@ PK7
Port K bit 7.
Definition Pin.h:113
@ PF2
Port F bit 2.
Definition Pin.h:78
@ PJ5
Port J bit 5.
Definition Pin.h:103
@ PH2
Port H bit 2.
Definition Pin.h:92
@ PA2
Port A bit 2.
Definition Pin.h:38
@ PE5
Port E bit 5.
Definition Pin.h:73
@ PH7
Port H bit 7.
Definition Pin.h:97
@ PD7
Port D bit 7.
Definition Pin.h:67
@ PK0
Port K bit 0.
Definition Pin.h:106
@ PJ2
Port J bit 2.
Definition Pin.h:100
@ PD0
Port D bit 0.
Definition Pin.h:60
@ PB0
Port B bit 0.
Definition Pin.h:44
@ PE6
Port E bit 6.
Definition Pin.h:74
@ PA0
Port A bit 0.
Definition Pin.h:36
@ PC7
Port C bit 7.
Definition Pin.h:59
@ PD6
Port D bit 6.
Definition Pin.h:66
@ PE7
Port E bit 7.
Definition Pin.h:75
@ PF4
Port F bit 4.
Definition Pin.h:80
@ PH5
Port H bit 5.
Definition Pin.h:95
@ PB6
Port B bit 6.
Definition Pin.h:50
@ PE3
Port E bit 3.
Definition Pin.h:71
@ PE1
Port E bit 1.
Definition Pin.h:69
@ PJ7
Port J bit 7.
Definition Pin.h:105
@ PC4
Port C bit 4.
Definition Pin.h:56
@ PC1
Port C bit 1.
Definition Pin.h:53
@ PL4
Port L bit 4.
Definition Pin.h:118
@ PG0
Port G bit 0.
Definition Pin.h:84
@ PB2
Port B bit 2.
Definition Pin.h:46
@ PA1
Port A bit 1.
Definition Pin.h:37
@ PD3
Port D bit 3.
Definition Pin.h:63
@ PF0
Port F bit 0.
Definition Pin.h:76
@ PA4
Port A bit 4.
Definition Pin.h:40
@ PG2
Port G bit 2.
Definition Pin.h:86
@ PA7
Port A bit 7.
Definition Pin.h:43
@ PK2
Port K bit 2.
Definition Pin.h:108
@ PK4
Port K bit 4.
Definition Pin.h:110
@ PA5
Port A bit 5.
Definition Pin.h:41
@ PE4
Port E bit 4.
Definition Pin.h:72
@ PK3
Port K bit 3.
Definition Pin.h:109
@ PE0
Port E bit 0.
Definition Pin.h:68
@ PK1
Port K bit 1.
Definition Pin.h:107
@ PB4
Port B bit 4.
Definition Pin.h:48
@ PJ6
Port J bit 6.
Definition Pin.h:104
@ PL7
Port L bit 7.
Definition Pin.h:121
@ PD1
Port D bit 1.
Definition Pin.h:61
@ PJ1
Port J bit 1.
Definition Pin.h:99
@ PH0
Port H bit 0.
Definition Pin.h:90
@ PJ4
Port J bit 4.
Definition Pin.h:102
@ PC5
Port C bit 5.
Definition Pin.h:57
@ PG1
Port G bit 1.
Definition Pin.h:85
@ PF7
Port F bit 7.
Definition Pin.h:83
@ PD2
Port D bit 2.
Definition Pin.h:62
@ PK5
Port K bit 5.
Definition Pin.h:111
@ PF1
Port F bit 1.
Definition Pin.h:77
@ PA3
Port A bit 3.
Definition Pin.h:39
@ PD5
Port D bit 5.
Definition Pin.h:65
@ PF6
Port F bit 6.
Definition Pin.h:82
@ PG5
Port G bit 5.
Definition Pin.h:89
@ PE2
Port E bit 2.
Definition Pin.h:70
@ PB1
Port B bit 1.
Definition Pin.h:45
@ port_b_width
Port B width.
Definition Pin.h:150
@ port_d_width
Port D width.
Definition Pin.h:152
@ port_l_width
Port L width.
Definition Pin.h:159
@ port_h_width
Port H width.
Definition Pin.h:156
@ port_a_width
Port A width.
Definition Pin.h:149
@ port_f_width
Port F width.
Definition Pin.h:154
@ port_k_width
Port K width.
Definition Pin.h:158
@ port_e_width
Port E width.
Definition Pin.h:153
@ port_g_width
Port G width.
Definition Pin.h:155
@ port_j_width
Port J width.
Definition Pin.h:157
@ port_c_width
Port C width.
Definition Pin.h:151
@ port_f_code
Port F code.
Definition Pin.h:139
@ port_e_code
Port E code.
Definition Pin.h:138
@ port_h_code
Port H code.
Definition Pin.h:141
@ port_b_code
Port B code.
Definition Pin.h:135
@ port_l_code
Port L code.
Definition Pin.h:144
@ port_k_code
Port K code.
Definition Pin.h:143
@ port_g_code
Port G code.
Definition Pin.h:140
@ port_j_code
Port J code.
Definition Pin.h:142
@ port_c_code
Port C code.
Definition Pin.h:136
@ port_d_code
Port D code.
Definition Pin.h:137
@ port_a_code
Port A code.
Definition Pin.h:134
Port
GPIO ports.
Definition Pin.h:20
@ C
GPIO port C.
Definition Pin.h:23
@ E
GPIO port E.
Definition Pin.h:25
@ A
GPIO port A.
Definition Pin.h:21
@ F
GPIO port F.
Definition Pin.h:26
@ B
GPIO port B.
Definition Pin.h:22
@ K
GPIO port K.
Definition Pin.h:30
@ H
GPIO port H.
Definition Pin.h:28
@ L
GPIO port L.
Definition Pin.h:31
@ G
GPIO port G.
Definition Pin.h:27
@ D
GPIO port D.
Definition Pin.h:24
@ J
GPIO port J.
Definition Pin.h:29
@ port_shift
port shift.
Definition Pin.h:126
@ bit_mask
bit mask.
Definition Pin.h:128
@ pin_count
pin count.
Definition Pin.h:129
@ port_mask
port mask.
Definition Pin.h:127
ATmega2560 hardware definitions.
Definition ADC.h:15