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.

define bit in lpc2148 processor

Status
Not open for further replies.

embpic

Advanced Member level 3
Advanced Member level 3
Joined
May 29, 2013
Messages
742
Helped
80
Reputation
160
Reaction score
77
Trophy points
1,308
Location
india
Visit site
Activity points
5,213
hello masters
i am started to program lpc2148 processor but getting problem in defining bit. and i saw some example and there define and use of BOOL function but this is not work for me.then how to define bit or BOOL data-type for lpc2148.
thanx...
 

Hi embpic,

You can use structure bitfields instead..through which you write and read individual bits ..like this


typedef struct bits
{
unsigned char bit0 : 1; // 8 individual bits
unsigned char bit1 : 1; // "
unsigned char bit2 : 1; // "
unsigned char bit3 : 1; // "
unsigned char bit4 : 1; // "
unsigned char bit5 : 1; // "
unsigned char bit6 : 1; // "
unsigned char bit7 : 1; // "
}bits_;

bits_ bit_access;


access the bits just like this :-
bit_access.bit0 = 1;
bit_access.bit0 = 0;

good wishes
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top