arduino / arduino/ArduinoCore-sam
Add PERIPH_A and PERIPH_B to Due pinMode() options
- Dominant language
- HTML
- Stars
- 91
- Forks
- 112
- PR merge metrics
- No merged PRs in 30d
Description
_From @CF20852 on August 24, 2014 16:47_
I wanted to configure TIOA7 to come out on D3 on my Due. I found that I could do so by adding
```
#define PERIPH_A 0x3
#define PERIPH_B 0x4
```
to wiring_constants.h in the hardware/arduino/sam/cores/arduino folder, and
```
case PERIPH_A:
PIO_Configure(
g_APinDescription[ulPin].pPort,
PIO_PERIPH_A,
g_APinDescription[ulPin].ulPin,
g_APinDescription[ulPin].ulPinConfiguration ) ;
break ;
case PERIPH_B:
PIO_Configure(
g_APinDescription[ulPin].pPort,
PIO_PERIPH_B,
g_APinDescription[ulPin].ulPin,
g_APinDescription[ulPin].ulPinConfiguration ) ;
break ;
```
to the switch/case statement in the pinMode code in wiring_digital.c in the same folder.
Then in my sketch I can just write
```
pinMode(3, PERIPH_B);
```
I figure if this is was a good idea, someone would have already done it :-) But here it is, just in case.
And yes, the PERIPH_A stuff is superfluous to my immediate need.
_Copied from original issue: arduino/Arduino#2257_
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.