|
32 | 32 | /* the rest are for general (non-interrupt) config */ |
33 | 33 | #define IOCFG_GEN_MASK (~IOCFG_INT_MASK) |
34 | 34 |
|
| 35 | +/* GPIO all DIOs mask */ |
| 36 | +#define GPIO_DIO_ALL_MASK 0xFFFFFFFF |
| 37 | + |
35 | 38 | struct gpio_cc13xx_cc26xx_data { |
36 | 39 | /* gpio_driver_data needs to be first */ |
37 | 40 | struct gpio_driver_data common; |
@@ -128,41 +131,38 @@ static int gpio_cc13xx_cc26xx_port_get_raw(const struct device *port, |
128 | 131 | { |
129 | 132 | __ASSERT_NO_MSG(value != NULL); |
130 | 133 |
|
131 | | - *value = GPIO_readMultiDio(GPIO_DIO_ALL_MASK); |
| 134 | + *value = HWREG(GPIO_BASE + GPIO_O_DIN31_0) & GPIO_DIO_ALL_MASK; |
132 | 135 |
|
133 | 136 | return 0; |
134 | 137 | } |
135 | 138 |
|
136 | | -static int gpio_cc13xx_cc26xx_port_set_masked_raw(const struct device *port, |
137 | | - uint32_t mask, |
138 | | - uint32_t value) |
| 139 | +static int gpio_cc13xx_cc26xx_port_set_bits_raw(const struct device *port, uint32_t mask) |
139 | 140 | { |
140 | | - GPIO_setMultiDio(mask & value); |
141 | | - GPIO_clearMultiDio(mask & ~value); |
| 141 | + HWREG(GPIO_BASE + GPIO_O_DOUTSET31_0) = mask; |
142 | 142 |
|
143 | 143 | return 0; |
144 | 144 | } |
145 | 145 |
|
146 | | -static int gpio_cc13xx_cc26xx_port_set_bits_raw(const struct device *port, |
147 | | - uint32_t mask) |
| 146 | +static int gpio_cc13xx_cc26xx_port_clear_bits_raw(const struct device *port, uint32_t mask) |
148 | 147 | { |
149 | | - GPIO_setMultiDio(mask); |
| 148 | + HWREG(GPIO_BASE + GPIO_O_DOUTCLR31_0) = mask; |
150 | 149 |
|
151 | 150 | return 0; |
152 | 151 | } |
153 | 152 |
|
154 | | -static int gpio_cc13xx_cc26xx_port_clear_bits_raw(const struct device *port, |
155 | | - uint32_t mask) |
| 153 | +static int gpio_cc13xx_cc26xx_port_set_masked_raw(const struct device *port, uint32_t mask, |
| 154 | + uint32_t value) |
156 | 155 | { |
157 | | - GPIO_clearMultiDio(mask); |
| 156 | + gpio_cc13xx_cc26xx_port_set_bits_raw(port, mask & value); |
| 157 | + gpio_cc13xx_cc26xx_port_clear_bits_raw(port, mask & ~value); |
158 | 158 |
|
159 | 159 | return 0; |
160 | 160 | } |
161 | 161 |
|
162 | 162 | static int gpio_cc13xx_cc26xx_port_toggle_bits(const struct device *port, |
163 | 163 | uint32_t mask) |
164 | 164 | { |
165 | | - GPIO_toggleMultiDio(mask); |
| 165 | + HWREG(GPIO_BASE + GPIO_O_DOUTTGL31_0) = mask; |
166 | 166 |
|
167 | 167 | return 0; |
168 | 168 | } |
@@ -209,16 +209,16 @@ static int gpio_cc13xx_cc26xx_manage_callback(const struct device *port, |
209 | 209 |
|
210 | 210 | static uint32_t gpio_cc13xx_cc26xx_get_pending_int(const struct device *dev) |
211 | 211 | { |
212 | | - return GPIO_getEventMultiDio(GPIO_DIO_ALL_MASK); |
| 212 | + return HWREG(GPIO_BASE + GPIO_O_EVFLAGS31_0) & GPIO_DIO_ALL_MASK; |
213 | 213 | } |
214 | 214 |
|
215 | 215 | static void gpio_cc13xx_cc26xx_isr(const struct device *dev) |
216 | 216 | { |
217 | 217 | struct gpio_cc13xx_cc26xx_data *data = dev->data; |
218 | 218 |
|
219 | | - uint32_t status = GPIO_getEventMultiDio(GPIO_DIO_ALL_MASK); |
| 219 | + uint32_t status = HWREG(GPIO_BASE + GPIO_O_EVFLAGS31_0) & GPIO_DIO_ALL_MASK; |
220 | 220 |
|
221 | | - GPIO_clearEventMultiDio(status); |
| 221 | + HWREG(GPIO_BASE + GPIO_O_EVFLAGS31_0) = status; |
222 | 222 |
|
223 | 223 | gpio_fire_callbacks(&data->callbacks, dev, status); |
224 | 224 | } |
|
0 commit comments