Adafruit Feather M0

Support for the Adafruit Feather M0. More...

Detailed Description

Support for the Adafruit Feather M0.

General information

Feather M0 boards are development boards shipped by Adafruit.

All the feather M0 boards are built based on the same Atmel SAMD21G18A microcontroller. See Atmel SAMD21.

Several types of Feather M0 boards exist:

The different modules used to differentiate the boards (ATWINC1500 WiFi, Bluefruit LE, SD card, LoRa) are connected via SPI (SPI_DEV(0)) to the SAMD21 mcu.

Pinout

Adafruit Feather M0 proto pinout

AIN7 can be used to measure the voltage of a connected Lipoly battery. It is mapped to ADC_LINE(6) in RIOT.

vbat *= 2; /* voltage was divided by 2, so multiply it back */
vbat *= 33; /* reference voltage 3.3V * 10 */
vbat /= 10240; /* resolution * 10 (because we multiplied 3.3V by 10) */
printf("Bat: %dV\n", vbat);

Flash the board

Use BOARD=feather-m0 with the make command.
Example with hello-world application:

make BOARD=feather-m0 -C examples/hello-world flash
Note
If the application crashes, automatic reflashing via USB, as explained above won't be possible. In this case, the board must be set in bootloader mode by double tapping the reset button before running the flash command.

Using the WiFi interface

To enable the WiFi interface of the Feather M0 WiFi variant of the board automatically for networking applications, use feather-m0-wifi as board and define the required WiFi parameters, for example:

CFLAGS='-DWIFI_SSID=\"<ssid>\" -DWIFI_PASS=\"<pass>\"' \
make BOARD=feather-m0-wifi -C examples/gnrc_networking

For detailed information about the parameters, see section ATWINC15x0 WiFi module driver.

Using with LoRa module

To enable the LoRa module available on the Feather M0 LoRa variant of the board automatically for LoRa applications, use feather-m0-lora as board:

make BOARD=feather-m0-lora -C examples/gnrc_lorawan

For detailed information about the parameters, see section Semtech SX1272 and SX1276 radios driver.

Accessing STDIO via UART

STDIO of RIOT is directly available over the USB port.

The TERM_DELAY environment variable can be used to add a delay (in second) before opening the serial terminal. The default value is 2s which should be enough in most of the situation.

Files

file  board.h
 Board specific configuration for the Adafruit Feather M0.
 
file  gpio_params.h
 Board specific configuration of direct mapped GPIOs.
 
file  periph_conf.h
 Configuration of CPU peripherals for Adafruit Feather M0.
 
file  sdcard_spi_params.h
 SD card configuration for the Adafruit Feather M0 Adalogger.
 
ADC_LINE
#define ADC_LINE(x)
Default ADC line access macro.
Definition: adc.h:86
ADC_RES_10BIT
@ ADC_RES_10BIT
ADC resolution: 10 bit.
Definition: adc.h:96
adc_sample
int32_t adc_sample(adc_t line, adc_res_t res)
Sample a value from the given ADC line.