The original problem was that the code defined the registers and mask as 8 bits, when the T4.x ones are 32 bits. So it only worked on a subset of pins. So first fix would be to simply define these values as 32 bits. But doing so leaves you code at risk as the Set/Clear code in this library is not atomic, Example: *clkPort |= clkPinMask; So if something happens in the small time window after the time the register is retrieved and then manipulated and written back, such as an interrupt. Or maybe if other hardware is driving the pin. These changes would be clobbered by the above code. Not sure how many other boards (if any) may be hit by the same issue. It is not an issue with T3.x as the Teensy code uses the M3/M4 bitband support, so for each pin there is a unique memory address for it and these operations are atomic. Note: the Arm M7 does not support bitbands. However in these caseAtomic code can be written for the T4.x by instead using the DR register of the IO port, you use the DR_SET, DR_CLEAR, DR_TOGGLE registers instead which do as the names imply the do that operation only those pins who have a 1 bit set to the value... |
||
|---|---|---|
| .github | ||
| examples | ||
| Adafruit_BusIO_Register.cpp | ||
| Adafruit_BusIO_Register.h | ||
| Adafruit_I2CDevice.cpp | ||
| Adafruit_I2CDevice.h | ||
| Adafruit_I2CRegister.h | ||
| Adafruit_SPIDevice.cpp | ||
| Adafruit_SPIDevice.h | ||
| CMakeLists.txt | ||
| LICENSE | ||
| README.md | ||
| component.mk | ||
| library.properties | ||
README.md
Adafruit Bus IO Library 
This is a helper library to abstract away I2C & SPI transactions and registers
Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit!
MIT license, all text above must be included in any redistribution