boards: add esp32-wrover-kit
This commit is contained in:
parent
6226b5dddd
commit
be78bb3a4d
5
boards/esp32-wrover-kit/Makefile
Normal file
5
boards/esp32-wrover-kit/Makefile
Normal file
@ -0,0 +1,5 @@
|
||||
MODULE = board
|
||||
|
||||
DIRS = $(RIOTBOARD)/common/esp32
|
||||
|
||||
include $(RIOTBASE)/Makefile.base
|
||||
1
boards/esp32-wrover-kit/Makefile.dep
Normal file
1
boards/esp32-wrover-kit/Makefile.dep
Normal file
@ -0,0 +1 @@
|
||||
include $(RIOTBOARD)/common/esp32/Makefile.dep
|
||||
15
boards/esp32-wrover-kit/Makefile.features
Normal file
15
boards/esp32-wrover-kit/Makefile.features
Normal file
@ -0,0 +1,15 @@
|
||||
# common board and CPU features
|
||||
include $(RIOTBOARD)/common/esp32/Makefile.features
|
||||
|
||||
# additional features provided by the board
|
||||
FEATURES_PROVIDED += periph_adc
|
||||
FEATURES_PROVIDED += periph_dac
|
||||
FEATURES_PROVIDED += periph_i2c
|
||||
FEATURES_PROVIDED += periph_pwm
|
||||
FEATURES_PROVIDED += periph_spi
|
||||
|
||||
# unique features provided by the board
|
||||
FEATURES_PROVIDED += sdcard_spi
|
||||
FEATURES_PROVIDED += esp_spi_ram
|
||||
|
||||
FEATURES_PROVIDED += arduino
|
||||
5
boards/esp32-wrover-kit/Makefile.include
Normal file
5
boards/esp32-wrover-kit/Makefile.include
Normal file
@ -0,0 +1,5 @@
|
||||
PSEUDOMODULES += esp32_wrover_kit_camera
|
||||
|
||||
USEMODULE += boards_common_esp32
|
||||
|
||||
include $(RIOTBOARD)/common/esp32/Makefile.include
|
||||
260
boards/esp32-wrover-kit/doc.txt
Normal file
260
boards/esp32-wrover-kit/doc.txt
Normal file
@ -0,0 +1,260 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Gunar Schorcht
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU Lesser
|
||||
* General Public License v2.1. See the file LICENSE in the top level
|
||||
* directory for more details.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup boards_esp32_esp-wrover-kit ESP-WROVER-KIT V3
|
||||
* @ingroup boards_esp32
|
||||
* @brief Support for for Espressif ESP-WROVER-KIT V3
|
||||
* @author Gunar Schorcht <gunar@schorcht.net>
|
||||
|
||||
## <a name="toc"> Table of Contents </a>
|
||||
|
||||
1. [Overview](#overview)
|
||||
2. [Hardware](#hardware)
|
||||
1. [MCU](#mcu)
|
||||
2. [Board Configuration](#board_configuration)
|
||||
3. [Board Pinout](#pinout)
|
||||
4. [Optional Hardware Configurations](#optional_hardware)
|
||||
3. [Flashing the Device](#flashing)
|
||||
4. [On-Chip Debugging with the device](#debugging)
|
||||
|
||||
## <a name="overview"> Overview </a> [[TOC](#toc)]
|
||||
|
||||
The Espressif ESP-WROVER-KIT is a development board that uses the ESP32-WROVER module which includes a built-in 4 MByte SPI RAM. Most important features of the board are
|
||||
|
||||
- Micro-SD card interface
|
||||
- OV7670 camera interface
|
||||
- 3.2" SPI LCD panel
|
||||
- RGB LED
|
||||
- USB bridge with JTAG interface
|
||||
|
||||
Furthermore, many GPIOs are broken out for extension. The USB bridge based on FDI FT2232HL provides a JTAG interface for OCD debugging through the USB interface.
|
||||
|
||||
\htmlonly<style>div.image img[src="https://docs.espressif.com/projects/esp-idf/en/latest/_images/esp32-wrover-kit-layout-front.jpg"]{width:600px;}</style>\endhtmlonly@image html "https://docs.espressif.com/projects/esp-idf/en/latest/_images/esp32-wrover-kit-layout-front.jpg" "ESP-WROVER-KIT V3"
|
||||
|
||||
## <a name="hardware"> Hardware </a> [[TOC](#toc)]
|
||||
|
||||
This section describes
|
||||
|
||||
- the [MCU](#mcu),
|
||||
- the default [board configuration](#board_configuration),
|
||||
- [optional hardware configurations](#optional_hardware),
|
||||
- the [board pinout](#pinout).
|
||||
|
||||
### <a name="mcu"> MCU </a> [[TOC](#toc)]
|
||||
|
||||
Most features of the board are provided by the ESP32 SoC. The following table summarizes these features and gives an overview of which of these features are supported by RIOT. For detailed information about the ESP32, see section \ref esp32_mcu "MCU ESP32".
|
||||
|
||||
<center>
|
||||
MCU | ESP32 | Supported by RIOT
|
||||
------------|-----------|------------------
|
||||
Vendor | Espressif | |
|
||||
Cores | 1 or 2 x Tensilica Xtensa LX6 | 1 core
|
||||
FPU | yes (ULP - Ultra low power co-processor) | no
|
||||
RAM | 520 kByte SRAM <br> 16 kByte RTC SRAM | yes
|
||||
ROM | 520 kByte | yes
|
||||
Flash | 512 kByte ... 16 MByte | yes
|
||||
Frequency | 240 MHz, 160 MHz, 80 MHz | yes
|
||||
Power Consumption | 68 mA @ 240 MHz <br> 44 mA @ 160 MHz <br> 31 mA @ 80 MHz <br> 5 uA in deep sleep mode | yes <br> yes <br> yes <br> no
|
||||
Timers | 4 x 64 bit | yes
|
||||
ADCs | 2 x SAR-ADC with up to 18 x 12 bit channels total | yes
|
||||
DACs | 2 x DAC with 8 bit | yes
|
||||
GPIOs | 34 (6 of them are only inputs) | yes
|
||||
I2Cs | 2 | yes
|
||||
SPIs | 4 | yes
|
||||
UARTs | 3 | yes
|
||||
WiFi | IEEE 802.11 b/g/n built in | yes
|
||||
Bluetooth | v4.2 BR/EDR and BLE | no
|
||||
Ethernet | MAC interface with dedicated DMA and IEEE 1588 support | yes
|
||||
CAN | version 2.0 | no
|
||||
IR | up to 8 channels TX/RX | no
|
||||
Motor PWM | 2 devices x 6 channels | yes
|
||||
LED PWM | 16 channels | no
|
||||
Crypto | Hardware acceleration of AES, SHA-2, RSA, ECC, RNG | no
|
||||
Vcc | 2.5 - 3.6 V | |
|
||||
Documents | [Datasheet](https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_en.pdf) <br> [Technical Reference](https://www.espressif.com/sites/default/files/documentation/esp32_technical_reference_manual_en.pdf) | |
|
||||
</center>
|
||||
|
||||
### <a name="board_configuration"> Board Configuration </a> [[TOC](#toc)]
|
||||
|
||||
ESP-WROVER-KIT has the following on-board components
|
||||
|
||||
- Micro-SD card interface
|
||||
- OV7670 camera interface
|
||||
- 3.2" SPI LCD panel
|
||||
- RGB LED
|
||||
- USB bridge with JTAG interface
|
||||
|
||||
The following table shows the default board configuration sorted according to the defined functionality of GPIOs for different hardware options. This configuration can be overridden by \ref esp32_app_spec_conf "application-specific configurations".
|
||||
|
||||
In the following table following abbreviations are used:
|
||||
|
||||
<b>SDC</b> = SD-Card interface is used (module **sdcard_spi** is enabled)<br>
|
||||
<b>CAM</b> = Camera is plugged in/used
|
||||
|
||||
<center>
|
||||
\anchor esp32_wrover_kit_table_board_configuration
|
||||
|
||||
Function | None | SDC | CAM | SDC+CAM | Remarks | Configuration
|
||||
:-------------------|--------|--------|--------|---------|:---------|----------
|
||||
ADC_LINE(0) | GPIO34 | GPIO34 | - | - | CAMERA_D6 | \ref esp32_adc_channels "ADC Channels"
|
||||
ADC_LINE(1) | GPIO35 | GPIO35 | - | - | CAMERA_D7 | \ref esp32_adc_channels "ADC Channels"
|
||||
ADC_LINE(2) | GPIO36 | GPIO36 | - | - | CAMERA_D4 | \ref esp32_adc_channels "ADC Channels"
|
||||
ADC_LINE(3) | GPIO39 | GPIO39 | - | - | CAMERA_D5 | \ref esp32_adc_channels "ADC Channels"
|
||||
PWM_DEV(0):0 / LED0 | GPIO0 | GPIO0 | - | - | LED_RED / CAMERA_RESET | \ref esp32_pwm_channels "PWM Channels"
|
||||
PWM_DEV(0):2 / LED2 | GPIO4 | GPIO4 | - | - | LED_BLUE / CAMERA_D0 | \ref esp32_pwm_channels "PWM Channels"
|
||||
LED1 | GPIO2 | GPIO2 | GPIO2 | GPIO2 | LED_GREEN | |
|
||||
I2C_DEV(0):SCL | GPIO27 | GPIO27 | GPIO27 | GPIO27 | CAMERA_SIO_C | \ref esp32_i2c_interfaces "I2C Interfaces"
|
||||
I2C_DEV(0):SDA | GPIO26 | GPIO26 | GPIO26 | GPIO27 | CAMERA_SIO_D | \ref esp32_i2c_interfaces "I2C Interfaces"
|
||||
UART_DEV(0):TX | GPIO1 | GPIO1 | GPIO1 | GPIO1 | | \ref esp32_uart_interfaces "UART interfaces"
|
||||
UART_DEV(0):RX | GPIO3 | GPIO3 | GPIO3 | GPIO3 | | \ref esp32_uart_interfaces "UART interfaces"
|
||||
SPI_DEV(0):SCK | GPIO14 | GPIO14 | GPIO14 | GPIO14 | HSPI: SD-Card / Peripherals | \ref esp32_spi_interfaces "SPI Interfaces"
|
||||
SPI_DEV(0):MOSI | GPIO15 | GPIO15 | GPIO15 | GPIO15 | HSPI: SD-Card / Peripherals | \ref esp32_spi_interfaces "SPI Interfaces"
|
||||
SPI_DEV(0):MISO | GPIO2 | GPIO2 | GPIO2 | GPIO2 | HSPI: SD-Card / Peripherals | \ref esp32_spi_interfaces "SPI Interfaces"
|
||||
SPI_DEV(0):CS0 | GPIO13 | GPIO13 | GPIO13 | GPIO13 | HSPI: SD-Card CS | \ref esp32_spi_interfaces "SPI Interfaces"
|
||||
SPI_DEV(1)/LCD:SCK | GPIO19 | GPIO19 | - | - | VSPI: LCD / CAMERA_D3 | \ref esp32_spi_interfaces "SPI Interfaces"
|
||||
SPI_DEV(1)/LCD:MOSI | GPIO23 | GPIO23 | - | - | VSPI: LCD / CAMERA_HREF | \ref esp32_spi_interfaces "SPI Interfaces"
|
||||
SPI_DEV(1)/LCD:MISO | GPIO25 | GPIO25 | - | - | VSPI: LCD / CAMERA_VSYNC | \ref esp32_spi_interfaces "SPI Interfaces"
|
||||
SPI_DEV(1)/LCD:CS0 | GPIO22 | GPIO22 | - | - | VSPI: LCD / CAMERA_PCLK | \ref esp32_spi_interfaces "SPI Interfaces"
|
||||
LCD_LED | GPIO5 | GPIO5 | - | - | CAMERA_D1 | |
|
||||
LCD_SCL | GPIO19 | GPIO19 | - | - | CAMERA_D3 | |
|
||||
LCD_MOSI | GPIO23 | GPIO23 | - | - | CAMERA_HREF | |
|
||||
LCD_MISO | GPIO25 | GPIO25 | - | - | CAMERA_VSYNC | |
|
||||
LCD_CS | GPIO22 | GPIO22 | - | - | CAMERA_PCLK | |
|
||||
LCD_D/C | GPIO21 | GPIO21 | - | - | CAMERA_XCLK | |
|
||||
LCD_RESET | GPIO18 | GPIO18 | - | - | CAMERA_D2 | |
|
||||
CAMERA_D0 | - | - | GPIO4 | GPIO4 | | |
|
||||
CAMERA_D1 | - | - | GPIO5 | GPIO5 | | |
|
||||
CAMERA_D2 | - | - | GPIO18 | GPIO18 | | |
|
||||
CAMERA_D3 | - | - | GPIO19 | GPIO19 | | |
|
||||
CAMERA_D4 | - | - | GPIO36 | GPIO36 | | |
|
||||
CAMERA_D5 | - | - | GPIO39 | GPIO39 | | |
|
||||
CAMERA_D6 | - | - | GPIO34 | GPIO34 | | |
|
||||
CAMERA_D7 | - | - | GPIO35 | GPIO35 | | |
|
||||
CAMERA_XCLK | - | - | GPIO21 | GPIO21 | | |
|
||||
CAMERA_PCLK | - | - | GPIO22 | GPIO22 | | |
|
||||
CAMERA_HREF | - | - | GPIO23 | GPIO23 | | |
|
||||
CAMERA_VSYNC | - | - | GPIO25 | GPIO25 | | |
|
||||
CAMERA_SIO_D | - | - | GPIO26 | GPIO26 | | |
|
||||
CAMERA_SIO_C | - | - | GPIO27 | GPIO27 | | |
|
||||
CAMERA_RESET | - | - | GPIO0 | GPIO0 | | |
|
||||
|
||||
</center>
|
||||
|
||||
Following table shows the default board configuration sorted by GPIOs.
|
||||
|
||||
<center>
|
||||
Pin | None | SDC | CAM | SDC+CAM | Remarks
|
||||
:------|:-----------------------|:--------------------|:--------------------|:---------------------------|:-----
|
||||
GPIO0 | PWM_DEV(0):0 / LED0 | PWM_DEV(0):0 / LED0 | CAMERA_RESET | CAMERA_RESET | |
|
||||
GPIO1 | UART_DEV(0):TX | UART_DEV(0):TX | UART_DEV(0):TX | UART_DEV(0):TX | |
|
||||
GPIO2 | SPI_DEV(0):MISO / LED1 | SPI_DEV(0):MISO | SPI_DEV(0):MISO | SPI_DEV(0):MISO | HSPI
|
||||
GPIO3 | UART_DEV(0):RX | UART_DEV(0):RX | UART_DEV(0):RX | UART_DEV(0):RX | |
|
||||
GPIO4 | PWM_DEV(0):1 / LED2 | PWM_DEV(0):1 / LED2 | CAMERA_D0 | CAMERA_D0 | |
|
||||
GPIO5 | LCD LED | LCD_LED | CAMERA_D1 | CAMERA_D1 | |
|
||||
GPIO6 | Flash CLK | Flash CLK | Flash CLK | Flash CLK | |
|
||||
GPIO7 | Flash SD0 | Flash SD0 | Flash SD0 | Flash SD0 | |
|
||||
GPIO8 | Flash SD1 | Flash SD1 | Flash SD1 | Flash SD1 | |
|
||||
GPIO9 | | | | | |
|
||||
GPIO10 | | | | | |
|
||||
GPIO11 | Flash CMD | Flash CMD | Flash CMD | Flash CMD | |
|
||||
GPIO12 | | | | | |
|
||||
GPIO13 | SPI_DEV(0):CS0 | SPI_DEV(0):CS0 | SPI_DEV(0):CS0 | SPI_DEV(0):CS0 | HSPI / SD-Card CS
|
||||
GPIO14 | SPI_DEV(0):SCK | SPI_DEV(0):SCK | SPI_DEV(0):SCK | SPI_DEV(0):SCK | HSPI
|
||||
GPIO15 | SPI_DEV(0):MOSI | SPI_DEV(0):MOSI | SPI_DEV(0):MOSI | SPI_DEV(0):MOSI | HSPI
|
||||
GPIO16 | N/A | N/A | N/A | N/A | see below
|
||||
GPIO17 | N/A | N/A | N/A | N/A | see below
|
||||
GPIO18 | LCD_RESET | LCD_RESET | LCD_RESET | CAMERA_D2 | |
|
||||
GPIO19 | SPI_DEV(1)/LCD:SCK | SPI_DEV(1)/LCD:SCK | SPI_DEV(1)/LCD:SCK | CAMERA_D3 | VSPI
|
||||
GPIO21 | LCD_D/C | LCD_D/C | LCD_D/C | CAMERA_XCLK | |
|
||||
GPIO22 | SPI_DEV(1)/LCD:CS | SPI_DEV(1)/LCD:CS0 | SPI_DEV(1)/LCD:CS0 | CAMERA_PCLK | VSPI
|
||||
GPIO23 | SPI_DEV(1)/LCD:MOSI | SPI_DEV(1)/LCD:MOSI | SPI_DEV(1)/LCD:MOSI | CAMERA_HREF | VSPI
|
||||
GPIO25 | SPI_DEV(1)/LCD:MISO | SPI_DEV(1)/LCD:MISO | SPI_DEV(1)/LCD:MISO | CAMERA_VSYNC | VSPI
|
||||
GPIO26 | I2C_DEV(0):SDA | I2C_DEV(0):SDA | I2C_DEV(0):SDA | I2C_DEV(0)/CAMERASIO_D:SDA | |
|
||||
GPIO27 | I2C_DEV(0):SCL | I2C_DEV(0):SCL | I2C_DEV(0):SCL | I2C_DEV(0)/CAMERASIO_C:SCL | |
|
||||
GPIO32 | N/A | N/A | N/A | N/A | see below
|
||||
GPIO33 | N/A | N/A | N/A | N/A | see below
|
||||
GPIO34 | ADC_LINE(0) | ADC_LINE(0) | ADC_LINE(0) | CAMERA_D6 | |
|
||||
GPIO35 | ADC_LINE(1) | ADC_LINE(1) | ADC_LINE(1) | CAMERA_D7 | |
|
||||
GPIO36 | ADC_LINE(2) | ADC_LINE(2) | ADC_LINE(2) | CAMERA_D4 | |
|
||||
GPIO39 | ADC_LINE(3) | ADC_LINE(3) | ADC_LINE(3) | CAMERA_D5 | |
|
||||
</center>
|
||||
|
||||
@note
|
||||
- SPI_DEV(0) uses the HSPI interface with the GPIO2 pin as the MISO signal. Since GPIO2 has bootstrapping functionality, it might be necessary to to press the **Boot** button for flashing RIOT when the SD card or the peripheral hardware is attached to this SPI interface.
|
||||
- GPIO0 cannot be used as SPI CS signal for external hardware connected to SPI_DEV(0). The reason for this is that the LEDs on this board are high-active and the default state of the LEDs after power-up causes a low level on the corresponding GPIO outputs.
|
||||
- GPIO2 cannot be used as PWM_DEV(0) channel 1 / LED0 when SPI_DEV(0) is used in any way. Reason is that GPIO2 is the MISO signal when SPI_DEV(0) is used and is therefore an input. PWM channels are outputs.
|
||||
- It might be necessary to remove the SD card or the peripheral hardware attached to the SPI_DEV(0) interface for flashing RIOT. Reason is that the **SPI_DEV(0)** interface uses the HSPI interface with the GPIO2 pin as the MISO signal, which has bootstrapping functionality.
|
||||
- GPIO16 and GPIO17 are used for the built-in SPI RAM and are not available on the I/O expansion connector, even though they are labeled there.
|
||||
- GPIO32 and GPIO33 are attached to a 32 kHz crystal by default. GPIO32 and GPIO33 are standard connected to a 32 kHz crystal. To make them available as a GPIO on the I/O expansion connector, SMD resistors would need to be removed and soldered.
|
||||
|
||||
For detailed information about the configuration of ESP32 boards, see
|
||||
section Peripherals in \ref esp32_riot.
|
||||
|
||||
https://docs.espressif.com/projects/esp-idf/en/latest/get-started/get-started-wrover-kit.html
|
||||
|
||||
### <a name="optional_hardware"> Optional Hardware Configurations </a> [[TOC](#toc)]
|
||||
|
||||
MRF24J40-based IEEE 802.15.4 radio modules and ENC28J60-based Ethernet network interface modules have been tested with the board. You could use the following code in your \ref esp32_app_spec_conf "application-specific configuration" to use such modules:
|
||||
|
||||
```
|
||||
#ifdef BOARD_ESP32_WROVER_KIT
|
||||
|
||||
#if MODULE_MRF24J40
|
||||
#define MRF24J40_PARAM_CS GPIO9 /* MRF24J40 CS signal */
|
||||
#define MRF24J40_PARAM_INT GPIO10 /* MRF24J40 INT signal */
|
||||
#define MRF24J40_PARAM_RESET GPIO12 /* MRF24J40 RESET signal */
|
||||
#endif
|
||||
|
||||
#if MODULE_ENC28J80
|
||||
#define ENC28J80_PARAM_CS GPIO9 /* ENC28J80 CS signal */
|
||||
#define ENC28J80_PARAM_INT GPIO10 /* ENC28J80 INT signal */
|
||||
#define ENC28J80_PARAM_RESET GPIO12 /* ENC28J80 RESET signal */
|
||||
endif
|
||||
|
||||
#endif
|
||||
```
|
||||
For other parameters, the default values defined by the drivers can be used.
|
||||
|
||||
@note
|
||||
- Only a few GPIOs are available for external hardware on ESP-WROVER-KIT boards. Therefore, MRF24J40 and ENC28J60 based modules use the same GPIOs and only one of these modules can be used simultaneously.
|
||||
- The **RESET** signal of MRF24J40 and ENC28J60 based modules can also be connected to the **RST** pin of the board (see \ref esp32_wrover_kit_pinout "pinout") to keep the configured GPIO free for other purposes.
|
||||
|
||||
### <a name="pinout"> Board Pinout </a> [[TOC](#toc)]
|
||||
|
||||
The following picture shows the pinout of the ESP-WROVER-KIT V3 boards as defined by the default board configuration. The light green GPIOs are not used by configured on-board hardware components and can be used for any purpose. However, if optional off-board hardware modules are used, these GPIOs may also be occupied, see \ref esp32_wrover_kit_table_board_configuration "optional functions" in table board configuration.
|
||||
|
||||
The corresponding board schematic can be found [here](https://dl.espressif.com/dl/schematics/ESP-WROVER-KIT_SCH-3.pdf).
|
||||
|
||||
\anchor esp32_wrover_kit_pinout
|
||||
|
||||
@image html "https://gitlab.com/gschorcht/RIOT.wiki-Images/raw/master/esp32/ESP-WROVER-KIT_V3_pinout.png?inline=false" "ESP32-WROVER-KIT V3 Pinout"
|
||||
|
||||
## <a name="flashing"> Flashing the Device </a> [[TOC](#toc)]
|
||||
|
||||
Flashing RIOT is quite straight forward. The board has a Micro-USB connector with reset/boot/flash logic. Just connect the board using the programming port to your host computer and type:
|
||||
```
|
||||
make flash BOARD=esp32-wrover-kit ...
|
||||
```
|
||||
|
||||
The USB bridge is based on FDI FT2232HL and offers two USB interfaces:
|
||||
|
||||
- the first interface is the JTAG interface for [On-Chip debugging](#debugging)
|
||||
- the second interface is the console interface, which is also used for flashing
|
||||
|
||||
Therefore, you have to declare the USB interface in the make command. For example, if the ESP32-WROVER-KIT is connected to the host computer through the USB interfaces **/dev/ttyUSB0** and **/dev/ttyUSB1**, the make command would be used as following:
|
||||
```
|
||||
make flash BOARD=esp32-wrover-kit PORT=/dev/ttyUSB1 ...
|
||||
```
|
||||
|
||||
For detailed information about ESP32 as well as configuring and compiling RIOT for ESP32 boards, see \ref esp32_riot.
|
||||
|
||||
## <a name="debugging"> On-Chip Debugging with the Device </a> [[TOC](#toc)]
|
||||
|
||||
Since the USB bridge based on FDI FT2232HL provides a JTAG interface for debugging through an USB interface, using ESP-ROVER-KIT is the easiest and most convinient way for On-Chip debugging. Please refer the [ESP-IDF Programming Guide](https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/jtag-debugging/index.html) for details on how to setup and how to use ESP-WROVER-KIT and OpenOCD.
|
||||
*/
|
||||
82
boards/esp32-wrover-kit/include/arduino_board.h
Normal file
82
boards/esp32-wrover-kit/include/arduino_board.h
Normal file
@ -0,0 +1,82 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Gunar Schorcht
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU Lesser
|
||||
* General Public License v2.1. See the file LICENSE in the top level
|
||||
* directory for more details.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ingroup boards_esp32_esp-wrover-kit
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief Board specific configuration for the Arduino API
|
||||
*
|
||||
* @author Gunar Schorcht <gunar@schorcht.net>
|
||||
*/
|
||||
|
||||
#ifndef ARDUINO_BOARD_H
|
||||
#define ARDUINO_BOARD_H
|
||||
|
||||
#include "periph/gpio.h"
|
||||
#include "periph/adc.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief The on-board LED is not available
|
||||
*/
|
||||
#define ARDUINO_LED (0)
|
||||
|
||||
/**
|
||||
* @brief Look-up table for the Arduino's digital pins
|
||||
*/
|
||||
static const gpio_t arduino_pinmap[] = {
|
||||
GPIO3, /* ARDUINO_PIN_0 (RxD) */
|
||||
GPIO1, /* ARDUINO_PIN_1 (TxD) */
|
||||
|
||||
GPIO19, /* ARDUINO_PIN_2 */
|
||||
GPIO0, /* ARDUINO_PIN_3 (PWM) */
|
||||
GPIO22, /* ARDUINO_PIN_4 */
|
||||
GPIO4, /* ARDUINO_PIN_5 (PWM) */
|
||||
GPIO23, /* ARDUINO_PIN_6 (PWM) */
|
||||
GPIO25, /* ARDUINO_PIN_7 */
|
||||
GPIO9, /* ARDUINO_PIN_8 */
|
||||
GPIO10, /* ARDUINO_PIN_9 (PWM) */
|
||||
|
||||
GPIO13, /* ARDUINO_PIN_10 (CS0 / PWM) */
|
||||
GPIO15, /* ARDUINO_PIN_11 (MOSI / PWM) */
|
||||
GPIO2, /* ARDUINO_PIN_12 (MISO) */
|
||||
GPIO14, /* ARDUINO_PIN_13 (SCK) */
|
||||
|
||||
GPIO34, /* ARDUINO_PIN_A0 */
|
||||
GPIO35, /* ARDUINO_PIN_A1 */
|
||||
GPIO36, /* ARDUINO_PIN_A2 */
|
||||
GPIO39, /* ARDUINO_PIN_A3 */
|
||||
|
||||
GPIO26, /* ARDUINO_PIN_A4 (SDA) */
|
||||
GPIO27, /* ARDUINO_PIN_A5 (SCL) */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Look-up table for the Arduino's analog pins
|
||||
*/
|
||||
static const adc_t arduino_analog_map[] = {
|
||||
GPIO34, /* ARDUINO_PIN_A0 */
|
||||
GPIO35, /* ARDUINO_PIN_A1 */
|
||||
GPIO36, /* ARDUINO_PIN_A2 */
|
||||
GPIO39, /* ARDUINO_PIN_A3 */
|
||||
|
||||
GPIO26, /* ARDUINO_PIN_A4 (SDA) */
|
||||
GPIO27, /* ARDUINO_PIN_A5 (SCL) */
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ARDUINO_BOARD_H */
|
||||
/** @} */
|
||||
112
boards/esp32-wrover-kit/include/board.h
Normal file
112
boards/esp32-wrover-kit/include/board.h
Normal file
@ -0,0 +1,112 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Gunar Schorcht
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU Lesser
|
||||
* General Public License v2.1. See the file LICENSE in the top level
|
||||
* directory for more details.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ingroup boards_esp32_esp-wrover-kit
|
||||
* @brief Board specific definitions for Espressif ESP-WROVER-KIT V3
|
||||
* @{
|
||||
*
|
||||
* The Espressif ESP-WROVER-KIT is a development board that uses the
|
||||
* ESP32-WROVER module which includes a built-in 4 MByte SPI RAM. Most
|
||||
* important features of the board are
|
||||
*
|
||||
* - Micro-SD card interface
|
||||
* - OV7670 camera interface
|
||||
* - 3.2" SPI LCD panel
|
||||
* - RGB LED
|
||||
*
|
||||
* Furthermore, many GPIOs are broken out for extension. The USB bridge
|
||||
* based on FDI FT2232HL provides a JTAG interface for debugging through
|
||||
* the USB interface.
|
||||
*
|
||||
* When the camera module is connected, add
|
||||
* ```
|
||||
* USEMODULE += esp32_wrover_kit_camera
|
||||
* ```
|
||||
* to the makefile of the application to use the according default board
|
||||
* configuration.
|
||||
*
|
||||
* For detailed information about the configuration of ESP32 boards, see
|
||||
* section \ref esp32_comm_periph "Common Peripherals".
|
||||
*
|
||||
* @note
|
||||
* Most definitions can be overridden by an \ref esp32_app_spec_conf
|
||||
* "application-specific board configuration".
|
||||
*
|
||||
* @file
|
||||
* @author Gunar Schorcht <gunar@schorcht.net>
|
||||
*/
|
||||
|
||||
#ifndef BOARD_H
|
||||
#define BOARD_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @name LED (on-board) configuration
|
||||
* @{
|
||||
*/
|
||||
|
||||
#if !MODULE_ESP32_WROVER_KIT_CAMERA || DOXYGEN
|
||||
#define LED0_PIN GPIO0 /**< LED0 is available when the camera is not plugged in */
|
||||
#define LED0_ACTIVE (1) /**< LED0 is high active */
|
||||
#endif
|
||||
|
||||
#if !MODULE_SDCARD_SPI || DOXYGEN
|
||||
#define LED1_PIN GPIO2 /**< LED1 is available when the SD-Card is not used */
|
||||
#define LED1_ACTIVE (1) /**< LED1 is high active */
|
||||
#endif
|
||||
|
||||
#if !MODULE_ESP32_WROVER_KIT_CAMERA || DOXYGEN
|
||||
#define LED2_PIN GPIO4 /**< LED2 is available when the camera is not plugged in */
|
||||
#define LED2_ACTIVE (1) /**< LED2 is high active */
|
||||
#endif
|
||||
|
||||
#ifdef LED0_PIN
|
||||
#define LED_RED_PIN LED0_PIN /**< LED0 is a red LED */
|
||||
#endif
|
||||
#ifdef LED1_PIN
|
||||
#define LED_GREEN_PIN LED1_PIN /**< LED1 is a green LED */
|
||||
#endif
|
||||
#ifdef LED2_PIN
|
||||
#define LED_BLUE_PIN LED2_PIN /**< LED2 is a blue LED */
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @name SD-Card interface configuration
|
||||
*
|
||||
* The SD-Card interface is connected to the HSPI interface. Since HSPI
|
||||
* becomes SPI_DEV(0) when the camera is connected, the SD card interface
|
||||
* uses SPI_DEV(0) in this case. Otherwise, SPI_DEV(1) is used.
|
||||
*
|
||||
* This configuration cannot be changed.
|
||||
* @{
|
||||
*/
|
||||
#if MODULE_SDCARD_SPI || DOXYGEN
|
||||
#define SDCARD_SPI_PARAM_SPI SPI_DEV(0) /**< SPI_DEV(0) is used when camera is connected */
|
||||
#define SDCARD_SPI_PARAM_CLK SPI0_SCK /**< HSPI SCK is used (fixed) */
|
||||
#define SDCARD_SPI_PARAM_MOSI SPI0_MOSI /**< HSPI MOSI is used (fixed) */
|
||||
#define SDCARD_SPI_PARAM_MISO SPI0_MISO /**< HSPI MISO is used (fixed) */
|
||||
#define SDCARD_SPI_PARAM_CS SPI0_CS0 /**< HSPI CS1 is used (fixed) */
|
||||
#define SDCARD_SPI_PARAM_POWER GPIO_UNDEF /**< power control is not used (fixed) */
|
||||
#endif
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* end extern "C" */
|
||||
#endif
|
||||
|
||||
/* include common board definitions as last step */
|
||||
#include "board_common.h"
|
||||
|
||||
#endif /* BOARD_H */
|
||||
/** @} */
|
||||
63
boards/esp32-wrover-kit/include/gpio_params.h
Normal file
63
boards/esp32-wrover-kit/include/gpio_params.h
Normal file
@ -0,0 +1,63 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Gunar Schorcht
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU Lesser
|
||||
* General Public License v2.1. See the file LICENSE in the top level
|
||||
* directory for more details.
|
||||
*/
|
||||
|
||||
#ifndef GPIO_PARAMS_H
|
||||
#define GPIO_PARAMS_H
|
||||
|
||||
/**
|
||||
* @ingroup boards_esp32_esp-wrover-kit
|
||||
* @brief Board specific configuration of direct mapped GPIOs
|
||||
* @file
|
||||
* @author Gunar Schorcht <gunar@schorcht.net>
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include "board.h"
|
||||
#include "saul/periph.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief LED and button configuration
|
||||
*/
|
||||
static const saul_gpio_params_t saul_gpio_params[] =
|
||||
{
|
||||
#ifdef LED0_PIN
|
||||
{
|
||||
.name = "LED red",
|
||||
.pin = LED0_PIN,
|
||||
.mode = GPIO_OUT,
|
||||
.flags = SAUL_GPIO_INIT_CLEAR
|
||||
},
|
||||
#endif
|
||||
#ifdef LED1_PIN
|
||||
{
|
||||
.name = "LED blue",
|
||||
.pin = LED1_PIN,
|
||||
.mode = GPIO_OUT,
|
||||
.flags = SAUL_GPIO_INIT_CLEAR
|
||||
},
|
||||
#endif
|
||||
#ifdef LED2_PIN
|
||||
{
|
||||
.name = "LED green",
|
||||
.pin = LED2_PIN,
|
||||
.mode = GPIO_OUT,
|
||||
.flags = SAUL_GPIO_INIT_CLEAR
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* GPIO_PARAMS_H */
|
||||
/** @} */
|
||||
219
boards/esp32-wrover-kit/include/periph_conf.h
Normal file
219
boards/esp32-wrover-kit/include/periph_conf.h
Normal file
@ -0,0 +1,219 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Gunar Schorcht
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU Lesser
|
||||
* General Public License v2.1. See the file LICENSE in the top level
|
||||
* directory for more details.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ingroup boards_esp32_esp-wrover-kit
|
||||
* @brief Peripheral MCU configuration for Espressif ESP-WROVER-KIT V3
|
||||
* @{
|
||||
*
|
||||
* The Espressif ESP-WROVER-KIT is a development board that uses the
|
||||
* ESP32-WROVER module which includes a built-in 4 MByte SPI RAM. Most
|
||||
* important features of the board are
|
||||
*
|
||||
* - Micro-SD card interface
|
||||
* - OV7670 camera interface
|
||||
* - 3.2" SPI LCD panel
|
||||
* - RGB LED
|
||||
*
|
||||
* Furthermore, many GPIOs are broken out for extension. The USB bridge
|
||||
* based on FDI FT2232HL provides a JTAG interface for debugging through
|
||||
* the USB interface.
|
||||
*
|
||||
* When the camera module is connected, add
|
||||
* ```
|
||||
* USEMODULE += esp32_wrover_kit_camera
|
||||
* ```
|
||||
* to the makefile of the application to use the according default board
|
||||
* configuration.
|
||||
*
|
||||
* For detailed information about the configuration of ESP32 boards, see
|
||||
* section \ref esp32_comm_periph "Common Peripherals".
|
||||
*
|
||||
* @note
|
||||
* Most definitions can be overridden by an \ref esp32_app_spec_conf
|
||||
* "application-specific board configuration".
|
||||
*
|
||||
* @file
|
||||
* @author Gunar Schorcht <gunar@schorcht.net>
|
||||
*/
|
||||
|
||||
#ifndef PERIPH_CONF_H
|
||||
#define PERIPH_CONF_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @name ADC and DAC channel configuration
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Declaration of GPIOs that can be used as ADC channels
|
||||
*
|
||||
* When the camera is connected there are no GPIOs left that could be used
|
||||
* as ADC channels.
|
||||
*
|
||||
* @note As long as the GPIOs listed in ADC_GPIOS are not initialized as ADC
|
||||
* channels with the ```adc_init``` function, they can be used for other
|
||||
* purposes.
|
||||
*/
|
||||
#ifndef ADC_GPIOS
|
||||
#ifndef MODULE_ESP32_WROVER_KIT_CAMERA
|
||||
#define ADC_GPIOS { GPIO34, GPIO35, GPIO36, GPIO39 }
|
||||
#else
|
||||
#define ADC_GPIOS { }
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Declaration of GPIOs that can be used as DAC channels
|
||||
*
|
||||
* ESP-WROVER-KIT has no GPIOs left that might be used as DAC channels.
|
||||
*/
|
||||
#ifndef DAC_GPIOS
|
||||
#define DAC_GPIOS { }
|
||||
#endif
|
||||
/** @} */
|
||||
|
||||
|
||||
/**
|
||||
* @name I2C configuration
|
||||
*
|
||||
* @note The GPIOs listed in the configuration are only initialized as I2C
|
||||
* signals when module ```perpih_i2c``` is used. Otherwise they are not
|
||||
* allocated and can be used for other purposes.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
#ifndef I2C0_SPEED
|
||||
#define I2C0_SPEED I2C_SPEED_FAST /**< I2C bus speed of I2C_DEV(0) */
|
||||
#endif
|
||||
#ifndef I2C0_SCL
|
||||
#define I2C0_SCL GPIO27 /**< SCL signal of I2C_DEV(0) [UEXT1] */
|
||||
#endif
|
||||
#ifndef I2C0_SDA
|
||||
#define I2C0_SDA GPIO26 /**< SDA signal of I2C_DEV(0) [UEXT1] */
|
||||
#endif
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @name PWM channel configuration
|
||||
*
|
||||
* LEDs are used as PWM channels for device PWM_DEV(0).
|
||||
*
|
||||
* @note As long as the according PWM device is not initialized with function
|
||||
* pwm_init, the GPIOs declared for this device can be used for other
|
||||
* purposes.
|
||||
*
|
||||
* @note As long as the according PWM device is not initialized with
|
||||
* the ```pwm_init```, the GPIOs declared for this device can be used
|
||||
* for other purposes.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
#ifndef PWM0_GPIOS
|
||||
#if !MODULE_ESP32_WROVER_KIT_CAMERA || DOXYGEN
|
||||
#define PWM0_GPIOS { LED0_PIN, LED2_PIN } /**< only available when camera is not connected */
|
||||
#else
|
||||
#define PWM0_GPIOS { }
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/** PWM_DEV(1) is not used */
|
||||
#ifndef PWM1_GPIOS
|
||||
#define PWM1_GPIOS { }
|
||||
#endif
|
||||
/** @} */
|
||||
|
||||
|
||||
/**
|
||||
* @name SPI configuration
|
||||
*
|
||||
* SPI configuration depends on configured/connected components.
|
||||
*
|
||||
* HSPI is is always available and therefore used as SPI_DEV(0)
|
||||
* VSPI is only available when the camera is not plugged.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef SPI0_DEV
|
||||
#define SPI0_DEV HSPI /**< HSPI is configured as SPI_DEV(0) */
|
||||
#endif
|
||||
|
||||
#ifndef SPI0_SCK
|
||||
#define SPI0_SCK GPIO14 /**< SD Card SCL */
|
||||
#endif
|
||||
#ifndef SPI0_MOSI
|
||||
#define SPI0_MOSI GPIO15 /**< SD Card MOSI */
|
||||
#endif
|
||||
#ifndef SPI0_MISO
|
||||
#define SPI0_MISO GPIO2 /**< SD Card MISO */
|
||||
#endif
|
||||
#ifndef SPI0_CS0
|
||||
#define SPI0_CS0 GPIO13 /**< SD Card CS */
|
||||
#endif
|
||||
|
||||
#if !MODULE_ESP32_WROVER_KIT_CAMERA || DOXYGEN
|
||||
/**
|
||||
* When the camera is not connected, VSPI is configured and becomes SPI_DEV(1).
|
||||
*
|
||||
* @note The GPIOs listed in the configuration are first initialized as SPI
|
||||
* signals when the corresponding SPI interface is used for the first time
|
||||
* by either calling the ```spi_init_cs``` function or the ```spi_acquire```
|
||||
* function. That is, they are not allocated as SPI signals before and can
|
||||
* be used for other purposes as long as the SPI interface is not used.
|
||||
*
|
||||
*/
|
||||
#ifndef SPI1_DEV
|
||||
#define SPI1_DEV VSPI
|
||||
#endif
|
||||
|
||||
#ifndef SPI1_SCK
|
||||
#define SPI1_SCK GPIO19 /**< VSPI SCK used as LCD SCL, can be used to connect peripherals */
|
||||
#endif
|
||||
#ifndef SPI1_MOSI
|
||||
#define SPI1_MOSI GPIO23 /**< VSPI MOSI used as LCD MOSI, can be used to connect peripherals */
|
||||
#endif
|
||||
#ifndef SPI1_MISO
|
||||
#define SPI1_MISO GPIO25 /**< VSPI MISO used as LCD MISO, can be used to connect peripherals */
|
||||
#endif
|
||||
#ifndef SPI1_CS0
|
||||
#define SPI1_CS0 GPIO22 /**< VSPI CS0 used as LCD CS, can be used to connect peripherals */
|
||||
#endif
|
||||
#endif /* !MODULE_ESP32_WROVER_KIT_CAMERA || DOXYGEN */
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @name UART configuration
|
||||
*
|
||||
* ESP32 provides 3 UART interaces at maximum:
|
||||
*
|
||||
* UART_DEV(0) uses fixed standard configuration.<br>
|
||||
* UART_DEV(1) is not available.<br>
|
||||
* UART_DEV(2) is not available.<br>
|
||||
* @{
|
||||
*/
|
||||
#define UART0_TXD GPIO10 /**< direct I/O pin for UART_DEV(0) TxD, can't be changed */
|
||||
#define UART0_RXD GPIO9 /**< direct I/O pin for UART_DEV(0) RxD, can't be changed */
|
||||
/** @} */
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* end extern "C" */
|
||||
#endif
|
||||
|
||||
/* include common board definitions as last step */
|
||||
#include "periph_conf_common.h"
|
||||
|
||||
#endif /* PERIPH_CONF_H */
|
||||
/** @} */
|
||||
Loading…
x
Reference in New Issue
Block a user