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

Board specific definitions for the ATxmegaA1 Xplained board. More...

Detailed Description

Board specific definitions for the ATxmegaA1 Xplained board.

Author
Gerson Fernando Budke nando.nosp@m.jve@.nosp@m.gmail.nosp@m..com

Definition in file board.h.

#include "cpu.h"
#include "macros/units.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.

#define CLOCK_CORECLOCK   MHZ(32)
 Clock configuration.
 
#define STDIO_UART_DEV   UART_DEV(2)
 Use the UART-2 for STDIO on this board.
 

Baudrate for STDIO terminal

The standard configuration for STDIO in cpu/atxmega/periph/uart.c is to use double speed.

For 32MHz F_CPU following Baudrate have good error rates 115200

Matches this with BAUD in Board/Makefile.include

#define STDIO_UART_BAUDRATE   (115200U)
 

LED pin definitions and handlers

#define LED_PORT   PORTE
 
#define LED0_PIN   GPIO_PIN(PORT_E, 0)
 
#define LED0_MODE   GPIO_OUT
 
#define LED0_MASK   (PIN0_bm)
 
#define LED0_ON   (LED_PORT.OUTCLR = LED0_MASK)
 
#define LED0_OFF   (LED_PORT.OUTSET = LED0_MASK)
 
#define LED0_TOGGLE   (LED_PORT.OUTTGL = LED0_MASK)
 
#define LED1_PIN   GPIO_PIN(PORT_E, 1)
 
#define LED1_MODE   GPIO_OUT
 
#define LED1_MASK   (PIN1_bm)
 
#define LED1_ON   (LED_PORT.OUTCLR = LED1_MASK)
 
#define LED1_OFF   (LED_PORT.OUTSET = LED1_MASK)
 
#define LED1_TOGGLE   (LED_PORT.OUTTGL = LED1_MASK)
 
#define LED2_PIN   GPIO_PIN(PORT_E, 2)
 
#define LED2_MODE   GPIO_OUT
 
#define LED2_MASK   (PIN2_bm)
 
#define LED2_ON   (LED_PORT.OUTCLR = LED2_MASK)
 
#define LED2_OFF   (LED_PORT.OUTSET = LED2_MASK)
 
#define LED2_TOGGLE   (LED_PORT.OUTTGL = LED2_MASK)
 
#define LED3_PIN   GPIO_PIN(PORT_E, 3)
 
#define LED3_MODE   GPIO_OUT
 
#define LED3_MASK   (PIN3_bm)
 
#define LED3_ON   (LED_PORT.OUTCLR = LED3_MASK)
 
#define LED3_OFF   (LED_PORT.OUTSET = LED3_MASK)
 
#define LED3_TOGGLE   (LED_PORT.OUTTGL = LED3_MASK)
 
#define LED4_PIN   GPIO_PIN(PORT_E, 4)
 
#define LED4_MODE   GPIO_OUT
 
#define LED4_MASK   (PIN4_bm)
 
#define LED4_ON   (LED_PORT.OUTCLR = LED4_MASK)
 
#define LED4_OFF   (LED_PORT.OUTSET = LED4_MASK)
 
#define LED4_TOGGLE   (LED_PORT.OUTTGL = LED4_MASK)
 
#define LED5_PIN   GPIO_PIN(PORT_E, 5)
 
#define LED5_MODE   GPIO_OUT
 
#define LED5_MASK   (PIN5_bm)
 
#define LED5_ON   (LED_PORT.OUTCLR = LED5_MASK)
 
#define LED5_OFF   (LED_PORT.OUTSET = LED5_MASK)
 
#define LED5_TOGGLE   (LED_PORT.OUTTGL = LED5_MASK)
 
#define LED6_PIN   GPIO_PIN(PORT_E, 6)
 
#define LED6_MODE   GPIO_OUT
 
#define LED6_MASK   (PIN6_bm)
 
#define LED6_ON   (LED_PORT.OUTCLR = LED6_MASK)
 
#define LED6_OFF   (LED_PORT.OUTSET = LED6_MASK)
 
#define LED6_TOGGLE   (LED_PORT.OUTTGL = LED6_MASK)
 
#define LED7_PIN   GPIO_PIN(PORT_E, 7)
 
#define LED7_MODE   GPIO_OUT
 
#define LED7_MASK   (PIN7_bm)
 
#define LED7_ON   (LED_PORT.OUTCLR = LED7_MASK)
 
#define LED7_OFF   (LED_PORT.OUTSET = LED7_MASK)
 
#define LED7_TOGGLE   (LED_PORT.OUTTGL = LED7_MASK)
 
#define LED_PORT_MASK
 

Button pin configuration

#define BTN0_PIN   GPIO_PIN(PORT_D, 0)
 
#define BTN0_MODE   (GPIO_IN | GPIO_OPC_PU | GPIO_SLEW_RATE)
 
#define BTN0_INT_FLANK   (GPIO_ISC_FALLING | GPIO_LVL_LOW)
 
#define BTN1_PIN   GPIO_PIN(PORT_D, 1)
 
#define BTN1_MODE   (GPIO_IN | GPIO_OPC_PU | GPIO_SLEW_RATE)
 
#define BTN1_INT_FLANK   (GPIO_ISC_FALLING | GPIO_LVL_LOW)
 
#define BTN2_PIN   GPIO_PIN(PORT_D, 2)
 
#define BTN2_MODE   (GPIO_IN | GPIO_OPC_PU | GPIO_SLEW_RATE)
 
#define BTN2_INT_FLANK   (GPIO_ISC_FALLING | GPIO_LVL_LOW)
 
#define BTN3_PIN   GPIO_PIN(PORT_D, 3)
 
#define BTN3_MODE   (GPIO_IN | GPIO_OPC_PU | GPIO_SLEW_RATE)
 
#define BTN3_INT_FLANK   (GPIO_ISC_FALLING | GPIO_LVL_LOW)
 
#define BTN4_PIN   GPIO_PIN(PORT_D, 4)
 
#define BTN4_MODE   (GPIO_IN | GPIO_OPC_PU | GPIO_SLEW_RATE)
 
#define BTN4_INT_FLANK   (GPIO_ISC_FALLING | GPIO_LVL_LOW)
 
#define BTN5_PIN   GPIO_PIN(PORT_D, 5)
 
#define BTN5_MODE   (GPIO_IN | GPIO_OPC_PU | GPIO_SLEW_RATE)
 
#define BTN5_INT_FLANK   (GPIO_ISC_FALLING | GPIO_LVL_LOW)
 
#define BTN6_PIN   GPIO_PIN(PORT_R, 0)
 
#define BTN6_MODE   (GPIO_IN | GPIO_OPC_PU | GPIO_SLEW_RATE)
 
#define BTN6_INT_FLANK   (GPIO_ISC_FALLING | GPIO_LVL_LOW)
 
#define BTN7_PIN   GPIO_PIN(PORT_R, 1)
 
#define BTN7_MODE   (GPIO_IN | GPIO_OPC_PU | GPIO_SLEW_RATE)
 
#define BTN7_INT_FLANK   (GPIO_ISC_FALLING | GPIO_LVL_LOW)
 

xtimer configuration values

if XTIMER_HZ > 1MHz then (XTIMER_HZ != (1000000ul << XTIMER_SHIFT)) if XTIMER_HZ < 1MHz then ((XTIMER_HZ << XTIMER_SHIFT) != 1000000ul)

32MHz Core Clock XTIMER_HZ 4000000 (clkdiv 8 ) XTIMER_SHIFT 2 XTIMER_HZ 1000000 () XTIMER_SHIFT 0 XTIMER_HZ 500000 (clkdiv 64) XTIMER_SHIFT 1 XTIMER_HZ 250000 (clkdiv 128) XTIMER_SHIFT 2 XTIMER_HZ 31250 (clkdiv 1024) XTIMER_SHIFT 5

#define XTIMER_DEV   TIMER_DEV(0)
 
#define XTIMER_CHAN   (0)
 
#define XTIMER_WIDTH   (16)
 
#define XTIMER_HZ   KHZ(500)
 
#define XTIMER_BACKOFF   (150)
 

Macro Definition Documentation

◆ BTN0_INT_FLANK

#define BTN0_INT_FLANK   (GPIO_ISC_FALLING | GPIO_LVL_LOW)

Definition at line 129 of file board.h.

◆ BTN0_MODE

#define BTN0_MODE   (GPIO_IN | GPIO_OPC_PU | GPIO_SLEW_RATE)

Definition at line 128 of file board.h.

◆ BTN0_PIN

#define BTN0_PIN   GPIO_PIN(PORT_D, 0)

Definition at line 127 of file board.h.

◆ BTN1_INT_FLANK

#define BTN1_INT_FLANK   (GPIO_ISC_FALLING | GPIO_LVL_LOW)

Definition at line 133 of file board.h.

◆ BTN1_MODE

#define BTN1_MODE   (GPIO_IN | GPIO_OPC_PU | GPIO_SLEW_RATE)

Definition at line 132 of file board.h.

◆ BTN1_PIN

#define BTN1_PIN   GPIO_PIN(PORT_D, 1)

Definition at line 131 of file board.h.

◆ BTN2_INT_FLANK

#define BTN2_INT_FLANK   (GPIO_ISC_FALLING | GPIO_LVL_LOW)

Definition at line 137 of file board.h.

◆ BTN2_MODE

#define BTN2_MODE   (GPIO_IN | GPIO_OPC_PU | GPIO_SLEW_RATE)

Definition at line 136 of file board.h.

◆ BTN2_PIN

#define BTN2_PIN   GPIO_PIN(PORT_D, 2)

Definition at line 135 of file board.h.

◆ BTN3_INT_FLANK

#define BTN3_INT_FLANK   (GPIO_ISC_FALLING | GPIO_LVL_LOW)

Definition at line 141 of file board.h.

◆ BTN3_MODE

#define BTN3_MODE   (GPIO_IN | GPIO_OPC_PU | GPIO_SLEW_RATE)

Definition at line 140 of file board.h.

◆ BTN3_PIN

#define BTN3_PIN   GPIO_PIN(PORT_D, 3)

Definition at line 139 of file board.h.

◆ BTN4_INT_FLANK

#define BTN4_INT_FLANK   (GPIO_ISC_FALLING | GPIO_LVL_LOW)

Definition at line 145 of file board.h.

◆ BTN4_MODE

#define BTN4_MODE   (GPIO_IN | GPIO_OPC_PU | GPIO_SLEW_RATE)

Definition at line 144 of file board.h.

◆ BTN4_PIN

#define BTN4_PIN   GPIO_PIN(PORT_D, 4)

Definition at line 143 of file board.h.

◆ BTN5_INT_FLANK

#define BTN5_INT_FLANK   (GPIO_ISC_FALLING | GPIO_LVL_LOW)

Definition at line 149 of file board.h.

◆ BTN5_MODE

#define BTN5_MODE   (GPIO_IN | GPIO_OPC_PU | GPIO_SLEW_RATE)

Definition at line 148 of file board.h.

◆ BTN5_PIN

#define BTN5_PIN   GPIO_PIN(PORT_D, 5)

Definition at line 147 of file board.h.

◆ BTN6_INT_FLANK

#define BTN6_INT_FLANK   (GPIO_ISC_FALLING | GPIO_LVL_LOW)

Definition at line 153 of file board.h.

◆ BTN6_MODE

#define BTN6_MODE   (GPIO_IN | GPIO_OPC_PU | GPIO_SLEW_RATE)

Definition at line 152 of file board.h.

◆ BTN6_PIN

#define BTN6_PIN   GPIO_PIN(PORT_R, 0)

Definition at line 151 of file board.h.

◆ BTN7_INT_FLANK

#define BTN7_INT_FLANK   (GPIO_ISC_FALLING | GPIO_LVL_LOW)

Definition at line 157 of file board.h.

◆ BTN7_MODE

#define BTN7_MODE   (GPIO_IN | GPIO_OPC_PU | GPIO_SLEW_RATE)

Definition at line 156 of file board.h.

◆ BTN7_PIN

#define BTN7_PIN   GPIO_PIN(PORT_R, 1)

Definition at line 155 of file board.h.

◆ CLOCK_CORECLOCK

#define CLOCK_CORECLOCK   MHZ(32)

Clock configuration.

Definition at line 32 of file board.h.

◆ LED0_MASK

#define LED0_MASK   (PIN0_bm)

Definition at line 65 of file board.h.

◆ LED0_MODE

#define LED0_MODE   GPIO_OUT

Definition at line 64 of file board.h.

◆ LED0_OFF

#define LED0_OFF   (LED_PORT.OUTSET = LED0_MASK)

Definition at line 67 of file board.h.

◆ LED0_ON

#define LED0_ON   (LED_PORT.OUTCLR = LED0_MASK)

Definition at line 66 of file board.h.

◆ LED0_PIN

#define LED0_PIN   GPIO_PIN(PORT_E, 0)

Definition at line 63 of file board.h.

◆ LED0_TOGGLE

#define LED0_TOGGLE   (LED_PORT.OUTTGL = LED0_MASK)

Definition at line 68 of file board.h.

◆ LED1_MASK

#define LED1_MASK   (PIN1_bm)

Definition at line 72 of file board.h.

◆ LED1_MODE

#define LED1_MODE   GPIO_OUT

Definition at line 71 of file board.h.

◆ LED1_OFF

#define LED1_OFF   (LED_PORT.OUTSET = LED1_MASK)

Definition at line 74 of file board.h.

◆ LED1_ON

#define LED1_ON   (LED_PORT.OUTCLR = LED1_MASK)

Definition at line 73 of file board.h.

◆ LED1_PIN

#define LED1_PIN   GPIO_PIN(PORT_E, 1)

Definition at line 70 of file board.h.

◆ LED1_TOGGLE

#define LED1_TOGGLE   (LED_PORT.OUTTGL = LED1_MASK)

Definition at line 75 of file board.h.

◆ LED2_MASK

#define LED2_MASK   (PIN2_bm)

Definition at line 79 of file board.h.

◆ LED2_MODE

#define LED2_MODE   GPIO_OUT

Definition at line 78 of file board.h.

◆ LED2_OFF

#define LED2_OFF   (LED_PORT.OUTSET = LED2_MASK)

Definition at line 81 of file board.h.

◆ LED2_ON

#define LED2_ON   (LED_PORT.OUTCLR = LED2_MASK)

Definition at line 80 of file board.h.

◆ LED2_PIN

#define LED2_PIN   GPIO_PIN(PORT_E, 2)

Definition at line 77 of file board.h.

◆ LED2_TOGGLE

#define LED2_TOGGLE   (LED_PORT.OUTTGL = LED2_MASK)

Definition at line 82 of file board.h.

◆ LED3_MASK

#define LED3_MASK   (PIN3_bm)

Definition at line 86 of file board.h.

◆ LED3_MODE

#define LED3_MODE   GPIO_OUT

Definition at line 85 of file board.h.

◆ LED3_OFF

#define LED3_OFF   (LED_PORT.OUTSET = LED3_MASK)

Definition at line 88 of file board.h.

◆ LED3_ON

#define LED3_ON   (LED_PORT.OUTCLR = LED3_MASK)

Definition at line 87 of file board.h.

◆ LED3_PIN

#define LED3_PIN   GPIO_PIN(PORT_E, 3)

Definition at line 84 of file board.h.

◆ LED3_TOGGLE

#define LED3_TOGGLE   (LED_PORT.OUTTGL = LED3_MASK)

Definition at line 89 of file board.h.

◆ LED4_MASK

#define LED4_MASK   (PIN4_bm)

Definition at line 93 of file board.h.

◆ LED4_MODE

#define LED4_MODE   GPIO_OUT

Definition at line 92 of file board.h.

◆ LED4_OFF

#define LED4_OFF   (LED_PORT.OUTSET = LED4_MASK)

Definition at line 95 of file board.h.

◆ LED4_ON

#define LED4_ON   (LED_PORT.OUTCLR = LED4_MASK)

Definition at line 94 of file board.h.

◆ LED4_PIN

#define LED4_PIN   GPIO_PIN(PORT_E, 4)

Definition at line 91 of file board.h.

◆ LED4_TOGGLE

#define LED4_TOGGLE   (LED_PORT.OUTTGL = LED4_MASK)

Definition at line 96 of file board.h.

◆ LED5_MASK

#define LED5_MASK   (PIN5_bm)

Definition at line 100 of file board.h.

◆ LED5_MODE

#define LED5_MODE   GPIO_OUT

Definition at line 99 of file board.h.

◆ LED5_OFF

#define LED5_OFF   (LED_PORT.OUTSET = LED5_MASK)

Definition at line 102 of file board.h.

◆ LED5_ON

#define LED5_ON   (LED_PORT.OUTCLR = LED5_MASK)

Definition at line 101 of file board.h.

◆ LED5_PIN

#define LED5_PIN   GPIO_PIN(PORT_E, 5)

Definition at line 98 of file board.h.

◆ LED5_TOGGLE

#define LED5_TOGGLE   (LED_PORT.OUTTGL = LED5_MASK)

Definition at line 103 of file board.h.

◆ LED6_MASK

#define LED6_MASK   (PIN6_bm)

Definition at line 107 of file board.h.

◆ LED6_MODE

#define LED6_MODE   GPIO_OUT

Definition at line 106 of file board.h.

◆ LED6_OFF

#define LED6_OFF   (LED_PORT.OUTSET = LED6_MASK)

Definition at line 109 of file board.h.

◆ LED6_ON

#define LED6_ON   (LED_PORT.OUTCLR = LED6_MASK)

Definition at line 108 of file board.h.

◆ LED6_PIN

#define LED6_PIN   GPIO_PIN(PORT_E, 6)

Definition at line 105 of file board.h.

◆ LED6_TOGGLE

#define LED6_TOGGLE   (LED_PORT.OUTTGL = LED6_MASK)

Definition at line 110 of file board.h.

◆ LED7_MASK

#define LED7_MASK   (PIN7_bm)

Definition at line 114 of file board.h.

◆ LED7_MODE

#define LED7_MODE   GPIO_OUT

Definition at line 113 of file board.h.

◆ LED7_OFF

#define LED7_OFF   (LED_PORT.OUTSET = LED7_MASK)

Definition at line 116 of file board.h.

◆ LED7_ON

#define LED7_ON   (LED_PORT.OUTCLR = LED7_MASK)

Definition at line 115 of file board.h.

◆ LED7_PIN

#define LED7_PIN   GPIO_PIN(PORT_E, 7)

Definition at line 112 of file board.h.

◆ LED7_TOGGLE

#define LED7_TOGGLE   (LED_PORT.OUTTGL = LED7_MASK)

Definition at line 117 of file board.h.

◆ LED_PORT

#define LED_PORT   PORTE

Definition at line 61 of file board.h.

◆ LED_PORT_MASK

#define LED_PORT_MASK
Value:
(LED0_MASK | LED1_MASK | LED2_MASK | LED3_MASK | \
LED4_MASK | LED5_MASK | LED6_MASK | LED7_MASK)
#define LED2_MASK
Mask of RX LED yellow.
Definition board.h:43
#define LED1_MASK
Mask of TX LED yellow.
Definition board.h:41

Definition at line 119 of file board.h.

◆ STDIO_UART_BAUDRATE

#define STDIO_UART_BAUDRATE   (115200U)

Definition at line 53 of file board.h.

◆ STDIO_UART_DEV

#define STDIO_UART_DEV   UART_DEV(2)

Use the UART-2 for STDIO on this board.

Definition at line 37 of file board.h.

◆ XTIMER_BACKOFF

#define XTIMER_BACKOFF   (150)

Definition at line 178 of file board.h.

◆ XTIMER_CHAN

#define XTIMER_CHAN   (0)

Definition at line 175 of file board.h.

◆ XTIMER_DEV

#define XTIMER_DEV   TIMER_DEV(0)

Definition at line 174 of file board.h.

◆ XTIMER_HZ

#define XTIMER_HZ   KHZ(500)

Definition at line 177 of file board.h.

◆ XTIMER_WIDTH

#define XTIMER_WIDTH   (16)

Definition at line 176 of file board.h.