[ARM] "io0pin&(3<<5)"

Status
Not open for further replies.

Munna Kumar

Newbie level 1
Joined
Mar 22, 2015
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
6
How to use & and | operater in embeded c?
Does it means something if i write IO0PIN&(3<<6)?
If yes tell me.
How to use & operater if i want to check the status of pin 4 and 7 simultaneously ? Tell me seperately to check for 0 and 1.
 

Re: &quot;io0pin&amp;(3&lt;&lt;5)&quot;

io0pin |= (1<<5); // set bit #5
io0pin &= ~(1<<5) // clear bit #5
| - logical OR
& - logical AND
~ - inversion

- - - Updated - - -

if (io0pin & (1<<4) && io0pin & (1<<7)) // true if 4 & 7 bits set
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…