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

problem with GPIOA_Type DATA field in TM4C #1

Open
pabigot opened this issue Mar 27, 2014 · 2 comments
Open

problem with GPIOA_Type DATA field in TM4C #1

pabigot opened this issue Mar 27, 2014 · 2 comments

Comments

@pabigot
Copy link

pabigot commented Mar 27, 2014

Thanks for making these available; I've been unable to get SVD or CMSIS information from TI directly. Can you say where you obtained them?

Reason I ask is the GPIOA_Type declarations have:

__I  uint32_t  RESERVED0[255];
__IO uint32_t  DATA;
__IO uint32_t  DIR;

I feel reasonably certain this is wrong, and that the correct declaration is:

__IO uint32_t  DATA[256];
__IO uint32_t  DIR;

which permits bit-banded access to pins 0 and 2 through (for example) GPIOA->DATA[0x05].

I'd like to see the SVD to try to confirm my understanding of how the map is supposed to be used.

@pabigot
Copy link
Author

pabigot commented Mar 27, 2014

The content can be fixed with:

cd Devices/TI
find . -name '*.h' | xargs sed -r -i -f/tmp/s.sed

with /tmp/s.sed being:

/GPIOA(_AHB)? Structure/,/^}/{
/RESERVED0/d
s/  DATA;     /  DATA[256];/
}

@pabigot
Copy link
Author

pabigot commented Apr 21, 2014

On further reflection, the original is not "wrong", it's just unfortunately incomplete. The original declared DATA register is the right one to manipulate all pins at once; the declaration simply fails to provide a way to use the underlying hardware's ability to affect a subset of the pins. Too bad.

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