Hello,
I was looking for a solution to pullup or pulldown the inputs of a Teensy 3.2 & 3.6 on web.
I found something like this:
portConfigRegister(pin) = PORT_PCR_MUX(1) | PORT_PCR_PE;
this shell pulldown the input pin down to ground by using the internal pullup/down resistor.
In my case I tried this for pin 19 on a Teensy 3.2.
I didn´t got any error that this is unknown or simular but it looks like there is something wrong how I use it.
Error messages:
C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/pins_arduino.h:206:35: error: expected unqualified-id before 'volatile'
#define portConfigRegister(pin) ((volatile uint32_t *)(digital_pin_to_info_PGM[(pin)].config))
^
any.ino:23:2: note: in expansion of macro 'portConfigRegister'
*portConfigRegister(19) = PORT_PCR_MUX(1) | PORT_PCR_PE;
^
C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/pins_arduino.h:206:35: error: expected ')' before 'volatile'
#define portConfigRegister(pin) ((volatile uint32_t *)(digital_pin_to_info_PGM[(pin)].config))
^
any.ino:23:2: note: in expansion of macro 'portConfigRegister'
*portConfigRegister(19) = PORT_PCR_MUX(1) | PORT_PCR_PE;
^
C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/pins_arduino.h:206:35: error: expected ')' before 'volatile'
#define portConfigRegister(pin) ((volatile uint32_t *)(digital_pin_to_info_PGM[(pin)].config))
^
any.ino:23:2: note: in expansion of macro 'portConfigRegister'
*portConfigRegister(19) = PORT_PCR_MUX(1) | PORT_PCR_PE;
^
C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/pins_arduino.h:206:35: error: expected constructor, destructor, or type conversion before 'volatile'
#define portConfigRegister(pin) ((volatile uint32_t *)(digital_pin_to_info_PGM[(pin)].config))
^
any.ino:23:2: note: in expansion of macro 'portConfigRegister'
*portConfigRegister(19) = PORT_PCR_MUX(1) | PORT_PCR_PE;
^
How is the correct format and how can I correctly use this?
Thank you!