diff --git a/peripherals/Kconfig b/peripherals/Kconfig index 701bc3ca6d..7b4fe5fa96 100644 --- a/peripherals/Kconfig +++ b/peripherals/Kconfig @@ -79,6 +79,7 @@ source "$PKGS_DIR/packages/peripherals/RgPower/Kconfig" source "$PKGS_DIR/packages/peripherals/bt_mx02/Kconfig" source "$PKGS_DIR/packages/peripherals/gc9a01/Kconfig" source "$PKGS_DIR/packages/peripherals/ikun-485/Kconfig" +source "$PKGS_DIR/packages/peripherals/Servo_sg90/Kconfig" if RT_VER_NUM > 0x40101 source "$PKGS_DIR/packages/peripherals/spi-tools/Kconfig" diff --git a/peripherals/Servo_sg90/Kconfig b/peripherals/Servo_sg90/Kconfig new file mode 100644 index 0000000000..a5f36421eb --- /dev/null +++ b/peripherals/Servo_sg90/Kconfig @@ -0,0 +1,66 @@ + +# Kconfig file for package Servo_sg90 +menuconfig PKG_USING_SERVO + bool "Servo : you can use it to control servo,such as sg90" + default n + +if PKG_USING_SERVO + + config PKG_SERVO_SG90_PATH + string + default "/packages/peripherals/Servo_sg90" + + menuconfig PKG_USING_SG90 + bool "Enable SG90" + default n + + if PKG_USING_SG90 + config PKG_USING_SG90_DEMO + bool "Enable sg90 demo" + default n + config PKG_USING_PWM_DEV_NAME + string "pwm device name,example: pwm2" + default "pwm2" + config PKG_USING_PWM_DEV_CHANNEL + int "the channel of PKG_USING_PWM_DEV_NAME" + range 1 10 + default 1 + config PKG_USING_MAX_ANGLE + int "the max pulse ns" + range 0 999999999 + default 2500000 + config PKG_USING_MIN_ANGLE + int "the min pulse ns" + range 0 999999999 + default 500000 + config PKG_USING_SG90_MAX_ANGLE + int "the max angle of your servo" + range 0 360 + default 180 + config PKG_USING_SG90_PERIOD + int "the period of sg90" + range 0 999999999 + default 20000000 + + endif + + + choice + prompt "Version" + help + Select the package version + + config PKG_USING_SERVO_V100 + bool "v1.0.0" + + config PKG_USING_SERVO_LATEST_VERSION + bool "latest" + endchoice + + config PKG_SERVO_SG90_VER + string + default "v1.0.0" if PKG_USING_SERVO_V100 + default "latest" if PKG_USING_SERVO_LATEST_VERSION + +endif + diff --git a/peripherals/Servo_sg90/package.json b/peripherals/Servo_sg90/package.json new file mode 100644 index 0000000000..6439d5d67d --- /dev/null +++ b/peripherals/Servo_sg90/package.json @@ -0,0 +1,33 @@ +{ + "name": "Servo_sg90", + "description": "use a package to control Servo", + "description_zh": "使用一款软件包进行控制舵机", + "enable": "PKG_USING_SERVO_SG90", + "keywords": [ + "Servo_sg90" + ], + "category": "peripherals", + "author": { + "name": "CXSforHPU", + "email": "19511928573@163.com", + "github": "CXSforHPU" + }, + "license": "MIT", + "repository": "https://github.com/CXSforHPU/Servo_sg90", + "icon": "unknown", + "homepage": "https://github.com/CXSforHPU/Servo_sg90#readme", + "doc": "unknown", + "site": [ + { + "version": "v1.0.0", + "URL": "https://github.com/CXSforHPU/Servo_sg90/archive/refs/tags/Servo_sg90-1.0.0.zip", + "filename": "Servo_sg90-1.0.0.zip" + }, + { + "version": "latest", + "URL": "https://github.com/CXSforHPU/Servo_sg90.git", + "filename": "", + "VER_SHA": "master" + } + ] +}