summaryrefslogtreecommitdiffstats
path: root/watch-library/hw
diff options
context:
space:
mode:
authorjoeycastillo <joeycastillo@utexas.edu>2021-08-26 16:32:42 -0400
committerGitHub <noreply@github.com>2021-08-26 16:32:42 -0400
commit6050aff2358c1535d967e13548bf54e7358a1b29 (patch)
tree9047066f6e241b3008199241f6146439b4455a9d /watch-library/hw
parentef9736a3c96d3e345b7184c678921b5243bbbb99 (diff)
parentd09d3c3c95a412ce5f5af8068205c416938510e7 (diff)
downloadSensor-Watch-6050aff2358c1535d967e13548bf54e7358a1b29.tar.gz
Sensor-Watch-6050aff2358c1535d967e13548bf54e7358a1b29.tar.bz2
Sensor-Watch-6050aff2358c1535d967e13548bf54e7358a1b29.zip
Merge pull request #8 from joeycastillo/external-interrupts
External interrupt refactor (closes #4, closes #5)
Diffstat (limited to 'watch-library/hw')
-rw-r--r--watch-library/hw/atmel_start_pins.h6
-rw-r--r--watch-library/hw/driver_init.c46
2 files changed, 4 insertions, 48 deletions
diff --git a/watch-library/hw/atmel_start_pins.h b/watch-library/hw/atmel_start_pins.h
index 28dc9919..7a3a7d78 100644
--- a/watch-library/hw/atmel_start_pins.h
+++ b/watch-library/hw/atmel_start_pins.h
@@ -44,11 +44,13 @@
#define BTN_LIGHT GPIO(GPIO_PORTA, 22)
#define BTN_MODE GPIO(GPIO_PORTA, 23)
#define BUZZER GPIO(GPIO_PORTA, 27)
-#define D1 GPIO(GPIO_PORTB, 0)
+#define A0 GPIO(GPIO_PORTB, 4)
#define A1 GPIO(GPIO_PORTB, 1)
#define A2 GPIO(GPIO_PORTB, 2)
+#define A3 GPIO(GPIO_PORTB, 3)
+#define A4 GPIO(GPIO_PORTB, 0)
#define D0 GPIO(GPIO_PORTB, 3)
-#define A0 GPIO(GPIO_PORTB, 4)
+#define D1 GPIO(GPIO_PORTB, 0)
#define BTN_ALARM GPIO(GPIO_PORTA, 2)
#define COM0 GPIO(GPIO_PORTB, 6)
#define COM1 GPIO(GPIO_PORTB, 7)
diff --git a/watch-library/hw/driver_init.c b/watch-library/hw/driver_init.c
index 02907feb..6d910d22 100644
--- a/watch-library/hw/driver_init.c
+++ b/watch-library/hw/driver_init.c
@@ -35,52 +35,6 @@ void ADC_0_init(void) {
adc_sync_init(&ADC_0, ADC, (void *)NULL);
}
-void EXTERNAL_IRQ_0_init(void) {
- hri_gclk_write_PCHCTRL_reg(GCLK, EIC_GCLK_ID, CONF_GCLK_EIC_SRC | (1 << GCLK_PCHCTRL_CHEN_Pos));
- hri_mclk_set_APBAMASK_EIC_bit(MCLK);
-
- // Set pin direction to input
- gpio_set_pin_direction(BTN_ALARM, GPIO_DIRECTION_IN);
-
- gpio_set_pin_pull_mode(BTN_ALARM,
- // <y> Pull configuration
- // <id> pad_pull_config
- // <GPIO_PULL_OFF"> Off
- // <GPIO_PULL_UP"> Pull-up
- // <GPIO_PULL_DOWN"> Pull-down
- GPIO_PULL_DOWN);
-
- gpio_set_pin_function(BTN_ALARM, PINMUX_PA02A_EIC_EXTINT2);
-
- // Set pin direction to input
- gpio_set_pin_direction(BTN_LIGHT, GPIO_DIRECTION_IN);
-
- gpio_set_pin_pull_mode(BTN_LIGHT,
- // <y> Pull configuration
- // <id> pad_pull_config
- // <GPIO_PULL_OFF"> Off
- // <GPIO_PULL_UP"> Pull-up
- // <GPIO_PULL_DOWN"> Pull-down
- GPIO_PULL_DOWN);
-
- gpio_set_pin_function(BTN_LIGHT, PINMUX_PA22A_EIC_EXTINT6);
-
- // Set pin direction to input
- gpio_set_pin_direction(BTN_MODE, GPIO_DIRECTION_IN);
-
- gpio_set_pin_pull_mode(BTN_MODE,
- // <y> Pull configuration
- // <id> pad_pull_config
- // <GPIO_PULL_OFF"> Off
- // <GPIO_PULL_UP"> Pull-up
- // <GPIO_PULL_DOWN"> Pull-down
- GPIO_PULL_DOWN);
-
- gpio_set_pin_function(BTN_MODE, PINMUX_PA23A_EIC_EXTINT7);
-
- ext_irq_init();
-}
-
void CALENDAR_0_CLOCK_init(void) {
hri_mclk_set_APBAMASK_RTC_bit(MCLK);
}