Espressif · ESP32-C3-DevKitM-1
ESP32-C3-DevKitM-1
Espressif ESP32-C3-DevKitM-1: an ESP32-C3-MINI-1 module (single RISC-V core, Wi-Fi, BLE) on a breadboard-sized board with a USB-UART bridge.
En bref
ESP32-C3 development board: one 160 MHz RISC-V core, 400 KB SRAM, 4 MB flash, Wi-Fi and Bluetooth LE. The TWAI (CAN) controller can be routed to any GPIO and needs an external transceiver.
Caractéristiques
Lues dans le modèle de la carte, dans le store.
- Processeur
- ESP32-C3 · 1× RISC-V RV32IMC · chip "esp32c3"
- Horloge
- 160 MHz
- Flash
- 4 MB
- RAM
- 400 KB
- Broches GPIO
- 15
- CAN (ADC)
- ADC1 5 ch 12-bit
- Niveau logique
- 3.3 V
- Alimentation
- 5 V USB (in); 3V3 pin: 3.3 V; 5V pin (from USB): 5 V
- Courant par broche
- pas encore dans le modèle de la carte
- Bus
- UART ×2, I²C ×1, SPI ×1, CAN ×1, USB ×1
- Sur n’importe quelle broche
- UART, I²C, SPI, CAN, PWM
- Tourne
- sans OS (bare metal)
Brochage
Chaque broche selon ce qu’elle fait. Survolez ou touchez une broche pour voir ce qu’elle peut être d’autre.
- Alimentation 3
- Numérique 7
- Analogique 2
- Bus 5
- Contrôle 1
- GPIO0GPIO0
- GPIO1GPIO1
- GPIO2GPIO2
- GPIO3GPIO3
- GPIO4GPIO4
- GPIO5GPIO5
- GPIO6GPIO6
- GPIO7GPIO7
- GPIO8GPIO8
- GPIO9GPIO9
- GPIO10GPIO10
- GPIO18GPIO18
- GPIO19GPIO19
- GPIO20GPIO20
- GPIO21GPIO21
- pwr5 V USB
- v3v33V3 pin
- v55V pin (from USB)
Attention
Ce qu’archec vérifie pour cette carte, d’après ses données. Chaque point nomme la vérification qui l’attrape.
Ses broches travaillent en 3.3 V. La sortie d’un capteur 5 V sur l’une d’elles demande un adaptateur de niveau entre les deux.
vérification
pin-levelDeux connecteurs de la carte partagent ces broches : GPIO3 (TWAI0 (add a transceiver) / I2C0). Utilisez l’un ou l’autre.
vérification
pin-conflictLa carte utilise déjà GPIO9 (User SW1 button (low when pressed)), GPIO8 (RGB LED (WS2812, one data wire) on GPIO8). Autre chose branché là entre en conflit.
vérification
pin-conflictElle donne 3.3 V (3V3 pin), 5 V (5V pin (from USB)). Alimentez chaque pièce depuis une sortie à sa propre tension.
vérification
board-supplyElle a 2 UART, 1 I²C, 1 SPI, 1 CAN. Un bus de plus d’un même type est une erreur.
vérification
board-peripheral
Premier modèle
Un clignotement pour cette carte : la carte, une LED et une partie qui l’inverse toutes les 500 ms. archec le vérifie, puis écrit le code à droite.
project Blink "Blink" {
version "0.1.0"
edition "1.0"
uses arche-hw-store "^0.1"
}
include "arche-hw-store/boards/esp32-c3-devkitm-1/esp32-c3-devkitm-1.arche"
include "arche-hw-store/devices/led/led.arche"
/// Turns the LED over at each step.
component Blinker "Blinker" {
out led: requires Led
fn blink "Blink" {
```arche
led.toggle()
```
wcet 50us
}
}
/// The board, an LED on pin GPIO5, and the blinker.
system Hw "Blink" {
part board: Esp32C3DevKitM1
part led: GpioLed { in pin { pins { pin GPIO5 } } }
part blinker: Blinker
blinker.led -> led.led
}
/// The firmware: the blinker every 500 ms.
deployment OnBoard "On the board" {
system Hw
platform Hw
binary blink on board {
thread main "Blink" { runs blinker; period 500ms; step blink }
}
}
//! Your code: the state and behaviour of this part. Write it between the USER CODE markers:
//! when the model changes, `archec gen` writes this file again around them (a new function, a
//! new input) and keeps them. Edit outside them and the file is yours: it is left as it is,
//! and the compiler says what to add (a new trait method).
#[allow(unused_imports)]
use crate::arche::*;
// @arche blinker main.arche:25 part
/// blinker
#[derive(Default)]
pub struct Blinker {}
impl BlinkerBehaviour for Blinker {
// @arche blinker.blink main.arche:13 fn
async fn blink(&mut self, _out: &BlinkerOut) {
// Blink: from the model (```arche)
_out.call_led_toggle().await;
}
}blink/src/app/blinker.rs, l’un des 14 fichiers qu’archec écrit.