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

Board specific definitions for the Adafruit PyBadge. More...

Detailed Description

Board specific definitions for the Adafruit PyBadge.

Author
Alexandre Abadie alexa.nosp@m.ndre.nosp@m..abad.nosp@m.ie@i.nosp@m.nria..nosp@m.fr

Definition in file board.h.

#include "cpu.h"
#include "periph/gpio.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.

LED pin definitions and handlers

#define LED0_PIN   GPIO_PIN(PA, 23)
 LED0 pin.
 
#define LED_PORT   PORT->Group[PA]
 LED0 port.
 
#define LED0_MASK   (1 << 23)
 LED0 mask.
 
#define LED0_ON   (LED_PORT.OUTSET.reg = LED0_MASK)
 LED0 on macro.
 
#define LED0_OFF   (LED_PORT.OUTCLR.reg = LED0_MASK)
 LED0 off macro.
 
#define LED0_TOGGLE   (LED_PORT.OUTTGL.reg = LED0_MASK)
 LED0 toggle macro.
 
#define LED0_NAME   "LED(Red)"
 LED0 name.
 

Buttons control (TI SN74HC165 shift register)

#define BUTTON_LATCH   GPIO_PIN(PB, 0)
 Latch pin.
 
#define BUTTON_CLK   GPIO_PIN(PB, 31)
 Clock pin.
 
#define BUTTON_OUT   GPIO_PIN(PB, 30)
 Serial output pin.
 

Backlight control

#define BACKLIGHT_PIN   GPIO_PIN(PA, 1)
 Backlight pin.
 
#define BACKLIGHT_PORT   PORT->Group[PA]
 Backlight pin port.
 
#define BACKLIGHT_MASK   (1 << 1)
 Backlight pin mask.
 
#define BACKLIGHT_ON   (BACKLIGHT_PORT.OUTSET.reg = BACKLIGHT_MASK)
 Turn backlight on.
 
#define BACKLIGHT_OFF   (BACKLIGHT_PORT.OUTCLR.reg = BACKLIGHT_MASK)
 Turn backlight off.
 

Display configuration (not supported yet)

#define ST77XX_PARAM_CNTRL   ST77XX_CNTRL_ST7735
 ST77xx controller variant.
 
#define ST77XX_PARAM_SPI   SPI_DEV(1)
 SPI device.
 
#define ST77XX_PARAM_CS   GPIO_PIN(PB, 7)
 Chip select pin.
 
#define ST77XX_PARAM_DCX   GPIO_PIN(PB, 5)
 DCX pin.
 
#define ST77XX_PARAM_RST   GPIO_PIN(PA, 0)
 Reset pin.
 
#define ST77XX_PARAM_NUM_LINES   (160U)
 Number of screen lines.
 
#define ST77XX_PARAM_RGB_CHANNELS   (128U)
 Number of screen rgb channel (height)
 
#define ST77XX_PARAM_RGB   (1)
 RGB configuration.
 
#define ST77XX_PARAM_INVERTED   (0)
 Inversion configuration.
 
#define ST77XX_PARAM_ROTATION   ST77XX_ROTATION_90
 Rotation mode.
 
#define LCD_SCREEN_WIDTH   (ST77XX_PARAM_NUM_LINES)
 LCD screen width.
 
#define LCD_SCREEN_HEIGHT   (ST77XX_PARAM_RGB_CHANNELS)
 LCD screen height.
 

Neopixel LEDs (not supported yet)

#define WS281X_PARAM_PIN   (GPIO_PIN(PA, 15))
 GPIO pin connected to the data pin of the first LED.
 
#define WS281X_PARAM_NUMOF   (5U)
 Number of LEDs chained.
 

Speaker (supported via DAC DDS module)

#define SPEAKER_ENABLE_PIN   GPIO_PIN(PA, 27)
 Speaker enable pin.
 
#define SPEAKER_PIN   GPIO_PIN(PA, 2)
 Speaker pin (A0)
 

MTD configuration

#define MTD_0   mtd_dev_get(0)
 MTD_0 constant.
 

Xtimer configuration

#define XTIMER_WIDTH   (32)
 Default timer is 32bit width.
 
#define XTIMER_HZ   (1000000ul)
 Default timer runs at 1MHz.
 

Macro Definition Documentation

◆ BACKLIGHT_MASK

#define BACKLIGHT_MASK   (1 << 1)

Backlight pin mask.

Definition at line 60 of file board.h.

◆ BACKLIGHT_OFF

#define BACKLIGHT_OFF   (BACKLIGHT_PORT.OUTCLR.reg = BACKLIGHT_MASK)

Turn backlight off.

Definition at line 62 of file board.h.

◆ BACKLIGHT_ON

#define BACKLIGHT_ON   (BACKLIGHT_PORT.OUTSET.reg = BACKLIGHT_MASK)

Turn backlight on.

Definition at line 61 of file board.h.

◆ BACKLIGHT_PIN

#define BACKLIGHT_PIN   GPIO_PIN(PA, 1)

Backlight pin.

Definition at line 58 of file board.h.

◆ BACKLIGHT_PORT

#define BACKLIGHT_PORT   PORT->Group[PA]

Backlight pin port.

Definition at line 59 of file board.h.

◆ BUTTON_CLK

#define BUTTON_CLK   GPIO_PIN(PB, 31)

Clock pin.

Definition at line 50 of file board.h.

◆ BUTTON_LATCH

#define BUTTON_LATCH   GPIO_PIN(PB, 0)

Latch pin.

Definition at line 49 of file board.h.

◆ BUTTON_OUT

#define BUTTON_OUT   GPIO_PIN(PB, 30)

Serial output pin.

Definition at line 51 of file board.h.

◆ LCD_SCREEN_HEIGHT

#define LCD_SCREEN_HEIGHT   (ST77XX_PARAM_RGB_CHANNELS)

LCD screen height.

Definition at line 80 of file board.h.

◆ LCD_SCREEN_WIDTH

#define LCD_SCREEN_WIDTH   (ST77XX_PARAM_NUM_LINES)

LCD screen width.

Definition at line 79 of file board.h.

◆ LED0_MASK

#define LED0_MASK   (1 << 23)

LED0 mask.

Definition at line 36 of file board.h.

◆ LED0_NAME

#define LED0_NAME   "LED(Red)"

LED0 name.

Definition at line 42 of file board.h.

◆ LED0_OFF

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

LED0 off macro.

Definition at line 39 of file board.h.

◆ LED0_ON

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

LED0 on macro.

Definition at line 38 of file board.h.

◆ LED0_PIN

#define LED0_PIN   GPIO_PIN(PA, 23)

LED0 pin.

Definition at line 33 of file board.h.

◆ LED0_TOGGLE

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

LED0 toggle macro.

Definition at line 40 of file board.h.

◆ LED_PORT

#define LED_PORT   PORT->Group[PA]

LED0 port.

Definition at line 35 of file board.h.

◆ MTD_0

#define MTD_0   mtd_dev_get(0)

MTD_0 constant.

Definition at line 103 of file board.h.

◆ SPEAKER_ENABLE_PIN

#define SPEAKER_ENABLE_PIN   GPIO_PIN(PA, 27)

Speaker enable pin.

Definition at line 95 of file board.h.

◆ SPEAKER_PIN

#define SPEAKER_PIN   GPIO_PIN(PA, 2)

Speaker pin (A0)

Definition at line 96 of file board.h.

◆ ST77XX_PARAM_CNTRL

#define ST77XX_PARAM_CNTRL   ST77XX_CNTRL_ST7735

ST77xx controller variant.

Definition at line 69 of file board.h.

◆ ST77XX_PARAM_CS

#define ST77XX_PARAM_CS   GPIO_PIN(PB, 7)

Chip select pin.

Definition at line 71 of file board.h.

◆ ST77XX_PARAM_DCX

#define ST77XX_PARAM_DCX   GPIO_PIN(PB, 5)

DCX pin.

Definition at line 72 of file board.h.

◆ ST77XX_PARAM_INVERTED

#define ST77XX_PARAM_INVERTED   (0)

Inversion configuration.

Definition at line 77 of file board.h.

◆ ST77XX_PARAM_NUM_LINES

#define ST77XX_PARAM_NUM_LINES   (160U)

Number of screen lines.

Definition at line 74 of file board.h.

◆ ST77XX_PARAM_RGB

#define ST77XX_PARAM_RGB   (1)

RGB configuration.

Definition at line 76 of file board.h.

◆ ST77XX_PARAM_RGB_CHANNELS

#define ST77XX_PARAM_RGB_CHANNELS   (128U)

Number of screen rgb channel (height)

Definition at line 75 of file board.h.

◆ ST77XX_PARAM_ROTATION

#define ST77XX_PARAM_ROTATION   ST77XX_ROTATION_90

Rotation mode.

Definition at line 78 of file board.h.

◆ ST77XX_PARAM_RST

#define ST77XX_PARAM_RST   GPIO_PIN(PA, 0)

Reset pin.

Definition at line 73 of file board.h.

◆ ST77XX_PARAM_SPI

#define ST77XX_PARAM_SPI   SPI_DEV(1)

SPI device.

Definition at line 70 of file board.h.

◆ WS281X_PARAM_NUMOF

#define WS281X_PARAM_NUMOF   (5U)

Number of LEDs chained.

Definition at line 88 of file board.h.

◆ WS281X_PARAM_PIN

#define WS281X_PARAM_PIN   (GPIO_PIN(PA, 15))

GPIO pin connected to the data pin of the first LED.

Definition at line 87 of file board.h.

◆ XTIMER_HZ

#define XTIMER_HZ   (1000000ul)

Default timer runs at 1MHz.

Definition at line 111 of file board.h.

◆ XTIMER_WIDTH

#define XTIMER_WIDTH   (32)

Default timer is 32bit width.

Definition at line 110 of file board.h.