Skip to content

Commit abd437a

Browse files
committed
metro-m0: Add GPS support
Plug a ublox GPS module into D4(tx)/D3(rx) Signed-off-by: Keith Packard <[email protected]>
1 parent 4bd22c0 commit abd437a

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/metro-m0/ao_pins.h

+14
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,18 @@ struct ao_adc {
118118

119119
#define AO_ADC_SQ6 SAMD21_ADC_INPUTCTRL_MUXPOS_TEMP
120120

121+
/* GPS */
122+
#define HAS_GPS 1
123+
124+
#define AO_SERIAL_SPEED_UBLOX AO_SERIAL_SPEED_9600
125+
126+
#define HAS_SERIAL_0 1
127+
#define USE_SERIAL_0_STDIN 0
128+
#define SERIAL_0_PA08_PA09 1
129+
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)
134+
121135
#endif /* _AO_PINS_H_ */

src/metro-m0/metro-m0.c

+2
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ int main(void)
6767
ao_exti_init();
6868
ao_spi_init();
6969
ao_adc_init();
70+
ao_serial_init();
71+
ao_gps_init();
7072
ao_beep_init();
7173
ao_usb_init();
7274
ao_storage_init();

0 commit comments

Comments
 (0)