diff --git a/boards/sensorwatch_blue/board.mk b/boards/sensorwatch_blue/board.mk new file mode 100644 index 0000000..c5e7b89 --- /dev/null +++ b/boards/sensorwatch_blue/board.mk @@ -0,0 +1,6 @@ +CHIP = saml22 +LDSCRIPT = saml22n18 + +DEFINES += \ + -D__SAML22J18A__ \ + -DSTATIC_FREQUENCY_CORRECTION=11 \ diff --git a/boards/sensorwatch_blue/pins.h b/boards/sensorwatch_blue/pins.h new file mode 100644 index 0000000..05d35a6 --- /dev/null +++ b/boards/sensorwatch_blue/pins.h @@ -0,0 +1,67 @@ +#pragma once + +#include "hal_gpio.h" + + +// Analog pins +HAL_GPIO_PIN(A0, B, 4) +HAL_GPIO_PIN(A1, B, 1) +HAL_GPIO_PIN(A2, B, 2) +HAL_GPIO_PIN(A3, B, 3) +HAL_GPIO_PIN(A4, B, 0) + +// SPI +HAL_GPIO_PIN(MISO, B, 0) +HAL_GPIO_PIN(SCK, B, 1) +HAL_GPIO_PIN(MOSI, B, 2) +HAL_GPIO_PIN(CS, B, 3) +#define SPI_SERCOM 3 +#define SPI_SERCOM_DOPO SPI_DOPO_0_SCK_3 +#define SPI_SERCOM_DIPO SPI_DIPO_2 + +// I2C +HAL_GPIO_PIN(SDA, B, 30) +HAL_GPIO_PIN(SCL, B, 31) +#define I2C_SERCOM 1 + +// Light +HAL_GPIO_PIN(BLUE, A, 20) +HAL_GPIO_PIN(RED, A, 21) +HAL_GPIO_PIN(LED, A, 21) // Default to red LED for blinky tests + +// Sound +HAL_GPIO_PIN(BUZZER, A, 27) + +// Buttons +HAL_GPIO_PIN(BTN_LIGHT, A, 22) +HAL_GPIO_PIN(BTN_MODE, A, 23) +HAL_GPIO_PIN(BTN_ALARM, A, 2) + +// Segment LCD +HAL_GPIO_PIN(SLCD0, B, 6) +HAL_GPIO_PIN(SLCD1, B, 7) +HAL_GPIO_PIN(SLCD2, B, 8) +HAL_GPIO_PIN(SLCD3, B, 9) +HAL_GPIO_PIN(SLCD4, A, 5) +HAL_GPIO_PIN(SLCD5, A, 4) +HAL_GPIO_PIN(SLCD6, A, 6) +HAL_GPIO_PIN(SLCD7, A, 7) +HAL_GPIO_PIN(SLCD8, A, 8) +HAL_GPIO_PIN(SLCD9, A, 9) +HAL_GPIO_PIN(SLCD10, A, 10) +HAL_GPIO_PIN(SLCD11, A, 11) +HAL_GPIO_PIN(SLCD12, B, 11) +HAL_GPIO_PIN(SLCD13, B, 12) +HAL_GPIO_PIN(SLCD14, B, 13) +HAL_GPIO_PIN(SLCD15, B, 14) +HAL_GPIO_PIN(SLCD16, B, 15) +HAL_GPIO_PIN(SLCD17, A, 12) +HAL_GPIO_PIN(SLCD18, A, 13) +HAL_GPIO_PIN(SLCD19, A, 14) +HAL_GPIO_PIN(SLCD20, A, 15) +HAL_GPIO_PIN(SLCD21, A, 16) +HAL_GPIO_PIN(SLCD22, A, 17) +HAL_GPIO_PIN(SLCD23, A, 18) +HAL_GPIO_PIN(SLCD24, A, 19) +HAL_GPIO_PIN(SLCD25, B, 16) +HAL_GPIO_PIN(SLCD26, B, 17) diff --git a/boards/sensorwatch_green/board.mk b/boards/sensorwatch_green/board.mk new file mode 100644 index 0000000..f90fde9 --- /dev/null +++ b/boards/sensorwatch_green/board.mk @@ -0,0 +1,6 @@ +CHIP = saml22 +LDSCRIPT = saml22n18 + +DEFINES += \ + -D__SAML22J18A__ \ + -DSTATIC_FREQUENCY_CORRECTION=22 \ diff --git a/boards/sensorwatch_green/pins.h b/boards/sensorwatch_green/pins.h new file mode 100644 index 0000000..ddd38e8 --- /dev/null +++ b/boards/sensorwatch_green/pins.h @@ -0,0 +1,67 @@ +#pragma once + +#include "hal_gpio.h" + + +// Analog pins +HAL_GPIO_PIN(A0, B, 4) +HAL_GPIO_PIN(A1, B, 1) +HAL_GPIO_PIN(A2, B, 2) +HAL_GPIO_PIN(A3, B, 3) +HAL_GPIO_PIN(A4, B, 0) + +// SPI +HAL_GPIO_PIN(MISO, B, 0) +HAL_GPIO_PIN(SCK, B, 1) +HAL_GPIO_PIN(MOSI, B, 2) +HAL_GPIO_PIN(CS, B, 3) +#define SPI_SERCOM 3 +#define SPI_SERCOM_DOPO SPI_DOPO_0_SCK_3 +#define SPI_SERCOM_DIPO SPI_DIPO_2 + +// I2C +HAL_GPIO_PIN(SDA, B, 30) +HAL_GPIO_PIN(SCL, B, 31) +#define I2C_SERCOM 1 + +// Light +HAL_GPIO_PIN(RED, A, 20) +HAL_GPIO_PIN(GREEN, A, 21) +HAL_GPIO_PIN(LED, A, 20) // Default to red LED for blinky tests + +// Sound +HAL_GPIO_PIN(BUZZER, A, 27) + +// Buttons +HAL_GPIO_PIN(BTN_LIGHT, A, 22) +HAL_GPIO_PIN(BTN_MODE, A, 23) +HAL_GPIO_PIN(BTN_ALARM, A, 2) + +// Segment LCD +HAL_GPIO_PIN(SLCD0, B, 6) +HAL_GPIO_PIN(SLCD1, B, 7) +HAL_GPIO_PIN(SLCD2, B, 8) +HAL_GPIO_PIN(SLCD3, B, 9) +HAL_GPIO_PIN(SLCD4, A, 5) +HAL_GPIO_PIN(SLCD5, A, 4) +HAL_GPIO_PIN(SLCD6, A, 6) +HAL_GPIO_PIN(SLCD7, A, 7) +HAL_GPIO_PIN(SLCD8, A, 8) +HAL_GPIO_PIN(SLCD9, A, 9) +HAL_GPIO_PIN(SLCD10, A, 10) +HAL_GPIO_PIN(SLCD11, A, 11) +HAL_GPIO_PIN(SLCD12, B, 11) +HAL_GPIO_PIN(SLCD13, B, 12) +HAL_GPIO_PIN(SLCD14, B, 13) +HAL_GPIO_PIN(SLCD15, B, 14) +HAL_GPIO_PIN(SLCD16, B, 15) +HAL_GPIO_PIN(SLCD17, A, 12) +HAL_GPIO_PIN(SLCD18, A, 13) +HAL_GPIO_PIN(SLCD19, A, 14) +HAL_GPIO_PIN(SLCD20, A, 15) +HAL_GPIO_PIN(SLCD21, A, 16) +HAL_GPIO_PIN(SLCD22, A, 17) +HAL_GPIO_PIN(SLCD23, A, 18) +HAL_GPIO_PIN(SLCD24, A, 19) +HAL_GPIO_PIN(SLCD25, B, 16) +HAL_GPIO_PIN(SLCD26, B, 17) diff --git a/boards/sensorwatch_red/board.mk b/boards/sensorwatch_red/board.mk new file mode 100644 index 0000000..2c0f9de --- /dev/null +++ b/boards/sensorwatch_red/board.mk @@ -0,0 +1,6 @@ +CHIP = saml22 +LDSCRIPT = saml22n18 + +DEFINES += \ + -D__SAML22J18A__ \ + -DWATCH_INVERT_LED_POLARITY \ diff --git a/boards/sensorwatch_red/pins.h b/boards/sensorwatch_red/pins.h new file mode 100644 index 0000000..33bb9c7 --- /dev/null +++ b/boards/sensorwatch_red/pins.h @@ -0,0 +1,64 @@ +#pragma once + +#include "hal_gpio.h" + + +// Analog pins (hard-wired to board features on Sensor Watch Lite) +HAL_GPIO_PIN(A0, B, 4) // Redefined below, hard-wired to temperature sensor enable +HAL_GPIO_PIN(A1, B, 1) // Redefined below, hard-wired to UART RX +HAL_GPIO_PIN(A2, B, 2) // Redefined below, hard-wired to temperature sensor +HAL_GPIO_PIN(A3, B, 3) // Not connected on Lite +HAL_GPIO_PIN(A4, B, 0) // Redefined below, hard-wired to UART TX + +// UART +HAL_GPIO_PIN(TX, B, 0) +HAL_GPIO_PIN(RX, B, 1) +#define UART_SERCOM 0 +#define UART_SERCOM_TXPO UART_TXPO_2 +#define UART_SERCOM_RXPO UART_RXPO_3 + +// Temperature sensor +HAL_GPIO_PIN(TS_ENABLE, B, 4) +HAL_GPIO_PIN(TEMPSENSE, B, 2) + +// Light +HAL_GPIO_PIN(RED, A, 20) +HAL_GPIO_PIN(GREEN, A, 21) +HAL_GPIO_PIN(LED, A, 20) // Default to red LED for blinky tests + +// Sound +HAL_GPIO_PIN(BUZZER, A, 27) + +// Buttons +HAL_GPIO_PIN(BTN_LIGHT, A, 22) +HAL_GPIO_PIN(BTN_MODE, A, 23) +HAL_GPIO_PIN(BTN_ALARM, A, 2) + +// Segment LCD +HAL_GPIO_PIN(SLCD0, B, 6) +HAL_GPIO_PIN(SLCD1, B, 7) +HAL_GPIO_PIN(SLCD2, B, 8) +HAL_GPIO_PIN(SLCD3, B, 9) +HAL_GPIO_PIN(SLCD4, A, 5) +HAL_GPIO_PIN(SLCD5, A, 4) +HAL_GPIO_PIN(SLCD6, A, 6) +HAL_GPIO_PIN(SLCD7, A, 7) +HAL_GPIO_PIN(SLCD8, A, 8) +HAL_GPIO_PIN(SLCD9, A, 9) +HAL_GPIO_PIN(SLCD10, A, 10) +HAL_GPIO_PIN(SLCD11, A, 11) +HAL_GPIO_PIN(SLCD12, B, 11) +HAL_GPIO_PIN(SLCD13, B, 12) +HAL_GPIO_PIN(SLCD14, B, 13) +HAL_GPIO_PIN(SLCD15, B, 14) +HAL_GPIO_PIN(SLCD16, B, 15) +HAL_GPIO_PIN(SLCD17, A, 12) +HAL_GPIO_PIN(SLCD18, A, 13) +HAL_GPIO_PIN(SLCD19, A, 14) +HAL_GPIO_PIN(SLCD20, A, 15) +HAL_GPIO_PIN(SLCD21, A, 16) +HAL_GPIO_PIN(SLCD22, A, 17) +HAL_GPIO_PIN(SLCD23, A, 18) +HAL_GPIO_PIN(SLCD24, A, 19) +HAL_GPIO_PIN(SLCD25, B, 16) +HAL_GPIO_PIN(SLCD26, B, 17)