Use CXD56 pin names

This commit is contained in:
Kamil Tomaszewski 2019-10-11 09:34:00 +02:00
parent 5f09609d41
commit 8f653d6238
7 changed files with 213 additions and 213 deletions

View File

@ -28,12 +28,12 @@
#define MICROPY_HW_MCU_NAME "CXD5602"
#define MICROPY_PY_SYS_PLATFORM "SPRESENSE"
#define DEFAULT_I2C_BUS_SCL (&pin_D15)
#define DEFAULT_I2C_BUS_SDA (&pin_D14)
#define DEFAULT_I2C_BUS_SCL (&pin_I2C0_BCK)
#define DEFAULT_I2C_BUS_SDA (&pin_I2C0_BDT)
#define DEFAULT_SPI_BUS_SCK (&pin_D13)
#define DEFAULT_SPI_BUS_MISO (&pin_D12)
#define DEFAULT_SPI_BUS_MOSI (&pin_D11)
#define DEFAULT_SPI_BUS_SCK (&pin_SPI4_SCK)
#define DEFAULT_SPI_BUS_MISO (&pin_SPI4_MISO)
#define DEFAULT_SPI_BUS_MOSI (&pin_SPI4_MOSI)
#define DEFAULT_UART_BUS_RX (&pin_D0)
#define DEFAULT_UART_BUS_TX (&pin_D1)
#define DEFAULT_UART_BUS_RX (&pin_UART2_RXD)
#define DEFAULT_UART_BUS_TX (&pin_UART2_TXD)

View File

@ -27,52 +27,52 @@
#include "shared-bindings/board/__init__.h"
STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_D0) },
{ MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_D1) },
{ MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_D2) },
{ MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_D3) },
{ MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_D4) },
{ MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_D5) },
{ MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_D6) },
{ MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_D7) },
{ MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_D8) },
{ MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_D9) },
{ MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_D10) },
{ MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_D11) },
{ MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_D12) },
{ MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_D13) },
{ MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_D14) },
{ MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_D15) },
{ MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_D16) },
{ MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_D17) },
{ MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_D18) },
{ MP_ROM_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_D19) },
{ MP_ROM_QSTR(MP_QSTR_D20), MP_ROM_PTR(&pin_D20) },
{ MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_D21) },
{ MP_ROM_QSTR(MP_QSTR_D22), MP_ROM_PTR(&pin_D22) },
{ MP_ROM_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_D23) },
{ MP_ROM_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_D24) },
{ MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_D25) },
{ MP_ROM_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_D26) },
{ MP_ROM_QSTR(MP_QSTR_D27), MP_ROM_PTR(&pin_D27) },
{ MP_ROM_QSTR(MP_QSTR_D28), MP_ROM_PTR(&pin_D28) },
{ MP_ROM_QSTR(MP_QSTR_LED0), MP_ROM_PTR(&pin_LED0) },
{ MP_ROM_QSTR(MP_QSTR_LED1), MP_ROM_PTR(&pin_LED1) },
{ MP_ROM_QSTR(MP_QSTR_LED2), MP_ROM_PTR(&pin_LED2) },
{ MP_ROM_QSTR(MP_QSTR_LED3), MP_ROM_PTR(&pin_LED3) },
{ MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_A0) },
{ MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_A1) },
{ MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_A2) },
{ MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_A3) },
{ MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_A4) },
{ MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_A5) },
{ MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_D14) },
{ MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_D15) },
{ MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_D13) },
{ MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_D12) },
{ MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_D11) },
{ MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_D0) },
{ MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_D1) },
{ MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_UART2_RXD) },
{ MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_UART2_TXD) },
{ MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_HIF_IRQ_OUT) },
{ MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PWM3) },
{ MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_SPI2_MOSI) },
{ MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PWM1) },
{ MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PWM0) },
{ MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_SPI3_CS1_X) },
{ MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_SPI2_MISO) },
{ MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PWM2) },
{ MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_SPI4_CS_X) },
{ MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_SPI4_MOSI) },
{ MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_SPI4_MISO) },
{ MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_SPI4_SCK) },
{ MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_I2C0_BDT) },
{ MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_I2C0_BCK) },
{ MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_EMMC_DATA0) },
{ MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_EMMC_DATA1) },
{ MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_I2S0_DATA_OUT) },
{ MP_ROM_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_I2S0_DATA_IN) },
{ MP_ROM_QSTR(MP_QSTR_D20), MP_ROM_PTR(&pin_EMMC_DATA2) },
{ MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_EMMC_DATA3) },
{ MP_ROM_QSTR(MP_QSTR_D22), MP_ROM_PTR(&pin_SEN_IRQ_IN) },
{ MP_ROM_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_EMMC_CLK) },
{ MP_ROM_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_EMMC_CMD) },
{ MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_I2S0_LRCK) },
{ MP_ROM_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_I2S0_BCK) },
{ MP_ROM_QSTR(MP_QSTR_D27), MP_ROM_PTR(&pin_UART2_CTS) },
{ MP_ROM_QSTR(MP_QSTR_D28), MP_ROM_PTR(&pin_UART2_RTS) },
{ MP_ROM_QSTR(MP_QSTR_LED0), MP_ROM_PTR(&pin_I2S1_BCK) },
{ MP_ROM_QSTR(MP_QSTR_LED1), MP_ROM_PTR(&pin_I2S1_LRCK) },
{ MP_ROM_QSTR(MP_QSTR_LED2), MP_ROM_PTR(&pin_I2S1_DATA_IN) },
{ MP_ROM_QSTR(MP_QSTR_LED3), MP_ROM_PTR(&pin_I2S1_DATA_OUT) },
{ MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_LPADC0) },
{ MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_LPADC1) },
{ MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_LPADC2) },
{ MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_LPADC3) },
{ MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_HPADC0) },
{ MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_HPADC1) },
{ MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_I2C0_BDT) },
{ MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_I2C0_BCK) },
{ MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_SPI4_SCK) },
{ MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_SPI4_MISO) },
{ MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_SPI4_MOSI) },
{ MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_UART2_RXD) },
{ MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_UART2_TXD) },
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
{ MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) },
{ MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) },

View File

@ -42,12 +42,12 @@ typedef struct {
} analogin_dev_t;
STATIC analogin_dev_t analogin_dev[] = {
{"/dev/lpadc0", &pin_A0, -1},
{"/dev/lpadc1", &pin_A1, -1},
{"/dev/lpadc2", &pin_A2, -1},
{"/dev/lpadc3", &pin_A3, -1},
{"/dev/hpadc0", &pin_A4, -1},
{"/dev/hpadc1", &pin_A5, -1},
{"/dev/lpadc0", &pin_LPADC0, -1},
{"/dev/lpadc1", &pin_LPADC1, -1},
{"/dev/lpadc2", &pin_LPADC2, -1},
{"/dev/lpadc3", &pin_LPADC3, -1},
{"/dev/hpadc0", &pin_HPADC0, -1},
{"/dev/hpadc1", &pin_HPADC1, -1},
};
void common_hal_analogio_analogin_construct(analogio_analogin_obj_t *self, const mcu_pin_obj_t *pin) {

View File

@ -39,80 +39,80 @@ typedef struct {
bool free;
} pin_status_t;
const mcu_pin_obj_t pin_D0 = PIN(PIN_UART2_RXD, false);
const mcu_pin_obj_t pin_D1 = PIN(PIN_UART2_TXD, false);
const mcu_pin_obj_t pin_D2 = PIN(PIN_HIF_IRQ_OUT, false);
const mcu_pin_obj_t pin_D3 = PIN(PIN_PWM3, false);
const mcu_pin_obj_t pin_D4 = PIN(PIN_SPI2_MOSI, false);
const mcu_pin_obj_t pin_D5 = PIN(PIN_PWM1, false);
const mcu_pin_obj_t pin_D6 = PIN(PIN_PWM0, false);
const mcu_pin_obj_t pin_D7 = PIN(PIN_SPI3_CS1_X, false);
const mcu_pin_obj_t pin_D8 = PIN(PIN_SPI2_MISO, false);
const mcu_pin_obj_t pin_D9 = PIN(PIN_PWM2, false);
const mcu_pin_obj_t pin_D10 = PIN(PIN_SPI4_CS_X, false);
const mcu_pin_obj_t pin_D11 = PIN(PIN_SPI4_MOSI, false);
const mcu_pin_obj_t pin_D12 = PIN(PIN_SPI4_MISO, false);
const mcu_pin_obj_t pin_D13 = PIN(PIN_SPI4_SCK, false);
const mcu_pin_obj_t pin_D14 = PIN(PIN_I2C0_BDT, false);
const mcu_pin_obj_t pin_D15 = PIN(PIN_I2C0_BCK, false);
const mcu_pin_obj_t pin_D16 = PIN(PIN_EMMC_DATA0, false);
const mcu_pin_obj_t pin_D17 = PIN(PIN_EMMC_DATA1, false);
const mcu_pin_obj_t pin_D18 = PIN(PIN_I2S0_DATA_OUT, false);
const mcu_pin_obj_t pin_D19 = PIN(PIN_I2S0_DATA_IN, false);
const mcu_pin_obj_t pin_D20 = PIN(PIN_EMMC_DATA2, false);
const mcu_pin_obj_t pin_D21 = PIN(PIN_EMMC_DATA3, false);
const mcu_pin_obj_t pin_D22 = PIN(PIN_SEN_IRQ_IN, false);
const mcu_pin_obj_t pin_D23 = PIN(PIN_EMMC_CLK, false);
const mcu_pin_obj_t pin_D24 = PIN(PIN_EMMC_CMD, false);
const mcu_pin_obj_t pin_D25 = PIN(PIN_I2S0_LRCK, false);
const mcu_pin_obj_t pin_D26 = PIN(PIN_I2S0_BCK, false);
const mcu_pin_obj_t pin_D27 = PIN(PIN_UART2_CTS, false);
const mcu_pin_obj_t pin_D28 = PIN(PIN_UART2_RTS, false);
const mcu_pin_obj_t pin_LED0 = PIN(PIN_I2S1_BCK, false);
const mcu_pin_obj_t pin_LED1 = PIN(PIN_I2S1_LRCK, false);
const mcu_pin_obj_t pin_LED2 = PIN(PIN_I2S1_DATA_IN, false);
const mcu_pin_obj_t pin_LED3 = PIN(PIN_I2S1_DATA_OUT, false);
const mcu_pin_obj_t pin_A0 = PIN(0, true);
const mcu_pin_obj_t pin_A1 = PIN(1, true);
const mcu_pin_obj_t pin_A2 = PIN(2, true);
const mcu_pin_obj_t pin_A3 = PIN(3, true);
const mcu_pin_obj_t pin_A4 = PIN(4, true);
const mcu_pin_obj_t pin_A5 = PIN(5, true);
const mcu_pin_obj_t pin_UART2_RXD = PIN(PIN_UART2_RXD, false);
const mcu_pin_obj_t pin_UART2_TXD = PIN(PIN_UART2_TXD, false);
const mcu_pin_obj_t pin_HIF_IRQ_OUT = PIN(PIN_HIF_IRQ_OUT, false);
const mcu_pin_obj_t pin_PWM3 = PIN(PIN_PWM3, false);
const mcu_pin_obj_t pin_SPI2_MOSI = PIN(PIN_SPI2_MOSI, false);
const mcu_pin_obj_t pin_PWM1 = PIN(PIN_PWM1, false);
const mcu_pin_obj_t pin_PWM0 = PIN(PIN_PWM0, false);
const mcu_pin_obj_t pin_SPI3_CS1_X = PIN(PIN_SPI3_CS1_X, false);
const mcu_pin_obj_t pin_SPI2_MISO = PIN(PIN_SPI2_MISO, false);
const mcu_pin_obj_t pin_PWM2 = PIN(PIN_PWM2, false);
const mcu_pin_obj_t pin_SPI4_CS_X = PIN(PIN_SPI4_CS_X, false);
const mcu_pin_obj_t pin_SPI4_MOSI = PIN(PIN_SPI4_MOSI, false);
const mcu_pin_obj_t pin_SPI4_MISO = PIN(PIN_SPI4_MISO, false);
const mcu_pin_obj_t pin_SPI4_SCK = PIN(PIN_SPI4_SCK, false);
const mcu_pin_obj_t pin_I2C0_BDT = PIN(PIN_I2C0_BDT, false);
const mcu_pin_obj_t pin_I2C0_BCK = PIN(PIN_I2C0_BCK, false);
const mcu_pin_obj_t pin_EMMC_DATA0 = PIN(PIN_EMMC_DATA0, false);
const mcu_pin_obj_t pin_EMMC_DATA1 = PIN(PIN_EMMC_DATA1, false);
const mcu_pin_obj_t pin_I2S0_DATA_OUT = PIN(PIN_I2S0_DATA_OUT, false);
const mcu_pin_obj_t pin_I2S0_DATA_IN = PIN(PIN_I2S0_DATA_IN, false);
const mcu_pin_obj_t pin_EMMC_DATA2 = PIN(PIN_EMMC_DATA2, false);
const mcu_pin_obj_t pin_EMMC_DATA3 = PIN(PIN_EMMC_DATA3, false);
const mcu_pin_obj_t pin_SEN_IRQ_IN = PIN(PIN_SEN_IRQ_IN, false);
const mcu_pin_obj_t pin_EMMC_CLK = PIN(PIN_EMMC_CLK, false);
const mcu_pin_obj_t pin_EMMC_CMD = PIN(PIN_EMMC_CMD, false);
const mcu_pin_obj_t pin_I2S0_LRCK = PIN(PIN_I2S0_LRCK, false);
const mcu_pin_obj_t pin_I2S0_BCK = PIN(PIN_I2S0_BCK, false);
const mcu_pin_obj_t pin_UART2_CTS = PIN(PIN_UART2_CTS, false);
const mcu_pin_obj_t pin_UART2_RTS = PIN(PIN_UART2_RTS, false);
const mcu_pin_obj_t pin_I2S1_BCK = PIN(PIN_I2S1_BCK, false);
const mcu_pin_obj_t pin_I2S1_LRCK = PIN(PIN_I2S1_LRCK, false);
const mcu_pin_obj_t pin_I2S1_DATA_IN = PIN(PIN_I2S1_DATA_IN, false);
const mcu_pin_obj_t pin_I2S1_DATA_OUT = PIN(PIN_I2S1_DATA_OUT, false);
const mcu_pin_obj_t pin_LPADC0 = PIN(0, true);
const mcu_pin_obj_t pin_LPADC1 = PIN(1, true);
const mcu_pin_obj_t pin_LPADC2 = PIN(2, true);
const mcu_pin_obj_t pin_LPADC3 = PIN(3, true);
const mcu_pin_obj_t pin_HPADC0 = PIN(4, true);
const mcu_pin_obj_t pin_HPADC1 = PIN(5, true);
STATIC pin_status_t pins[] = {
{ &pin_D0, true, true },
{ &pin_D1, true, true },
{ &pin_D2, true, true },
{ &pin_D3, true, true },
{ &pin_D4, true, true },
{ &pin_D5, true, true },
{ &pin_D6, true, true },
{ &pin_D7, true, true },
{ &pin_D8, true, true },
{ &pin_D9, true, true },
{ &pin_D10, true, true },
{ &pin_D11, true, true },
{ &pin_D12, true, true },
{ &pin_D13, true, true },
{ &pin_D14, true, true },
{ &pin_D15, true, true },
{ &pin_D16, true, true },
{ &pin_D17, true, true },
{ &pin_D18, true, true },
{ &pin_D19, true, true },
{ &pin_D20, true, true },
{ &pin_D21, true, true },
{ &pin_D22, true, true },
{ &pin_D23, true, true },
{ &pin_D24, true, true },
{ &pin_D25, true, true },
{ &pin_D26, true, true },
{ &pin_D27, true, true },
{ &pin_D28, true, true },
{ &pin_LED0, true, true },
{ &pin_LED1, true, true },
{ &pin_LED2, true, true },
{ &pin_LED3, true, true },
{ &pin_UART2_RXD, true, true },
{ &pin_UART2_TXD, true, true },
{ &pin_HIF_IRQ_OUT, true, true },
{ &pin_PWM3, true, true },
{ &pin_SPI2_MOSI, true, true },
{ &pin_PWM1, true, true },
{ &pin_PWM0, true, true },
{ &pin_SPI3_CS1_X, true, true },
{ &pin_SPI2_MISO, true, true },
{ &pin_PWM2, true, true },
{ &pin_SPI4_CS_X, true, true },
{ &pin_SPI4_MOSI, true, true },
{ &pin_SPI4_MISO, true, true },
{ &pin_SPI4_SCK, true, true },
{ &pin_I2C0_BDT, true, true },
{ &pin_I2C0_BCK, true, true },
{ &pin_EMMC_DATA0, true, true },
{ &pin_EMMC_DATA1, true, true },
{ &pin_I2S0_DATA_OUT, true, true },
{ &pin_I2S0_DATA_IN, true, true },
{ &pin_EMMC_DATA2, true, true },
{ &pin_EMMC_DATA3, true, true },
{ &pin_SEN_IRQ_IN, true, true },
{ &pin_EMMC_CLK, true, true },
{ &pin_EMMC_CMD, true, true },
{ &pin_I2S0_LRCK, true, true },
{ &pin_I2S0_BCK, true, true },
{ &pin_UART2_CTS, true, true },
{ &pin_UART2_RTS, true, true },
{ &pin_I2S1_BCK, true, true },
{ &pin_I2S1_LRCK, true, true },
{ &pin_I2S1_DATA_IN, true, true },
{ &pin_I2S1_DATA_OUT, true, true },
};
bool common_hal_mcu_pin_is_free(const mcu_pin_obj_t *pin) {

View File

@ -44,45 +44,45 @@ typedef struct {
bool analog;
} mcu_pin_obj_t;
extern const mcu_pin_obj_t pin_D0;
extern const mcu_pin_obj_t pin_D1;
extern const mcu_pin_obj_t pin_D2;
extern const mcu_pin_obj_t pin_D3;
extern const mcu_pin_obj_t pin_D4;
extern const mcu_pin_obj_t pin_D5;
extern const mcu_pin_obj_t pin_D6;
extern const mcu_pin_obj_t pin_D7;
extern const mcu_pin_obj_t pin_D8;
extern const mcu_pin_obj_t pin_D9;
extern const mcu_pin_obj_t pin_D10;
extern const mcu_pin_obj_t pin_D11;
extern const mcu_pin_obj_t pin_D12;
extern const mcu_pin_obj_t pin_D13;
extern const mcu_pin_obj_t pin_D14;
extern const mcu_pin_obj_t pin_D15;
extern const mcu_pin_obj_t pin_D16;
extern const mcu_pin_obj_t pin_D17;
extern const mcu_pin_obj_t pin_D18;
extern const mcu_pin_obj_t pin_D19;
extern const mcu_pin_obj_t pin_D20;
extern const mcu_pin_obj_t pin_D21;
extern const mcu_pin_obj_t pin_D22;
extern const mcu_pin_obj_t pin_D23;
extern const mcu_pin_obj_t pin_D24;
extern const mcu_pin_obj_t pin_D25;
extern const mcu_pin_obj_t pin_D26;
extern const mcu_pin_obj_t pin_D27;
extern const mcu_pin_obj_t pin_D28;
extern const mcu_pin_obj_t pin_LED0;
extern const mcu_pin_obj_t pin_LED1;
extern const mcu_pin_obj_t pin_LED2;
extern const mcu_pin_obj_t pin_LED3;
extern const mcu_pin_obj_t pin_A0;
extern const mcu_pin_obj_t pin_A1;
extern const mcu_pin_obj_t pin_A2;
extern const mcu_pin_obj_t pin_A3;
extern const mcu_pin_obj_t pin_A4;
extern const mcu_pin_obj_t pin_A5;
extern const mcu_pin_obj_t pin_UART2_RXD;
extern const mcu_pin_obj_t pin_UART2_TXD;
extern const mcu_pin_obj_t pin_HIF_IRQ_OUT;
extern const mcu_pin_obj_t pin_PWM3;
extern const mcu_pin_obj_t pin_SPI2_MOSI;
extern const mcu_pin_obj_t pin_PWM1;
extern const mcu_pin_obj_t pin_PWM0;
extern const mcu_pin_obj_t pin_SPI3_CS1_X;
extern const mcu_pin_obj_t pin_SPI2_MISO;
extern const mcu_pin_obj_t pin_PWM2;
extern const mcu_pin_obj_t pin_SPI4_CS_X;
extern const mcu_pin_obj_t pin_SPI4_MOSI;
extern const mcu_pin_obj_t pin_SPI4_MISO;
extern const mcu_pin_obj_t pin_SPI4_SCK;
extern const mcu_pin_obj_t pin_I2C0_BDT;
extern const mcu_pin_obj_t pin_I2C0_BCK;
extern const mcu_pin_obj_t pin_EMMC_DATA0;
extern const mcu_pin_obj_t pin_EMMC_DATA1;
extern const mcu_pin_obj_t pin_I2S0_DATA_OUT;
extern const mcu_pin_obj_t pin_I2S0_DATA_IN;
extern const mcu_pin_obj_t pin_EMMC_DATA2;
extern const mcu_pin_obj_t pin_EMMC_DATA3;
extern const mcu_pin_obj_t pin_SEN_IRQ_IN;
extern const mcu_pin_obj_t pin_EMMC_CLK;
extern const mcu_pin_obj_t pin_EMMC_CMD;
extern const mcu_pin_obj_t pin_I2S0_LRCK;
extern const mcu_pin_obj_t pin_I2S0_BCK;
extern const mcu_pin_obj_t pin_UART2_CTS;
extern const mcu_pin_obj_t pin_UART2_RTS;
extern const mcu_pin_obj_t pin_I2S1_BCK;
extern const mcu_pin_obj_t pin_I2S1_LRCK;
extern const mcu_pin_obj_t pin_I2S1_DATA_IN;
extern const mcu_pin_obj_t pin_I2S1_DATA_OUT;
extern const mcu_pin_obj_t pin_LPADC0;
extern const mcu_pin_obj_t pin_LPADC1;
extern const mcu_pin_obj_t pin_LPADC2;
extern const mcu_pin_obj_t pin_LPADC3;
extern const mcu_pin_obj_t pin_HPADC0;
extern const mcu_pin_obj_t pin_HPADC1;
void never_reset_pin_number(uint8_t pin_number);
void reset_pin_number(uint8_t pin_number);

View File

@ -68,44 +68,44 @@ void common_hal_mcu_reset(void) {
}
STATIC const mp_rom_map_elem_t mcu_pin_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_D0) },
{ MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_D1) },
{ MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_D2) },
{ MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_D3) },
{ MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_D4) },
{ MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_D5) },
{ MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_D6) },
{ MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_D7) },
{ MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_D8) },
{ MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_D9) },
{ MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_D10) },
{ MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_D11) },
{ MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_D12) },
{ MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_D13) },
{ MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_D14) },
{ MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_D15) },
{ MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_D16) },
{ MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_D17) },
{ MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_D18) },
{ MP_ROM_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_D19) },
{ MP_ROM_QSTR(MP_QSTR_D20), MP_ROM_PTR(&pin_D20) },
{ MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_D21) },
{ MP_ROM_QSTR(MP_QSTR_D22), MP_ROM_PTR(&pin_D22) },
{ MP_ROM_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_D23) },
{ MP_ROM_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_D24) },
{ MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_D25) },
{ MP_ROM_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_D26) },
{ MP_ROM_QSTR(MP_QSTR_D27), MP_ROM_PTR(&pin_D27) },
{ MP_ROM_QSTR(MP_QSTR_D28), MP_ROM_PTR(&pin_D28) },
{ MP_ROM_QSTR(MP_QSTR_LED0), MP_ROM_PTR(&pin_LED0) },
{ MP_ROM_QSTR(MP_QSTR_LED1), MP_ROM_PTR(&pin_LED1) },
{ MP_ROM_QSTR(MP_QSTR_LED2), MP_ROM_PTR(&pin_LED2) },
{ MP_ROM_QSTR(MP_QSTR_LED3), MP_ROM_PTR(&pin_LED3) },
{ MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_A0) },
{ MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_A1) },
{ MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_A2) },
{ MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_A3) },
{ MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_A4) },
{ MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_A5) },
{ MP_ROM_QSTR(MP_QSTR_UART2_RXD), MP_ROM_PTR(&pin_UART2_RXD) },
{ MP_ROM_QSTR(MP_QSTR_UART2_TXD), MP_ROM_PTR(&pin_UART2_TXD) },
{ MP_ROM_QSTR(MP_QSTR_HIF_IRQ_OUT), MP_ROM_PTR(&pin_HIF_IRQ_OUT) },
{ MP_ROM_QSTR(MP_QSTR_PWM3), MP_ROM_PTR(&pin_PWM3) },
{ MP_ROM_QSTR(MP_QSTR_SPI2_MOSI), MP_ROM_PTR(&pin_SPI2_MOSI) },
{ MP_ROM_QSTR(MP_QSTR_PWM1), MP_ROM_PTR(&pin_PWM1) },
{ MP_ROM_QSTR(MP_QSTR_PWM0), MP_ROM_PTR(&pin_PWM0) },
{ MP_ROM_QSTR(MP_QSTR_SPI3_CS1_X), MP_ROM_PTR(&pin_SPI3_CS1_X) },
{ MP_ROM_QSTR(MP_QSTR_SPI2_MISO), MP_ROM_PTR(&pin_SPI2_MISO) },
{ MP_ROM_QSTR(MP_QSTR_PWM2), MP_ROM_PTR(&pin_PWM2) },
{ MP_ROM_QSTR(MP_QSTR_SPI4_CS_X), MP_ROM_PTR(&pin_SPI4_CS_X) },
{ MP_ROM_QSTR(MP_QSTR_SPI4_MOSI), MP_ROM_PTR(&pin_SPI4_MOSI) },
{ MP_ROM_QSTR(MP_QSTR_SPI4_MISO), MP_ROM_PTR(&pin_SPI4_MISO) },
{ MP_ROM_QSTR(MP_QSTR_SPI4_SCK), MP_ROM_PTR(&pin_SPI4_SCK) },
{ MP_ROM_QSTR(MP_QSTR_I2C0_BDT), MP_ROM_PTR(&pin_I2C0_BDT) },
{ MP_ROM_QSTR(MP_QSTR_I2C0_BCK), MP_ROM_PTR(&pin_I2C0_BCK) },
{ MP_ROM_QSTR(MP_QSTR_EMMC_DATA0), MP_ROM_PTR(&pin_EMMC_DATA0) },
{ MP_ROM_QSTR(MP_QSTR_EMMC_DATA1), MP_ROM_PTR(&pin_EMMC_DATA1) },
{ MP_ROM_QSTR(MP_QSTR_I2S0_DATA_OUT), MP_ROM_PTR(&pin_I2S0_DATA_OUT) },
{ MP_ROM_QSTR(MP_QSTR_I2S0_DATA_IN), MP_ROM_PTR(&pin_I2S0_DATA_IN) },
{ MP_ROM_QSTR(MP_QSTR_EMMC_DATA2), MP_ROM_PTR(&pin_EMMC_DATA2) },
{ MP_ROM_QSTR(MP_QSTR_EMMC_DATA3), MP_ROM_PTR(&pin_EMMC_DATA3) },
{ MP_ROM_QSTR(MP_QSTR_SEN_IRQ_IN), MP_ROM_PTR(&pin_SEN_IRQ_IN) },
{ MP_ROM_QSTR(MP_QSTR_EMMC_CLK), MP_ROM_PTR(&pin_EMMC_CLK) },
{ MP_ROM_QSTR(MP_QSTR_EMMC_CMD), MP_ROM_PTR(&pin_EMMC_CMD) },
{ MP_ROM_QSTR(MP_QSTR_I2S0_LRCK), MP_ROM_PTR(&pin_I2S0_LRCK) },
{ MP_ROM_QSTR(MP_QSTR_I2S0_BCK), MP_ROM_PTR(&pin_I2S0_BCK) },
{ MP_ROM_QSTR(MP_QSTR_UART2_CTS), MP_ROM_PTR(&pin_UART2_CTS) },
{ MP_ROM_QSTR(MP_QSTR_UART2_RTS), MP_ROM_PTR(&pin_UART2_RTS) },
{ MP_ROM_QSTR(MP_QSTR_I2S1_BCK), MP_ROM_PTR(&pin_I2S1_BCK) },
{ MP_ROM_QSTR(MP_QSTR_I2S1_LRCK), MP_ROM_PTR(&pin_I2S1_LRCK) },
{ MP_ROM_QSTR(MP_QSTR_I2S1_DATA_IN), MP_ROM_PTR(&pin_I2S1_DATA_IN) },
{ MP_ROM_QSTR(MP_QSTR_I2S1_DATA_OUT), MP_ROM_PTR(&pin_I2S1_DATA_OUT) },
{ MP_ROM_QSTR(MP_QSTR_LPADC0), MP_ROM_PTR(&pin_LPADC0) },
{ MP_ROM_QSTR(MP_QSTR_LPADC1), MP_ROM_PTR(&pin_LPADC1) },
{ MP_ROM_QSTR(MP_QSTR_LPADC2), MP_ROM_PTR(&pin_LPADC2) },
{ MP_ROM_QSTR(MP_QSTR_LPADC3), MP_ROM_PTR(&pin_LPADC3) },
{ MP_ROM_QSTR(MP_QSTR_HPADC0), MP_ROM_PTR(&pin_HPADC0) },
{ MP_ROM_QSTR(MP_QSTR_HPADC1), MP_ROM_PTR(&pin_HPADC1) },
};
MP_DEFINE_CONST_DICT(mcu_pin_globals, mcu_pin_globals_table);

View File

@ -40,10 +40,10 @@ typedef struct {
} pwmout_dev_t;
STATIC pwmout_dev_t pwmout_dev[] = {
{"/dev/pwm0", &pin_D6, -1, true},
{"/dev/pwm1", &pin_D5, -1, true},
{"/dev/pwm2", &pin_D9, -1, true},
{"/dev/pwm3", &pin_D3, -1, true}
{"/dev/pwm0", &pin_PWM0, -1, true},
{"/dev/pwm1", &pin_PWM1, -1, true},
{"/dev/pwm2", &pin_PWM2, -1, true},
{"/dev/pwm3", &pin_PWM3, -1, true}
};
pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t *self,