liletian
Full Member level 6
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
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