I am trying to encapsulate 2 ports from 18F2620 into a single variable. What I want to be able to do is something like the following pseudocode
variable ex_port = porta:portb // 16 bits of 2 ports in a single variable
for (z = 0, z<16, z++)
ex_port.z = 1
what I'm trying to do is to sequence through both ports as well as to be able to address each individual port pin wihtout having to first address the individual port. I hope that makes sense.
Is there some way to bundle the ports together like this?
Since boostc does not support bitfields, this becomes pretty large if I used a structure of bytes.
I hope I'm not just making this way harder than it needs to be. Is there an easy way?