23 #if defined(PIC16F1705) || defined(PIC16LF1705) 24 const PinDef c_PIN_RA0 = {0b00000000, &RA0PPS, 0b00000001, &TRISA, &PORTA, &ANSELA, &LATA};
25 const PinDef c_PIN_RA1 = {0b00000001, &RA1PPS, 0b00000010, &TRISA, &PORTA, &ANSELA, &LATA};
26 const PinDef c_PIN_RA2 = {0b00000010, &RA2PPS, 0b00000100, &TRISA, &PORTA, &ANSELA, &LATA};
27 const PinDef c_PIN_RA3 = {0b00000011, NULL, 0b00001000, NULL, &PORTA, NULL, NULL};
28 const PinDef c_PIN_RA4 = {0b00000100, &RA4PPS, 0b00010000, &TRISA, &PORTA, &ANSELA, &LATA};
29 const PinDef c_PIN_RA5 = {0b00000101, &RA5PPS, 0b00100000, &TRISA, &PORTA, NULL, &LATA};
31 const PinDef c_PIN_RC0 = {0b00010000, &RC0PPS, 0b00000001, &TRISC, &PORTC, &ANSELC, &LATC};
32 const PinDef c_PIN_RC1 = {0b00010001, &RC1PPS, 0b00000010, &TRISC, &PORTC, &ANSELC, &LATC};
33 const PinDef c_PIN_RC2 = {0b00010010, &RC2PPS, 0b00000100, &TRISC, &PORTC, &ANSELC, &LATC};
34 const PinDef c_PIN_RC3 = {0b00010011, &RC3PPS, 0b00001000, &TRISC, &PORTC, &ANSELC, &LATC};
35 const PinDef c_PIN_RC4 = {0b00010100, &RC4PPS, 0b00010000, &TRISC, &PORTC, NULL, &LATC};
36 const PinDef c_PIN_RC5 = {0b00010101, &RC5PPS, 0b00100000, &TRISC, &PORTC, NULL, &LATC};
59 #elif defined(PIC16F1709) || defined(PIC16LF1709) 60 const PinDef c_PIN_RA0 = {0b00000000, &RA0PPS, 0b00000001, &TRISA, &PORTA, &ANSELA, &LATA};
61 const PinDef c_PIN_RA1 = {0b00000001, &RA1PPS, 0b00000010, &TRISA, &PORTA, &ANSELA, &LATA};
62 const PinDef c_PIN_RA2 = {0b00000010, &RA2PPS, 0b00000100, &TRISA, &PORTA, &ANSELA, &LATA};
63 const PinDef c_PIN_RA3 = {0b00000011, NULL, 0b00001000, NULL, &PORTA, NULL, NULL};
64 const PinDef c_PIN_RA4 = {0b00000100, &RA4PPS, 0b00010000, &TRISA, &PORTA, &ANSELA, &LATA};
65 const PinDef c_PIN_RA5 = {0b00000101, &RA5PPS, 0b00100000, &TRISA, &PORTA, NULL, &LATA};
67 const PinDef c_PIN_RB4 = {0b00001100, &RB4PPS, 0b00010000, &TRISB, &PORTB, &ANSELB, &LATB};
68 const PinDef c_PIN_RB5 = {0b00001101, &RB5PPS, 0b00100000, &TRISB, &PORTB, &ANSELB, &LATB};
69 const PinDef c_PIN_RB6 = {0b00001110, &RB6PPS, 0b01000000, &TRISB, &PORTB, NULL, &LATB};
70 const PinDef c_PIN_RB7 = {0b00001111, &RB7PPS, 0b10000000, &TRISB, &PORTB, NULL, &LATB};
72 const PinDef c_PIN_RC0 = {0b00010000, &RC0PPS, 0b00000001, &TRISC, &PORTC, &ANSELC, &LATC};
73 const PinDef c_PIN_RC1 = {0b00010001, &RC1PPS, 0b00000010, &TRISC, &PORTC, &ANSELC, &LATC};
74 const PinDef c_PIN_RC2 = {0b00010010, &RC2PPS, 0b00000100, &TRISC, &PORTC, &ANSELC, &LATC};
75 const PinDef c_PIN_RC3 = {0b00010011, &RC3PPS, 0b00001000, &TRISC, &PORTC, &ANSELC, &LATC};
76 const PinDef c_PIN_RC4 = {0b00010100, &RC4PPS, 0b00010000, &TRISC, &PORTC, NULL, &LATC};
77 const PinDef c_PIN_RC5 = {0b00010101, &RC5PPS, 0b00100000, &TRISC, &PORTC, NULL, &LATC};
78 const PinDef c_PIN_RC6 = {0b00010110, &RC6PPS, 0b01000000, &TRISC, &PORTC, &ANSELC, &LATC};
79 const PinDef c_PIN_RC7 = {0b00010111, &RC7PPS, 0b10000000, &TRISC, &PORTC, &ANSELC, &LATC};
82 const PinDef* PIN_RA0 = &c_PIN_RA0;
83 const PinDef* PIN_RA1 = &c_PIN_RA1;
84 const PinDef* PIN_RA2 = &c_PIN_RA2;
85 const PinDef* PIN_RA3 = &c_PIN_RA3;
86 const PinDef* PIN_RA4 = &c_PIN_RA4;
87 const PinDef* PIN_RA5 = &c_PIN_RA5;
89 const PinDef* PIN_RB4 = &c_PIN_RB4;
90 const PinDef* PIN_RB5 = &c_PIN_RB5;
91 const PinDef* PIN_RB6 = &c_PIN_RB6;
92 const PinDef* PIN_RB7 = &c_PIN_RB7;
94 const PinDef* PIN_RC0 = &c_PIN_RC0;
95 const PinDef* PIN_RC1 = &c_PIN_RC1;
96 const PinDef* PIN_RC2 = &c_PIN_RC2;
97 const PinDef* PIN_RC3 = &c_PIN_RC3;
98 const PinDef* PIN_RC4 = &c_PIN_RC4;
99 const PinDef* PIN_RC5 = &c_PIN_RC5;
100 const PinDef* PIN_RC6 = &c_PIN_RC6;
101 const PinDef* PIN_RC7 = &c_PIN_RC7;
103 #error "No valid PIC chip defined" 122 volatile unsigned char* state_reg =
volatile unsigned char * tris_reg
Pointer to the pin's tris register (can be NULL)
const PinDef * PIN_RA0
PIN_RA0 defintion.
GPIO input/output library allowing to write to and read from IO pins.
const PinDef * PIN_RA5
PIN_RA5 defintion.
const PinDef * PIN_RC0
PIN_RC0 defintion.
const PinDef * PIN_RB5
PIN_RB5 defintion.
volatile unsigned char * port_reg
Pointer to the pin's port register (never NULL)
void pin_set_output(const PinDef *def, bool on)
const PinDef * PIN_RA2
PIN_RA2 defintion.
#define PIN_INPUT_MODE_DIGITAL
See pin_set_input_mode())
const PinDef * PIN_RC4
PIN_RC4 defintion.
Record to store a collection of registers and masks related to a pin.
volatile unsigned char * latch_reg
Pointer to the pin's output register (can be NULL)
const PinDef * PIN_RC1
PIN_RC1 defintion.
const PinDef * PIN_RC2
PIN_RC2 defintion.
const PinDef * PIN_RB6
PIN_RB6 defintion.
const PinDef * PIN_RC6
PIN_RC6 defintion.
void pin_set_pin_mode(const PinDef *def, bool output)
bool pin_get_input(const PinDef *def)
const PinDef * PIN_RB7
PIN_RB7 defintion.
const PinDef * PIN_RA4
PIN_RA4 defintion.
const PinDef * PIN_RA1
PIN_RA1 defintion.
const PinDef * PIN_RC5
PIN_RC5 defintion.
const PinDef * PIN_RA3
PIN_RA3 defintion.
void pin_set_input_mode(const PinDef *def, uint8_t input_mode)
const PinDef * PIN_RC7
PIN_RC7 defintion.
volatile unsigned char * ansel_reg
Pointer to the pin's analog selection register (can be NULL)
uint8_t pin_tris_bitmask
Mask for the pin to use with the referenced tris_reg.
const PinDef * PIN_RB4
PIN_RB4 defintion.
const PinDef * PIN_RC3
PIN_RC3 defintion.