Compare commits
4 commits
9c680bd65f
...
22dfda2c1c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
22dfda2c1c | ||
|
|
cab65de189 | ||
|
|
c79e543c41 | ||
|
|
3c556e6729 |
13 changed files with 144 additions and 11 deletions
|
|
@ -1 +1 @@
|
|||
Subproject commit ece6e68f29c6f406a4434659bcbcfe558baaa3a9
|
||||
Subproject commit 82928635c893189343cf8eb78569f0c4136fded0
|
||||
|
|
@ -110,7 +110,7 @@ extern bool __isFreeRTOS;
|
|||
#endif
|
||||
|
||||
#ifndef PGM_VOID_P
|
||||
#define PGM_VOID_P void *
|
||||
#define PGM_VOID_P const void *
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
@ -159,3 +159,7 @@ constexpr uint64_t __bitset(const int (&a)[N], size_t i = 0U) {
|
|||
#define __GPIOCNT 30
|
||||
#define __FIRSTANALOGGPIO 26
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
using namespace arduino;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
extern "C" typedef struct uart_inst uart_inst_t;
|
||||
|
||||
class SerialPIO : public HardwareSerial {
|
||||
class SerialPIO : public arduino::HardwareSerial {
|
||||
public:
|
||||
static const pin_size_t NOPIN = 0xff; // Use in constructor to disable RX or TX unit
|
||||
SerialPIO(pin_size_t tx, pin_size_t rx, size_t fifoSize = 32);
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
#include "Arduino.h"
|
||||
#include "api/HardwareSerial.h"
|
||||
|
||||
class SerialSemiClass : public HardwareSerial {
|
||||
class SerialSemiClass : public arduino::HardwareSerial {
|
||||
public:
|
||||
SerialSemiClass() {
|
||||
/* noop */
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
extern "C" typedef struct uart_inst uart_inst_t;
|
||||
|
||||
#define UART_PIN_NOT_DEFINED (255u)
|
||||
class SerialUART : public HardwareSerial {
|
||||
class SerialUART : public arduino::HardwareSerial {
|
||||
public:
|
||||
SerialUART(uart_inst_t *uart, pin_size_t tx, pin_size_t rx, pin_size_t rts = UART_PIN_NOT_DEFINED, pin_size_t cts = UART_PIN_NOT_DEFINED);
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
#include "api/HardwareSerial.h"
|
||||
#include <stdarg.h>
|
||||
|
||||
class SerialUSB : public HardwareSerial {
|
||||
class SerialUSB : public arduino::HardwareSerial {
|
||||
public:
|
||||
SerialUSB() { }
|
||||
void begin(unsigned long baud = 115200) override;
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
#include <errno.h>
|
||||
#include <_syslist.h>
|
||||
#include <sys/times.h>
|
||||
#include <sys/unistd.h>
|
||||
#include <pico/stdlib.h>
|
||||
#include <pico/multicore.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -56,9 +56,9 @@ extern "C" void shiftOut(pin_size_t dataPin, pin_size_t clockPin, BitOrder bitOr
|
|||
}
|
||||
for (i = 0; i < 8; i++) {
|
||||
if (bitOrder == LSBFIRST) {
|
||||
digitalWrite(dataPin, !!(val & (1 << i)));
|
||||
digitalWrite(dataPin, !!(val & (1 << i)) ? HIGH : LOW);
|
||||
} else {
|
||||
digitalWrite(dataPin, !!(val & (1 << (7 - i))));
|
||||
digitalWrite(dataPin, !!(val & (1 << (7 - i))) ? HIGH : LOW);
|
||||
}
|
||||
|
||||
digitalWrite(clockPin, HIGH);
|
||||
|
|
|
|||
|
|
@ -216,9 +216,9 @@ void handleFileList() {
|
|||
// as an HTTP chunk
|
||||
Serial.println(output);
|
||||
server.sendContent(output);
|
||||
output = ',';
|
||||
output = ",";
|
||||
} else {
|
||||
output = '[';
|
||||
output = "[";
|
||||
}
|
||||
|
||||
output += "{\"type\":\"";
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <Udp.h>
|
||||
#include <include/slist.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -507,7 +507,7 @@ bool TwoWire::writeReadAsync(uint8_t address, const void *wbuffer, size_t wbytes
|
|||
abortAsync();
|
||||
|
||||
// Create or enlarge dma command buffer, we need one entry for every i2c byte we want to write/read
|
||||
const size_t bufLen = (wbytes + rbytes) * 2;
|
||||
const size_t bufLen = (wbytes + rbytes) * sizeof(uint16_t);
|
||||
if (_dmaSendBufferLen < bufLen) {
|
||||
if (_dmaSendBuffer) {
|
||||
free(_dmaSendBuffer);
|
||||
|
|
@ -518,6 +518,7 @@ bool TwoWire::writeReadAsync(uint8_t address, const void *wbuffer, size_t wbytes
|
|||
if (!_dmaSendBuffer) {
|
||||
return false;
|
||||
}
|
||||
_dmaSendBufferLen = bufLen;
|
||||
}
|
||||
|
||||
// Fill the dma command buffer
|
||||
|
|
|
|||
55
tools/json/adafruit_metro_rp2350.json
Normal file
55
tools/json/adafruit_metro_rp2350.json
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
{
|
||||
"build": {
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"boot2_source": "none.S",
|
||||
"usb_vid": "0x239A",
|
||||
"usb_pid": "0x814D"
|
||||
}
|
||||
},
|
||||
"core": "earlephilhower",
|
||||
"cpu": "cortex-m33",
|
||||
"extra_flags": "-DARDUINO_ADAFRUIT_METRO_RP2350 -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250 ",
|
||||
"f_cpu": "150000000L",
|
||||
"hwids": [
|
||||
[
|
||||
"0x2E8A",
|
||||
"0x00C0"
|
||||
],
|
||||
[
|
||||
"0x239A",
|
||||
"0x814D"
|
||||
]
|
||||
],
|
||||
"mcu": "rp2350",
|
||||
"variant": "adafruit_metro_rp2350"
|
||||
},
|
||||
"debug": {
|
||||
"jlink_device": "RP2350_0",
|
||||
"openocd_target": "rp2350.cfg",
|
||||
"svd_path": "rp2350.svd"
|
||||
},
|
||||
"frameworks": [
|
||||
"arduino"
|
||||
],
|
||||
"name": "Metro RP2350",
|
||||
"upload": {
|
||||
"maximum_ram_size": 524288,
|
||||
"maximum_size": 16777216,
|
||||
"require_upload_port": true,
|
||||
"native_usb": true,
|
||||
"use_1200bps_touch": true,
|
||||
"wait_for_upload_port": false,
|
||||
"protocol": "picotool",
|
||||
"protocols": [
|
||||
"blackmagic",
|
||||
"cmsis-dap",
|
||||
"jlink",
|
||||
"raspberrypi-swd",
|
||||
"picotool",
|
||||
"picoprobe"
|
||||
]
|
||||
},
|
||||
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
|
||||
"vendor": "Adafruit"
|
||||
}
|
||||
71
variants/adafruit_metro_rp2350/pins_arduino.h
Normal file
71
variants/adafruit_metro_rp2350/pins_arduino.h
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
#pragma once
|
||||
#define PICO_RP2350B 1
|
||||
|
||||
// LEDs
|
||||
#define PIN_LED (23u)
|
||||
|
||||
#define PIN_NEOPIXEL (25)
|
||||
#define NUM_NEOPIXEL (1)
|
||||
|
||||
// 'Boot0' button also on GPIO #24
|
||||
#define PIN_BUTTON (24u)
|
||||
|
||||
// USB host connector
|
||||
#define PIN_USB_HOST_DP (32u)
|
||||
#define PIN_USB_HOST_DM (33u)
|
||||
#define PIN_5V_EN (29u)
|
||||
#define PIN_5V_EN_STATE (1u)
|
||||
|
||||
// SDIO
|
||||
#define PIN_SD_CLK (34u)
|
||||
#define PIN_SD_CMD_MOSI (35u)
|
||||
#define PIN_SD_DAT0_MISO (36u)
|
||||
#define PIN_SD_DAT1 (37u)
|
||||
#define PIN_SD_DAT2 (38u)
|
||||
#define PIN_SD_DAT3_CS (39u)
|
||||
#define PIN_SD_DETECT (40u)
|
||||
|
||||
#define __PIN_A0 (41u)
|
||||
#define __PIN_A1 (42u)
|
||||
#define __PIN_A2 (43u)
|
||||
#define __PIN_A3 (44u)
|
||||
#define __PIN_A4 (45u)
|
||||
#define __PIN_A5 (46u)
|
||||
|
||||
// UARTs
|
||||
#define PIN_SERIAL1_TX (0u)
|
||||
#define PIN_SERIAL1_RX (1u)
|
||||
#define PIN_SERIAL2_TX (99u) // not pinned out
|
||||
#define PIN_SERIAL2_RX (99u)
|
||||
|
||||
// SPI
|
||||
#define __SPI0_DEVICE spi1
|
||||
#define PIN_SPI1_MISO (36u)
|
||||
#define PIN_SPI1_MOSI (35u)
|
||||
#define PIN_SPI1_SCK (34u)
|
||||
#define PIN_SPI1_SS (39u)
|
||||
|
||||
#define __SPI1_DEVICE spi0
|
||||
#define PIN_SPI0_MISO (28u)
|
||||
#define PIN_SPI0_MOSI (31u)
|
||||
#define PIN_SPI0_SCK (30u)
|
||||
#define PIN_SPI0_SS (29u)
|
||||
|
||||
// Wire
|
||||
#define __WIRE0_DEVICE i2c0
|
||||
#define PIN_WIRE0_SDA (20u)
|
||||
#define PIN_WIRE0_SCL (21u)
|
||||
|
||||
#define __WIRE1_DEVICE i2c1
|
||||
#define PIN_WIRE1_SDA (99u) // not pinned out
|
||||
#define PIN_WIRE1_SCL (99u)
|
||||
|
||||
#define SERIAL_HOWMANY (1u)
|
||||
#define SPI_HOWMANY (2u)
|
||||
#define WIRE_HOWMANY (1u)
|
||||
|
||||
// PSRAM
|
||||
#define RP2350_PSRAM_CS (47u)
|
||||
#define RP2350_PSRAM_MAX_SCK_HZ (109*1000*1000)
|
||||
|
||||
#include "../generic/common.h"
|
||||
Loading…
Reference in a new issue