All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Loading...
Searching...
No Matches

Board specific configuration for the Seeed Studio XIAO nRF52840 and Seeed Studio XIAO nRF52840 Sense. More...

Detailed Description

Board specific configuration for the Seeed Studio XIAO nRF52840 and Seeed Studio XIAO nRF52840 Sense.

Author
Mikolai Gütschow mikol.nosp@m.ai.g.nosp@m.uetsc.nosp@m.how@.nosp@m.tu-dr.nosp@m.esde.nosp@m.n.de

Definition in file board.h.

#include "cpu.h"
#include "board_common.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.

Macros

#define MTD_0   mtd_dev_get(0)
 Default MTD device.
 

LED pin configuration

The Seeedstudio Xiao nRF52840 boards have an RGB LED next to the USB-C connector.

#define LED0_PIN   GPIO_PIN(0, 26)
 Pin Definition for the Red LED.
 
#define LED1_PIN   GPIO_PIN(0, 30)
 Pin Definition for the Green LED.
 
#define LED2_PIN   GPIO_PIN(0, 6)
 Pin Definition for the Blue LED.
 
#define LED_PORT   (NRF_P0)
 GPIO Port of the LED GPIOs.
 
#define LED0_MASK   (1 << 26)
 Bit position of the Red LED GPIO Output Bit.
 
#define LED1_MASK   (1 << 30)
 Bit position of the Green LED GPIO Output Bit.
 
#define LED2_MASK   (1 << 6)
 Bit position of the Blue LED GPIO Output Bit.
 
#define LED_MASK   (LED0_MASK | LED1_MASK | LED2_MASK)
 Bit position of all LED GPIO Output Bits

 
#define LED0_ON   (LED_PORT->OUTCLR = LED0_MASK)
 Turn the Red LED on.
 
#define LED0_OFF   (LED_PORT->OUTSET = LED0_MASK)
 Turn the Red LED off.
 
#define LED0_TOGGLE   (LED_PORT->OUT ^= LED0_MASK)
 Toggle the Red LED.
 
#define LED1_ON   (LED_PORT->OUTCLR = LED1_MASK)
 Turn the Green LED on.
 
#define LED1_OFF   (LED_PORT->OUTSET = LED1_MASK)
 Turn the Green LED off.
 
#define LED1_TOGGLE   (LED_PORT->OUT ^= LED1_MASK)
 Toggle the Green LED.
 
#define LED2_ON   (LED_PORT->OUTCLR = LED2_MASK)
 Turn the Blue LED on.
 
#define LED2_OFF   (LED_PORT->OUTSET = LED2_MASK)
 Turn the Blue LED off.
 
#define LED2_TOGGLE   (LED_PORT->OUT ^= LED2_MASK)
 Toggle the Blue LED.
 

SPI NOR flash hardware configuration

A 2MB P25Q16H flash is present on the board.

See also
https://files.seeedstudio.com/wiki/github_weiruanexample/Flash_P25Q16H-UXH-IR_Datasheet.pdf
#define XIAO_NRF52840_NOR_PAGE_SIZE   (256)
 Page Size of the P25Q16H flash.
 
#define XIAO_NRF52840_NOR_PAGES_PER_SECTOR   (16)
 Page Count per Sector of the P25Q16H flash.
 
#define XIAO_NRF52840_NOR_SECTOR_COUNT   (512)
 Sector Count of the P25Q16H flash.
 
#define XIAO_NRF52840_NOR_FLAGS
 Supported Modes of the P25Q16H flash.
 
#define XIAO_NRF52840_NOR_SPI_DEV   SPI_DEV(1)
 SPI Bus of the P25Q16H flash.
 
#define XIAO_NRF52840_NOR_SPI_CLK   SPI_CLK_10MHZ
 SPI Clock Frequency.
 
#define XIAO_NRF52840_NOR_SPI_CS   GPIO_PIN(0, 25)
 Chip Select Pin of the P25Q16H flash.
 
#define XIAO_NRF52840_NOR_SPI_WP   GPIO_PIN(0, 22)
 Write Protect Pin of the P25Q16H flash.
 
#define XIAO_NRF52840_NOR_SPI_HOLD   GPIO_PIN(0, 23)
 Hold Pin of the P25Q16H flash.
 
#define XIAO_NRF52840_NOR_SPI_MODE   SPI_MODE_0
 SPI Clock Mode of the P25Q16H flash.
 

ztimer configuration values

#define CONFIG_ZTIMER_USEC_ADJUST_SET   7
 overhead for the ztimer_set function in us
 
#define CONFIG_ZTIMER_USEC_ADJUST_SLEEP   22
 overhead for the ztimer_sleep function in us
 

Macro Definition Documentation

◆ CONFIG_ZTIMER_USEC_ADJUST_SET

#define CONFIG_ZTIMER_USEC_ADJUST_SET   7

overhead for the ztimer_set function in us

Definition at line 106 of file board.h.

◆ CONFIG_ZTIMER_USEC_ADJUST_SLEEP

#define CONFIG_ZTIMER_USEC_ADJUST_SLEEP   22

overhead for the ztimer_sleep function in us

Definition at line 107 of file board.h.

◆ LED0_MASK

#define LED0_MASK   (1 << 26)

Bit position of the Red LED GPIO Output Bit.

Definition at line 42 of file board.h.

◆ LED0_OFF

#define LED0_OFF   (LED_PORT->OUTSET = LED0_MASK)

Turn the Red LED off.

Definition at line 49 of file board.h.

◆ LED0_ON

#define LED0_ON   (LED_PORT->OUTCLR = LED0_MASK)

Turn the Red LED on.

Definition at line 48 of file board.h.

◆ LED0_PIN

#define LED0_PIN   GPIO_PIN(0, 26)

Pin Definition for the Red LED.

Definition at line 37 of file board.h.

◆ LED0_TOGGLE

#define LED0_TOGGLE   (LED_PORT->OUT ^= LED0_MASK)

Toggle the Red LED.

Definition at line 50 of file board.h.

◆ LED1_MASK

#define LED1_MASK   (1 << 30)

Bit position of the Green LED GPIO Output Bit.

Definition at line 43 of file board.h.

◆ LED1_OFF

#define LED1_OFF   (LED_PORT->OUTSET = LED1_MASK)

Turn the Green LED off.

Definition at line 53 of file board.h.

◆ LED1_ON

#define LED1_ON   (LED_PORT->OUTCLR = LED1_MASK)

Turn the Green LED on.

Definition at line 52 of file board.h.

◆ LED1_PIN

#define LED1_PIN   GPIO_PIN(0, 30)

Pin Definition for the Green LED.

Definition at line 38 of file board.h.

◆ LED1_TOGGLE

#define LED1_TOGGLE   (LED_PORT->OUT ^= LED1_MASK)

Toggle the Green LED.

Definition at line 54 of file board.h.

◆ LED2_MASK

#define LED2_MASK   (1 << 6)

Bit position of the Blue LED GPIO Output Bit.

Definition at line 44 of file board.h.

◆ LED2_OFF

#define LED2_OFF   (LED_PORT->OUTSET = LED2_MASK)

Turn the Blue LED off.

Definition at line 57 of file board.h.

◆ LED2_ON

#define LED2_ON   (LED_PORT->OUTCLR = LED2_MASK)

Turn the Blue LED on.

Definition at line 56 of file board.h.

◆ LED2_PIN

#define LED2_PIN   GPIO_PIN(0, 6)

Pin Definition for the Blue LED.

Definition at line 39 of file board.h.

◆ LED2_TOGGLE

#define LED2_TOGGLE   (LED_PORT->OUT ^= LED2_MASK)

Toggle the Blue LED.

Definition at line 58 of file board.h.

◆ LED_MASK

#define LED_MASK   (LED0_MASK | LED1_MASK | LED2_MASK)

Bit position of all LED GPIO Output Bits

Definition at line 45 of file board.h.

◆ LED_PORT

#define LED_PORT   (NRF_P0)

GPIO Port of the LED GPIOs.

Definition at line 41 of file board.h.

◆ MTD_0

#define MTD_0   mtd_dev_get(0)

Default MTD device.

Definition at line 86 of file board.h.

◆ XIAO_NRF52840_NOR_FLAGS

#define XIAO_NRF52840_NOR_FLAGS
Value:
#define SPI_NOR_F_SECT_4K
Flag to set when the device support 4KiB sector erase (sector_erase opcode)
Definition mtd_spi_nor.h:87
#define SPI_NOR_F_SECT_64K
Flag to set when the device support 64KiB block erase (block_erase_32k opcode)
Definition mtd_spi_nor.h:97
#define SPI_NOR_F_SECT_32K
Flag to set when the device support 32KiB block erase (block_erase_32k opcode)
Definition mtd_spi_nor.h:92

Supported Modes of the P25Q16H flash.

Definition at line 73 of file board.h.

◆ XIAO_NRF52840_NOR_PAGE_SIZE

#define XIAO_NRF52840_NOR_PAGE_SIZE   (256)

Page Size of the P25Q16H flash.

Definition at line 70 of file board.h.

◆ XIAO_NRF52840_NOR_PAGES_PER_SECTOR

#define XIAO_NRF52840_NOR_PAGES_PER_SECTOR   (16)

Page Count per Sector of the P25Q16H flash.

Definition at line 71 of file board.h.

◆ XIAO_NRF52840_NOR_SECTOR_COUNT

#define XIAO_NRF52840_NOR_SECTOR_COUNT   (512)

Sector Count of the P25Q16H flash.

Definition at line 72 of file board.h.

◆ XIAO_NRF52840_NOR_SPI_CLK

#define XIAO_NRF52840_NOR_SPI_CLK   SPI_CLK_10MHZ

SPI Clock Frequency.

Definition at line 78 of file board.h.

◆ XIAO_NRF52840_NOR_SPI_CS

#define XIAO_NRF52840_NOR_SPI_CS   GPIO_PIN(0, 25)

Chip Select Pin of the P25Q16H flash.

Definition at line 79 of file board.h.

◆ XIAO_NRF52840_NOR_SPI_DEV

#define XIAO_NRF52840_NOR_SPI_DEV   SPI_DEV(1)

SPI Bus of the P25Q16H flash.

Definition at line 77 of file board.h.

◆ XIAO_NRF52840_NOR_SPI_HOLD

#define XIAO_NRF52840_NOR_SPI_HOLD   GPIO_PIN(0, 23)

Hold Pin of the P25Q16H flash.

Definition at line 81 of file board.h.

◆ XIAO_NRF52840_NOR_SPI_MODE

#define XIAO_NRF52840_NOR_SPI_MODE   SPI_MODE_0

SPI Clock Mode of the P25Q16H flash.

Definition at line 82 of file board.h.

◆ XIAO_NRF52840_NOR_SPI_WP

#define XIAO_NRF52840_NOR_SPI_WP   GPIO_PIN(0, 22)

Write Protect Pin of the P25Q16H flash.

Definition at line 80 of file board.h.