diff --git a/demo/stm32g030c8/MDK-ARM/RGB_ASM.uvprojx b/demo/stm32g030c8/MDK-ARM/RGB_ASM.uvprojx new file mode 100644 index 000000000..8bb8816d8 --- /dev/null +++ b/demo/stm32g030c8/MDK-ARM/RGB_ASM.uvprojx @@ -0,0 +1,403 @@ + + + + 2.1 + +
### uVision Project, (C) Keil Software
+ + + + stm32g030c8 + 0x4 + ARM-ADS + 6160000::V6.16::ARMCLANG + 1 + + + STM32G030C8Tx + STMicroelectronics + Keil.STM32G0xx_DFP.1.3.0 + http://www.keil.com/pack/ + IRAM(0x20000000-0x20001FFF) IROM(0x8000000-0x800FFFF) CLOCK(8000000) CPUTYPE("Cortex-M0+") TZ + + + + 0 + + + + + + + + + + + $$Device:STM32G030C8Tx$CMSIS\SVD\STM32G030.svd + 0 + 0 + + + + + + + 0 + 0 + 0 + 0 + 1 + + stm32g030c8\ + stm32g030c8 + 0 + 1 + 1 + 1 + 1 + + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + 1 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 0 + + + SARMCM3.DLL + -REMAP + DARMCM1.DLL + -pCM0+ + SARMCM3.DLL + + TARMCM1.DLL + -pCM0+ + + + + 1 + 0 + 0 + 0 + 16 + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + "" () + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M0+" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 0 + 3 + 4 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x2000 + + + 1 + 0x8000000 + 0x10000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x10000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x2000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 3 + 0 + 0 + 1 + 0 + 0 + 3 + 3 + 1 + 1 + 0 + 0 + 0 + + + USE_HAL_DRIVER,STM32G030xx,HAL_ADC_MODULE_ENABLED,HAL_UART_MODULE_ENABLED,HAL_USART_MODULE_ENABLED,HAL_TIM_MODULE_ENABLED + + ../Core/Inc; ../Drivers/STM32G0xx_HAL_Driver/Inc; ../Drivers/STM32G0xx_HAL_Driver/Inc/Legacy; ../Drivers/CMSIS/Device/ST/STM32G0xx/Include; ../Drivers/CMSIS/Include; ..\pikascript\pikascript-core; ..\pikascript\pikascript-api; ..\pikascript\pikascript-lib\STM32 + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 4 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + + + + + + + + + + + + + + + RGB_ASM + + + RGB_ASM.c + 1 + ..\pikascript\pikascript-lib\PikaPiZero\RGB_ASM.c + + + + + + + + + + + + + +
diff --git a/demo/stm32g030c8/MDK-ARM/pikascript-core.uvprojx b/demo/stm32g030c8/MDK-ARM/pikascript-core.uvprojx new file mode 100644 index 000000000..eaaf3baa2 --- /dev/null +++ b/demo/stm32g030c8/MDK-ARM/pikascript-core.uvprojx @@ -0,0 +1,473 @@ + + + + 2.1 + +
### uVision Project, (C) Keil Software
+ + + + stm32g030c8 + 0x4 + ARM-ADS + 6160000::V6.16::ARMCLANG + 1 + + + STM32G030C8Tx + STMicroelectronics + Keil.STM32G0xx_DFP.1.3.0 + http://www.keil.com/pack/ + IRAM(0x20000000-0x20001FFF) IROM(0x8000000-0x800FFFF) CLOCK(8000000) CPUTYPE("Cortex-M0+") TZ + + + + 0 + + + + + + + + + + + $$Device:STM32G030C8Tx$CMSIS\SVD\STM32G030.svd + 0 + 0 + + + + + + + 0 + 0 + 0 + 0 + 1 + + stm32g030c8\ + stm32g030c8 + 0 + 1 + 1 + 1 + 1 + + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + 1 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 0 + + + SARMCM3.DLL + -REMAP + DARMCM1.DLL + -pCM0+ + SARMCM3.DLL + + TARMCM1.DLL + -pCM0+ + + + + 1 + 0 + 0 + 0 + 16 + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + "" () + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M0+" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 0 + 3 + 4 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x2000 + + + 1 + 0x8000000 + 0x10000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x10000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x2000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 3 + 0 + 0 + 1 + 0 + 0 + 3 + 3 + 1 + 1 + 0 + 0 + 0 + + + USE_HAL_DRIVER,STM32G030xx,HAL_ADC_MODULE_ENABLED,HAL_UART_MODULE_ENABLED,HAL_USART_MODULE_ENABLED,HAL_TIM_MODULE_ENABLED + + ../Core/Inc; ../Drivers/STM32G0xx_HAL_Driver/Inc; ../Drivers/STM32G0xx_HAL_Driver/Inc/Legacy; ../Drivers/CMSIS/Device/ST/STM32G0xx/Include; ../Drivers/CMSIS/Include; ..\pikascript\pikascript-core; ..\pikascript\pikascript-api; ..\pikascript\pikascript-lib\STM32 + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 4 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + + + + + + + + + + + + + + + pikascript-core + + + BaseObj.c + 1 + ..\pikascript\pikascript-core\BaseObj.c + + + dataArg.c + 1 + ..\pikascript\pikascript-core\dataArg.c + + + dataArgs.c + 1 + ..\pikascript\pikascript-core\dataArgs.c + + + dataLink.c + 1 + ..\pikascript\pikascript-core\dataLink.c + + + dataLinkNode.c + 1 + ..\pikascript\pikascript-core\dataLinkNode.c + + + dataMemory.c + 1 + ..\pikascript\pikascript-core\dataMemory.c + + + dataString.c + 1 + ..\pikascript\pikascript-core\dataString.c + + + dataStrs.c + 1 + ..\pikascript\pikascript-core\dataStrs.c + + + method.c + 1 + ..\pikascript\pikascript-core\method.c + + + PikaBlock.c + 1 + ..\pikascript\pikascript-core\PikaBlock.c + + + PikaIf.c + 1 + ..\pikascript\pikascript-core\PikaIf.c + + + PikaInvoke.c + 1 + ..\pikascript\pikascript-core\PikaInvoke.c + + + PikaObj.c + 1 + ..\pikascript\pikascript-core\PikaObj.c + + + PikaWhile.c + 1 + ..\pikascript\pikascript-core\PikaWhile.c + + + TinyObj.c + 1 + ..\pikascript\pikascript-core\TinyObj.c + + + + + + + + + + + + + +
diff --git a/demo/stm32g030c8/MDK-ARM/stm32g030c8.uvprojx b/demo/stm32g030c8/MDK-ARM/stm32g030c8.uvprojx index 432324fb3..4a44c2185 100644 --- a/demo/stm32g030c8/MDK-ARM/stm32g030c8.uvprojx +++ b/demo/stm32g030c8/MDK-ARM/stm32g030c8.uvprojx @@ -313,7 +313,7 @@ 1 - 7 + 1 0 0 1 @@ -332,7 +332,7 @@ 3 1 1 - 1 + 0 0 0 @@ -642,86 +642,6 @@ - - pikascript-core - - - BaseObj.c - 1 - ..\pikascript\pikascript-core\BaseObj.c - - - dataArg.c - 1 - ..\pikascript\pikascript-core\dataArg.c - - - dataArgs.c - 1 - ..\pikascript\pikascript-core\dataArgs.c - - - dataLink.c - 1 - ..\pikascript\pikascript-core\dataLink.c - - - dataLinkNode.c - 1 - ..\pikascript\pikascript-core\dataLinkNode.c - - - dataMemory.c - 1 - ..\pikascript\pikascript-core\dataMemory.c - - - dataString.c - 1 - ..\pikascript\pikascript-core\dataString.c - - - dataStrs.c - 1 - ..\pikascript\pikascript-core\dataStrs.c - - - method.c - 1 - ..\pikascript\pikascript-core\method.c - - - PikaBlock.c - 1 - ..\pikascript\pikascript-core\PikaBlock.c - - - PikaIf.c - 1 - ..\pikascript\pikascript-core\PikaIf.c - - - PikaInvoke.c - 1 - ..\pikascript\pikascript-core\PikaInvoke.c - - - PikaObj.c - 1 - ..\pikascript\pikascript-core\PikaObj.c - - - PikaWhile.c - 1 - ..\pikascript\pikascript-core\PikaWhile.c - - - TinyObj.c - 1 - ..\pikascript\pikascript-core\TinyObj.c - - - pikascript-api @@ -875,6 +795,21 @@ 1 ..\pikascript\pikascript-lib\PikaPiZero\PikaPiZero_RGB.c + + RGB_ASM.lib + 4 + ..\pikascript\pikascript-lib\PikaPiZero\RGB_ASM.lib + + + + + pikascript-core + + + pikascript-core.lib + 4 + ..\pikascript\pikascript-core\pikascript-core.lib + @@ -887,8 +822,8 @@ - - + + diff --git a/demo/stm32g030c8/MDK-ARM/stm32g030c8/ArInp.Scr b/demo/stm32g030c8/MDK-ARM/stm32g030c8/ArInp.Scr new file mode 100644 index 000000000..5083eaef8 --- /dev/null +++ b/demo/stm32g030c8/MDK-ARM/stm32g030c8/ArInp.Scr @@ -0,0 +1,16 @@ +--create stm32g030c8\stm32g030c8.lib +stm32g030c8\baseobj.o +stm32g030c8\dataarg.o +stm32g030c8\dataargs.o +stm32g030c8\datalink.o +stm32g030c8\datalinknode.o +stm32g030c8\datamemory.o +stm32g030c8\datastring.o +stm32g030c8\datastrs.o +stm32g030c8\method.o +stm32g030c8\pikablock.o +stm32g030c8\pikaif.o +stm32g030c8\pikainvoke.o +stm32g030c8\pikaobj.o +stm32g030c8\pikawhile.o +stm32g030c8\tinyobj.o diff --git a/demo/stm32g030c8/MDK-ARM/stm32g030c8/RGB_ASM.lib b/demo/stm32g030c8/MDK-ARM/stm32g030c8/RGB_ASM.lib new file mode 100644 index 000000000..3d8f27a61 Binary files /dev/null and b/demo/stm32g030c8/MDK-ARM/stm32g030c8/RGB_ASM.lib differ diff --git a/demo/stm32g030c8/MDK-ARM/stm32g030c8/stm32g030c8.lib b/demo/stm32g030c8/MDK-ARM/stm32g030c8/stm32g030c8.lib new file mode 100644 index 000000000..c163afe95 Binary files /dev/null and b/demo/stm32g030c8/MDK-ARM/stm32g030c8/stm32g030c8.lib differ diff --git a/demo/stm32g030c8/pikascript/PikaPiZero.py b/demo/stm32g030c8/pikascript/PikaPiZero.py index 9d7ce162c..52ebf312c 100644 --- a/demo/stm32g030c8/pikascript/PikaPiZero.py +++ b/demo/stm32g030c8/pikascript/PikaPiZero.py @@ -10,4 +10,10 @@ class RGB(PikaStdLib.SysObj): pass def red(): pass + def green(): + pass + def blue(): + pass + def white(): + pass diff --git a/demo/stm32g030c8/pikascript/main.py b/demo/stm32g030c8/pikascript/main.py index 34323cb3e..d139d4566 100644 --- a/demo/stm32g030c8/pikascript/main.py +++ b/demo/stm32g030c8/pikascript/main.py @@ -4,18 +4,9 @@ import PikaStdLib time = STM32.Time() uart = STM32.UART() -<<<<<<< HEAD uart.init() -uart.setId() +uart.setId(1) uart.enable() -======= -pwm = STM32.PWM() -pwm.init() -pwm.setPin('PA8') -pwm.setFrequency(2000) -pwm.setDuty(0.5) -pwm.enable() ->>>>>>> 75642075742a22be2a2f4f20354f9ee028543b7c print('initing rgb...') rgb = PikaPiZero.RGB() @@ -27,7 +18,11 @@ mem = PikaStdLib.MemChecker() print('mem max:') mem.max() while True: - time.sleep_ms(500) - rgb.red() - time.sleep_ms(500) + time.sleep_ms(250) rgb.red() + time.sleep_ms(250) + rgb.green() + time.sleep_ms(250) + rgb.white() + time.sleep_ms(250) + rgb.blue() diff --git a/demo/stm32g030c8/pikascript/pikascript-api/PikaMain-api.c b/demo/stm32g030c8/pikascript/pikascript-api/PikaMain-api.c index 2c5f8df1e..46eed30a3 100644 --- a/demo/stm32g030c8/pikascript/pikascript-api/PikaMain-api.c +++ b/demo/stm32g030c8/pikascript/pikascript-api/PikaMain-api.c @@ -3,29 +3,23 @@ /* ******************************** */ #include "PikaMain.h" #include "PikaStdLib_SysObj.h" -<<<<<<< HEAD #include "PikaStdLib_MemChecker.h" #include "PikaPiZero_RGB.h" -======= -#include "STM32_PWM.h" ->>>>>>> 75642075742a22be2a2f4f20354f9ee028543b7c #include "STM32_Time.h" +#include "STM32_UART.h" #include #include #include "BaseObj.h" PikaObj *New_PikaMain(Args *args){ PikaObj *self = New_PikaStdLib_SysObj(args); -<<<<<<< HEAD obj_import(self, "PikaStdLib_MemChecker", New_PikaStdLib_MemChecker); obj_newObj(self, "mem", "PikaStdLib_MemChecker"); obj_import(self, "PikaPiZero_RGB", New_PikaPiZero_RGB); obj_newObj(self, "rgb", "PikaPiZero_RGB"); -======= - obj_import(self, "STM32_PWM", New_STM32_PWM); - obj_newObj(self, "pwm", "STM32_PWM"); ->>>>>>> 75642075742a22be2a2f4f20354f9ee028543b7c obj_import(self, "STM32_Time", New_STM32_Time); obj_newObj(self, "time", "STM32_Time"); + obj_import(self, "STM32_UART", New_STM32_UART); + obj_newObj(self, "uart", "STM32_UART"); return self; } diff --git a/demo/stm32g030c8/pikascript/pikascript-api/PikaPiZero_RGB-api.c b/demo/stm32g030c8/pikascript/pikascript-api/PikaPiZero_RGB-api.c index aa5e6ddcd..397927fb1 100644 --- a/demo/stm32g030c8/pikascript/pikascript-api/PikaPiZero_RGB-api.c +++ b/demo/stm32g030c8/pikascript/pikascript-api/PikaPiZero_RGB-api.c @@ -8,10 +8,18 @@ #include #include "BaseObj.h" +void PikaPiZero_RGB_blueMethod(PikaObj *self, Args *args){ + PikaPiZero_RGB_blue(self); +} + void PikaPiZero_RGB_enableMethod(PikaObj *self, Args *args){ PikaPiZero_RGB_enable(self); } +void PikaPiZero_RGB_greenMethod(PikaObj *self, Args *args){ + PikaPiZero_RGB_green(self); +} + void PikaPiZero_RGB_initMethod(PikaObj *self, Args *args){ PikaPiZero_RGB_init(self); } @@ -20,12 +28,19 @@ void PikaPiZero_RGB_redMethod(PikaObj *self, Args *args){ PikaPiZero_RGB_red(self); } +void PikaPiZero_RGB_whiteMethod(PikaObj *self, Args *args){ + PikaPiZero_RGB_white(self); +} + PikaObj *New_PikaPiZero_RGB(Args *args){ PikaObj *self = New_PikaStdLib_SysObj(args); obj_import(self, "STM32_GPIO", New_STM32_GPIO); obj_newObj(self, "pin", "STM32_GPIO"); + class_defineMethod(self, "blue()", PikaPiZero_RGB_blueMethod); class_defineMethod(self, "enable()", PikaPiZero_RGB_enableMethod); + class_defineMethod(self, "green()", PikaPiZero_RGB_greenMethod); class_defineMethod(self, "init()", PikaPiZero_RGB_initMethod); class_defineMethod(self, "red()", PikaPiZero_RGB_redMethod); + class_defineMethod(self, "white()", PikaPiZero_RGB_whiteMethod); return self; } diff --git a/demo/stm32g030c8/pikascript/pikascript-api/PikaPiZero_RGB.h b/demo/stm32g030c8/pikascript/pikascript-api/PikaPiZero_RGB.h index 775e40d4a..095c7bee4 100644 --- a/demo/stm32g030c8/pikascript/pikascript-api/PikaPiZero_RGB.h +++ b/demo/stm32g030c8/pikascript/pikascript-api/PikaPiZero_RGB.h @@ -9,8 +9,11 @@ PikaObj *New_PikaPiZero_RGB(Args *args); +void PikaPiZero_RGB_blue(PikaObj *self); void PikaPiZero_RGB_enable(PikaObj *self); +void PikaPiZero_RGB_green(PikaObj *self); void PikaPiZero_RGB_init(PikaObj *self); void PikaPiZero_RGB_red(PikaObj *self); +void PikaPiZero_RGB_white(PikaObj *self); #endif diff --git a/demo/stm32g030c8/pikascript/pikascript-api/compiler-info.txt b/demo/stm32g030c8/pikascript/pikascript-api/compiler-info.txt index 709750b7a..c3fb52afb 100644 --- a/demo/stm32g030c8/pikascript/pikascript-api/compiler-info.txt +++ b/demo/stm32g030c8/pikascript/pikascript-api/compiler-info.txt @@ -1,5 +1 @@ -<<<<<<< HEAD -Compiler { dist_path: "pikascript-api/", source_path: "", class_list: {"PikaMain": ClassInfo { this_class_name: "PikaMain", super_class_name: "PikaStdLib_SysObj", method_list: {}, object_list: {"mem": ObjectInfo { class_name: "PikaMain", name: "mem", import_class_name: "PikaStdLib_MemChecker" }, "rgb": ObjectInfo { class_name: "PikaMain", name: "rgb", import_class_name: "PikaPiZero_RGB" }, "time": ObjectInfo { class_name: "PikaMain", name: "time", import_class_name: "STM32_Time" }, "uart": ObjectInfo { class_name: "PikaMain", name: "uart", import_class_name: "STM32_UART" }}, import_list: {}, script_list: Script { content: " obj_run(pikaMain, \"uart.init()\");\r\n obj_run(pikaMain, \"uart.setId()\");\r\n obj_run(pikaMain, \"uart.enable()\");\r\n obj_run(pikaMain, \"print('initing rgb...')\");\r\n obj_run(pikaMain, \"rgb.init()\");\r\n obj_run(pikaMain, \"rgb.enable()\");\r\n obj_run(pikaMain, \"print('init rgb ok!')\");\r\n obj_run(pikaMain, \"print('mem max:')\");\r\n obj_run(pikaMain, \"mem.max()\");\r\n obj_run(pikaMain, \"while True:\");\r\n obj_run(pikaMain, \" time.sleep_ms(500)\");\r\n obj_run(pikaMain, \" rgb.red()\");\r\n obj_run(pikaMain, \" time.sleep_ms(500)\");\r\n obj_run(pikaMain, \" rgb.red()\");\r\n" } }, "PikaPiZero_RGB": ClassInfo { this_class_name: "PikaPiZero_RGB", super_class_name: "PikaStdLib_SysObj", method_list: {"enable": MethodInfo { class_name: "PikaPiZero_RGB", name: "enable", arg_list: None, return_type: None }, "init": MethodInfo { class_name: "PikaPiZero_RGB", name: "init", arg_list: None, return_type: None }, "red": MethodInfo { class_name: "PikaPiZero_RGB", name: "red", arg_list: None, return_type: None }}, object_list: {"pin": ObjectInfo { class_name: "PikaPiZero_RGB", name: "pin", import_class_name: "STM32_GPIO" }}, import_list: {}, script_list: Script { content: "" } }, "PikaStdDevice_ADC": ClassInfo { this_class_name: "PikaStdDevice_ADC", super_class_name: "TinyObj", method_list: {"enable": MethodInfo { class_name: "PikaStdDevice_ADC", name: "enable", arg_list: None, return_type: None }, "init": MethodInfo { class_name: "PikaStdDevice_ADC", name: "init", arg_list: None, return_type: None }, "platformEnable": MethodInfo { class_name: "PikaStdDevice_ADC", name: "platformEnable", arg_list: Some(ArgList { py_arg_list: "pin:str", list: {"pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: None }, "platformRead": MethodInfo { class_name: "PikaStdDevice_ADC", name: "platformRead", arg_list: Some(ArgList { py_arg_list: "pin:str", list: {"pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: Some(PyType { type_name: "float" }) }, "read": MethodInfo { class_name: "PikaStdDevice_ADC", name: "read", arg_list: None, return_type: Some(PyType { type_name: "float" }) }, "setPin": MethodInfo { class_name: "PikaStdDevice_ADC", name: "setPin", arg_list: Some(ArgList { py_arg_list: "pin:str", list: {"pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "PikaStdDevice_GPIO": ClassInfo { this_class_name: "PikaStdDevice_GPIO", super_class_name: "TinyObj", method_list: {"disable": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "disable", arg_list: None, return_type: None }, "enable": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "enable", arg_list: None, return_type: None }, "getMode": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "getMode", arg_list: None, return_type: Some(PyType { type_name: "str" }) }, "getPin": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "getPin", arg_list: None, return_type: Some(PyType { type_name: "str" }) }, "high": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "high", arg_list: None, return_type: None }, "init": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "init", arg_list: None, return_type: None }, "low": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "low", arg_list: None, return_type: None }, "platformDisable": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "platformDisable", arg_list: None, return_type: None }, "platformEnable": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "platformEnable", arg_list: None, return_type: None }, "platformHigh": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "platformHigh", arg_list: None, return_type: None }, "platformLow": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "platformLow", arg_list: None, return_type: None }, "platformSetMode": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "platformSetMode", arg_list: Some(ArgList { py_arg_list: "mode:str", list: {"mode": PyArg { py_type: PyType { type_name: "str" }, name: "mode" }} }), return_type: None }, "setMode": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "setMode", arg_list: Some(ArgList { py_arg_list: "mode:str", list: {"mode": PyArg { py_type: PyType { type_name: "str" }, name: "mode" }} }), return_type: None }, "setPin": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "setPin", arg_list: Some(ArgList { py_arg_list: "pinName:str", list: {"pinName": PyArg { py_type: PyType { type_name: "str" }, name: "pinName" }} }), return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "PikaStdDevice_PWM": ClassInfo { this_class_name: "PikaStdDevice_PWM", super_class_name: "TinyObj", method_list: {"enable": MethodInfo { class_name: "PikaStdDevice_PWM", name: "enable", arg_list: None, return_type: None }, "getDuty": MethodInfo { class_name: "PikaStdDevice_PWM", name: "getDuty", arg_list: None, return_type: Some(PyType { type_name: "float" }) }, "getFrequency": MethodInfo { class_name: "PikaStdDevice_PWM", name: "getFrequency", arg_list: None, return_type: Some(PyType { type_name: "int" }) }, "init": MethodInfo { class_name: "PikaStdDevice_PWM", name: "init", arg_list: None, return_type: None }, "platformEnable": MethodInfo { class_name: "PikaStdDevice_PWM", name: "platformEnable", arg_list: Some(ArgList { py_arg_list: "pin:str,freq:int,duty:float", list: {"duty": PyArg { py_type: PyType { type_name: "float" }, name: "duty" }, "freq": PyArg { py_type: PyType { type_name: "int" }, name: "freq" }, "pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: None }, "platformSetDuty": MethodInfo { class_name: "PikaStdDevice_PWM", name: "platformSetDuty", arg_list: Some(ArgList { py_arg_list: "pin:str,duty:float", list: {"duty": PyArg { py_type: PyType { type_name: "float" }, name: "duty" }, "pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: None }, "platformSetFrequency": MethodInfo { class_name: "PikaStdDevice_PWM", name: "platformSetFrequency", arg_list: Some(ArgList { py_arg_list: "pin:str,freq:int", list: {"freq": PyArg { py_type: PyType { type_name: "int" }, name: "freq" }, "pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: None }, "setDuty": MethodInfo { class_name: "PikaStdDevice_PWM", name: "setDuty", arg_list: Some(ArgList { py_arg_list: "duty:float", list: {"duty": PyArg { py_type: PyType { type_name: "float" }, name: "duty" }} }), return_type: None }, "setFrequency": MethodInfo { class_name: "PikaStdDevice_PWM", name: "setFrequency", arg_list: Some(ArgList { py_arg_list: "freq:int", list: {"freq": PyArg { py_type: PyType { type_name: "int" }, name: "freq" }} }), return_type: None }, "setPin": MethodInfo { class_name: "PikaStdDevice_PWM", name: "setPin", arg_list: Some(ArgList { py_arg_list: "pin:str", list: {"pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "PikaStdDevice_Time": ClassInfo { this_class_name: "PikaStdDevice_Time", super_class_name: "TinyObj", method_list: {"sleep_ms": MethodInfo { class_name: "PikaStdDevice_Time", name: "sleep_ms", arg_list: Some(ArgList { py_arg_list: "ms:int", list: {"ms": PyArg { py_type: PyType { type_name: "int" }, name: "ms" }} }), return_type: None }, "sleep_s": MethodInfo { class_name: "PikaStdDevice_Time", name: "sleep_s", arg_list: Some(ArgList { py_arg_list: "s:int", list: {"s": PyArg { py_type: PyType { type_name: "int" }, name: "s" }} }), return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "PikaStdDevice_UART": ClassInfo { this_class_name: "PikaStdDevice_UART", super_class_name: "TinyObj", method_list: {"enable": MethodInfo { class_name: "PikaStdDevice_UART", name: "enable", arg_list: None, return_type: None }, "init": MethodInfo { class_name: "PikaStdDevice_UART", name: "init", arg_list: None, return_type: None }, "platformEnable": MethodInfo { class_name: "PikaStdDevice_UART", name: "platformEnable", arg_list: Some(ArgList { py_arg_list: "id:int,baudRate:int", list: {"baudRate": PyArg { py_type: PyType { type_name: "int" }, name: "baudRate" }, "id": PyArg { py_type: PyType { type_name: "int" }, name: "id" }} }), return_type: None }, "platformRead": MethodInfo { class_name: "PikaStdDevice_UART", name: "platformRead", arg_list: Some(ArgList { py_arg_list: "id:int,length:int", list: {"id": PyArg { py_type: PyType { type_name: "int" }, name: "id" }, "length": PyArg { py_type: PyType { type_name: "int" }, name: "length" }} }), return_type: Some(PyType { type_name: "str" }) }, "platformWrite": MethodInfo { class_name: "PikaStdDevice_UART", name: "platformWrite", arg_list: Some(ArgList { py_arg_list: "id:int,data:str", list: {"data": PyArg { py_type: PyType { type_name: "str" }, name: "data" }, "id": PyArg { py_type: PyType { type_name: "int" }, name: "id" }} }), return_type: None }, "read": MethodInfo { class_name: "PikaStdDevice_UART", name: "read", arg_list: Some(ArgList { py_arg_list: "length:int", list: {"length": PyArg { py_type: PyType { type_name: "int" }, name: "length" }} }), return_type: Some(PyType { type_name: "str" }) }, "setBaudRate": MethodInfo { class_name: "PikaStdDevice_UART", name: "setBaudRate", arg_list: Some(ArgList { py_arg_list: "baudRate:int", list: {"baudRate": PyArg { py_type: PyType { type_name: "int" }, name: "baudRate" }} }), return_type: None }, "setId": MethodInfo { class_name: "PikaStdDevice_UART", name: "setId", arg_list: Some(ArgList { py_arg_list: "id:int", list: {"id": PyArg { py_type: PyType { type_name: "int" }, name: "id" }} }), return_type: None }, "write": MethodInfo { class_name: "PikaStdDevice_UART", name: "write", arg_list: Some(ArgList { py_arg_list: "data:str", list: {"data": PyArg { py_type: PyType { type_name: "str" }, name: "data" }} }), return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "PikaStdLib_MemChecker": ClassInfo { this_class_name: "PikaStdLib_MemChecker", super_class_name: "BaseObj", method_list: {"max": MethodInfo { class_name: "PikaStdLib_MemChecker", name: "max", arg_list: None, return_type: None }, "now": MethodInfo { class_name: "PikaStdLib_MemChecker", name: "now", arg_list: None, return_type: None }, "resetMax": MethodInfo { class_name: "PikaStdLib_MemChecker", name: "resetMax", arg_list: None, return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "PikaStdLib_SysObj": ClassInfo { this_class_name: "PikaStdLib_SysObj", super_class_name: "BaseObj", method_list: {"ls": MethodInfo { class_name: "PikaStdLib_SysObj", name: "ls", arg_list: Some(ArgList { py_arg_list: "objPath:str", list: {"objPath": PyArg { py_type: PyType { type_name: "str" }, name: "objPath" }} }), return_type: None }, "new": MethodInfo { class_name: "PikaStdLib_SysObj", name: "new", arg_list: Some(ArgList { py_arg_list: "objPath:str,classPath:str", list: {"classPath": PyArg { py_type: PyType { type_name: "str" }, name: "classPath" }, "objPath": PyArg { py_type: PyType { type_name: "str" }, name: "objPath" }} }), return_type: None }, "remove": MethodInfo { class_name: "PikaStdLib_SysObj", name: "remove", arg_list: Some(ArgList { py_arg_list: "argPath:str", list: {"argPath": PyArg { py_type: PyType { type_name: "str" }, name: "argPath" }} }), return_type: None }, "type": MethodInfo { class_name: "PikaStdLib_SysObj", name: "type", arg_list: Some(ArgList { py_arg_list: "argPath:str", list: {"argPath": PyArg { py_type: PyType { type_name: "str" }, name: "argPath" }} }), return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "STM32_ADC": ClassInfo { this_class_name: "STM32_ADC", super_class_name: "PikaStdDevice_ADC", method_list: {"platformEnable": MethodInfo { class_name: "STM32_ADC", name: "platformEnable", arg_list: Some(ArgList { py_arg_list: "pin:str", list: {"pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: None }, "platformRead": MethodInfo { class_name: "STM32_ADC", name: "platformRead", arg_list: Some(ArgList { py_arg_list: "pin:str", list: {"pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: Some(PyType { type_name: "float" }) }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "STM32_GPIO": ClassInfo { this_class_name: "STM32_GPIO", super_class_name: "PikaStdDevice_GPIO", method_list: {"platformDisable": MethodInfo { class_name: "STM32_GPIO", name: "platformDisable", arg_list: None, return_type: None }, "platformEnable": MethodInfo { class_name: "STM32_GPIO", name: "platformEnable", arg_list: None, return_type: None }, "platformHigh": MethodInfo { class_name: "STM32_GPIO", name: "platformHigh", arg_list: None, return_type: None }, "platformLow": MethodInfo { class_name: "STM32_GPIO", name: "platformLow", arg_list: None, return_type: None }, "platformSetMode": MethodInfo { class_name: "STM32_GPIO", name: "platformSetMode", arg_list: Some(ArgList { py_arg_list: "mode:str", list: {"mode": PyArg { py_type: PyType { type_name: "str" }, name: "mode" }} }), return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "STM32_PWM": ClassInfo { this_class_name: "STM32_PWM", super_class_name: "PikaStdDevice_PWM", method_list: {"platformEnable": MethodInfo { class_name: "STM32_PWM", name: "platformEnable", arg_list: Some(ArgList { py_arg_list: "pin:str,freq:int,duty:float", list: {"duty": PyArg { py_type: PyType { type_name: "float" }, name: "duty" }, "freq": PyArg { py_type: PyType { type_name: "int" }, name: "freq" }, "pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: None }, "platformSetDuty": MethodInfo { class_name: "STM32_PWM", name: "platformSetDuty", arg_list: Some(ArgList { py_arg_list: "pin:str,duty:float", list: {"duty": PyArg { py_type: PyType { type_name: "float" }, name: "duty" }, "pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: None }, "platformSetFrequency": MethodInfo { class_name: "STM32_PWM", name: "platformSetFrequency", arg_list: Some(ArgList { py_arg_list: "pin:str,freq:int", list: {"freq": PyArg { py_type: PyType { type_name: "int" }, name: "freq" }, "pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "STM32_Time": ClassInfo { this_class_name: "STM32_Time", super_class_name: "PikaStdDevice_Time", method_list: {"sleep_ms": MethodInfo { class_name: "STM32_Time", name: "sleep_ms", arg_list: Some(ArgList { py_arg_list: "ms:int", list: {"ms": PyArg { py_type: PyType { type_name: "int" }, name: "ms" }} }), return_type: None }, "sleep_s": MethodInfo { class_name: "STM32_Time", name: "sleep_s", arg_list: Some(ArgList { py_arg_list: "s:int", list: {"s": PyArg { py_type: PyType { type_name: "int" }, name: "s" }} }), return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "STM32_UART": ClassInfo { this_class_name: "STM32_UART", super_class_name: "PikaStdDevice_UART", method_list: {"platformEnable": MethodInfo { class_name: "STM32_UART", name: "platformEnable", arg_list: Some(ArgList { py_arg_list: "id:int,baudRate:int", list: {"baudRate": PyArg { py_type: PyType { type_name: "int" }, name: "baudRate" }, "id": PyArg { py_type: PyType { type_name: "int" }, name: "id" }} }), return_type: None }, "platformRead": MethodInfo { class_name: "STM32_UART", name: "platformRead", arg_list: Some(ArgList { py_arg_list: "id:int,length:int", list: {"id": PyArg { py_type: PyType { type_name: "int" }, name: "id" }, "length": PyArg { py_type: PyType { type_name: "int" }, name: "length" }} }), return_type: Some(PyType { type_name: "str" }) }, "platformWrite": MethodInfo { class_name: "STM32_UART", name: "platformWrite", arg_list: Some(ArgList { py_arg_list: "id:int,data:str", list: {"data": PyArg { py_type: PyType { type_name: "str" }, name: "data" }, "id": PyArg { py_type: PyType { type_name: "int" }, name: "id" }} }), return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }}, class_now_name: Some("PikaMain") } -======= -Compiler { dist_path: "pikascript-api/", source_path: "", class_list: {"PikaMain": ClassInfo { this_class_name: "PikaMain", super_class_name: "PikaStdLib_SysObj", method_list: {}, object_list: {"pwm": ObjectInfo { class_name: "PikaMain", name: "pwm", import_class_name: "STM32_PWM" }, "time": ObjectInfo { class_name: "PikaMain", name: "time", import_class_name: "STM32_Time" }}, import_list: {}, script_list: Script { content: " obj_run(pikaMain, \"pwm.init()\");\r\n obj_run(pikaMain, \"pwm.setPin('PA8')\");\r\n obj_run(pikaMain, \"pwm.setFrequency(2000)\");\r\n obj_run(pikaMain, \"pwm.setDuty(0.5)\");\r\n obj_run(pikaMain, \"pwm.enable()\");\r\n obj_run(pikaMain, \"while True:\");\r\n obj_run(pikaMain, \" time.sleep_ms(500)\");\r\n obj_run(pikaMain, \" pwm.setDuty(0.5)\");\r\n obj_run(pikaMain, \" time.sleep_ms(500)\");\r\n obj_run(pikaMain, \" pwm.setDuty(0.3)\");\r\n" } }, "PikaStdDevice_ADC": ClassInfo { this_class_name: "PikaStdDevice_ADC", super_class_name: "TinyObj", method_list: {"enable": MethodInfo { class_name: "PikaStdDevice_ADC", name: "enable", arg_list: None, return_type: None }, "init": MethodInfo { class_name: "PikaStdDevice_ADC", name: "init", arg_list: None, return_type: None }, "platformEnable": MethodInfo { class_name: "PikaStdDevice_ADC", name: "platformEnable", arg_list: Some(ArgList { py_arg_list: "pin:str", list: {"pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: None }, "platformRead": MethodInfo { class_name: "PikaStdDevice_ADC", name: "platformRead", arg_list: Some(ArgList { py_arg_list: "pin:str", list: {"pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: Some(PyType { type_name: "float" }) }, "read": MethodInfo { class_name: "PikaStdDevice_ADC", name: "read", arg_list: None, return_type: Some(PyType { type_name: "float" }) }, "setPin": MethodInfo { class_name: "PikaStdDevice_ADC", name: "setPin", arg_list: Some(ArgList { py_arg_list: "pin:str", list: {"pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "PikaStdDevice_GPIO": ClassInfo { this_class_name: "PikaStdDevice_GPIO", super_class_name: "TinyObj", method_list: {"disable": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "disable", arg_list: None, return_type: None }, "enable": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "enable", arg_list: None, return_type: None }, "getMode": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "getMode", arg_list: None, return_type: Some(PyType { type_name: "str" }) }, "getPin": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "getPin", arg_list: None, return_type: Some(PyType { type_name: "str" }) }, "high": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "high", arg_list: None, return_type: None }, "init": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "init", arg_list: None, return_type: None }, "low": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "low", arg_list: None, return_type: None }, "platformDisable": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "platformDisable", arg_list: None, return_type: None }, "platformEnable": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "platformEnable", arg_list: None, return_type: None }, "platformHigh": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "platformHigh", arg_list: None, return_type: None }, "platformLow": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "platformLow", arg_list: None, return_type: None }, "platformSetMode": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "platformSetMode", arg_list: Some(ArgList { py_arg_list: "mode:str", list: {"mode": PyArg { py_type: PyType { type_name: "str" }, name: "mode" }} }), return_type: None }, "setMode": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "setMode", arg_list: Some(ArgList { py_arg_list: "mode:str", list: {"mode": PyArg { py_type: PyType { type_name: "str" }, name: "mode" }} }), return_type: None }, "setPin": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "setPin", arg_list: Some(ArgList { py_arg_list: "pinName:str", list: {"pinName": PyArg { py_type: PyType { type_name: "str" }, name: "pinName" }} }), return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "PikaStdDevice_PWM": ClassInfo { this_class_name: "PikaStdDevice_PWM", super_class_name: "TinyObj", method_list: {"enable": MethodInfo { class_name: "PikaStdDevice_PWM", name: "enable", arg_list: None, return_type: None }, "getDuty": MethodInfo { class_name: "PikaStdDevice_PWM", name: "getDuty", arg_list: None, return_type: Some(PyType { type_name: "float" }) }, "getFrequency": MethodInfo { class_name: "PikaStdDevice_PWM", name: "getFrequency", arg_list: None, return_type: Some(PyType { type_name: "int" }) }, "init": MethodInfo { class_name: "PikaStdDevice_PWM", name: "init", arg_list: None, return_type: None }, "platformEnable": MethodInfo { class_name: "PikaStdDevice_PWM", name: "platformEnable", arg_list: Some(ArgList { py_arg_list: "pin:str,freq:int,duty:float", list: {"duty": PyArg { py_type: PyType { type_name: "float" }, name: "duty" }, "freq": PyArg { py_type: PyType { type_name: "int" }, name: "freq" }, "pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: None }, "platformSetDuty": MethodInfo { class_name: "PikaStdDevice_PWM", name: "platformSetDuty", arg_list: Some(ArgList { py_arg_list: "pin:str,duty:float", list: {"duty": PyArg { py_type: PyType { type_name: "float" }, name: "duty" }, "pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: None }, "platformSetFrequency": MethodInfo { class_name: "PikaStdDevice_PWM", name: "platformSetFrequency", arg_list: Some(ArgList { py_arg_list: "pin:str,freq:int", list: {"freq": PyArg { py_type: PyType { type_name: "int" }, name: "freq" }, "pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: None }, "setDuty": MethodInfo { class_name: "PikaStdDevice_PWM", name: "setDuty", arg_list: Some(ArgList { py_arg_list: "duty:float", list: {"duty": PyArg { py_type: PyType { type_name: "float" }, name: "duty" }} }), return_type: None }, "setFrequency": MethodInfo { class_name: "PikaStdDevice_PWM", name: "setFrequency", arg_list: Some(ArgList { py_arg_list: "freq:int", list: {"freq": PyArg { py_type: PyType { type_name: "int" }, name: "freq" }} }), return_type: None }, "setPin": MethodInfo { class_name: "PikaStdDevice_PWM", name: "setPin", arg_list: Some(ArgList { py_arg_list: "pin:str", list: {"pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "PikaStdDevice_Time": ClassInfo { this_class_name: "PikaStdDevice_Time", super_class_name: "TinyObj", method_list: {"sleep_ms": MethodInfo { class_name: "PikaStdDevice_Time", name: "sleep_ms", arg_list: Some(ArgList { py_arg_list: "ms:int", list: {"ms": PyArg { py_type: PyType { type_name: "int" }, name: "ms" }} }), return_type: None }, "sleep_s": MethodInfo { class_name: "PikaStdDevice_Time", name: "sleep_s", arg_list: Some(ArgList { py_arg_list: "s:int", list: {"s": PyArg { py_type: PyType { type_name: "int" }, name: "s" }} }), return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "PikaStdDevice_UART": ClassInfo { this_class_name: "PikaStdDevice_UART", super_class_name: "TinyObj", method_list: {"enable": MethodInfo { class_name: "PikaStdDevice_UART", name: "enable", arg_list: None, return_type: None }, "init": MethodInfo { class_name: "PikaStdDevice_UART", name: "init", arg_list: None, return_type: None }, "platformEnable": MethodInfo { class_name: "PikaStdDevice_UART", name: "platformEnable", arg_list: Some(ArgList { py_arg_list: "id:int,baudRate:int", list: {"baudRate": PyArg { py_type: PyType { type_name: "int" }, name: "baudRate" }, "id": PyArg { py_type: PyType { type_name: "int" }, name: "id" }} }), return_type: None }, "platformRead": MethodInfo { class_name: "PikaStdDevice_UART", name: "platformRead", arg_list: Some(ArgList { py_arg_list: "id:int,length:int", list: {"id": PyArg { py_type: PyType { type_name: "int" }, name: "id" }, "length": PyArg { py_type: PyType { type_name: "int" }, name: "length" }} }), return_type: Some(PyType { type_name: "str" }) }, "platformWrite": MethodInfo { class_name: "PikaStdDevice_UART", name: "platformWrite", arg_list: Some(ArgList { py_arg_list: "id:int,data:str", list: {"data": PyArg { py_type: PyType { type_name: "str" }, name: "data" }, "id": PyArg { py_type: PyType { type_name: "int" }, name: "id" }} }), return_type: None }, "read": MethodInfo { class_name: "PikaStdDevice_UART", name: "read", arg_list: Some(ArgList { py_arg_list: "length:int", list: {"length": PyArg { py_type: PyType { type_name: "int" }, name: "length" }} }), return_type: Some(PyType { type_name: "str" }) }, "setBaudRate": MethodInfo { class_name: "PikaStdDevice_UART", name: "setBaudRate", arg_list: Some(ArgList { py_arg_list: "baudRate:int", list: {"baudRate": PyArg { py_type: PyType { type_name: "int" }, name: "baudRate" }} }), return_type: None }, "setId": MethodInfo { class_name: "PikaStdDevice_UART", name: "setId", arg_list: Some(ArgList { py_arg_list: "id:int", list: {"id": PyArg { py_type: PyType { type_name: "int" }, name: "id" }} }), return_type: None }, "write": MethodInfo { class_name: "PikaStdDevice_UART", name: "write", arg_list: Some(ArgList { py_arg_list: "data:str", list: {"data": PyArg { py_type: PyType { type_name: "str" }, name: "data" }} }), return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "STM32_ADC": ClassInfo { this_class_name: "STM32_ADC", super_class_name: "PikaStdDevice_ADC", method_list: {"platformEnable": MethodInfo { class_name: "STM32_ADC", name: "platformEnable", arg_list: Some(ArgList { py_arg_list: "pin:str", list: {"pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: None }, "platformRead": MethodInfo { class_name: "STM32_ADC", name: "platformRead", arg_list: Some(ArgList { py_arg_list: "pin:str", list: {"pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: Some(PyType { type_name: "float" }) }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "STM32_GPIO": ClassInfo { this_class_name: "STM32_GPIO", super_class_name: "PikaStdDevice_GPIO", method_list: {"platformDisable": MethodInfo { class_name: "STM32_GPIO", name: "platformDisable", arg_list: None, return_type: None }, "platformEnable": MethodInfo { class_name: "STM32_GPIO", name: "platformEnable", arg_list: None, return_type: None }, "platformHigh": MethodInfo { class_name: "STM32_GPIO", name: "platformHigh", arg_list: None, return_type: None }, "platformLow": MethodInfo { class_name: "STM32_GPIO", name: "platformLow", arg_list: None, return_type: None }, "platformSetMode": MethodInfo { class_name: "STM32_GPIO", name: "platformSetMode", arg_list: Some(ArgList { py_arg_list: "mode:str", list: {"mode": PyArg { py_type: PyType { type_name: "str" }, name: "mode" }} }), return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "STM32_PWM": ClassInfo { this_class_name: "STM32_PWM", super_class_name: "PikaStdDevice_PWM", method_list: {"platformEnable": MethodInfo { class_name: "STM32_PWM", name: "platformEnable", arg_list: Some(ArgList { py_arg_list: "pin:str,freq:int,duty:float", list: {"duty": PyArg { py_type: PyType { type_name: "float" }, name: "duty" }, "freq": PyArg { py_type: PyType { type_name: "int" }, name: "freq" }, "pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: None }, "platformSetDuty": MethodInfo { class_name: "STM32_PWM", name: "platformSetDuty", arg_list: Some(ArgList { py_arg_list: "pin:str,duty:float", list: {"duty": PyArg { py_type: PyType { type_name: "float" }, name: "duty" }, "pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: None }, "platformSetFrequency": MethodInfo { class_name: "STM32_PWM", name: "platformSetFrequency", arg_list: Some(ArgList { py_arg_list: "pin:str,freq:int", list: {"freq": PyArg { py_type: PyType { type_name: "int" }, name: "freq" }, "pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "STM32_Time": ClassInfo { this_class_name: "STM32_Time", super_class_name: "PikaStdDevice_Time", method_list: {"sleep_ms": MethodInfo { class_name: "STM32_Time", name: "sleep_ms", arg_list: Some(ArgList { py_arg_list: "ms:int", list: {"ms": PyArg { py_type: PyType { type_name: "int" }, name: "ms" }} }), return_type: None }, "sleep_s": MethodInfo { class_name: "STM32_Time", name: "sleep_s", arg_list: Some(ArgList { py_arg_list: "s:int", list: {"s": PyArg { py_type: PyType { type_name: "int" }, name: "s" }} }), return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "STM32_UART": ClassInfo { this_class_name: "STM32_UART", super_class_name: "PikaStdDevice_UART", method_list: {"platformEnable": MethodInfo { class_name: "STM32_UART", name: "platformEnable", arg_list: Some(ArgList { py_arg_list: "id:int,baudRate:int", list: {"baudRate": PyArg { py_type: PyType { type_name: "int" }, name: "baudRate" }, "id": PyArg { py_type: PyType { type_name: "int" }, name: "id" }} }), return_type: None }, "platformRead": MethodInfo { class_name: "STM32_UART", name: "platformRead", arg_list: Some(ArgList { py_arg_list: "id:int,length:int", list: {"id": PyArg { py_type: PyType { type_name: "int" }, name: "id" }, "length": PyArg { py_type: PyType { type_name: "int" }, name: "length" }} }), return_type: Some(PyType { type_name: "str" }) }, "platformWrite": MethodInfo { class_name: "STM32_UART", name: "platformWrite", arg_list: Some(ArgList { py_arg_list: "id:int,data:str", list: {"data": PyArg { py_type: PyType { type_name: "str" }, name: "data" }, "id": PyArg { py_type: PyType { type_name: "int" }, name: "id" }} }), return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }}, class_now_name: Some("PikaMain") } ->>>>>>> 75642075742a22be2a2f4f20354f9ee028543b7c +Compiler { dist_path: "pikascript-api/", source_path: "", class_list: {"PikaMain": ClassInfo { this_class_name: "PikaMain", super_class_name: "PikaStdLib_SysObj", method_list: {}, object_list: {"mem": ObjectInfo { class_name: "PikaMain", name: "mem", import_class_name: "PikaStdLib_MemChecker" }, "rgb": ObjectInfo { class_name: "PikaMain", name: "rgb", import_class_name: "PikaPiZero_RGB" }, "time": ObjectInfo { class_name: "PikaMain", name: "time", import_class_name: "STM32_Time" }, "uart": ObjectInfo { class_name: "PikaMain", name: "uart", import_class_name: "STM32_UART" }}, import_list: {}, script_list: Script { content: " obj_run(pikaMain, \"uart.init()\");\r\n obj_run(pikaMain, \"uart.setId(1)\");\r\n obj_run(pikaMain, \"uart.enable()\");\r\n obj_run(pikaMain, \"print('initing rgb...')\");\r\n obj_run(pikaMain, \"rgb.init()\");\r\n obj_run(pikaMain, \"rgb.enable()\");\r\n obj_run(pikaMain, \"print('init rgb ok!')\");\r\n obj_run(pikaMain, \"print('mem max:')\");\r\n obj_run(pikaMain, \"mem.max()\");\r\n obj_run(pikaMain, \"while True:\");\r\n obj_run(pikaMain, \" time.sleep_ms(250)\");\r\n obj_run(pikaMain, \" rgb.red()\");\r\n obj_run(pikaMain, \" time.sleep_ms(250)\");\r\n obj_run(pikaMain, \" rgb.green()\");\r\n obj_run(pikaMain, \" time.sleep_ms(250)\");\r\n obj_run(pikaMain, \" rgb.white()\");\r\n obj_run(pikaMain, \" time.sleep_ms(250)\");\r\n obj_run(pikaMain, \" rgb.blue()\");\r\n" } }, "PikaPiZero_RGB": ClassInfo { this_class_name: "PikaPiZero_RGB", super_class_name: "PikaStdLib_SysObj", method_list: {"blue": MethodInfo { class_name: "PikaPiZero_RGB", name: "blue", arg_list: None, return_type: None }, "enable": MethodInfo { class_name: "PikaPiZero_RGB", name: "enable", arg_list: None, return_type: None }, "green": MethodInfo { class_name: "PikaPiZero_RGB", name: "green", arg_list: None, return_type: None }, "init": MethodInfo { class_name: "PikaPiZero_RGB", name: "init", arg_list: None, return_type: None }, "red": MethodInfo { class_name: "PikaPiZero_RGB", name: "red", arg_list: None, return_type: None }, "white": MethodInfo { class_name: "PikaPiZero_RGB", name: "white", arg_list: None, return_type: None }}, object_list: {"pin": ObjectInfo { class_name: "PikaPiZero_RGB", name: "pin", import_class_name: "STM32_GPIO" }}, import_list: {}, script_list: Script { content: "" } }, "PikaStdDevice_ADC": ClassInfo { this_class_name: "PikaStdDevice_ADC", super_class_name: "TinyObj", method_list: {"enable": MethodInfo { class_name: "PikaStdDevice_ADC", name: "enable", arg_list: None, return_type: None }, "init": MethodInfo { class_name: "PikaStdDevice_ADC", name: "init", arg_list: None, return_type: None }, "platformEnable": MethodInfo { class_name: "PikaStdDevice_ADC", name: "platformEnable", arg_list: Some(ArgList { py_arg_list: "pin:str", list: {"pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: None }, "platformRead": MethodInfo { class_name: "PikaStdDevice_ADC", name: "platformRead", arg_list: Some(ArgList { py_arg_list: "pin:str", list: {"pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: Some(PyType { type_name: "float" }) }, "read": MethodInfo { class_name: "PikaStdDevice_ADC", name: "read", arg_list: None, return_type: Some(PyType { type_name: "float" }) }, "setPin": MethodInfo { class_name: "PikaStdDevice_ADC", name: "setPin", arg_list: Some(ArgList { py_arg_list: "pin:str", list: {"pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "PikaStdDevice_GPIO": ClassInfo { this_class_name: "PikaStdDevice_GPIO", super_class_name: "TinyObj", method_list: {"disable": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "disable", arg_list: None, return_type: None }, "enable": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "enable", arg_list: None, return_type: None }, "getMode": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "getMode", arg_list: None, return_type: Some(PyType { type_name: "str" }) }, "getPin": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "getPin", arg_list: None, return_type: Some(PyType { type_name: "str" }) }, "high": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "high", arg_list: None, return_type: None }, "init": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "init", arg_list: None, return_type: None }, "low": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "low", arg_list: None, return_type: None }, "platformDisable": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "platformDisable", arg_list: None, return_type: None }, "platformEnable": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "platformEnable", arg_list: None, return_type: None }, "platformHigh": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "platformHigh", arg_list: None, return_type: None }, "platformLow": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "platformLow", arg_list: None, return_type: None }, "platformSetMode": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "platformSetMode", arg_list: Some(ArgList { py_arg_list: "mode:str", list: {"mode": PyArg { py_type: PyType { type_name: "str" }, name: "mode" }} }), return_type: None }, "setMode": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "setMode", arg_list: Some(ArgList { py_arg_list: "mode:str", list: {"mode": PyArg { py_type: PyType { type_name: "str" }, name: "mode" }} }), return_type: None }, "setPin": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "setPin", arg_list: Some(ArgList { py_arg_list: "pinName:str", list: {"pinName": PyArg { py_type: PyType { type_name: "str" }, name: "pinName" }} }), return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "PikaStdDevice_PWM": ClassInfo { this_class_name: "PikaStdDevice_PWM", super_class_name: "TinyObj", method_list: {"enable": MethodInfo { class_name: "PikaStdDevice_PWM", name: "enable", arg_list: None, return_type: None }, "getDuty": MethodInfo { class_name: "PikaStdDevice_PWM", name: "getDuty", arg_list: None, return_type: Some(PyType { type_name: "float" }) }, "getFrequency": MethodInfo { class_name: "PikaStdDevice_PWM", name: "getFrequency", arg_list: None, return_type: Some(PyType { type_name: "int" }) }, "init": MethodInfo { class_name: "PikaStdDevice_PWM", name: "init", arg_list: None, return_type: None }, "platformEnable": MethodInfo { class_name: "PikaStdDevice_PWM", name: "platformEnable", arg_list: Some(ArgList { py_arg_list: "pin:str,freq:int,duty:float", list: {"duty": PyArg { py_type: PyType { type_name: "float" }, name: "duty" }, "freq": PyArg { py_type: PyType { type_name: "int" }, name: "freq" }, "pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: None }, "platformSetDuty": MethodInfo { class_name: "PikaStdDevice_PWM", name: "platformSetDuty", arg_list: Some(ArgList { py_arg_list: "pin:str,duty:float", list: {"duty": PyArg { py_type: PyType { type_name: "float" }, name: "duty" }, "pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: None }, "platformSetFrequency": MethodInfo { class_name: "PikaStdDevice_PWM", name: "platformSetFrequency", arg_list: Some(ArgList { py_arg_list: "pin:str,freq:int", list: {"freq": PyArg { py_type: PyType { type_name: "int" }, name: "freq" }, "pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: None }, "setDuty": MethodInfo { class_name: "PikaStdDevice_PWM", name: "setDuty", arg_list: Some(ArgList { py_arg_list: "duty:float", list: {"duty": PyArg { py_type: PyType { type_name: "float" }, name: "duty" }} }), return_type: None }, "setFrequency": MethodInfo { class_name: "PikaStdDevice_PWM", name: "setFrequency", arg_list: Some(ArgList { py_arg_list: "freq:int", list: {"freq": PyArg { py_type: PyType { type_name: "int" }, name: "freq" }} }), return_type: None }, "setPin": MethodInfo { class_name: "PikaStdDevice_PWM", name: "setPin", arg_list: Some(ArgList { py_arg_list: "pin:str", list: {"pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "PikaStdDevice_Time": ClassInfo { this_class_name: "PikaStdDevice_Time", super_class_name: "TinyObj", method_list: {"sleep_ms": MethodInfo { class_name: "PikaStdDevice_Time", name: "sleep_ms", arg_list: Some(ArgList { py_arg_list: "ms:int", list: {"ms": PyArg { py_type: PyType { type_name: "int" }, name: "ms" }} }), return_type: None }, "sleep_s": MethodInfo { class_name: "PikaStdDevice_Time", name: "sleep_s", arg_list: Some(ArgList { py_arg_list: "s:int", list: {"s": PyArg { py_type: PyType { type_name: "int" }, name: "s" }} }), return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "PikaStdDevice_UART": ClassInfo { this_class_name: "PikaStdDevice_UART", super_class_name: "TinyObj", method_list: {"enable": MethodInfo { class_name: "PikaStdDevice_UART", name: "enable", arg_list: None, return_type: None }, "init": MethodInfo { class_name: "PikaStdDevice_UART", name: "init", arg_list: None, return_type: None }, "platformEnable": MethodInfo { class_name: "PikaStdDevice_UART", name: "platformEnable", arg_list: Some(ArgList { py_arg_list: "id:int,baudRate:int", list: {"baudRate": PyArg { py_type: PyType { type_name: "int" }, name: "baudRate" }, "id": PyArg { py_type: PyType { type_name: "int" }, name: "id" }} }), return_type: None }, "platformRead": MethodInfo { class_name: "PikaStdDevice_UART", name: "platformRead", arg_list: Some(ArgList { py_arg_list: "id:int,length:int", list: {"id": PyArg { py_type: PyType { type_name: "int" }, name: "id" }, "length": PyArg { py_type: PyType { type_name: "int" }, name: "length" }} }), return_type: Some(PyType { type_name: "str" }) }, "platformWrite": MethodInfo { class_name: "PikaStdDevice_UART", name: "platformWrite", arg_list: Some(ArgList { py_arg_list: "id:int,data:str", list: {"data": PyArg { py_type: PyType { type_name: "str" }, name: "data" }, "id": PyArg { py_type: PyType { type_name: "int" }, name: "id" }} }), return_type: None }, "read": MethodInfo { class_name: "PikaStdDevice_UART", name: "read", arg_list: Some(ArgList { py_arg_list: "length:int", list: {"length": PyArg { py_type: PyType { type_name: "int" }, name: "length" }} }), return_type: Some(PyType { type_name: "str" }) }, "setBaudRate": MethodInfo { class_name: "PikaStdDevice_UART", name: "setBaudRate", arg_list: Some(ArgList { py_arg_list: "baudRate:int", list: {"baudRate": PyArg { py_type: PyType { type_name: "int" }, name: "baudRate" }} }), return_type: None }, "setId": MethodInfo { class_name: "PikaStdDevice_UART", name: "setId", arg_list: Some(ArgList { py_arg_list: "id:int", list: {"id": PyArg { py_type: PyType { type_name: "int" }, name: "id" }} }), return_type: None }, "write": MethodInfo { class_name: "PikaStdDevice_UART", name: "write", arg_list: Some(ArgList { py_arg_list: "data:str", list: {"data": PyArg { py_type: PyType { type_name: "str" }, name: "data" }} }), return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "PikaStdLib_MemChecker": ClassInfo { this_class_name: "PikaStdLib_MemChecker", super_class_name: "BaseObj", method_list: {"max": MethodInfo { class_name: "PikaStdLib_MemChecker", name: "max", arg_list: None, return_type: None }, "now": MethodInfo { class_name: "PikaStdLib_MemChecker", name: "now", arg_list: None, return_type: None }, "resetMax": MethodInfo { class_name: "PikaStdLib_MemChecker", name: "resetMax", arg_list: None, return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "PikaStdLib_SysObj": ClassInfo { this_class_name: "PikaStdLib_SysObj", super_class_name: "BaseObj", method_list: {"ls": MethodInfo { class_name: "PikaStdLib_SysObj", name: "ls", arg_list: Some(ArgList { py_arg_list: "objPath:str", list: {"objPath": PyArg { py_type: PyType { type_name: "str" }, name: "objPath" }} }), return_type: None }, "new": MethodInfo { class_name: "PikaStdLib_SysObj", name: "new", arg_list: Some(ArgList { py_arg_list: "objPath:str,classPath:str", list: {"classPath": PyArg { py_type: PyType { type_name: "str" }, name: "classPath" }, "objPath": PyArg { py_type: PyType { type_name: "str" }, name: "objPath" }} }), return_type: None }, "remove": MethodInfo { class_name: "PikaStdLib_SysObj", name: "remove", arg_list: Some(ArgList { py_arg_list: "argPath:str", list: {"argPath": PyArg { py_type: PyType { type_name: "str" }, name: "argPath" }} }), return_type: None }, "type": MethodInfo { class_name: "PikaStdLib_SysObj", name: "type", arg_list: Some(ArgList { py_arg_list: "argPath:str", list: {"argPath": PyArg { py_type: PyType { type_name: "str" }, name: "argPath" }} }), return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "STM32_ADC": ClassInfo { this_class_name: "STM32_ADC", super_class_name: "PikaStdDevice_ADC", method_list: {"platformEnable": MethodInfo { class_name: "STM32_ADC", name: "platformEnable", arg_list: Some(ArgList { py_arg_list: "pin:str", list: {"pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: None }, "platformRead": MethodInfo { class_name: "STM32_ADC", name: "platformRead", arg_list: Some(ArgList { py_arg_list: "pin:str", list: {"pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: Some(PyType { type_name: "float" }) }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "STM32_GPIO": ClassInfo { this_class_name: "STM32_GPIO", super_class_name: "PikaStdDevice_GPIO", method_list: {"platformDisable": MethodInfo { class_name: "STM32_GPIO", name: "platformDisable", arg_list: None, return_type: None }, "platformEnable": MethodInfo { class_name: "STM32_GPIO", name: "platformEnable", arg_list: None, return_type: None }, "platformHigh": MethodInfo { class_name: "STM32_GPIO", name: "platformHigh", arg_list: None, return_type: None }, "platformLow": MethodInfo { class_name: "STM32_GPIO", name: "platformLow", arg_list: None, return_type: None }, "platformSetMode": MethodInfo { class_name: "STM32_GPIO", name: "platformSetMode", arg_list: Some(ArgList { py_arg_list: "mode:str", list: {"mode": PyArg { py_type: PyType { type_name: "str" }, name: "mode" }} }), return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "STM32_PWM": ClassInfo { this_class_name: "STM32_PWM", super_class_name: "PikaStdDevice_PWM", method_list: {"platformEnable": MethodInfo { class_name: "STM32_PWM", name: "platformEnable", arg_list: Some(ArgList { py_arg_list: "pin:str,freq:int,duty:float", list: {"duty": PyArg { py_type: PyType { type_name: "float" }, name: "duty" }, "freq": PyArg { py_type: PyType { type_name: "int" }, name: "freq" }, "pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: None }, "platformSetDuty": MethodInfo { class_name: "STM32_PWM", name: "platformSetDuty", arg_list: Some(ArgList { py_arg_list: "pin:str,duty:float", list: {"duty": PyArg { py_type: PyType { type_name: "float" }, name: "duty" }, "pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: None }, "platformSetFrequency": MethodInfo { class_name: "STM32_PWM", name: "platformSetFrequency", arg_list: Some(ArgList { py_arg_list: "pin:str,freq:int", list: {"freq": PyArg { py_type: PyType { type_name: "int" }, name: "freq" }, "pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "STM32_Time": ClassInfo { this_class_name: "STM32_Time", super_class_name: "PikaStdDevice_Time", method_list: {"sleep_ms": MethodInfo { class_name: "STM32_Time", name: "sleep_ms", arg_list: Some(ArgList { py_arg_list: "ms:int", list: {"ms": PyArg { py_type: PyType { type_name: "int" }, name: "ms" }} }), return_type: None }, "sleep_s": MethodInfo { class_name: "STM32_Time", name: "sleep_s", arg_list: Some(ArgList { py_arg_list: "s:int", list: {"s": PyArg { py_type: PyType { type_name: "int" }, name: "s" }} }), return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "STM32_UART": ClassInfo { this_class_name: "STM32_UART", super_class_name: "PikaStdDevice_UART", method_list: {"platformEnable": MethodInfo { class_name: "STM32_UART", name: "platformEnable", arg_list: Some(ArgList { py_arg_list: "id:int,baudRate:int", list: {"baudRate": PyArg { py_type: PyType { type_name: "int" }, name: "baudRate" }, "id": PyArg { py_type: PyType { type_name: "int" }, name: "id" }} }), return_type: None }, "platformRead": MethodInfo { class_name: "STM32_UART", name: "platformRead", arg_list: Some(ArgList { py_arg_list: "id:int,length:int", list: {"id": PyArg { py_type: PyType { type_name: "int" }, name: "id" }, "length": PyArg { py_type: PyType { type_name: "int" }, name: "length" }} }), return_type: Some(PyType { type_name: "str" }) }, "platformWrite": MethodInfo { class_name: "STM32_UART", name: "platformWrite", arg_list: Some(ArgList { py_arg_list: "id:int,data:str", list: {"data": PyArg { py_type: PyType { type_name: "str" }, name: "data" }, "id": PyArg { py_type: PyType { type_name: "int" }, name: "id" }} }), return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }}, class_now_name: Some("PikaMain") } \ No newline at end of file diff --git a/demo/stm32g030c8/pikascript/pikascript-api/pikaScript.c b/demo/stm32g030c8/pikascript/pikascript-api/pikaScript.c index b11cbd954..e6321e286 100644 --- a/demo/stm32g030c8/pikascript/pikascript-api/pikaScript.c +++ b/demo/stm32g030c8/pikascript/pikascript-api/pikaScript.c @@ -7,9 +7,8 @@ PikaObj * pikaScriptInit(){ PikaObj * pikaMain = newRootObj("pikaMain", New_PikaMain); -<<<<<<< HEAD obj_run(pikaMain, "uart.init()"); - obj_run(pikaMain, "uart.setId()"); + obj_run(pikaMain, "uart.setId(1)"); obj_run(pikaMain, "uart.enable()"); obj_run(pikaMain, "print('initing rgb...')"); obj_run(pikaMain, "rgb.init()"); @@ -18,22 +17,14 @@ PikaObj * pikaScriptInit(){ obj_run(pikaMain, "print('mem max:')"); obj_run(pikaMain, "mem.max()"); obj_run(pikaMain, "while True:"); - obj_run(pikaMain, " time.sleep_ms(500)"); + obj_run(pikaMain, " time.sleep_ms(250)"); obj_run(pikaMain, " rgb.red()"); - obj_run(pikaMain, " time.sleep_ms(500)"); - obj_run(pikaMain, " rgb.red()"); -======= - obj_run(pikaMain, "pwm.init()"); - obj_run(pikaMain, "pwm.setPin('PA8')"); - obj_run(pikaMain, "pwm.setFrequency(2000)"); - obj_run(pikaMain, "pwm.setDuty(0.5)"); - obj_run(pikaMain, "pwm.enable()"); - obj_run(pikaMain, "while True:"); - obj_run(pikaMain, " time.sleep_ms(500)"); - obj_run(pikaMain, " pwm.setDuty(0.5)"); - obj_run(pikaMain, " time.sleep_ms(500)"); - obj_run(pikaMain, " pwm.setDuty(0.3)"); ->>>>>>> 75642075742a22be2a2f4f20354f9ee028543b7c + obj_run(pikaMain, " time.sleep_ms(250)"); + obj_run(pikaMain, " rgb.green()"); + obj_run(pikaMain, " time.sleep_ms(250)"); + obj_run(pikaMain, " rgb.white()"); + obj_run(pikaMain, " time.sleep_ms(250)"); + obj_run(pikaMain, " rgb.blue()"); obj_run(pikaMain, ""); return pikaMain; } diff --git a/demo/stm32g030c8/pikascript/pikascript-core/pikascript-core.lib b/demo/stm32g030c8/pikascript/pikascript-core/pikascript-core.lib new file mode 100644 index 000000000..c163afe95 Binary files /dev/null and b/demo/stm32g030c8/pikascript/pikascript-core/pikascript-core.lib differ diff --git a/demo/stm32g030c8/pikascript/pikascript-lib/PikaPiZero/PikaPiZero_RGB.c b/demo/stm32g030c8/pikascript/pikascript-lib/PikaPiZero/PikaPiZero_RGB.c index 136ddff15..b477af5ae 100644 --- a/demo/stm32g030c8/pikascript/pikascript-lib/PikaPiZero/PikaPiZero_RGB.c +++ b/demo/stm32g030c8/pikascript/pikascript-lib/PikaPiZero/PikaPiZero_RGB.c @@ -3,29 +3,7 @@ #include "BaseObj.h" #include "STM32_common.h" #include "dataStrs.h" - -void RGB_setUp(){ - GPIOB->BSRR = GPIO_PIN_12; // set - int i; - i++; - i++; - i++; - i++; - i++; - i++; - i++; - i++; - GPIOB->BRR = GPIO_PIN_12; // reset -} - -void RGB_setDown(){ - GPIOB->BSRR = GPIO_PIN_12; // set - int i; - i++; - i++; - i++; - GPIOB->BRR = GPIO_PIN_12; -} +#include "RGB_ASM.h" void RGB_reset(){ GPIOB->BRR = GPIO_PIN_12; // reset @@ -38,21 +16,14 @@ void RGB_reset(){ #define WHITE 0x0F0F0F #define CUTDOWN 0x000000 -void RGB_set(uint32_t G8R8B8) -{ - int i; - uint8_t byte = 0; - for(i = 23; i>=0 ;i--){ - byte = ((G8R8B8 >> i) & 0x01); - if(byte){ - RGB_setUp(); - } - else{ - RGB_setDown(); - } - } +void RGB_setVoid(){ + __asm( + "nop" + ); } + + void PikaPiZero_RGB_enable(PikaObj *self){ obj_run(self, "pin.init()"); obj_run(self, "pin.setPin('PB12')"); @@ -62,9 +33,31 @@ void PikaPiZero_RGB_enable(PikaObj *self){ void PikaPiZero_RGB_init(PikaObj *self){ } + void PikaPiZero_RGB_red(PikaObj *self){ RGB_set(RED); - RGB_set(GREEN); - RGB_set(BLUE); - RGB_set(WHITE); + RGB_set(RED); + RGB_set(RED); + RGB_set(RED); } + +void PikaPiZero_RGB_blue(PikaObj *self){ + RGB_set(BLUE); + RGB_set(BLUE); + RGB_set(BLUE); + RGB_set(BLUE); +} + +void PikaPiZero_RGB_green(PikaObj *self){ + RGB_set(GREEN); + RGB_set(GREEN); + RGB_set(GREEN); + RGB_set(GREEN); +} + +void PikaPiZero_RGB_white(PikaObj *self){ + RGB_set(WHITE); + RGB_set(WHITE); + RGB_set(WHITE); + RGB_set(WHITE); +} \ No newline at end of file diff --git a/demo/stm32g030c8/pikascript/pikascript-lib/PikaPiZero/RGB_ASM.c b/demo/stm32g030c8/pikascript/pikascript-lib/PikaPiZero/RGB_ASM.c new file mode 100644 index 000000000..4d65642c8 --- /dev/null +++ b/demo/stm32g030c8/pikascript/pikascript-lib/PikaPiZero/RGB_ASM.c @@ -0,0 +1,37 @@ +#include "RGB_ASM.h" +#include "STM32_common.h" + +void RGB_set(uint32_t G8R8B8) +{ + int i = 23; + uint8_t byte = 0; + while( i>0 ){ + byte = ((G8R8B8 >> i) & 0x01); + if(byte){ + GPIOB->BSRR = GPIO_PIN_12; // set + __ASM ("nop");__ASM ("nop");__ASM ("nop"); + __ASM ("nop");__ASM ("nop");__ASM ("nop"); + __ASM ("nop");__ASM ("nop");__ASM ("nop"); + __ASM ("nop");__ASM ("nop");__ASM ("nop"); + __ASM ("nop");__ASM ("nop");__ASM ("nop"); + __ASM ("nop");__ASM ("nop");__ASM ("nop"); + __ASM ("nop");__ASM ("nop");__ASM ("nop"); + __ASM ("nop");__ASM ("nop");__ASM ("nop"); + __ASM ("nop");__ASM ("nop");__ASM ("nop"); + __ASM ("nop");__ASM ("nop");__ASM ("nop"); + __ASM ("nop");__ASM ("nop");__ASM ("nop"); + __ASM ("nop");__ASM ("nop");__ASM ("nop"); + __ASM ("nop");__ASM ("nop");__ASM ("nop"); + GPIOB->BRR = GPIO_PIN_12; // reset + } + else{ + GPIOB->BSRR = GPIO_PIN_12; // set + __ASM ("nop");__ASM ("nop");__ASM ("nop"); + __ASM ("nop");__ASM ("nop");__ASM ("nop"); + __ASM ("nop");__ASM ("nop");__ASM ("nop"); + __ASM ("nop");__ASM ("nop");__ASM ("nop"); + GPIOB->BRR = GPIO_PIN_12; + } + i -- ; + } +} \ No newline at end of file diff --git a/demo/stm32g030c8/pikascript/pikascript-lib/PikaPiZero/RGB_ASM.h b/demo/stm32g030c8/pikascript/pikascript-lib/PikaPiZero/RGB_ASM.h new file mode 100644 index 000000000..7f8309777 --- /dev/null +++ b/demo/stm32g030c8/pikascript/pikascript-lib/PikaPiZero/RGB_ASM.h @@ -0,0 +1,3 @@ +#include + +void RGB_set(uint32_t G8R8B8); \ No newline at end of file diff --git a/demo/stm32g030c8/pikascript/pikascript-lib/PikaPiZero/RGB_ASM.lib b/demo/stm32g030c8/pikascript/pikascript-lib/PikaPiZero/RGB_ASM.lib new file mode 100644 index 000000000..3d8f27a61 Binary files /dev/null and b/demo/stm32g030c8/pikascript/pikascript-lib/PikaPiZero/RGB_ASM.lib differ