-
Notifications
You must be signed in to change notification settings - Fork 1
/
pins64.txt
90 lines (81 loc) · 4.38 KB
/
pins64.txt
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
//this file is for 64 pins - pic32mmxxxxgpm064
//this file included inline into Pins.hpp
//helper enum
enum : uint8_t {
PTSHIFT = 4, PTMASK = 3,
PNSHIFT = 0, PNMASK = 15,
RPSHIFT = 6, RPMASK = 31,
ANSHIFT = 11, ANMASK = 31
};
//use any format you wish-> A0, RP1, AN0, PIN11
//all will refer to the same pin with the appropriate functions
enum
RPN : uint16_t {
// encode as- 0xaaaaarrrrrppnnnn - | ANn | RPn | PORT | PIN |
// aaaaa = ANn = 0-19
// pp = port A=0,B=1,C=2,D=3
// nnnn = pin = 0-15
// rrrrr = RPn = 1-24
//pins without AN (analog in) will be set to use AVss (29) as AN
//input (since AN0 is 0, we need something other than 0 to signify
//no AN for pin, so we will just give it something that will result
//in no result if ever used adcval() by mistake)
//A0 - A15
A0 = 0|1<<RPSHIFT|0<<ANSHIFT, A1 = 1|2<<RPSHIFT|1<<ANSHIFT,
A2 = 2|3<<RPSHIFT|5<<ANSHIFT, A3 = 3|4<<RPSHIFT|6<<ANSHIFT,
A4 = 4|5<<RPSHIFT|29<<ANSHIFT, A5 = 5|29<<ANSHIFT,
A6 = 6|19<<ANSHIFT, A7 = 7|21<<RPSHIFT|29<<ANSHIFT,
A8 = 8|29<<ANSHIFT, A9 = 9|24<<RPSHIFT|29<<ANSHIFT,
A10 = 10|22<<RPSHIFT|29<<ANSHIFT, A11 = 11|18<<ANSHIFT,
A12 = 12|17<<ANSHIFT, A13 = 13|16<<ANSHIFT,
A14 = 14|29<<ANSHIFT, A15 = 15|29<<ANSHIFT,
//B0-B15
B0 = 16|6<<RPSHIFT|2<<ANSHIFT, B1 = 17|7<<RPSHIFT|3<<ANSHIFT,
B2 = 18|8<<RPSHIFT|4<<ANSHIFT, B3 = 19|9<<RPSHIFT|11<<ANSHIFT,
B4 = 20|10<<RPSHIFT|7<<ANSHIFT, B5 = 21|11<<RPSHIFT|29<<ANSHIFT,
B6 = 22|29<<ANSHIFT, B7 = 23|12<<RPSHIFT|29<<ANSHIFT,
B8 = 24|13<<RPSHIFT|29<<ANSHIFT, B9 = 25|14<<RPSHIFT|29<<ANSHIFT,
B10 = 26|29<<ANSHIFT, B11 = 27|29<<ANSHIFT,
/*no B12*/ B13 = 29|15<<RPSHIFT|8<<ANSHIFT,
B14 = 30|16<<RPSHIFT|9<<ANSHIFT, B15 = 31|17<<RPSHIFT|10<<ANSHIFT,
//C0-C15
C0 = 32|12<<ANSHIFT, C1 = 33|13<<ANSHIFT,
C2 = 34|19<<RPSHIFT|29<<ANSHIFT, C3 = 35|29<<ANSHIFT,
C4 = 36|29<<ANSHIFT, C5 = 37|15<<ANSHIFT,
C6 = 38|23<<RPSHIFT|29<<ANSHIFT, C7 = 39|20<<RPSHIFT|29<<ANSHIFT,
C8 = 40|14<<ANSHIFT, C9 = 41|18<<RPSHIFT|29<<ANSHIFT,
C10 = 42|29<<ANSHIFT, C11 = 43|29<<ANSHIFT,
C12 = 44|29<<ANSHIFT, C13 = 45|29<<ANSHIFT,
C14 = 46|29<<ANSHIFT, C15 = 47|29<<ANSHIFT,
//D0-D4
D0 = 48|29<<ANSHIFT, D1 = 49|29<<ANSHIFT,
D2 = 50|29<<ANSHIFT, D3 = 51|29<<ANSHIFT,
D4 = 52|29<<ANSHIFT,
//RPn 1-24
RP1 = A0, RP2 = A1, RP3 = A2, RP4 = A3,
RP5 = A4, RP6 = B0, RP7 = B1, RP8 = B2,
RP9 = B3, RP10 = B4, RP11 = B5, RP12 = B7,
RP13 = B8, RP14 = B9, RP15 = B13, RP16 = B14,
RP17 = B15, RP18 = C9, RP19 = C2, RP20 = C7,
RP21 = A7, RP22 = A10, RP23 = C6, RP24 = A9,
//ANn 0-19
AN0 = A0, AN1 = A1, AN2 = B0, AN3 = B1, AN4 = B2, AN5 = A2,
AN6 = A3, AN7 = B4, AN8 = B13, AN9 = B14, AN10 = B15, AN11 = B3,
AN12 = C0, AN13 = C1, AN14 = C8, AN15 = C5, AN16 = A13, AN17 = A12,
AN18 = A11, AN19 = A6,
//PINn 1-64
PIN1 = A7, PIN2 = B14, PIN3 = B15, /*PIN4 = AVss, PIN5 = AVdd,*/
PIN6 = A13, PIN7 = A12, PIN8 = A11, /*PIN9 = MCLR,*/ PIN10 = A6,
PIN11 = A0, PIN12 = A1, PIN13 = B0, PIN14 = B1, PIN15 = B2,
PIN16 = B3, /*PIN17 = Vdd, PIN18 = Vss,*/ PIN19 = C0, PIN20 = C1,
PIN21 = C2, PIN22 = C11, /*PIN23 = Vdd, PIN24 = Vss,*/ PIN25 = A2,
PIN26 = A3, PIN27 = A8, PIN28 = B4, PIN29 = A4, PIN30 = A9,
PIN31 = D4, PIN32 = D2, PIN33 = D3, PIN34 = D0, PIN35 = C3,
PIN36 = C4, PIN37 = C5, /*PIN38 = Vss, PIN39 = Vdd,*/ PIN40 = C12,
PIN41 = C14, PIN42 = C15, PIN43 = B5, PIN44 = B6, PIN45 = C10,
PIN46 = B7, PIN47 = C13, PIN48 = B8, PIN49 = B9, PIN50 = C6,
PIN51 = C7, PIN52 = C8, PIN53 = D1, PIN54 = A5, PIN55 = C9,
/*PIN56 = Vcap, PIN57 = Vdd,*/ PIN58 = A15, PIN59 = A14,
PIN60 = B10, PIN61 = B11, /*PIN62 = Vusb,*/ PIN63 = B13,
PIN64 = A10
};