Loading...
Searching...
No Matches
board.h File Reference

Support for the SenseBox MCU with SAMD21 board. More...

Detailed Description

Support for the SenseBox MCU with SAMD21 board.

Board specific configuration for the SenseBox MCU with SAMD21 board.

Author
Leandro Lanzieri leand.nosp@m.ro.l.nosp@m.anzie.nosp@m.ri@h.nosp@m.aw-ha.nosp@m.mbur.nosp@m.g.de

Definition in file board.h.

#include "cpu.h"
#include "periph_conf.h"
#include "periph_cpu.h"
+ Include dependency graph for board.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define WAIT_FOR_SPI_RESET   (3000000UL)
 Delay to wait for SPI reset.
 
#define HDC1000_PARAM_ADDR   (0x40)
 HDC1000 Temperature & Humidity sensor.
 
#define TSL2561_PARAM_ADDR   TSL2561_ADDR_LOW
 TSL2561 Visible light sensor.
 
#define BMX280_PARAM_I2C_ADDR   (0x76)
 BMP280 Pressure and temperature sensor.
 

LED pin definitions and handlers

#define LED0_PIN   GPIO_PIN(PA, 27)
 
#define LED_PORT   PORT->Group[PA]
 
#define LED0_MASK   (1 << 27)
 
#define LED0_ON   (LED_PORT.OUTSET.reg = LED0_MASK)
 
#define LED0_OFF   (LED_PORT.OUTCLR.reg = LED0_MASK)
 
#define LED0_TOGGLE   (LED_PORT.OUTTGL.reg = LED0_MASK)
 
#define LED1_PIN   GPIO_PIN(PA, 28)
 
#define LED1_MASK   (1 << 28)
 
#define LED1_ON   (LED_PORT.OUTSET.reg = LED1_MASK)
 
#define LED1_OFF   (LED_PORT.OUTCLR.reg = LED1_MASK)
 
#define LED1_TOGGLE   (LED_PORT.OUTTGL.reg = LED1_MASK)
 

SW0 (Button) pin definitions

#define BTN0_PIN   GPIO_PIN(PA, 20)
 
#define BTN0_MODE   GPIO_IN_PU
 

XBEE1 bus

XBEE1 is enabled by default.

The enable pin is 'XBEE1_EN_PIN'. To disable this bus call 'XBEE1_DISABLE', to re-enable it call 'XBEE1_ENABLE'.

#define XBEE1_EN_PORT   PORT->Group[PB]
 
#define XBEE1_EN_MASK   (1 << 3)
 
#define XBEE1_EN_MODE   GPIO_OUT
 
#define XBEE1_EN_PIN   GPIO_PIN(PB, 3)
 
#define XBEE1_ENABLE   (XBEE1_EN_PORT.OUTCLR.reg = XBEE1_EN_MASK)
 
#define XBEE1_DISABLE   (XBEE1_EN_PORT.OUTSET.reg = XBEE1_EN_MASK)
 
#define XBEE1_CS_PIN   GPIO_PIN(PA, 18)
 
#define XBEE1_INT_PIN   GPIO_PIN(PA, 21)
 

XBEE2 bus

XBEE2 is enabled by default.

The enable pin is 'XBEE2_EN_PIN'. To disable this bus call 'XBEE2_DISABLE', to re-enable it call 'XBEE2_ENABLE'.

#define XBEE2_EN_PORT   PORT->Group[PB]
 
#define XBEE2_EN_MASK   (1 << 10)
 
#define XBEE2_EN_PIN   GPIO_PIN(PB, 10)
 
#define XBEE2_EN_MODE   GPIO_OUT
 
#define XBEE2_ENABLE   (XBEE2_EN_PORT.OUTCLR.reg = XBEE2_EN_MASK)
 
#define XBEE2_DISABLE   (XBEE2_EN_PORT.OUTSET.reg = XBEE2_EN_MASK)
 
#define XBEE2_CS_PIN   GPIO_PIN(PA, 14)
 
#define XBEE2_INT_PIN   GPIO_PIN(PA, 15)
 

I2C bus

I2C is enabled by default.

The enable pin is 'I2C_EN_PIN'. To disable this bus call 'I2C_DISABLE', to re-enable it call 'I2C_ENABLE'.

#define I2C_EN_PORT   PORT->Group[PB]
 
#define I2C_EN_MASK   (1 << 11)
 
#define I2C_EN_PIN   GPIO_PIN(PB, 11)
 
#define I2C_EN_MODE   GPIO_OUT
 
#define I2C_ENABLE   (I2C_EN_PORT.OUTSET.reg = I2C_EN_MASK)
 
#define I2C_DISABLE   (I2C_EN_PORT.OUTCLR.reg = I2C_EN_MASK)
 

SX127X

SX127X configuration (on XBEE1 port).

This particular board has merged DIO0 and DIO1 interrupt pins into one. The driver will always check the interrupt type in the ISR handler, so it's enough to set the DIO0 pin in order to handle both DIO0 and DIO1.

#define SX127X_PARAM_SPI   (SPI_DEV(0))
 
#define SX127X_PARAM_SPI_NSS   XBEE1_CS_PIN /* D23 */
 
#define SX127X_PARAM_RESET   GPIO_UNDEF
 
#define SX127X_PARAM_DIO0   XBEE1_INT_PIN /* D24 */
 
#define SX127X_PARAM_DIO1   GPIO_UNDEF
 
#define SX127X_PARAM_DIO2   GPIO_UNDEF
 
#define SX127X_PARAM_DIO3   GPIO_UNDEF
 
#define SX127X_PARAM_PASELECT   (SX127X_PA_BOOST)
 
#define MTD_0   mtd_dev_get(0)
 MTD device 0 (SD Card) definition.
 

Macro Definition Documentation

◆ BMX280_PARAM_I2C_ADDR

#define BMX280_PARAM_I2C_ADDR   (0x76)

BMP280 Pressure and temperature sensor.

Definition at line 162 of file board.h.

◆ BTN0_MODE

#define BTN0_MODE   GPIO_IN_PU

Definition at line 59 of file board.h.

◆ BTN0_PIN

#define BTN0_PIN   GPIO_PIN(PA, 20)

Definition at line 58 of file board.h.

◆ HDC1000_PARAM_ADDR

#define HDC1000_PARAM_ADDR   (0x40)

HDC1000 Temperature & Humidity sensor.

Definition at line 152 of file board.h.

◆ I2C_DISABLE

#define I2C_DISABLE   (I2C_EN_PORT.OUTCLR.reg = I2C_EN_MASK)

Definition at line 115 of file board.h.

◆ I2C_EN_MASK

#define I2C_EN_MASK   (1 << 11)

Definition at line 110 of file board.h.

◆ I2C_EN_MODE

#define I2C_EN_MODE   GPIO_OUT

Definition at line 112 of file board.h.

◆ I2C_EN_PIN

#define I2C_EN_PIN   GPIO_PIN(PB, 11)

Definition at line 111 of file board.h.

◆ I2C_EN_PORT

#define I2C_EN_PORT   PORT->Group[PB]

Definition at line 109 of file board.h.

◆ I2C_ENABLE

#define I2C_ENABLE   (I2C_EN_PORT.OUTSET.reg = I2C_EN_MASK)

Definition at line 114 of file board.h.

◆ LED0_MASK

#define LED0_MASK   (1 << 27)

Definition at line 40 of file board.h.

◆ LED0_OFF

#define LED0_OFF   (LED_PORT.OUTCLR.reg = LED0_MASK)

Definition at line 43 of file board.h.

◆ LED0_ON

#define LED0_ON   (LED_PORT.OUTSET.reg = LED0_MASK)

Definition at line 42 of file board.h.

◆ LED0_PIN

#define LED0_PIN   GPIO_PIN(PA, 27)

Definition at line 37 of file board.h.

◆ LED0_TOGGLE

#define LED0_TOGGLE   (LED_PORT.OUTTGL.reg = LED0_MASK)

Definition at line 44 of file board.h.

◆ LED1_MASK

#define LED1_MASK   (1 << 28)

Definition at line 47 of file board.h.

◆ LED1_OFF

#define LED1_OFF   (LED_PORT.OUTCLR.reg = LED1_MASK)

Definition at line 50 of file board.h.

◆ LED1_ON

#define LED1_ON   (LED_PORT.OUTSET.reg = LED1_MASK)

Definition at line 49 of file board.h.

◆ LED1_PIN

#define LED1_PIN   GPIO_PIN(PA, 28)

Definition at line 46 of file board.h.

◆ LED1_TOGGLE

#define LED1_TOGGLE   (LED_PORT.OUTTGL.reg = LED1_MASK)

Definition at line 51 of file board.h.

◆ LED_PORT

#define LED_PORT   PORT->Group[PA]

Definition at line 39 of file board.h.

◆ MTD_0

#define MTD_0   mtd_dev_get(0)

MTD device 0 (SD Card) definition.

mtd_dev_get(0) is defined in board.c

Definition at line 169 of file board.h.

◆ SX127X_PARAM_DIO0

#define SX127X_PARAM_DIO0   XBEE1_INT_PIN /* D24 */

Definition at line 133 of file board.h.

◆ SX127X_PARAM_DIO1

#define SX127X_PARAM_DIO1   GPIO_UNDEF

Definition at line 135 of file board.h.

◆ SX127X_PARAM_DIO2

#define SX127X_PARAM_DIO2   GPIO_UNDEF

Definition at line 137 of file board.h.

◆ SX127X_PARAM_DIO3

#define SX127X_PARAM_DIO3   GPIO_UNDEF

Definition at line 139 of file board.h.

◆ SX127X_PARAM_PASELECT

#define SX127X_PARAM_PASELECT   (SX127X_PA_BOOST)

Definition at line 141 of file board.h.

◆ SX127X_PARAM_RESET

#define SX127X_PARAM_RESET   GPIO_UNDEF

Definition at line 131 of file board.h.

◆ SX127X_PARAM_SPI

#define SX127X_PARAM_SPI   (SPI_DEV(0))

Definition at line 127 of file board.h.

◆ SX127X_PARAM_SPI_NSS

#define SX127X_PARAM_SPI_NSS   XBEE1_CS_PIN /* D23 */

Definition at line 129 of file board.h.

◆ TSL2561_PARAM_ADDR

#define TSL2561_PARAM_ADDR   TSL2561_ADDR_LOW

TSL2561 Visible light sensor.

Definition at line 157 of file board.h.

◆ WAIT_FOR_SPI_RESET

#define WAIT_FOR_SPI_RESET   (3000000UL)

Delay to wait for SPI reset.

Definition at line 147 of file board.h.

◆ XBEE1_CS_PIN

#define XBEE1_CS_PIN   GPIO_PIN(PA, 18)

Definition at line 77 of file board.h.

◆ XBEE1_DISABLE

#define XBEE1_DISABLE   (XBEE1_EN_PORT.OUTSET.reg = XBEE1_EN_MASK)

Definition at line 75 of file board.h.

◆ XBEE1_EN_MASK

#define XBEE1_EN_MASK   (1 << 3)

Definition at line 70 of file board.h.

◆ XBEE1_EN_MODE

#define XBEE1_EN_MODE   GPIO_OUT

Definition at line 71 of file board.h.

◆ XBEE1_EN_PIN

#define XBEE1_EN_PIN   GPIO_PIN(PB, 3)

Definition at line 72 of file board.h.

◆ XBEE1_EN_PORT

#define XBEE1_EN_PORT   PORT->Group[PB]

Definition at line 69 of file board.h.

◆ XBEE1_ENABLE

#define XBEE1_ENABLE   (XBEE1_EN_PORT.OUTCLR.reg = XBEE1_EN_MASK)

Definition at line 74 of file board.h.

◆ XBEE1_INT_PIN

#define XBEE1_INT_PIN   GPIO_PIN(PA, 21)

Definition at line 79 of file board.h.

◆ XBEE2_CS_PIN

#define XBEE2_CS_PIN   GPIO_PIN(PA, 14)

Definition at line 97 of file board.h.

◆ XBEE2_DISABLE

#define XBEE2_DISABLE   (XBEE2_EN_PORT.OUTSET.reg = XBEE2_EN_MASK)

Definition at line 95 of file board.h.

◆ XBEE2_EN_MASK

#define XBEE2_EN_MASK   (1 << 10)

Definition at line 90 of file board.h.

◆ XBEE2_EN_MODE

#define XBEE2_EN_MODE   GPIO_OUT

Definition at line 92 of file board.h.

◆ XBEE2_EN_PIN

#define XBEE2_EN_PIN   GPIO_PIN(PB, 10)

Definition at line 91 of file board.h.

◆ XBEE2_EN_PORT

#define XBEE2_EN_PORT   PORT->Group[PB]

Definition at line 89 of file board.h.

◆ XBEE2_ENABLE

#define XBEE2_ENABLE   (XBEE2_EN_PORT.OUTCLR.reg = XBEE2_EN_MASK)

Definition at line 94 of file board.h.

◆ XBEE2_INT_PIN

#define XBEE2_INT_PIN   GPIO_PIN(PA, 15)

Definition at line 99 of file board.h.