Why like to set a mask for Pio?

Hi All,

void PioSet ( uint16 mask, uint16 bits )

When the mask[i] is true, and the bits[i] will true, or the bits[i] will store the Pio[i]'s input value instead of my assignment value.

Why so complicated?

why not just:

Pioset ( uint16 bits);

BR /Boki.

Reply to
bokiteam
Loading thread data ...

First, I apologize if this ends up being posted twice. 14 hours without it even showing up on the news server I originally posted from gives me reason to believe that someone along that path found my wisdom so profound that they diverted it off the wire for their selfish benefit. ;-)

Now as to the OP's query, but from a different news server:

Because then all PIO bits would be affected, which is fine if the caller already knows how the PIO is currently set, but using a mask allows the caller to specify *which* bits to 'merge' in with the PIO setting and which bits to ignore.

--
Dan Henry
Reply to
Dan Henry

"mask" and "bits" allows you to set and clear bits with a single function (and a single call to that function). "mask" determines the affected bits and "bits" sets or clears only those bits.

With Pioset ( uint16 bits ) you would need a separate Pioclr ( uint16 bits ) function.

Alan Nishioka

Reply to
Alan Nishioka

I got it, thank you very much!

btw, if you have any post problem, maybe you can take a try on google group, no server is needed.

BR Boki.

Dan Henry wrote:

Reply to
bokiteam

And on what, do you think, is google running?

Meindert

Reply to
Meindert Sprang

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.