adding back heritage pycubed board defs
This commit is contained in:
parent
4f10a91f85
commit
1ccaeeb619
|
@ -0,0 +1,61 @@
|
|||
/*
|
||||
* This file is part of the MicroPython project, http://micropython.org/
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2017 Scott Shawcroft for Adafruit Industries
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "supervisor/board.h"
|
||||
#include "py/mpconfig.h"
|
||||
#include "shared-bindings/nvm/ByteArray.h"
|
||||
#include "common-hal/microcontroller/Pin.h"
|
||||
#include "hal/include/hal_gpio.h"
|
||||
#include "shared-bindings/pwmio/PWMOut.h"
|
||||
|
||||
nvm_bytearray_obj_t bootcnt = {
|
||||
.base = {
|
||||
.type = &nvm_bytearray_type
|
||||
},
|
||||
.len = (uint32_t)8192,
|
||||
.start_address = (uint8_t *)(0x00080000 - 8192)
|
||||
};
|
||||
|
||||
|
||||
void board_init(void) {
|
||||
pwmio_pwmout_obj_t pwm;
|
||||
common_hal_pwmio_pwmout_construct(&pwm, &pin_PA23, 4096, 2, false);
|
||||
common_hal_pwmio_pwmout_never_reset(&pwm);
|
||||
}
|
||||
|
||||
bool board_requests_safe_mode(void) {
|
||||
return false;
|
||||
}
|
||||
|
||||
void reset_board(void) {
|
||||
uint8_t value_out = 0;
|
||||
common_hal_nvm_bytearray_get_bytes(&bootcnt,0,1,&value_out);
|
||||
++value_out;
|
||||
common_hal_nvm_bytearray_set_bytes(&bootcnt,0,&value_out,1);
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
|
||||
#define MICROPY_HW_BOARD_NAME "PyCubedv04"
|
||||
#define MICROPY_HW_MCU_NAME "samd51j19"
|
||||
#define CIRCUITPY_MCU_FAMILY samd51
|
||||
|
||||
#define MICROPY_HW_LED_STATUS (&pin_PA16)
|
||||
#define MICROPY_HW_NEOPIXEL (&pin_PA21)
|
||||
|
||||
#define AUTORESET_DELAY_MS 500
|
||||
|
||||
#define CIRCUITPY_INTERNAL_NVM_SIZE 8192
|
||||
|
||||
#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE)
|
||||
|
||||
// External flash W25Q80DV
|
||||
#define EXTERNAL_FLASH_QSPI_DUAL
|
||||
|
||||
#define BOARD_HAS_CRYSTAL 1
|
||||
|
||||
#define DEFAULT_I2C_BUS_SCL (&pin_PB13)
|
||||
#define DEFAULT_I2C_BUS_SDA (&pin_PB12)
|
||||
|
||||
#define DEFAULT_SPI_BUS_SCK (&pin_PA13)
|
||||
#define DEFAULT_SPI_BUS_MOSI (&pin_PA12)
|
||||
#define DEFAULT_SPI_BUS_MISO (&pin_PA14)
|
||||
|
||||
#define DEFAULT_UART_BUS_TX (&pin_PB02)
|
||||
#define DEFAULT_UART_BUS_RX (&pin_PB03)
|
||||
|
||||
#define IGNORE_PIN_PA24 1
|
||||
#define IGNORE_PIN_PA25 1
|
|
@ -0,0 +1,26 @@
|
|||
USB_VID = 0x04D8
|
||||
USB_PID = 0xEC44
|
||||
USB_PRODUCT = "PyCubed"
|
||||
USB_MANUFACTURER = "maholli"
|
||||
|
||||
CHIP_VARIANT = SAMD51J19A
|
||||
CHIP_FAMILY = samd51
|
||||
|
||||
QSPI_FLASH_FILESYSTEM = 1
|
||||
EXTERNAL_FLASH_DEVICES = W25Q80DV
|
||||
LONGINT_IMPL = MPZ
|
||||
|
||||
CIRCUITPY_DRIVE_LABEL = "PYCUBED"
|
||||
|
||||
# Not needed.
|
||||
CIRCUITPY_AUDIOBUSIO = 0
|
||||
CIRCUITPY_BITMAPTOOLS = 0
|
||||
CIRCUITPY_DISPLAYIO = 0
|
||||
CIRCUITPY_FRAMEBUFFERIO = 0
|
||||
CIRCUITPY_KEYPAD = 0
|
||||
CIRCUITPY_RGBMATRIX = 0
|
||||
CIRCUITPY_PS2IO = 0
|
||||
|
||||
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel
|
||||
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Register
|
||||
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_SD
|
|
@ -0,0 +1,57 @@
|
|||
#include "shared-bindings/board/__init__.h"
|
||||
#include "supervisor/board.h"
|
||||
|
||||
STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
|
||||
CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS
|
||||
|
||||
{ MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA13) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA12) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA14) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_xSDCS), MP_ROM_PTR(&pin_PA27) },
|
||||
|
||||
{ MP_ROM_QSTR(MP_QSTR_RELAY_A), MP_ROM_PTR(&pin_PB15) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_BURN1), MP_ROM_PTR(&pin_PB31) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_BURN2), MP_ROM_PTR(&pin_PA15) },
|
||||
|
||||
{ MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_PA06) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_L1PROG), MP_ROM_PTR(&pin_PA07) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_AIN4), MP_ROM_PTR(&pin_PA04) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_AIN5), MP_ROM_PTR(&pin_PA05) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_CHRG), MP_ROM_PTR(&pin_PB08) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_DAC0), MP_ROM_PTR(&pin_PA02) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_PA17), MP_ROM_PTR(&pin_PA17) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_PA18), MP_ROM_PTR(&pin_PA18) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_PA19), MP_ROM_PTR(&pin_PA19) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_PA20), MP_ROM_PTR(&pin_PA20) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_PA22), MP_ROM_PTR(&pin_PA22) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_PB16), MP_ROM_PTR(&pin_PB16) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_PB17), MP_ROM_PTR(&pin_PB17) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_PB22), MP_ROM_PTR(&pin_PB22) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_PB23), MP_ROM_PTR(&pin_PB23) },
|
||||
|
||||
{ MP_ROM_QSTR(MP_QSTR_RF1_RST), MP_ROM_PTR(&pin_PB00) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_RF1_CS), MP_ROM_PTR(&pin_PB30) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_RF1_IO0), MP_ROM_PTR(&pin_PB05) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_RF1_IO4), MP_ROM_PTR(&pin_PB04) },
|
||||
|
||||
{ MP_ROM_QSTR(MP_QSTR_RF2_RST), MP_ROM_PTR(&pin_PB14) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_RF2_CS), MP_ROM_PTR(&pin_PB09) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_RF2_IO1), MP_ROM_PTR(&pin_PB06) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_RF2_BSY), MP_ROM_PTR(&pin_PB07) },
|
||||
|
||||
{ MP_ROM_QSTR(MP_QSTR_EN_GPS), MP_ROM_PTR(&pin_PB01) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PB02) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PB03) },
|
||||
|
||||
{ MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB12) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB13) },
|
||||
|
||||
{ MP_ROM_QSTR(MP_QSTR_WDT_WDI), MP_ROM_PTR(&pin_PA23) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA21) },
|
||||
|
||||
{ MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) },
|
||||
{ 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_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);
|
|
@ -0,0 +1,61 @@
|
|||
/*
|
||||
* This file is part of the MicroPython project, http://micropython.org/
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2017 Scott Shawcroft for Adafruit Industries
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "supervisor/board.h"
|
||||
#include "py/mpconfig.h"
|
||||
#include "shared-bindings/nvm/ByteArray.h"
|
||||
#include "common-hal/microcontroller/Pin.h"
|
||||
#include "hal/include/hal_gpio.h"
|
||||
#include "shared-bindings/pwmio/PWMOut.h"
|
||||
|
||||
nvm_bytearray_obj_t bootcnt = {
|
||||
.base = {
|
||||
.type = &nvm_bytearray_type
|
||||
},
|
||||
.len = (uint32_t)8192,
|
||||
.start_address = (uint8_t *)(0x00080000 - 8192)
|
||||
};
|
||||
|
||||
|
||||
void board_init(void) {
|
||||
pwmio_pwmout_obj_t pwm;
|
||||
common_hal_pwmio_pwmout_construct(&pwm, &pin_PA23, 4096, 2, false);
|
||||
common_hal_pwmio_pwmout_never_reset(&pwm);
|
||||
}
|
||||
|
||||
bool board_requests_safe_mode(void) {
|
||||
return false;
|
||||
}
|
||||
|
||||
void reset_board(void) {
|
||||
uint8_t value_out = 0;
|
||||
common_hal_nvm_bytearray_get_bytes(&bootcnt,0,1,&value_out);
|
||||
++value_out;
|
||||
common_hal_nvm_bytearray_set_bytes(&bootcnt,0,&value_out,1);
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
#define MICROPY_HW_BOARD_NAME "PyCubedv04-MRAM"
|
||||
#define MICROPY_HW_MCU_NAME "samd51j19"
|
||||
#define CIRCUITPY_MCU_FAMILY samd51
|
||||
|
||||
#define MICROPY_HW_LED_STATUS (&pin_PA16)
|
||||
#define MICROPY_HW_NEOPIXEL (&pin_PA21)
|
||||
|
||||
// External flash MR2xH40 MRAM
|
||||
#define EXTERNAL_FLASH_QSPI_SINGLE
|
||||
#define EXTERNAL_FLASH_NO_JEDEC
|
||||
|
||||
#define AUTORESET_DELAY_MS 500
|
||||
|
||||
#define CIRCUITPY_INTERNAL_NVM_SIZE 8192
|
||||
|
||||
#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE)
|
||||
|
||||
#define BOARD_HAS_CRYSTAL 1
|
||||
|
||||
#define DEFAULT_I2C_BUS_SCL (&pin_PB13)
|
||||
#define DEFAULT_I2C_BUS_SDA (&pin_PB12)
|
||||
|
||||
#define DEFAULT_SPI_BUS_SCK (&pin_PA13)
|
||||
#define DEFAULT_SPI_BUS_MOSI (&pin_PA12)
|
||||
#define DEFAULT_SPI_BUS_MISO (&pin_PA14)
|
||||
|
||||
#define DEFAULT_UART_BUS_TX (&pin_PB02)
|
||||
#define DEFAULT_UART_BUS_RX (&pin_PB03)
|
||||
|
||||
#define IGNORE_PIN_PA24 1
|
||||
#define IGNORE_PIN_PA25 1
|
|
@ -0,0 +1,26 @@
|
|||
USB_VID = 0x04D8
|
||||
USB_PID = 0xEC44
|
||||
USB_PRODUCT = "PyCubed"
|
||||
USB_MANUFACTURER = "maholli"
|
||||
|
||||
CHIP_VARIANT = SAMD51J19A
|
||||
CHIP_FAMILY = samd51
|
||||
|
||||
QSPI_FLASH_FILESYSTEM = 1
|
||||
EXTERNAL_FLASH_DEVICES = MR2xH40
|
||||
LONGINT_IMPL = MPZ
|
||||
|
||||
CIRCUITPY_DRIVE_LABEL = "PYCUBED"
|
||||
|
||||
# Not needed.
|
||||
CIRCUITPY_AUDIOBUSIO = 0
|
||||
CIRCUITPY_BITMAPTOOLS = 0
|
||||
CIRCUITPY_DISPLAYIO = 0
|
||||
CIRCUITPY_FRAMEBUFFERIO = 0
|
||||
CIRCUITPY_KEYPAD = 0
|
||||
CIRCUITPY_RGBMATRIX = 0
|
||||
CIRCUITPY_PS2IO = 0
|
||||
|
||||
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel
|
||||
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Register
|
||||
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_SD
|
|
@ -0,0 +1,57 @@
|
|||
#include "shared-bindings/board/__init__.h"
|
||||
#include "supervisor/board.h"
|
||||
|
||||
STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
|
||||
CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS
|
||||
|
||||
{ MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA13) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA12) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA14) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_xSDCS), MP_ROM_PTR(&pin_PA27) },
|
||||
|
||||
{ MP_ROM_QSTR(MP_QSTR_RELAY_A), MP_ROM_PTR(&pin_PB15) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_BURN1), MP_ROM_PTR(&pin_PB31) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_BURN2), MP_ROM_PTR(&pin_PA15) },
|
||||
|
||||
{ MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_PA06) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_L1PROG), MP_ROM_PTR(&pin_PA07) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_AIN4), MP_ROM_PTR(&pin_PA04) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_AIN5), MP_ROM_PTR(&pin_PA05) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_CHRG), MP_ROM_PTR(&pin_PB08) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_DAC0), MP_ROM_PTR(&pin_PA02) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_PA17), MP_ROM_PTR(&pin_PA17) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_PA18), MP_ROM_PTR(&pin_PA18) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_PA19), MP_ROM_PTR(&pin_PA19) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_PA20), MP_ROM_PTR(&pin_PA20) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_PA22), MP_ROM_PTR(&pin_PA22) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_PB16), MP_ROM_PTR(&pin_PB16) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_PB17), MP_ROM_PTR(&pin_PB17) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_PB22), MP_ROM_PTR(&pin_PB22) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_PB23), MP_ROM_PTR(&pin_PB23) },
|
||||
|
||||
{ MP_ROM_QSTR(MP_QSTR_RF1_RST), MP_ROM_PTR(&pin_PB00) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_RF1_CS), MP_ROM_PTR(&pin_PB30) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_RF1_IO0), MP_ROM_PTR(&pin_PB05) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_RF1_IO4), MP_ROM_PTR(&pin_PB04) },
|
||||
|
||||
{ MP_ROM_QSTR(MP_QSTR_RF2_RST), MP_ROM_PTR(&pin_PB14) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_RF2_CS), MP_ROM_PTR(&pin_PB09) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_RF2_IO1), MP_ROM_PTR(&pin_PB06) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_RF2_BSY), MP_ROM_PTR(&pin_PB07) },
|
||||
|
||||
{ MP_ROM_QSTR(MP_QSTR_EN_GPS), MP_ROM_PTR(&pin_PB01) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PB02) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PB03) },
|
||||
|
||||
{ MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB12) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB13) },
|
||||
|
||||
{ MP_ROM_QSTR(MP_QSTR_WDT_WDI), MP_ROM_PTR(&pin_PA23) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA21) },
|
||||
|
||||
{ MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) },
|
||||
{ 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_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);
|
Loading…
Reference in New Issue