@@ -91,11 +91,11 @@ void rp2350_init(void);
9191 * @param pin The GPIO pin number
9292 * @return The address of the GPIO pad register for the given pin
9393 */
94- static inline uint32_t calculate_gpio_pad_register_addr (gpio_t pin ) {
94+ static inline uint32_t * calculate_gpio_pad_register_addr (gpio_t pin ) {
9595 /* Each pin has a 4 byte register, so we can calculate the address
9696 * by adding 4 bytes for each pin, starting at the base address of PADS_BANK0
9797 * and adding 4 bytes to skip VOLTAGE_SELECT */
98- return PADS_BANK0_BASE + 4 * (pin + 1 );
98+ return ( uint32_t * ) ( PADS_BANK0_BASE + ( 4 * (pin + 1 )) );
9999}
100100
101101/**
@@ -105,7 +105,7 @@ static inline uint32_t calculate_gpio_pad_register_addr(gpio_t pin) {
105105 */
106106static uint32_t calculate_gpio_io_status_register_addr (gpio_t pin ) {
107107 /* Each status register is followed by a ctrl register */
108- return IO_BANK0_BASE + 8 * pin ;
108+ return IO_BANK0_BASE + ( 8 * pin ) ;
109109}
110110
111111/**
@@ -114,11 +114,11 @@ static uint32_t calculate_gpio_io_status_register_addr(gpio_t pin) {
114114 * @param pin The GPIO pin number
115115 * @return The address of the GPIO IO control register for the given pin
116116 */
117- static inline uint32_t calculate_gpio_io_ctrl_register_addr (gpio_t pin ) {
117+ static inline uint32_t * calculate_gpio_io_ctrl_register_addr (gpio_t pin ) {
118118 /* Each pin has a 8 byte register (4 Bytes of Status, 4 Bytes of CTRL),
119119 * so we can calculate the address by adding 8 bytes for each pin,
120120 * starting at the base address of IO_BANK0 */
121- return calculate_gpio_io_status_register_addr (pin ) + 4 ;
121+ return ( uint32_t * ) ( calculate_gpio_io_status_register_addr (pin ) + 4 ) ;
122122}
123123
124124
0 commit comments