Merge pull request #289 from BlitzCityDIY/main

Adding support for CAN and RFM Feather
This commit is contained in:
Melissa LeBlanc-Williams 2023-04-11 12:55:35 -07:00 committed by GitHub
commit 80642040cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 1 deletions

View file

@ -648,6 +648,12 @@ class Board:
# Feather RP2040 ThinkInk # Feather RP2040 ThinkInk
if product == 0x812C: if product == 0x812C:
return boards.FEATHER_EPD_U2IF return boards.FEATHER_EPD_U2IF
# Feather RP2040 RFM
if product == 0x812E:
return boards.FEATHER_RFM_U2IF
# Feather RP2040 CAN
if product == 0x8130:
return boards.FEATHER_CAN_U2IF
# Will only reach here if a device was added in chip.py but here. # Will only reach here if a device was added in chip.py but here.
raise RuntimeError("RP2040_U2IF device was added to chip but not board.") raise RuntimeError("RP2040_U2IF device was added to chip but not board.")
@ -830,7 +836,9 @@ class Board:
yield self.board.GREATFET_ONE yield self.board.GREATFET_ONE
yield self.board.PICO_U2IF yield self.board.PICO_U2IF
yield self.board.FEATHER_U2IF yield self.board.FEATHER_U2IF
yield self.board.FEATHER_CAN_U2IF
yield self.board.FEATHER_EPD_U2IF yield self.board.FEATHER_EPD_U2IF
yield self.board.FEATHER_RFM_U2IF
yield self.board.ITSYBITY_U2IF yield self.board.ITSYBITY_U2IF
yield self.board.MACROPAD_U2IF yield self.board.MACROPAD_U2IF
yield self.board.QTPY_U2IF yield self.board.QTPY_U2IF
@ -907,11 +915,21 @@ class Board:
"""Check whether the current board is a Feather RP2040 w/ u2if.""" """Check whether the current board is a Feather RP2040 w/ u2if."""
return self.id == boards.FEATHER_U2IF return self.id == boards.FEATHER_U2IF
@property
def feather_can_u2if(self) -> bool:
"""Check whether the current board is a Feather CAN Bus RP2040 w/ u2if."""
return self.id == boards.FEATHER_CAN_U2IF
@property @property
def feather_epd_u2if(self) -> bool: def feather_epd_u2if(self) -> bool:
"""Check whether the current board is a Feather ThinkInk RP2040 w/ u2if.""" """Check whether the current board is a Feather ThinkInk RP2040 w/ u2if."""
return self.id == boards.FEATHER_EPD_U2IF return self.id == boards.FEATHER_EPD_U2IF
@property
def feather_rfm_u2if(self) -> bool:
"""Check whether the current board is a Feather RFM RP2040 w/ u2if."""
return self.id == boards.FEATHER_RFM_U2IF
@property @property
def itsybitsy_u2if(self) -> bool: def itsybitsy_u2if(self) -> bool:
"""Check whether the current board is a Itsy Bitsy w/ u2if.""" """Check whether the current board is a Itsy Bitsy w/ u2if."""

View file

@ -118,8 +118,20 @@ class Chip:
# QT2040 Trinkey # QT2040 Trinkey
# MacroPad RP2040 # MacroPad RP2040
# Feather RP2040 ThinkInk # Feather RP2040 ThinkInk
# Feather RP2040 RFM
# Feather RP2040 CAN Bus
vendor == 0x239A vendor == 0x239A
and product in (0x00F1, 0x00FD, 0x00F7, 0x0109, 0x0107, 0x812C) and product
in (
0x00F1,
0x00FD,
0x00F7,
0x0109,
0x0107,
0x812C,
0x812E,
0x8130,
)
): ):
self._chip_id = chips.RP2040_U2IF self._chip_id = chips.RP2040_U2IF
return self._chip_id return self._chip_id

View file

@ -149,7 +149,9 @@ PCDUINO3 = "PCDUINO3"
# https://github.com/execuc/u2if # https://github.com/execuc/u2if
PICO_U2IF = "PICO_U2IF" PICO_U2IF = "PICO_U2IF"
FEATHER_U2IF = "FEATHER_U2IF" FEATHER_U2IF = "FEATHER_U2IF"
FEATHER_CAN_U2IF = "FEATHER_CAN_U2IF"
FEATHER_EPD_U2IF = "FEATHER_EPD_U2IF" FEATHER_EPD_U2IF = "FEATHER_EPD_U2IF"
FEATHER_RFM_U2IF = "FEATHER_RFM_U2IF"
ITSYBITSY_U2IF = "ITSYBITSY_U2IF" ITSYBITSY_U2IF = "ITSYBITSY_U2IF"
MACROPAD_U2IF = "MACROPAD_U2IF" MACROPAD_U2IF = "MACROPAD_U2IF"
QTPY_U2IF = "QTPY_U2IF" QTPY_U2IF = "QTPY_U2IF"