- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm trying to find MORE information on the use of naming pins in PSoC1. I've read (& reread) both GPIO Demystified posts as well as AN 2094 - Getting Started with GPIO.
From what I've gathered, if I name a pin (say PB), then I can access the PORT by typing LED_1_Data_ADDR. How do I access just the PIN then to determine if it's high or low?
Right now, if "PB" is at port 1, pin 7, I read that pin by using PRT1DR & 0x80. What would I do if I want to use the name only?
AN 2094 says there's a macro for the pin mask, but doesn't give the command. Where should I look for more information so I can figure this out?
Thanks!
- Labels:
-
PSoC 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Also be aware of the need to use shadow registers on ports with mixed
I/O in them.
www.planetpsoc.com/psoc1-articles-digital/13-basics-of-psoc-gpio.html
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi - and thanks to both of you.
I actually looked in the PSoCGPIOINT.h file and found the answer to my question, so you've just confirmed that I interpreted the info in the file correctly. Of course, my working project also convinced me. I can now move that pesky push button switch to wherever there's a free pin on a port and not have to keep editing my switch function! I need the pin mask is so that I can use shadow registers flexibly.
Thanks again!