Raspberry Pi · SC0918
Raspberry Pi Pico W
Raspberry Pi Pico W: a Pico with an Infineon CYW43439 (Wi-Fi, Bluetooth).
En bref
RP2040 board with Wi-Fi and Bluetooth (CYW43439): two 133 MHz Cortex-M0+ cores, 264 KB SRAM, 2 MB flash. No CAN controller: CAN goes through an MCP2515 on SPI0.
Caractéristiques
Lues dans le modèle de la carte, dans le store.
- Processeur
- RP2040 · 2× Cortex-M0+ · chip "rp2040"
- Horloge
- 133 MHz
- Flash
- 2 MB
- RAM
- 264 KB
- Broches GPIO
- 26
- CAN (ADC)
- ADC 3 ch 12-bit
- Niveau logique
- 3.3 V
- Alimentation
- 5 V USB or VSYS (in); 3V3(OUT), pin 36: 3.3 V (≤ 300 mA); VBUS, pin 40 (5 V from USB): 5 V
- Courant par broche
- pas encore dans le modèle de la carte
- Bus
- UART ×2, I²C ×2, SPI ×2, USB ×1
- 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 9
- Analogique 2
- Bus 15
- PIN_0GP0
- PIN_1GP1
- PIN_2GP2
- PIN_3GP3
- PIN_4GP4
- PIN_5GP5
- PIN_6GP6
- PIN_7GP7
- PIN_8GP8
- PIN_9GP9
- PIN_10GP10
- PIN_11GP11
- PIN_12GP12
- PIN_13GP13
- PIN_14GP14
- PIN_15GP15
- PIN_16GP16
- PIN_17GP17
- PIN_18GP18
- PIN_19GP19
- PIN_20GP20
- PIN_21GP21
- PIN_22GP22
- PIN_26GP26
- PIN_27GP27
- PIN_28GP28
- pwr5 V USB or VSYS
- v3v33V3(OUT), pin 36
- vbusVBUS, pin 40 (5 V 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-levelLa sortie 3V3(OUT), pin 36 donne au plus 300 mA en 3.3 V. Additionnez ce que vous alimentez avec.
vérification
board-currentElle donne 3.3 V (3V3(OUT), pin 36), 5 V (VBUS, pin 40 (5 V from USB)). Alimentez chaque pièce depuis une sortie à sa propre tension.
vérification
board-supplyElle a 2 UART, 2 I²C, 2 SPI. Un bus de plus d’un même type est une erreur.
vérification
board-peripheralChaque bus va sur les broches qui peuvent le porter (voir le brochage). Une autre broche est une erreur.
vérification
pin-function
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/raspberry-pi-pico-w/raspberry-pi-pico-w.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 PIN_2, and the blinker.
system Hw "Blink" {
part board: RaspberryPiPicoW
part led: GpioLed { in pin { pins { pin PIN_2 } } }
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 16 fichiers qu’archec écrit.