Skip to content

Commit

Permalink
Merge pull request #9833 from jepler/floppsy-revb
Browse files Browse the repository at this point in the history
  • Loading branch information
jepler authored Nov 27, 2024
2 parents 9659673 + c875b6d commit 68cdc53
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 31 deletions.
6 changes: 3 additions & 3 deletions ports/raspberrypi/boards/adafruit_floppsy_rp2040/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ void board_init(void) {
bus->base.type = &fourwire_fourwire_type;
common_hal_fourwire_fourwire_construct(bus,
spi,
&pin_GPIO25, // TFT_DC Command or data
&pin_GPIO29, // TFT_CS Chip select
CIRCUITPY_BOARD_TFT_DC,
CIRCUITPY_BOARD_TFT_CS,
NULL, // TFT_RESET Reset
40000000, // Baudrate
0, // Polarity
Expand All @@ -62,7 +62,7 @@ void board_init(void) {
MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command
display_init_sequence,
sizeof(display_init_sequence),
&pin_GPIO28, // backlight pin
CIRCUITPY_BOARD_TFT_BACKLIGHT,
NO_BRIGHTNESS_COMMAND,
1.0f, // brightness
false, // single_byte_bounds
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@
#define MICROPY_HW_BOARD_NAME "Adafruit Floppsy RP2040"
#define MICROPY_HW_MCU_NAME "rp2040"

#define MICROPY_HW_NEOPIXEL (&pin_GPIO15)
#define MICROPY_HW_NEOPIXEL (&pin_GPIO22)

#define DEFAULT_I2C_BUS_SCL (&pin_GPIO17)
#define DEFAULT_I2C_BUS_SDA (&pin_GPIO16)

#define CIRCUITPY_BOARD_TFT_DC (&pin_GPIO23)
#define CIRCUITPY_BOARD_TFT_CS (&pin_GPIO24)
#define CIRCUITPY_BOARD_TFT_BACKLIGHT (&pin_GPIO25)

#define CIRCUITPY_BOARD_SPI (1)
#define CIRCUITPY_BOARD_SPI_PIN {{.clock = &pin_GPIO26, .mosi = &pin_GPIO27}}
#define CIRCUITPY_BOARD_SPI_PIN {{.clock = &pin_GPIO18, .mosi = &pin_GPIO19, .miso = &pin_GPIO20 }}
60 changes: 34 additions & 26 deletions ports/raspberrypi/boards/adafruit_floppsy_rp2040/pins.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,42 +9,50 @@
static const mp_rom_map_elem_t board_module_globals_table[] = {
CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS

{ MP_OBJ_NEW_QSTR(MP_QSTR_DENSITY), MP_ROM_PTR(&pin_GPIO0) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SELECT), MP_ROM_PTR(&pin_GPIO1) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MOTOR), MP_ROM_PTR(&pin_GPIO2) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_DIRECTION), MP_ROM_PTR(&pin_GPIO3) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_STEP), MP_ROM_PTR(&pin_GPIO4) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_WRDATA), MP_ROM_PTR(&pin_GPIO5) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_WRGATE), MP_ROM_PTR(&pin_GPIO6) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SIDE), MP_ROM_PTR(&pin_GPIO7) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_FLOPPY_DIRECTION), MP_ROM_PTR(&pin_GPIO8) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_INDEX), MP_ROM_PTR(&pin_GPIO9) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_TRACK0), MP_ROM_PTR(&pin_GPIO10) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_WRPROT), MP_ROM_PTR(&pin_GPIO11) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_RDDATA), MP_ROM_PTR(&pin_GPIO12) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_READY), MP_ROM_PTR(&pin_GPIO13) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_PERIPH_RESET), MP_ROM_PTR(&pin_GPIO0) },

{ MP_OBJ_NEW_QSTR(MP_QSTR_DENSITY), MP_ROM_PTR(&pin_GPIO1) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SELECT), MP_ROM_PTR(&pin_GPIO2) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MOTOR), MP_ROM_PTR(&pin_GPIO3) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_DIRECTION), MP_ROM_PTR(&pin_GPIO4) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_STEP), MP_ROM_PTR(&pin_GPIO5) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_WRDATA), MP_ROM_PTR(&pin_GPIO6) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_WRGATE), MP_ROM_PTR(&pin_GPIO7) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SIDE), MP_ROM_PTR(&pin_GPIO8) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_FLOPPY_DIRECTION), MP_ROM_PTR(&pin_GPIO9) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_INDEX), MP_ROM_PTR(&pin_GPIO10) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_TRACK0), MP_ROM_PTR(&pin_GPIO11) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_WRPROT), MP_ROM_PTR(&pin_GPIO12) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_RDDATA), MP_ROM_PTR(&pin_GPIO13) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_READY), MP_ROM_PTR(&pin_GPIO14) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_FLOPPY_ENABLE), MP_ROM_PTR(&pin_GPIO15) },

{ MP_OBJ_NEW_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO16) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO17) },

{ MP_OBJ_NEW_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO14) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO22) },

{ MP_OBJ_NEW_QSTR(MP_QSTR_SD_CD), MP_ROM_PTR(&pin_GPIO24) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_AW9523_SD_CD), MP_ROM_INT(15) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_AW9523_BUTTON_LEFT), MP_ROM_INT(0) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_AW9523_BUTTON_UP), MP_ROM_INT(1) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_AW9523_BUTTON_RIGHT), MP_ROM_INT(2) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_AW9523_BUTTON_DOWN), MP_ROM_INT(3) },

{ MP_OBJ_NEW_QSTR(MP_QSTR_SD_SCK), MP_ROM_PTR(&pin_GPIO18) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SDIO_CLK), MP_ROM_PTR(&pin_GPIO18) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO18) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO19) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO20) },

{ MP_OBJ_NEW_QSTR(MP_QSTR_SD_MOSI), MP_ROM_PTR(&pin_GPIO19) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SDIO_COMMAND), MP_ROM_PTR(&pin_GPIO19) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SD_CS), MP_ROM_PTR(&pin_GPIO21) },

{ MP_OBJ_NEW_QSTR(MP_QSTR_SD_MISO), MP_ROM_PTR(&pin_GPIO20) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SDIO_DATA0), MP_ROM_PTR(&pin_GPIO20) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_TFT_DC), MP_ROM_PTR(CIRCUITPY_BOARD_TFT_DC) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_TFT_CS), MP_ROM_PTR(CIRCUITPY_BOARD_TFT_CS) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_TFT_BACKLIGHT), MP_ROM_PTR(CIRCUITPY_BOARD_TFT_BACKLIGHT) },

{ MP_OBJ_NEW_QSTR(MP_QSTR_SDIO_DATA1), MP_ROM_PTR(&pin_GPIO21) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SDIO_DATA2), MP_ROM_PTR(&pin_GPIO22) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO26) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO26) },

{ MP_OBJ_NEW_QSTR(MP_QSTR_SD_CS), MP_ROM_PTR(&pin_GPIO23) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SDIO_DATA3), MP_ROM_PTR(&pin_GPIO23) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO27) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO27) },

{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
{ MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_i2c_obj) },
Expand Down

0 comments on commit 68cdc53

Please sign in to comment.