2 * Copyright © 2022 Keith Packard <keithp@keithp.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
22 #define LED_0_PORT (&samd21_port_a)
25 #define LED_BLUE (1 << 0)
27 #define AO_LED_PANIC LED_BLUE
30 #define USE_USB_STDIO 1
34 #define AO_DFLL48M 48000000
35 #define AO_XOSC32K 32768
37 #define AO_AHB_PRESCALER 1
38 #define AO_APBA_PRESCALER 1
47 #define M25_MAX_CHIPS 1
50 #define AO_M25_SPI_CS_PORT (&samd21_port_a)
51 #define AO_M25_SPI_CS_MASK (1 << 13)
52 #define AO_M25_SPI_BUS AO_SPI_5_PB22_PB23_PB03
55 #define AO_M25_SPI_CS_PORT (&samd21_port_a)
56 #define AO_M25_SPI_CS_MASK (1 << 14) /* D2 */
57 #define AO_M25_SPI_BUS AO_SPI_4_PB10_PB11_PA12
67 /* Beep on PA11 function F TCC0.3 */
69 #define AO_BEEP_TCC (&samd21_tcc0)
70 #define AO_BEEP_TCC_APBC_MASK SAMD21_PM_APBCMASK_TCC0
71 #define AO_BEEP_PORT (&samd21_port_a)
72 #define AO_BEEP_PIN (11)
73 #define AO_BEEP_FUNC SAMD21_PORT_PMUX_FUNC_F
76 #define AO_DATA_RING 32
85 #define AO_NUM_ADC_PIN 6
86 #define AO_NUM_ADC (AO_NUM_ADC_PIN + 1)
88 #define AO_ADC_DUMP(p) \
89 printf("tick: %5lu a0: %5d a1: %5d a2: %5d a3: %5d a4: %5d a5: %5d temp: %5d\n", \
91 (p)->adc.a[0], (p)->adc.a[1], (p)->adc.a[2], \
92 (p)->adc.a[3], (p)->adc.a[4], (p)->adc.a[5], \
95 #define AO_ADC_PIN0_PORT (&samd21_port_a)
96 #define AO_ADC_PIN0_PIN 2
99 #define AO_ADC_PIN1_PORT (&samd21_port_b)
100 #define AO_ADC_PIN1_PIN 8
103 #define AO_ADC_PIN2_PORT (&samd21_port_b)
104 #define AO_ADC_PIN2_PIN 9
107 #define AO_ADC_PIN3_PORT (&samd21_port_a)
108 #define AO_ADC_PIN3_PIN 4
111 #define AO_ADC_PIN4_PORT (&samd21_port_a)
112 #define AO_ADC_PIN4_PIN 5
115 #define AO_ADC_PIN5_PORT (&samd21_port_b)
116 #define AO_ADC_PIN5_PIN 2
117 #define AO_ADC_SQ5 10
119 #define AO_ADC_SQ6 SAMD21_ADC_INPUTCTRL_MUXPOS_TEMP
124 #define AO_SERIAL_SPEED_UBLOX AO_SERIAL_SPEED_9600
126 #define HAS_SERIAL_0 1
127 #define USE_SERIAL_0_STDIN 0
128 #define SERIAL_0_PA08_PA09 1
130 #define ao_gps_getchar ao_serial0_getchar
131 #define ao_gps_putchar ao_serial0_putchar
132 #define ao_gps_set_speed ao_serial0_set_speed
133 #define ao_gps_fifo (ao_samd21_usart0.rx_fifo)
135 #endif /* _AO_PINS_H_ */