aboutsummaryrefslogtreecommitdiffstats
path: root/src/lpc176x/i2c.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2019-04-01 00:11:23 -0400
committerKevin O'Connor <kevin@koconnor.net>2019-04-04 18:29:31 -0400
commit3e71a57f67ce0dde62e942dfa33bf38d64262916 (patch)
treef4b128d810d8678d41b71c6a02aa23875c2c9ea7 /src/lpc176x/i2c.c
parentbc9fd03dabc38ae55fae3151e94cffe7157b95bd (diff)
downloadkutter-3e71a57f67ce0dde62e942dfa33bf38d64262916.tar.gz
kutter-3e71a57f67ce0dde62e942dfa33bf38d64262916.tar.xz
kutter-3e71a57f67ce0dde62e942dfa33bf38d64262916.zip
lpc176x: Use enumerations for buses and reserve pins
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/lpc176x/i2c.c')
-rw-r--r--src/lpc176x/i2c.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lpc176x/i2c.c b/src/lpc176x/i2c.c
index 420bef95..7b87083f 100644
--- a/src/lpc176x/i2c.c
+++ b/src/lpc176x/i2c.c
@@ -11,6 +11,9 @@
#include "internal.h" // gpio_peripheral
#include "sched.h" // sched_shutdown
+DECL_ENUMERATION("i2c_bus", "i2c1", 0);
+DECL_CONSTANT_STR("BUS_PINS_i2c1", "P0.1,P0.0");
+
// i2c connection status flags
enum {
IF_START = 1<<5, IF_STOP = 1<<4, IF_IRQ = 1<<3, IF_ACK = 1<<2, IF_ENA = 1<<6
@@ -25,8 +28,8 @@ i2c_init(void)
have_run_init = 1;
// Init i2c bus 1 pins
- gpio_peripheral(GPIO(0, 0), 3, 0);
gpio_peripheral(GPIO(0, 1), 3, 0);
+ gpio_peripheral(GPIO(0, 0), 3, 0);
// Set 100Khz frequency
enable_pclock(PCLK_I2C1);