summaryrefslogtreecommitdiff
path: root/board/hadoken/gpio.inc
diff options
context:
space:
mode:
authorMyles Watson <mylesgw@chromium.org>2014-11-25 14:52:29 -0800
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2014-12-31 00:01:06 +0000
commit362bc01a172d5d123f30e4dd51b539a404375e06 (patch)
tree33494f18451e7c7665b61762b36db1dcb8039b14 /board/hadoken/gpio.inc
parentf0fe0160a589ed0e0553df42741d605092050354 (diff)
downloadchrome-ec-362bc01a172d5d123f30e4dd51b539a404375e06.tar.gz
hadoken: Update I/O configuration.
Add support for alternate functions for nrf51. Add more register definitions for the nrf51. Use assertions for conditions that should never happen. Use BUILD_ASSERT to keep the sources in sync. Add three more GPIOs to hadoken. BQ27621_GPOUT - Configurable output from the fuel gauge. LID_PRESENT_L - The input for the hall sensor. IND_CHRG_DISABLE - The output to control inductive charging. BUG=chrome-os-partner:34477 BRANCH=none TEST=Used gpioget and magnets for LID_PRESENT_L Used fuel gauge console commands to trigger BQ27621_GPOUT Tested the assertions with gdb Signed-off-by: Myles Watson <mylesgw@chromium.org> Change-Id: I508f79ae45127104fa14f9f75fbf545f226387e4 Reviewed-on: https://chromium-review.googlesource.com/234286 Reviewed-by: Randall Spangler <rspangler@chromium.org> Tested-by: Myles Watson <mylesgw@chromium.org> Reviewed-by: Alec Berg <alecaberg@chromium.org> Commit-Queue: Myles Watson <mylesgw@chromium.org>
Diffstat (limited to 'board/hadoken/gpio.inc')
-rw-r--r--board/hadoken/gpio.inc19
1 files changed, 17 insertions, 2 deletions
diff --git a/board/hadoken/gpio.inc b/board/hadoken/gpio.inc
index da5df7a968..009953bf93 100644
--- a/board/hadoken/gpio.inc
+++ b/board/hadoken/gpio.inc
@@ -24,10 +24,17 @@ GPIO(KB_IN06, 0, 27, GPIO_KB_INPUT, NULL)
GPIO(KB_IN07, 0, 26, GPIO_KB_INPUT, NULL)
/* Other inputs */
+GPIO(MCU_GPIO_13, 0, 13, GPIO_INPUT, NULL) /* PAIR on the debug board */
+GPIO(MCU_GPIO_14, 0, 14, GPIO_INPUT, NULL) /* TP 4 */
+GPIO(MCU_GPIO_17, 0, 17, GPIO_INPUT, NULL) /* TP 5 */
+GPIO(MCU_GPIO_19, 0, 19, GPIO_INPUT, NULL) /* TP 6 */
+GPIO(BQ27621_GPOUT, 0, 20, GPIO_INPUT, NULL) /* Fuel Gauge */
+GPIO(LID_PRESENT_L, 0, 31, GPIO_INPUT, NULL) /* Hall sensor */
+
+/* Will be an output at some point */
+GPIO(IND_CHRG_DISABLE, 0, 21, GPIO_INPUT, NULL) /* Control for charging */
/* Outputs */
-GPIO(LED0, 0, 18, GPIO_OUTPUT | GPIO_HIGH, NULL)
-GPIO(LED1, 0, 19, GPIO_OUTPUT | GPIO_HIGH, NULL)
GPIO(KB_OUT00, 0, 2, GPIO_KB_OUTPUT, NULL)
GPIO(KB_OUT01, 0, 10, GPIO_KB_OUTPUT, NULL)
GPIO(KB_OUT02, 0, 7, GPIO_KB_OUTPUT, NULL)
@@ -42,5 +49,13 @@ GPIO(KB_OUT10, 0, 12, GPIO_KB_OUTPUT, NULL)
GPIO(KB_OUT11, 0, 15, GPIO_KB_OUTPUT, NULL)
GPIO(KB_OUT12, 0, 11, GPIO_KB_OUTPUT, NULL)
+/* Configure the TWI (I2C) interface in the init function. */
+GPIO(MCU_SCL, 0, 23, GPIO_INPUT | GPIO_PULL_UP | GPIO_OPEN_DRAIN, NULL)
+GPIO(MCU_SDA, 0, 22, GPIO_INPUT | GPIO_PULL_UP | GPIO_OPEN_DRAIN, NULL)
+
+/* Use port 0 for I2C (TWI0), Pins 22 & 23 */
+ALTERNATE(0, 0x800000, NRF51_TWI0_ALT_FUNC_SCL, MODULE_I2C, GPIO_INPUT | GPIO_PULL_UP | GPIO_OPEN_DRAIN)
+ALTERNATE(0, 0x400000, NRF51_TWI0_ALT_FUNC_SDA, MODULE_I2C, GPIO_INPUT | GPIO_PULL_UP | GPIO_OPEN_DRAIN)
+
/* Unimplemented */
UNIMPLEMENTED(ENTERING_RW)