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

Can't set pins > 31 as GPIO #113

Open
1 task
CyanBlob opened this issue Sep 2, 2020 · 0 comments
Open
1 task

Can't set pins > 31 as GPIO #113

CyanBlob opened this issue Sep 2, 2020 · 0 comments

Comments

@CyanBlob
Copy link

CyanBlob commented Sep 2, 2020

Make sure you read and understand this document.
Use one of the two templates below and delete the rest.

  • BUG REPORT

BUG REPORT

Expected behavior

We should be able to use all physical pins as GPIOHS pins

Actual behavior

As it stands, only pins 0-31 can be used as GPIOHS. This is because, for whatever reason, in the following code:

fpioa_set_function(3, FUNC_GPIOHS3);
gpiohs_set_drive_mode(3, GPIO_DM_OUTPUT);
gpiohs_set_pin(3, GPIO_PV_HIGH);

the physical pin is identified by the enum FUNC_GPIOHS3 instead of the first argument to fpioa_set_function. That enum is limited to FUNC_GPIOHS0 - FUNC_GPIOHS31, so pins 32-35 are unusable.

My expectation for how this would work is that the following would turn on pin 35:

fpioa_set_function(35, FUNC_GPIOHS1);
gpiohs_set_drive_mode(35, GPIO_DM_OUTPUT);
gpiohs_set_pin(35, GPIO_PV_HIGH);

This behavior would allow setting any 32 hardware pins to GPIOHS at a time. Is there a hardware limitation as to why physical pins > 31 can't be used?

Document version

Standalone SDK version 0.5.6

Hardware

Sipeed MAiX BiT

System

What system do you use?
Arch Linux, running PlatformIO 4.3.4 with the standalone SDK version 0.5.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant