Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PERIPH_A and PERIPH_B to Due pinMode() options #2257

Closed
CF20852 opened this issue Aug 24, 2014 · 1 comment
Closed

Add PERIPH_A and PERIPH_B to Due pinMode() options #2257

CF20852 opened this issue Aug 24, 2014 · 1 comment
Assignees
Labels
Architecture: SAM Applies only to the SAM microcontrollers (Due) Component: Core Related to the code for the standard Arduino API feature request A request to make an enhancement (not a bug fix)

Comments

@CF20852
Copy link

CF20852 commented Aug 24, 2014

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.

@CF20852 CF20852 changed the title Add PERIPH_A and PERIPH_B to Due pinMode() Add PERIPH_A and PERIPH_B to Due pinMode() options Aug 24, 2014
@cmaglie cmaglie added Component: Core Related to the code for the standard Arduino API feature request A request to make an enhancement (not a bug fix) Architecture: SAM Applies only to the SAM microcontrollers (Due) labels Sep 8, 2015
@agdl
Copy link
Member

agdl commented Feb 8, 2017

This issue was moved to arduino/ArduinoCore-sam#12

@agdl agdl closed this as completed Feb 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Architecture: SAM Applies only to the SAM microcontrollers (Due) Component: Core Related to the code for the standard Arduino API feature request A request to make an enhancement (not a bug fix)
Projects
None yet
Development

No branches or pull requests

3 participants