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

Board definitions that are common for all ESP32x boards. More...

Detailed Description

Board definitions that are common for all ESP32x boards.

This file contains board configurations that are valid for all ESP32.

For detailed information about the configuration of ESP32 boards, see section Common Peripherals.

Author
Gunar Schorcht gunar.nosp@m.@sch.nosp@m.orcht.nosp@m..net

Definition in file board_common.h.

#include <stdint.h>
#include "cpu.h"
#include "periph_conf.h"
#include "periph/gpio.h"
#include "sdkconfig.h"
+ Include dependency graph for board_common.h:

Go to the source code of this file.

Functions

void print_board_config (void)
 Print the board configuration in a human readable format.
 

LED configuration (three predefined LEDs at maximum)

Note
LEDx_ACTIVE value must be declared in board configuration.
#define LED0_MASK   (BIT(LED0_PIN))
 
#define LED0_ON   (gpio_write(LED0_PIN, LED0_ACTIVE))
 
#define LED0_OFF   (gpio_write(LED0_PIN, !LED0_ACTIVE))
 
#define LED0_TOGGLE   (gpio_toggle(LED0_PIN))
 
#define LED1_MASK   (BIT(LED1_PIN))
 
#define LED1_ON   (gpio_write(LED1_PIN, LED1_ACTIVE))
 
#define LED1_OFF   (gpio_write(LED1_PIN, !LED1_ACTIVE))
 
#define LED1_TOGGLE   (gpio_toggle(LED1_PIN))
 
#define LED2_MASK   (BIT(LED2_PIN))
 
#define LED2_ON   (gpio_write(LED2_PIN, LED2_ACTIVE))
 
#define LED2_OFF   (gpio_write(LED2_PIN, !LED2_ACTIVE))
 
#define LED2_TOGGLE   (gpio_toggle(LED2_PIN))
 

STDIO configuration

#define STDIO_UART_BAUDRATE   (115200)
 < Default baudrate of UART for stdio
 

MTD system drive configuration

Built-in SPI flash memory is used as MTD system drive.

#define SPI_FLASH_DRIVE_START   0
 MTD drive start address in SPI flash memory.
 
#define MTD_0   mtd_dev_get(0)
 MTD device for the internal Flash.
 
#define MTD_1   mtd_dev_get(1)
 MTD device for the SD Card.
 
#define CONFIG_SDCARD_GENERIC_MTD_OFFSET   1
 Default MTD offset for SPI SD Card interfaces.
 
#define CONFIG_SDMMC_GENERIC_MTD_OFFSET   1
 Default MTD offset for SD/MMC interfaces.
 

Macro Definition Documentation

◆ CONFIG_SDCARD_GENERIC_MTD_OFFSET

#define CONFIG_SDCARD_GENERIC_MTD_OFFSET   1

Default MTD offset for SPI SD Card interfaces.

mtd1 is used for SPI SD Cards by default if module mtd_sdcard_default is used.

Definition at line 117 of file board_common.h.

◆ CONFIG_SDMMC_GENERIC_MTD_OFFSET

#define CONFIG_SDMMC_GENERIC_MTD_OFFSET   1

Default MTD offset for SD/MMC interfaces.

mtd1 is used for SD/MMCs by default if module mtd_sdmmc_default is used.

Definition at line 127 of file board_common.h.

◆ LED0_MASK

#define LED0_MASK   (BIT(LED0_PIN))

Definition at line 48 of file board_common.h.

◆ LED0_OFF

#define LED0_OFF   (gpio_write(LED0_PIN, !LED0_ACTIVE))

Definition at line 50 of file board_common.h.

◆ LED0_ON

#define LED0_ON   (gpio_write(LED0_PIN, LED0_ACTIVE))

Definition at line 49 of file board_common.h.

◆ LED0_TOGGLE

#define LED0_TOGGLE   (gpio_toggle(LED0_PIN))

Definition at line 51 of file board_common.h.

◆ LED1_MASK

#define LED1_MASK   (BIT(LED1_PIN))

Definition at line 55 of file board_common.h.

◆ LED1_OFF

#define LED1_OFF   (gpio_write(LED1_PIN, !LED1_ACTIVE))

Definition at line 57 of file board_common.h.

◆ LED1_ON

#define LED1_ON   (gpio_write(LED1_PIN, LED1_ACTIVE))

Definition at line 56 of file board_common.h.

◆ LED1_TOGGLE

#define LED1_TOGGLE   (gpio_toggle(LED1_PIN))

Definition at line 58 of file board_common.h.

◆ LED2_MASK

#define LED2_MASK   (BIT(LED2_PIN))

Definition at line 62 of file board_common.h.

◆ LED2_OFF

#define LED2_OFF   (gpio_write(LED2_PIN, !LED2_ACTIVE))

Definition at line 64 of file board_common.h.

◆ LED2_ON

#define LED2_ON   (gpio_write(LED2_PIN, LED2_ACTIVE))

Definition at line 63 of file board_common.h.

◆ LED2_TOGGLE

#define LED2_TOGGLE   (gpio_toggle(LED2_PIN))

Definition at line 65 of file board_common.h.

◆ MTD_0

#define MTD_0   mtd_dev_get(0)

MTD device for the internal Flash.

Definition at line 102 of file board_common.h.

◆ MTD_1

#define MTD_1   mtd_dev_get(1)

MTD device for the SD Card.

Definition at line 105 of file board_common.h.

◆ SPI_FLASH_DRIVE_START

#define SPI_FLASH_DRIVE_START   0

MTD drive start address in SPI flash memory.

Defines the start address of the MTD system device in the SPI flash memory. It can be overridden by application-specific board configuration

If the MTD start address is not defined or is 0, the first possible multiple of 0x100000 (1 MByte) is used in free SPI flash memory, which was determined from the partition table.

Definition at line 99 of file board_common.h.

◆ STDIO_UART_BAUDRATE

#define STDIO_UART_BAUDRATE   (115200)

< Default baudrate of UART for stdio

Definition at line 75 of file board_common.h.