2023-08-17 14:00:17 -04:00
|
|
|
#include "shared-bindings/board/__init__.h"
|
|
|
|
#include "shared-module/displayio/__init__.h"
|
|
|
|
|
2023-08-22 06:44:52 -04:00
|
|
|
CIRCUITPY_BOARD_BUS_SINGLETON(porta_i2c, i2c, 1)
|
|
|
|
|
2023-08-17 14:00:17 -04:00
|
|
|
STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
|
|
|
|
CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS
|
|
|
|
|
|
|
|
// Power MAIN
|
2023-08-22 06:44:52 -04:00
|
|
|
{ MP_ROM_QSTR(MP_QSTR_POWER_MAIN), MP_ROM_PTR(&pin_GPIO2) },
|
2023-08-17 14:00:17 -04:00
|
|
|
|
|
|
|
// sd card
|
2023-08-22 06:44:52 -04:00
|
|
|
{ MP_ROM_QSTR(MP_QSTR_SD_CS), MP_ROM_PTR(&pin_GPIO4) },
|
2023-08-17 14:00:17 -04:00
|
|
|
|
2023-08-22 06:44:52 -04:00
|
|
|
// Power EXT - Controls 5V rail on Port A, B and C
|
|
|
|
{ MP_ROM_QSTR(MP_QSTR_POWER_EXT), MP_ROM_PTR(&pin_GPIO5) },
|
2023-08-17 14:00:17 -04:00
|
|
|
|
|
|
|
// SPI Internal
|
|
|
|
{ MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO12) },
|
|
|
|
{ MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO13) },
|
|
|
|
{ MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO14) },
|
|
|
|
|
|
|
|
// IT8951
|
|
|
|
{ MP_ROM_QSTR(MP_QSTR_IT8951_CS), MP_ROM_PTR(&pin_GPIO15) },
|
|
|
|
{ MP_ROM_QSTR(MP_QSTR_IT8951_RESET), MP_ROM_PTR(&pin_GPIO23) },
|
2023-08-22 06:44:52 -04:00
|
|
|
{ MP_ROM_QSTR(MP_QSTR_IT8951_POWER), MP_ROM_PTR(&pin_GPIO23) },
|
2023-08-17 14:00:17 -04:00
|
|
|
{ MP_ROM_QSTR(MP_QSTR_IT8951_BUSY), MP_ROM_PTR(&pin_GPIO27) },
|
|
|
|
|
2023-08-22 06:44:52 -04:00
|
|
|
// Port C - UART Mode - External pins
|
2023-08-17 14:00:17 -04:00
|
|
|
{ MP_ROM_QSTR(MP_QSTR_PORTC_RX), MP_ROM_PTR(&pin_GPIO18) },
|
2023-08-22 06:44:52 -04:00
|
|
|
{ MP_ROM_QSTR(MP_QSTR_RX2), MP_ROM_PTR(&pin_GPIO18) },
|
|
|
|
{ MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO18) },
|
|
|
|
|
2023-08-17 14:00:17 -04:00
|
|
|
{ MP_ROM_QSTR(MP_QSTR_PORTC_TX), MP_ROM_PTR(&pin_GPIO19) },
|
2023-08-22 06:44:52 -04:00
|
|
|
{ MP_ROM_QSTR(MP_QSTR_TX2), MP_ROM_PTR(&pin_GPIO19) },
|
|
|
|
{ MP_ROM_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_GPIO19) },
|
2023-08-17 14:00:17 -04:00
|
|
|
|
|
|
|
// I2C
|
|
|
|
{ MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO21) },
|
2023-08-22 06:44:52 -04:00
|
|
|
{ MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_GPIO21) },
|
2023-08-17 14:00:17 -04:00
|
|
|
|
2023-08-22 06:44:52 -04:00
|
|
|
{ MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO22) },
|
|
|
|
{ MP_ROM_QSTR(MP_QSTR_D22), MP_ROM_PTR(&pin_GPIO22) },
|
2023-08-17 14:00:17 -04:00
|
|
|
|
2023-08-22 06:44:52 -04:00
|
|
|
// Port A - I2C Mode - External pins
|
2023-08-17 14:00:17 -04:00
|
|
|
{ MP_ROM_QSTR(MP_QSTR_PORTA_SDA), MP_ROM_PTR(&pin_GPIO25) },
|
2023-08-22 06:44:52 -04:00
|
|
|
{ MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO25) },
|
|
|
|
|
2023-08-17 14:00:17 -04:00
|
|
|
{ MP_ROM_QSTR(MP_QSTR_PORTA_SCL), MP_ROM_PTR(&pin_GPIO32) },
|
2023-08-22 06:44:52 -04:00
|
|
|
{ MP_ROM_QSTR(MP_QSTR_D32), MP_ROM_PTR(&pin_GPIO32) },
|
2023-08-17 14:00:17 -04:00
|
|
|
|
2023-08-22 06:44:52 -04:00
|
|
|
// Port B - Generic I/O Mode - External pins
|
2023-08-17 14:00:17 -04:00
|
|
|
{ MP_ROM_QSTR(MP_QSTR_PORTB_IN), MP_ROM_PTR(&pin_GPIO26) },
|
2023-08-22 06:44:52 -04:00
|
|
|
{ MP_ROM_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_GPIO26) },
|
2023-08-22 10:17:40 -04:00
|
|
|
|
2023-08-17 14:00:17 -04:00
|
|
|
{ MP_ROM_QSTR(MP_QSTR_PORTB_OUT), MP_ROM_PTR(&pin_GPIO33) },
|
2023-08-22 06:44:52 -04:00
|
|
|
{ MP_ROM_QSTR(MP_QSTR_D33), MP_ROM_PTR(&pin_GPIO33) },
|
2023-08-17 14:00:17 -04:00
|
|
|
|
|
|
|
// Battery voltage
|
|
|
|
{ MP_ROM_QSTR(MP_QSTR_BATTERY_VOLTAGE), MP_ROM_PTR(&pin_GPIO35) },
|
|
|
|
|
|
|
|
// Touch
|
|
|
|
{ MP_ROM_QSTR(MP_QSTR_TOUCH_INT), MP_ROM_PTR(&pin_GPIO36) },
|
|
|
|
|
|
|
|
// buttons
|
|
|
|
{ MP_ROM_QSTR(MP_QSTR_BTN_UP), MP_ROM_PTR(&pin_GPIO37) },
|
|
|
|
{ MP_ROM_QSTR(MP_QSTR_BTN_CENTER), MP_ROM_PTR(&pin_GPIO38) },
|
|
|
|
{ MP_ROM_QSTR(MP_QSTR_BTN_DOWN), MP_ROM_PTR(&pin_GPIO39) },
|
|
|
|
|
|
|
|
|
|
|
|
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
|
2023-08-22 06:44:52 -04:00
|
|
|
{ MP_ROM_QSTR(MP_QSTR_PORTA_I2C), MP_ROM_PTR(&board_porta_i2c_obj) },
|
2023-08-17 14:00:17 -04:00
|
|
|
{ MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) },
|
|
|
|
{ MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) },
|
|
|
|
|
|
|
|
{ MP_ROM_QSTR(MP_QSTR_DISPLAY), MP_ROM_PTR(&displays[0].display)}
|
|
|
|
};
|
|
|
|
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);
|