Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

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

Status
Not open for further replies.

Munna Kumar

Newbie level 1
Newbie level 1
Joined
Mar 22, 2015
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Visit site
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.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top