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.

is anyone familiar with book programming embedded system

Status
Not open for further replies.

liletian

Full Member level 6
Joined
Mar 5, 2008
Messages
337
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,298
Activity points
3,790
pin22_func_general

Hi Guys
Is anyone familiar with the book "programming embedded systems", I am confusing with page 49 in the book.
First they
#define LED_GREEN (0x00400000)
Then they
set one of the register vale to
GPIO_0_clear_REG = LED_GREEN;

Then they set up the control pin
#DEFINE PIN22_FUNC_GENERAL (oxFFFFCFFF)
CAN anyone explain why they define "PIN22_FUNC_GENERAL (oxFFFFCFFF)"?
I had no clue why they are doing this!
GPIO_O_FUNC_HI_REG &= PIN22_FUNC_GENERAL;


at last they
GPIO_O_DIRECTION_REG |= LED_GREEN


The definition of GPIO_0_clear_REG,GPIO_O_FUNC_HI_REG,GPIO_O_DIRECTION_REG are

GPIO_O_DIRECTION_REG =(*((unit32_t volatile *)ox40E0000C))
GPIO_0_clear_REG=(*((unit32_t volatile *)ox40E00024))
GPIO_O_FUNC_HI_REG=(*((unit32_t volatile *)ox40E00058))
Thanks a lot for your help
 

Configures GPIO pins for general I/O or alternate functionality.00 = GPIO pin is used as general-purpose I/O.
GPIO_O_FUNC_HI_REG &= PIN22_FUNC_GENERAL is used to configure GPIO22 as general-purpose I/O
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top