Skip to content

Commit c86c53c

Browse files
authored
Merge pull request #24 from selfcustody/develop
Develop
2 parents 39bb833 + 0942fdc commit c86c53c

18 files changed

Lines changed: 4962 additions & 183 deletions

File tree

‎projects/maixpy_amigo/compile/overrides/components/micropython/port/src/omv/img/font.c‎

Lines changed: 123 additions & 33 deletions
Large diffs are not rendered by default.

‎projects/maixpy_bit/compile/overrides/components/micropython/port/src/omv/img/font.c‎

Lines changed: 92 additions & 25 deletions
Large diffs are not rendered by default.

‎projects/maixpy_cube/compile/overrides/components/micropython/port/src/omv/img/font.c‎

Lines changed: 92 additions & 25 deletions
Large diffs are not rendered by default.

‎projects/maixpy_dock/compile/overrides/components/micropython/port/src/omv/img/font.c‎

Lines changed: 92 additions & 25 deletions
Large diffs are not rendered by default.

‎projects/maixpy_m5stickv/compile/overrides/components/micropython/port/src/omv/img/font.c‎

Lines changed: 92 additions & 25 deletions
Large diffs are not rendered by default.

‎projects/maixpy_wonder_mv/compile/overrides/components/micropython/port/src/omv/img/font.c‎

Lines changed: 92 additions & 25 deletions
Large diffs are not rendered by default.

‎projects/maixpy_yahboom/compile/overrides/components/micropython/port/src/omv/img/font.c‎

Lines changed: 92 additions & 25 deletions
Large diffs are not rendered by default.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
cmake_minimum_required(VERSION 3.9)
2+
3+
4+
# Get SDK path
5+
if(NOT SDK_PATH)
6+
get_filename_component(SDK_PATH ../../ ABSOLUTE)
7+
if(EXISTS $ENV{MY_SDK_PATH})
8+
set(SDK_PATH $ENV{MY_SDK_PATH})
9+
endif()
10+
endif()
11+
12+
# Check SDK Path
13+
if(NOT EXISTS ${SDK_PATH})
14+
message(FATAL_ERROR "SDK path Error, Please set SDK_PATH or MY_SDK_PATH variable")
15+
endif()
16+
17+
# Get Toolchain path
18+
if(NOT CONFIG_TOOLCHAIN_PATH)
19+
if(EXISTS $ENV{MY_TOOLCHAIN_PATH})
20+
set(CONFIG_TOOLCHAIN_PATH $ENV{MY_TOOLCHAIN_PATH})
21+
endif()
22+
endif()
23+
24+
# Call compile
25+
include(${SDK_PATH}/tools/cmake/compile.cmake)
26+
27+
28+
# Project Name
29+
project(maixpy)
30+
31+
32+
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
try:
2+
import ujson as json
3+
except ImportError:
4+
import json
5+
6+
# todo: serial console not fully functioning for debugging and/or repl
7+
# yahboom_devkit pretends to be "yahboom" so that krux code can enable common features
8+
config = json.loads("""
9+
{
10+
"type": "yahboom",
11+
"lcd": {
12+
"dcx": 38,
13+
"ss": 36,
14+
"rst": 37,
15+
"clk": 39,
16+
"height": 240,
17+
"width": 320,
18+
"invert": 1,
19+
"dir": 96,
20+
"lcd_type": 0
21+
},
22+
"sdcard": {
23+
"sclk": 27,
24+
"mosi": 28,
25+
"miso": 26,
26+
"cs": 29
27+
},
28+
"board_info": {
29+
"BOOT_KEY": 16,
30+
"CONNEXT_A": 4,
31+
"CONNEXT_B": 5,
32+
"I2C_SDA": 10,
33+
"I2C_SCL": 9,
34+
"SPI_SCLK": 27,
35+
"SPI_MOSI": 28,
36+
"SPI_MISO": 26,
37+
"SPI_CS": 29
38+
},
39+
"krux": {
40+
"pins": {
41+
"BUTTON_A": 2,
42+
"BUTTON_B": 3,
43+
"BUTTON_C": 1,
44+
"TOUCH_IRQ": 12,
45+
"I2C_SDA": 10,
46+
"I2C_SCL": 9
47+
},
48+
"display": {
49+
"touch": true,
50+
"font": [8, 16],
51+
"font_wide": [16, 16]
52+
}
53+
}
54+
}
55+
""")
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
from Maix import FPIOA
2+
3+
class fm:
4+
fpioa = FPIOA()
5+
6+
def help():
7+
__class__.fpioa.help()
8+
9+
def get_pin_by_function(function):
10+
return __class__.fpioa.get_Pin_num(function)
11+
12+
def register(pin, function, force=True):
13+
pin_used = __class__.get_pin_by_function(function)
14+
if pin_used == pin:
15+
return
16+
if None != pin_used:
17+
info = "[Warning] function is used by %s(pin:%d)" % (
18+
fm.str_function(function), pin_used)
19+
if force == False:
20+
raise Exception(info)
21+
else:
22+
print(info)
23+
__class__.fpioa.set_function(pin, function)
24+
25+
def unregister(pin):
26+
__class__.fpioa.set_function(pin, fm.fpioa.RESV0)
27+
28+
def str_function(function):
29+
if fm.fpioa.GPIOHS0 <= function and function <= fm.fpioa.GPIO7:
30+
if fm.fpioa.GPIO0 <= function:
31+
return 'fm.fpioa.GPIO%d' % (function - fm.fpioa.GPIO0)
32+
return 'fm.fpioa.GPIOHS%d' % (function - fm.fpioa.GPIOHS0)
33+
return 'unknown'
34+
35+
def get_gpio_used():
36+
return [(__class__.str_function(f), __class__.get_pin_by_function(f)) for f in range(fm.fpioa.GPIOHS0, fm.fpioa.GPIO7 + 1)]

0 commit comments

Comments
 (0)