Skip to content

Need help with direct register manipulation #75

Answered by maxgerhardt
imeshsps asked this question in Q&A
Discussion options

You must be logged in to vote

See

/* GPIOx(x=A,B,C,D,F) definitions */
#define GPIOA (GPIO_BASE + 0x00000000U)
#define GPIOB (GPIO_BASE + 0x00000400U)
#define GPIOC (GPIO_BASE + 0x00000800U)
#define GPIOD (GPIO_BASE + 0x00000C00U)
#define GPIOF (GPIO_BASE + 0x00001400U)
/* registers definitions */
#define GPIO_CTL(gpiox) REG32((gpiox) + 0x00000000U) /*!< GPIO port control register */
#define GPIO_OMODE(gpiox) REG32((gpiox) + 0x00000004U) /*!< GPIO port output mode register */

So you would have to do

GPIO_CTL(GPIOC) |= 0x08000000;

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@imeshsps
Comment options

@maxgerhardt
Comment options

@maxgerhardt
Comment options

@imeshsps
Comment options

@maxgerhardt
Comment options

Answer selected by imeshsps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants