forked from kendryte/kendryte-standalone-sdk
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b797321
commit 9d28c7b
Showing
41 changed files
with
1,424 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,30 @@ | |||
#project(components) | |||
|
|||
# create driver library | |||
message("CMAKE_CURRENT_LIST_DIR: ${CMAKE_CURRENT_LIST_DIR}") | |||
|
|||
FILE(GLOB_RECURSE LIB_SRC | |||
"${CMAKE_CURRENT_LIST_DIR}/*.h" | |||
"${CMAKE_CURRENT_LIST_DIR}/*.hpp" | |||
"${CMAKE_CURRENT_LIST_DIR}/*.cpp" | |||
"${CMAKE_CURRENT_LIST_DIR}/*.c" | |||
"${CMAKE_CURRENT_LIST_DIR}/*.s" | |||
"${CMAKE_CURRENT_LIST_DIR}/*.S" | |||
) | |||
|
|||
message("LIB_SRC: ${LIB_SRC}") | |||
|
|||
FILE(GLOB_RECURSE ASSEMBLY_FILES | |||
"${CMAKE_CURRENT_LIST_DIR}/*.s" | |||
"${CMAKE_CURRENT_LIST_DIR}/*.S" | |||
) | |||
|
|||
include_directories(${CMAKE_CURRENT_LIST_DIR}/boards/include ${CMAKE_CURRENT_LIST_DIR}/boards/m5stick/include ${CMAKE_CURRENT_LIST_DIR}/config) | |||
|
|||
SET_PROPERTY(SOURCE ${ASSEMBLY_FILES} PROPERTY LANGUAGE C) | |||
SET_SOURCE_FILES_PROPERTIES(${ASSEMBLY_FILES} PROPERTIES COMPILE_FLAGS "-x assembler-with-cpp -D __riscv64") | |||
|
|||
ADD_LIBRARY(components | |||
${LIB_SRC} | |||
) | |||
SET_TARGET_PROPERTIES(components PROPERTIES LINKER_LANGUAGE C) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,13 @@ | |||
if(CONFIG_BOARD_M5STICK) | |||
|
|||
list(APPEND ADD_INCLUDE "m5stick/include") | |||
aux_source_directory("m5stick/src" ADD_SRCS) | |||
list(APPEND ADD_REQUIREMENTS kendryte_sdk) | |||
|
|||
endif() | |||
|
|||
list(APPEND ADD_INCLUDE "include") | |||
aux_source_directory("src" BOARDS_SRCS) | |||
list(APPEND ADD_SRCS ${BOARDS_SRCS}) | |||
|
|||
register_component() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,30 @@ | |||
|
|||
menu "Board config" | |||
|
|||
choice BOARD | |||
bool "Select board" | |||
default BOARD_MAIX | |||
config BOARD_MAIX | |||
bool "Select board Maix" | |||
|
|||
config BOARD_M5STICK | |||
bool "Select board m5stick" | |||
endchoice | |||
|
|||
config LCD_DEFAULT_WIDTH | |||
int "LCD default width" | |||
default 320 | |||
|
|||
config LCD_DEFAULT_HEIGHT | |||
int "LCD default height" | |||
default 240 | |||
|
|||
config LCD_DEFAULT_FREQ | |||
int "LCD default driver clock frequency" | |||
default 15000000 | |||
|
|||
config SENSOR_FREQ | |||
int "Sensor clock(xclk) frequency" | |||
default 24000000 | |||
endmenu | |||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,21 @@ | |||
#ifndef __BOARDS_H | |||
#define __BOARDS_H | |||
|
|||
#ifdef __cplusplus | |||
extern "C" { | |||
#endif /* __cplusplus */ | |||
|
|||
#include "global_config.h" | |||
|
|||
// #define CONFIG_LCD_DEFAULT_FREQ 15000000 | |||
// #define CONFIG_LCD_DEFAULT_WIDTH 320 | |||
// #define CONFIG_LCD_DEFAULT_HEIGHT 240 | |||
|
|||
extern int boards_init(); | |||
|
|||
#ifdef __cplusplus | |||
} | |||
#endif | |||
|
|||
#endif //__BOARDS_H | |||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,17 @@ | |||
#ifndef __M5STICK_H | |||
#define __M5STICK_H | |||
|
|||
#ifdef __cplusplus | |||
extern "C" { | |||
#endif /* __cplusplus */ | |||
|
|||
#include "stdbool.h" | |||
|
|||
extern bool m5stick_init(); | |||
|
|||
#ifdef __cplusplus | |||
} | |||
#endif | |||
|
|||
#endif | |||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,13 @@ | |||
|
|||
//compile append define start | |||
|
|||
#define BUILD_TIME_YEAR 2020 | |||
#define BUILD_TIME_MONTH 1 | |||
#define BUILD_TIME_DAY 12 | |||
#define BUILD_TIME_HOUR 20 | |||
#define BUILD_TIME_MINUTE 49 | |||
#define BUILD_TIME_SECOND 33 | |||
#define BUILD_TIME_WEEK_OF_DAY 6 | |||
#define BUILD_TIME_YEAR_OF_DAY 12 | |||
|
|||
//compile append define end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,11 @@ | |||
|
|||
//compile append define start | |||
|
|||
#define BUILD_VERSION_MAJOR 0 | |||
#define BUILD_VERSION_MINOR 5 | |||
#define BUILD_VERSION_DEV 0 | |||
#define BUILD_VERSION_DEV2 12 | |||
#define BUILD_GIT_COMMIT_ID "g284ce83d6" | |||
#define BUILD_GIT_IS_DIRTY 0 | |||
|
|||
//compile append define end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,23 @@ | |||
# Generated by c_cpp_project_framework(https://github.com/Neutree/c_cpp_project_framework) | |||
### DO NOT edit this file!! ### | |||
|
|||
set(CONFIG_TOOLCHAIN_PATH "/opt/kendryte-toolchain/bin") | |||
set(CONFIG_TOOLCHAIN_PREFIX "riscv64-unknown-elf-") | |||
set(CONFIG_BOARD_MAIX "y") | |||
set(CONFIG_BOARD_M5STICK "") | |||
set(CONFIG_LCD_DEFAULT_WIDTH "320") | |||
set(CONFIG_LCD_DEFAULT_HEIGHT "240") | |||
set(CONFIG_LCD_DEFAULT_FREQ "15000000") | |||
set(CONFIG_SENSOR_FREQ "24000000") | |||
set(CONFIG_COMPONENT_DRIVERS_ENABLE "") | |||
set(CONFIG_COMPONENT_KENDRYTE_SDK_ENABLE "y") | |||
set(CONFIG_SDK_LOG_LEVEL "5") | |||
set(CONFIG_FREERTOS_ENABLE "y") | |||
set(CONFIG_STATIC_TASK_CLEAN_UP_ENABLE "") | |||
set(CONFIG_FREERTOS_MALLOC_CUSTOM "") | |||
set(CONFIG_FREEROTS_MINIMUM_STACK_SIZE "2048") | |||
set(CONFIG_MIC_ARRAY_ENABLE "") | |||
set(CONFIG_COMPONENT_MICROPYTHON_ENABLE "") | |||
set(CONFIG_COMPONENT_SPIFFS_ENABLE "") | |||
set(CONFIG_COMPONENT_UTILS_ENABLE "") | |||
set(CONFIGS_LIST CONFIG_TOOLCHAIN_PATH;CONFIG_TOOLCHAIN_PREFIX;CONFIG_BOARD_MAIX;CONFIG_BOARD_M5STICK;CONFIG_LCD_DEFAULT_WIDTH;CONFIG_LCD_DEFAULT_HEIGHT;CONFIG_LCD_DEFAULT_FREQ;CONFIG_SENSOR_FREQ;CONFIG_COMPONENT_DRIVERS_ENABLE;CONFIG_COMPONENT_KENDRYTE_SDK_ENABLE;CONFIG_SDK_LOG_LEVEL;CONFIG_FREERTOS_ENABLE;CONFIG_STATIC_TASK_CLEAN_UP_ENABLE;CONFIG_FREERTOS_MALLOC_CUSTOM;CONFIG_FREEROTS_MINIMUM_STACK_SIZE;CONFIG_MIC_ARRAY_ENABLE;CONFIG_COMPONENT_MICROPYTHON_ENABLE;CONFIG_COMPONENT_SPIFFS_ENABLE;CONFIG_COMPONENT_UTILS_ENABLE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,13 @@ | |||
/* Generated by Kconfiglib (https://github.com/ulfalizer/Kconfiglib) */ | |||
#define CONFIG_TOOLCHAIN_PATH "/opt/kendryte-toolchain/bin" | |||
#define CONFIG_TOOLCHAIN_PREFIX "riscv64-unknown-elf-" | |||
#define CONFIG_BOARD_M5STICK | |||
#define CONFIG_BOARD_MAIX 1 | |||
#define CONFIG_LCD_DEFAULT_WIDTH 320 | |||
#define CONFIG_LCD_DEFAULT_HEIGHT 240 | |||
#define CONFIG_LCD_DEFAULT_FREQ 15000000 | |||
#define CONFIG_SENSOR_FREQ 24000000 | |||
#define CONFIG_COMPONENT_KENDRYTE_SDK_ENABLE 1 | |||
#define CONFIG_SDK_LOG_LEVEL 5 | |||
#define CONFIG_FREERTOS_ENABLE 1 | |||
#define CONFIG_FREEROTS_MINIMUM_STACK_SIZE 2048 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,48 @@ | |||
# Generated by Kconfiglib (https://github.com/ulfalizer/Kconfiglib) | |||
|
|||
# | |||
# Toolchain configuration | |||
# | |||
CONFIG_TOOLCHAIN_PATH="/opt/kendryte-toolchain/bin" | |||
CONFIG_TOOLCHAIN_PREFIX="riscv64-unknown-elf-" | |||
# end of Toolchain configuration | |||
|
|||
# | |||
# Components configuration | |||
# | |||
|
|||
# | |||
# Board config | |||
# | |||
CONFIG_BOARD_MAIX=y | |||
# CONFIG_BOARD_M5STICK is not set | |||
CONFIG_LCD_DEFAULT_WIDTH=320 | |||
CONFIG_LCD_DEFAULT_HEIGHT=240 | |||
CONFIG_LCD_DEFAULT_FREQ=15000000 | |||
CONFIG_SENSOR_FREQ=24000000 | |||
# end of Board config | |||
|
|||
# CONFIG_COMPONENT_DRIVERS_ENABLE is not set | |||
CONFIG_COMPONENT_KENDRYTE_SDK_ENABLE=y | |||
|
|||
# | |||
# Kendryte SDK configurations | |||
# | |||
CONFIG_SDK_LOG_LEVEL=5 | |||
CONFIG_FREERTOS_ENABLE=y | |||
|
|||
# | |||
# FreeRTOS configurations | |||
# | |||
# CONFIG_STATIC_TASK_CLEAN_UP_ENABLE is not set | |||
# CONFIG_FREERTOS_MALLOC_CUSTOM is not set | |||
CONFIG_FREEROTS_MINIMUM_STACK_SIZE=2048 | |||
# end of FreeRTOS configurations | |||
|
|||
# CONFIG_MIC_ARRAY_ENABLE is not set | |||
# end of Kendryte SDK configurations | |||
|
|||
# CONFIG_COMPONENT_MICROPYTHON_ENABLE is not set | |||
# CONFIG_COMPONENT_SPIFFS_ENABLE is not set | |||
# CONFIG_COMPONENT_UTILS_ENABLE is not set | |||
# end of Components configuration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,34 @@ | |||
if(CONFIG_COMPONENT_DRIVERS_ENABLE) | |||
|
|||
list(APPEND ADD_INCLUDE "flash/include" | |||
"joystick/include" | |||
"lcd/include" | |||
"sd_card/include" | |||
) | |||
aux_source_directory("flash/src" FLASH_SRCS) | |||
aux_source_directory("joystick/src" JOYSTICK_SRCS) | |||
aux_source_directory("lcd/src" LCD_SRCS) | |||
aux_source_directory("sd_card/src" SD_CARD_SRCS) | |||
|
|||
if(CONFIG_WS2812_ENABLE) | |||
list(APPEND ADD_INCLUDE "ws2812/include") | |||
aux_source_directory("ws2812/src" WS2812_SRCS) | |||
list(APPEND ADD_SRCS ${WS2812_SRCS}) | |||
endif() | |||
if(CONFIG_HTPA_ENABLE) | |||
list(APPEND ADD_INCLUDE "htpa/include") | |||
aux_source_directory("htpa/src" HTPA_SRCS) | |||
list(APPEND ADD_SRCS ${HTPA_SRCS}) | |||
endif() | |||
|
|||
list(APPEND ADD_SRCS ${FLASH_SRCS} | |||
${JOYSTICK_SRCS} | |||
${LCD_SRCS} | |||
${SD_CARD_SRCS} | |||
) | |||
|
|||
list(APPEND ADD_REQUIREMENTS kendryte_sdk) | |||
|
|||
register_component() | |||
endif() | |||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,28 @@ | |||
|
|||
|
|||
config COMPONENT_DRIVERS_ENABLE | |||
bool "Enbale drivers component" | |||
default n | |||
select COMPONENT_KENDRYTE_SDK_ENABLE | |||
|
|||
menu "Drivers configuration" | |||
depends on COMPONENT_DRIVERS_ENABLE | |||
|
|||
menu "SD card" | |||
config SPI_SD_CARD_FORCE_HIGH_SPEED | |||
bool "Force SPI SD card high speed mode" | |||
default y | |||
endmenu | |||
|
|||
menu "WS2812" | |||
config WS2812_ENABLE | |||
bool "Enbale ws2812 over i2s component" | |||
default n | |||
endmenu | |||
menu "HTPA thermal sensor" | |||
config HTPA_ENABLE | |||
bool "Enbale HTPA thermal sensor" | |||
default n | |||
endmenu | |||
endmenu | |||
|
Oops, something went wrong.