Zpuino and access to ports

Recommended Posts

Hello, it definitely is possible, but I don't remember the syntax off the top of my head and am away from my dev machine at the moment. Maybe Alvie can post an example, or I will look it up monday morning.



Share this post

Link to post
Share on other sites

Yes, it is possible, but only as long as the sequence fits in 32-bits.


outputRegisterForPin(pinNumber) will get you the register for that pin block, and it's 32-bits. So outputRegisterForPin(0) will return the register for the 0-31 pins, outputRegisterForPin(32) for pins 32-63, so on.

register_t bank0 = outputRegisterForPin(0);// All outputs to ones.bank0 = 0xffffffff;// read all inputsunsigned values = bank0;


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now