Toggle output port with register

Status
Not open for further replies.

bpoultier

Member
Hi all,

I'm looking for a way to toggle output port directly with the GPIOx_PTOR register as it's specified page 1336:
https://www.pjrc.com/teensy/K20P64M72SF1RM.pdf

My problem is to match the teensy3.2 pin with the register. If I want toggle pin 13 (embedded led), what is the register value that I have to set ? GPIOA, B, C, D, E ?

In advance many thanks. Bruno
 
Support has recently been added for :: digitalToggleFast()

That code is in :: hardware\teensy\avr\cores\teensy3\core_pins.h:

for pin13 the code uses this when the pin number supplied is a CONSTANT compile time value:
Code:
static inline void digitalToggleFast(uint8_t pin)
{
	if (__builtin_constant_p(pin)) {
...
		else if (pin == 13) {
			CORE_PIN13_PORTTOGGLE = CORE_PIN13_BITMASK;
		}
 
Status
Not open for further replies.
Back
Top