From 2939b105b2ff869930d20f6d3d220d887d4e5c2c Mon Sep 17 00:00:00 2001 From: Cyprien Laplace Date: Sun, 14 Dec 2014 18:08:17 +0100 Subject: [PATCH] Make use of the pio and gpio config functions - eeprom part --- extdrv/eeprom.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/extdrv/eeprom.c b/extdrv/eeprom.c index 2f35fec..24af641 100644 --- a/extdrv/eeprom.c +++ b/extdrv/eeprom.c @@ -27,6 +27,7 @@ #include "core/system.h" #include "core/pio.h" #include "lib/string.h" +#include "drivers/gpio.h" #include "drivers/i2c.h" #include "extdrv/eeprom.h" @@ -44,14 +45,11 @@ * and the EEPROM should not be accessed by the module. * Other I2C EEPROMs should not need these functions. */ -static struct pio i2c_eeprom_cs = LPC_GPIO_0_15; +static const struct pio i2c_eeprom_cs = LPC_GPIO_0_15; int mod_gpio_demo_eeprom_cs_pull_low(void) { - struct lpc_gpio* gpio_port_regs = LPC_GPIO_REGS(i2c_eeprom_cs.port); - config_pio(&i2c_eeprom_cs, (LPC_IO_MODE_PULL_UP | LPC_IO_DIGITAL)); /* Configure SPI_CS as output and set it low. */ - gpio_port_regs->data_dir |= (1 << i2c_eeprom_cs.pin); - gpio_port_regs->clear = (1 << i2c_eeprom_cs.pin); + config_gpio(&i2c_eeprom_cs, 0, GPIO_DIR_OUT, 0); return 0; } void mod_gpio_demo_eeprom_cs_release(void) -- 2.43.0