Skip to content

Commit 55c52a3

Browse files
authored
Merge pull request #350 from lugamodder/main
Add RV1106 Luckfox Pico Max
2 parents 717172a + de897ac commit 55c52a3

File tree

5 files changed

+27
-0
lines changed

5 files changed

+27
-0
lines changed

adafruit_platformdetect/board.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,8 @@ def id(self) -> Optional[str]:
213213
board_id = boards.MILKV_DUO
214214
elif chip_id == chips.TH1520:
215215
board_id = boards.LICHEEPI_4A
216+
elif chip_id == chips.RV1106:
217+
board_id = self._rv1106_id()
216218
self._board_id = board_id
217219
return board_id
218220

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

809+
def _rv1106_id(self) -> Optional[str]:
810+
"""Check what type of rv1106 board."""
811+
board_value = self.detector.get_device_model()
812+
board = None
813+
if board_value and "Luckfox Pico Max" in board_value:
814+
board = boards.LUCKFOX_PICO_MAX
815+
return board
816+
807817
@property
808818
def any_siemens_simatic_iot2000(self) -> bool:
809819
"""Check whether the current board is a SIEMENS SIMATIC IOT2000 Gateway."""
@@ -989,6 +999,11 @@ def any_repka_board(self):
989999
"""Check whether the current board is any Repka device."""
9901000
return self.id in boards._REPKA_PI_IDS
9911001

1002+
@property
1003+
def any_luckfox_pico_board(self):
1004+
"""Check whether the current board is any Luckfox Pico device."""
1005+
return self.id in boards._LUCKFOX_IDS
1006+
9921007
@property
9931008
def os_environ_board(self) -> bool:
9941009
"""Check whether the current board is an OS environment variable special case."""
@@ -1054,6 +1069,7 @@ def lazily_generate_conditions():
10541069
yield self.any_olimex_lime2_board
10551070
yield self.any_repka_board
10561071
yield self.any_milkv_board
1072+
yield self.any_luckfox_pico_board
10571073

10581074
return any(condition for condition in lazily_generate_conditions())
10591075

adafruit_platformdetect/chip.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,9 @@ def _linux_id(self) -> Optional[str]:
248248
if self.detector.check_dt_compatible_value("rockchip,rk3588"):
249249
return chips.RK3588
250250

251+
if self.detector.check_dt_compatible_value("rockchip,rv1106"):
252+
return chips.RV1106
253+
251254
if self.detector.check_dt_compatible_value("amlogic,a311d"):
252255
return chips.A311D
253256

adafruit_platformdetect/constants/boards.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,9 @@
227227

228228
_KHADAS_40_PIN_IDS = (KHADAS_VIM3,)
229229

230+
# Luckfox Pico boards
231+
LUCKFOX_PICO_MAX = "LUCKFOX_PICO_MAX"
232+
230233
# Asus Tinkerboard
231234
_ASUS_TINKER_BOARD_IDS = (
232235
ASUS_TINKER_BOARD,
@@ -582,3 +585,6 @@
582585
)
583586

584587
_MILKV_IDS_ = (MILKV_DUO,)
588+
589+
# Luckfox
590+
_LUCKFOX_IDS = (LUCKFOX_PICO_MAX,)

adafruit_platformdetect/constants/chips.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
RK3566 = "RK3566"
6363
RK3568 = "RK3568"
6464
RK3588 = "RK3588"
65+
RV1106 = "RV1106"
6566
PENTIUM_N3710 = "PENTIUM_N3710" # SOC Braswell core
6667
CELERON_N5105 = "CELERON_N5105"
6768
STM32F405 = "STM32F405"

bin/detect.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
print("Is this an ASUS Tinker board?", detector.board.any_asus_tinker_board)
7070
print("Is this an STM32MP1 board?", detector.board.any_stm32mp1)
7171
print("Is this a MilkV board?", detector.board.any_milkv_board)
72+
print("Is this a Luckfox Pico board?", detector.board.any_luckfox_pico_board)
7273
print("Is this a generic Linux PC?", detector.board.generic_linux)
7374
print(
7475
"Is this an OS environment variable special case?", detector.board.os_environ_board

0 commit comments

Comments
 (0)