Skip to content

Commit

Permalink
Merge pull request #350 from lugamodder/main
Browse files Browse the repository at this point in the history
Add RV1106 Luckfox Pico Max
  • Loading branch information
makermelissa committed May 9, 2024
2 parents 717172a + de897ac commit 55c52a3
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 0 deletions.
16 changes: 16 additions & 0 deletions adafruit_platformdetect/board.py
Expand Up @@ -213,6 +213,8 @@ def id(self) -> Optional[str]:
board_id = boards.MILKV_DUO
elif chip_id == chips.TH1520:
board_id = boards.LICHEEPI_4A
elif chip_id == chips.RV1106:
board_id = self._rv1106_id()
self._board_id = board_id
return board_id

Expand Down Expand Up @@ -804,6 +806,14 @@ def _siemens_simatic_iot2000_id(self) -> Optional[str]:
board = boards.SIEMENS_SIMATIC_IOT2050_BASIC
return board

def _rv1106_id(self) -> Optional[str]:
"""Check what type of rv1106 board."""
board_value = self.detector.get_device_model()
board = None
if board_value and "Luckfox Pico Max" in board_value:
board = boards.LUCKFOX_PICO_MAX
return board

@property
def any_siemens_simatic_iot2000(self) -> bool:
"""Check whether the current board is a SIEMENS SIMATIC IOT2000 Gateway."""
Expand Down Expand Up @@ -989,6 +999,11 @@ def any_repka_board(self):
"""Check whether the current board is any Repka device."""
return self.id in boards._REPKA_PI_IDS

@property
def any_luckfox_pico_board(self):
"""Check whether the current board is any Luckfox Pico device."""
return self.id in boards._LUCKFOX_IDS

@property
def os_environ_board(self) -> bool:
"""Check whether the current board is an OS environment variable special case."""
Expand Down Expand Up @@ -1054,6 +1069,7 @@ def lazily_generate_conditions():
yield self.any_olimex_lime2_board
yield self.any_repka_board
yield self.any_milkv_board
yield self.any_luckfox_pico_board

return any(condition for condition in lazily_generate_conditions())

Expand Down
3 changes: 3 additions & 0 deletions adafruit_platformdetect/chip.py
Expand Up @@ -248,6 +248,9 @@ def _linux_id(self) -> Optional[str]:
if self.detector.check_dt_compatible_value("rockchip,rk3588"):
return chips.RK3588

if self.detector.check_dt_compatible_value("rockchip,rv1106"):
return chips.RV1106

if self.detector.check_dt_compatible_value("amlogic,a311d"):
return chips.A311D

Expand Down
6 changes: 6 additions & 0 deletions adafruit_platformdetect/constants/boards.py
Expand Up @@ -227,6 +227,9 @@

_KHADAS_40_PIN_IDS = (KHADAS_VIM3,)

# Luckfox Pico boards
LUCKFOX_PICO_MAX = "LUCKFOX_PICO_MAX"

# Asus Tinkerboard
_ASUS_TINKER_BOARD_IDS = (
ASUS_TINKER_BOARD,
Expand Down Expand Up @@ -582,3 +585,6 @@
)

_MILKV_IDS_ = (MILKV_DUO,)

# Luckfox
_LUCKFOX_IDS = (LUCKFOX_PICO_MAX,)
1 change: 1 addition & 0 deletions adafruit_platformdetect/constants/chips.py
Expand Up @@ -62,6 +62,7 @@
RK3566 = "RK3566"
RK3568 = "RK3568"
RK3588 = "RK3588"
RV1106 = "RV1106"
PENTIUM_N3710 = "PENTIUM_N3710" # SOC Braswell core
CELERON_N5105 = "CELERON_N5105"
STM32F405 = "STM32F405"
Expand Down
1 change: 1 addition & 0 deletions bin/detect.py
Expand Up @@ -69,6 +69,7 @@
print("Is this an ASUS Tinker board?", detector.board.any_asus_tinker_board)
print("Is this an STM32MP1 board?", detector.board.any_stm32mp1)
print("Is this a MilkV board?", detector.board.any_milkv_board)
print("Is this a Luckfox Pico board?", detector.board.any_luckfox_pico_board)
print("Is this a generic Linux PC?", detector.board.generic_linux)
print(
"Is this an OS environment variable special case?", detector.board.os_environ_board
Expand Down

0 comments on commit 55c52a3

Please sign in to comment.