Skip to content

Commit

Permalink
drivers: gpio_gecko: Use emlib API for compatibility
Browse files Browse the repository at this point in the history
This ensures compatibility with Silicon Labs EXX32 MCU Series 1.

Signed-off-by: Gil Benkö <gil.benkoe@pm.me>
Signed-off-by: Christian Taedcke <hacking@taedcke.com>
  • Loading branch information
GilBenkoe authored and chrta committed Nov 21, 2018
1 parent 5fb053e commit 71b6609
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions drivers/gpio/gpio_gecko.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,21 +154,13 @@ static int gpio_gecko_write(struct device *dev,
* Writing zeros to the other bits leaves the data
* output unchanged for the other pins.
*/
#if defined(_GPIO_P_DOUTSET_MASK)
gpio_base->DOUTSET = BIT(pin);
#else
BUS_RegBitWrite(&gpio_base->DOUT, pin, 1);
#endif
GPIO_PinOutSet(config->gpio_index, pin);
} else {
/* Clear the data output for the corresponding pin.
* Writing zeros to the other bits leaves the data
* output unchanged for the other pins.
*/
#if defined(_GPIO_P_DOUTCLR_MASK)
gpio_base->DOUTCLR = BIT(pin);
#else
BUS_RegBitWrite(&gpio_base->DOUT, pin, 0);
#endif
GPIO_PinOutClear(config->gpio_index, pin);
}
} else { /* GPIO_ACCESS_BY_PORT */
/* Write the data output for all the pins */
Expand Down

0 comments on commit 71b6609

Please sign in to comment.