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

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

Detailed Description

Board specific definitions for the ATxmegaA3BU 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.
 

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   PORTR
 
#define LED0_PIN   GPIO_PIN(PORT_R, 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_R, 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 LED_PORT_MASK   (LED0_MASK | LED1_MASK)
 

Button pin configuration

#define BTN0_PIN   GPIO_PIN(PORT_E, 5)
 
#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_F, 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_F, 2)
 
#define BTN2_MODE   (GPIO_IN | GPIO_OPC_PU | GPIO_SLEW_RATE)
 
#define BTN2_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 81 of file board.h.

◆ BTN0_MODE

#define BTN0_MODE   (GPIO_IN | GPIO_OPC_PU | GPIO_SLEW_RATE)

Definition at line 80 of file board.h.

◆ BTN0_PIN

#define BTN0_PIN   GPIO_PIN(PORT_E, 5)

Definition at line 79 of file board.h.

◆ BTN1_INT_FLANK

#define BTN1_INT_FLANK   (GPIO_ISC_FALLING | GPIO_LVL_LOW)

Definition at line 85 of file board.h.

◆ BTN1_MODE

#define BTN1_MODE   (GPIO_IN | GPIO_OPC_PU | GPIO_SLEW_RATE)

Definition at line 84 of file board.h.

◆ BTN1_PIN

#define BTN1_PIN   GPIO_PIN(PORT_F, 1)

Definition at line 83 of file board.h.

◆ BTN2_INT_FLANK

#define BTN2_INT_FLANK   (GPIO_ISC_FALLING | GPIO_LVL_LOW)

Definition at line 89 of file board.h.

◆ BTN2_MODE

#define BTN2_MODE   (GPIO_IN | GPIO_OPC_PU | GPIO_SLEW_RATE)

Definition at line 88 of file board.h.

◆ BTN2_PIN

#define BTN2_PIN   GPIO_PIN(PORT_F, 2)

Definition at line 87 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 60 of file board.h.

◆ LED0_MODE

#define LED0_MODE   GPIO_OUT

Definition at line 59 of file board.h.

◆ LED0_OFF

#define LED0_OFF   (LED_PORT.OUTSET = LED0_MASK)

Definition at line 62 of file board.h.

◆ LED0_ON

#define LED0_ON   (LED_PORT.OUTCLR = LED0_MASK)

Definition at line 61 of file board.h.

◆ LED0_PIN

#define LED0_PIN   GPIO_PIN(PORT_R, 0)

Definition at line 58 of file board.h.

◆ LED0_TOGGLE

#define LED0_TOGGLE   (LED_PORT.OUTTGL = LED0_MASK)

Definition at line 63 of file board.h.

◆ LED1_MASK

#define LED1_MASK   (PIN1_bm)

Definition at line 67 of file board.h.

◆ LED1_MODE

#define LED1_MODE   GPIO_OUT

Definition at line 66 of file board.h.

◆ LED1_OFF

#define LED1_OFF   (LED_PORT.OUTSET = LED1_MASK)

Definition at line 69 of file board.h.

◆ LED1_ON

#define LED1_ON   (LED_PORT.OUTCLR = LED1_MASK)

Definition at line 68 of file board.h.

◆ LED1_PIN

#define LED1_PIN   GPIO_PIN(PORT_R, 1)

Definition at line 65 of file board.h.

◆ LED1_TOGGLE

#define LED1_TOGGLE   (LED_PORT.OUTTGL = LED1_MASK)

Definition at line 70 of file board.h.

◆ LED_PORT

#define LED_PORT   PORTR

Definition at line 56 of file board.h.

◆ LED_PORT_MASK

#define LED_PORT_MASK   (LED0_MASK | LED1_MASK)

Definition at line 72 of file board.h.

◆ STDIO_UART_BAUDRATE

#define STDIO_UART_BAUDRATE   (115200U)

Definition at line 48 of file board.h.

◆ XTIMER_BACKOFF

#define XTIMER_BACKOFF   (150)

Definition at line 110 of file board.h.

◆ XTIMER_CHAN

#define XTIMER_CHAN   (0)

Definition at line 107 of file board.h.

◆ XTIMER_DEV

#define XTIMER_DEV   TIMER_DEV(0)

Definition at line 106 of file board.h.

◆ XTIMER_HZ

#define XTIMER_HZ   KHZ(500)

Definition at line 109 of file board.h.

◆ XTIMER_WIDTH

#define XTIMER_WIDTH   (16)

Definition at line 108 of file board.h.