├── .github └── FUNDING.yml ├── .gitignore ├── CONTRIBUTING.md ├── Kconfig ├── LICENSE ├── Makefile ├── README.md ├── RELEASE_NOTES.md ├── arch ├── 8051 │ ├── Kconfig │ ├── Makefile │ ├── include │ │ ├── errno.h │ │ └── macros.S │ ├── mach-cy7c6801xa │ │ ├── interrupt.c │ │ ├── picoRTOS_device.h │ │ ├── startup.S │ │ └── timer-t2.c │ ├── mach-mcs51 │ │ ├── interrupt.c │ │ └── timer-t2.c │ ├── mach-n76e003 │ │ ├── interrupt.c │ │ ├── picoRTOS_device.h │ │ ├── startup.S │ │ ├── timer-t2.c │ │ └── timer-wkt.c │ ├── mach-stc12c5axx │ │ ├── interrupt.c │ │ ├── picoRTOS_device.h │ │ ├── startup.S │ │ └── timer-t0.c │ ├── mach-ucsim_51 │ │ ├── picoRTOS_device.h │ │ └── startup.S │ ├── picoRTOS_port.c │ ├── picoRTOS_portasm.S │ └── picoRTOS_types.h ├── Kconfig ├── arm │ ├── Kconfig │ ├── Makefile │ ├── armv6-m │ │ ├── Kconfig │ │ ├── mach-rp2040 │ │ │ ├── boot2.S │ │ │ ├── picoRTOS-SMP_port.c │ │ │ ├── picoRTOS-SMP_portasm.S │ │ │ ├── picoRTOS_device.h │ │ │ └── startup.S │ │ ├── picoRTOS_port.c │ │ ├── picoRTOS_portasm.S │ │ └── picoRTOS_types.h │ ├── armv7-m │ │ ├── Kconfig │ │ ├── mach-atsam3x8e │ │ │ ├── picoRTOS_device.h │ │ │ └── startup.S │ │ ├── mach-stm32f10xxx │ │ │ ├── picoRTOS_device.h │ │ │ └── startup.S │ │ ├── picoRTOS_port.c │ │ ├── picoRTOS_portasm.S │ │ └── picoRTOS_types.h │ ├── armv7e-m │ │ ├── Kconfig │ │ ├── cache_cmcc.c │ │ ├── cache_mvsa.c │ │ ├── mach-atsame5x │ │ │ ├── picoRTOS_device.h │ │ │ └── startup.S │ │ ├── mach-renesas_ra4 │ │ │ ├── picoRTOS_device.h │ │ │ └── startup.S │ │ ├── mach-stm32f401x │ │ │ ├── picoRTOS_device.h │ │ │ └── startup.S │ │ ├── mach-stm32h7xx │ │ │ ├── picoRTOS_device.h │ │ │ └── startup.S │ │ ├── mach-stm32l4x │ │ │ ├── picoRTOS_device.h │ │ │ └── startup.S │ │ ├── picoRTOS_port.c │ │ ├── picoRTOS_portasm.S │ │ └── picoRTOS_types.h │ ├── include │ │ └── macros.S │ └── stub-newlib-4.4.0.S ├── avr │ ├── Kconfig │ ├── Makefile │ ├── include │ │ └── errno.h │ ├── mach-atmega2560 │ │ └── picoRTOS_device.h │ ├── mach-atmega328p │ │ └── picoRTOS_device.h │ ├── mach-atmega32u4 │ │ └── picoRTOS_device.h │ ├── mach-attiny1607 │ │ └── picoRTOS_device.h │ ├── mach-attiny414 │ │ └── picoRTOS_device.h │ ├── mach-attiny817 │ │ └── picoRTOS_device.h │ ├── mach-attiny88 │ │ ├── picoRTOS_device.h │ │ └── timer-tc0.c │ ├── mach-lgt8fx8p │ │ └── picoRTOS_device.h │ ├── picoRTOS_port.c │ ├── picoRTOS_portasm.S │ ├── picoRTOS_types.h │ ├── timer-rtc.c │ └── timer-tc0.c ├── c2000 │ ├── Kconfig │ ├── Makefile │ ├── c28x │ │ ├── Kconfig │ │ ├── mach-f28379x │ │ │ ├── picoRTOS_device.h │ │ │ └── startup.asm │ │ ├── picoRTOS_port.c │ │ ├── picoRTOS_portasm.asm │ │ └── picoRTOS_types.h │ └── include │ │ └── macros.asm ├── hcs08 │ ├── Kconfig │ ├── Makefile │ ├── include │ │ ├── errno.h │ │ └── macros.S │ ├── mach-mc9s08ptxx │ │ ├── picoRTOS_device.h │ │ ├── startup.S │ │ ├── timer-mtim1.c │ │ └── timer-rtc.c │ ├── picoRTOS_port.c │ ├── picoRTOS_portasm.S │ └── picoRTOS_types.h ├── include │ ├── picoRTOS-SMP_port.h │ └── picoRTOS_port.h ├── mips │ ├── Kconfig │ ├── Makefile │ ├── include │ │ ├── macros.S │ │ └── regs.h │ └── m51xx │ │ ├── Kconfig │ │ ├── mach-pic32mz │ │ ├── intc.c │ │ ├── picoRTOS_device.h │ │ └── startup.S │ │ ├── picoRTOS_port.c │ │ ├── picoRTOS_portasm.S │ │ └── picoRTOS_types.h ├── powerpc │ ├── Kconfig │ ├── Makefile │ ├── e200z4 │ │ ├── include │ │ │ └── macros.S │ │ ├── mach-mpc574x │ │ │ ├── core-mc_me.c │ │ │ ├── intc-siul2.c │ │ │ ├── picoRTOS_device.h │ │ │ ├── spinlock-sema42.c │ │ │ ├── startup.S │ │ │ ├── timer-pit.c │ │ │ └── timer-stm.c │ │ ├── picoRTOS-SMP_port.c │ │ ├── picoRTOS-SMP_portasm.S │ │ ├── picoRTOS_port.c │ │ ├── picoRTOS_portasm.S │ │ └── picoRTOS_types.h │ └── e200z7 │ │ ├── include │ │ └── macros.S │ │ ├── mach-mpc577x │ │ ├── core-siu.c │ │ ├── intc-siu.c │ │ ├── picoRTOS_device.h │ │ ├── spinlock-sema4.c │ │ └── startup.S │ │ ├── picoRTOS-SMP_port.c │ │ ├── picoRTOS-SMP_portasm.S │ │ ├── picoRTOS_port.c │ │ ├── picoRTOS_portasm.S │ │ └── picoRTOS_types.h ├── pthread │ ├── Kconfig │ ├── Makefile │ └── linux │ │ ├── picoRTOS_port.c │ │ └── picoRTOS_types.h ├── riscv │ ├── Kconfig │ ├── Makefile │ ├── include │ │ ├── errno.h │ │ ├── macros.S │ │ └── regs.h │ ├── rv32ec │ │ ├── Kconfig │ │ ├── mach-ch32v003 │ │ │ ├── gcc │ │ │ │ ├── div.S │ │ │ │ ├── muldi3.S │ │ │ │ └── riscv-asm.h │ │ │ ├── intc-pfic.c │ │ │ ├── picoRTOS_device.h │ │ │ ├── startup.S │ │ │ └── timer-stk.c │ │ ├── picoRTOS_port.c │ │ ├── picoRTOS_portasm.S │ │ ├── picoRTOS_types.h │ │ └── timer-pfic.c │ └── rv32imac │ │ ├── Kconfig │ │ ├── mach-gd32vf103 │ │ ├── intc-eclic.c │ │ ├── picoRTOS_device.h │ │ └── startup.S │ │ ├── picoRTOS_port.c │ │ ├── picoRTOS_portasm.S │ │ └── picoRTOS_types.h ├── stm8 │ ├── Kconfig │ ├── Makefile │ ├── include │ │ ├── errno.h │ │ └── macros.S │ ├── mach-stm8s │ │ ├── picoRTOS_device.h │ │ ├── startup.S │ │ └── timer-awu.c │ ├── picoRTOS_port.c │ ├── picoRTOS_portasm.S │ └── picoRTOS_types.h └── win32 │ ├── Kconfig │ ├── Makefile │ ├── picoRTOS_port.c │ └── picoRTOS_types.h ├── demo ├── adafruit-itsybitsy-m4 │ ├── Makefile │ ├── adafruit-itsybitsy-m4.X │ │ ├── Makefile │ │ ├── nbproject │ │ │ ├── Makefile-default.mk │ │ │ ├── Makefile-genesis.properties │ │ │ ├── Makefile-impl.mk │ │ │ ├── Makefile-local-default.mk │ │ │ ├── Makefile-variables.mk │ │ │ ├── configurations.xml │ │ │ ├── private │ │ │ │ ├── configurations.xml │ │ │ │ └── private.xml │ │ │ └── project.xml │ │ ├── samd51g19a_flash.ld │ │ ├── startup_samd51g19a.c │ │ └── system_samd51g19a.c │ ├── adafruit-itsybitsy-m4.c │ ├── adafruit-itsybitsy-m4.h │ ├── configs │ │ ├── adafruit-itsybitsy_flash_defconfig │ │ └── adafruit-itsybitsy_ram_defconfig │ ├── main.c │ └── openocd.cfg ├── amigaball-lcd │ ├── Makefile.adafruit-itsybitsy-m4 │ ├── Makefile.arduino-mega2560 │ ├── Makefile.arduino-nano-v3 │ ├── Makefile.common │ ├── Makefile.devebox-stm32h7xx_m │ ├── Makefile.launchxl-f28379d │ ├── Makefile.raspberry-pico │ ├── Makefile.sipeed-longan-nano │ ├── README.md │ ├── amigaball.c │ ├── board │ │ ├── adafruit-itsybitsy-m4.c │ │ ├── arduino-mega2560.c │ │ ├── arduino-nano-v3-clone.c │ │ ├── arduino-nano-v3.c │ │ ├── board.h │ │ ├── devebox-stm32h7xx_m.c │ │ ├── launchxl-f28379d.c │ │ ├── raspberry-pico.c │ │ └── sipeed-longan-nano.c │ ├── configs │ │ ├── adafruit-itsybitsy-m4_defconfig │ │ ├── arduino-mega2560_defconfig │ │ ├── arduino-nano-v3_defconfig │ │ ├── devebox-stm32h7xx_m_defconfig │ │ ├── launchxl-f28379d_defconfig │ │ ├── raspberry-pico_defconfig │ │ └── sipeed-longan-nano_defconfig │ ├── elf2uf2 │ │ ├── CMakeLists.txt │ │ ├── boot │ │ │ └── uf2.h │ │ ├── elf.h │ │ └── main.cpp │ ├── lcd.c │ ├── lcd.h │ ├── main.c │ └── openocd │ │ ├── adafruit-itsybitsy-m4.cfg │ │ ├── devebox-stm32h7xx-m.cfg │ │ ├── raspberry-pico.cfg │ │ └── sipeed-longan-nano.cfg ├── arduino-due │ ├── Makefile │ ├── README.md │ ├── arduino-due.c │ ├── arduino-due.h │ ├── configs │ │ ├── arduino-due_flash_defconfig │ │ └── arduino-due_ram_defconfig │ ├── main.c │ └── openocd.cfg ├── arduino-mega2560 │ ├── .config │ ├── Makefile │ ├── README.md │ ├── arduino-mega2560.c │ ├── arduino-mega2560.h │ └── main.c ├── arduino-uno │ ├── .config │ ├── Makefile │ ├── README.md │ ├── arduino-uno.c │ ├── arduino-uno.h │ ├── arduino-uno.ino │ └── main.c ├── arduino-uno_r4 │ ├── .config │ ├── Makefile │ ├── README.md │ ├── arduino-uno_r4.c │ ├── arduino-uno_r4.h │ └── main.c ├── attiny1607-cnano │ ├── .config │ ├── Makefile │ ├── README.md │ ├── attiny1607-cnano.X │ │ ├── .gitignore │ │ ├── Makefile │ │ ├── debug │ │ │ └── default │ │ │ │ └── queuelogs │ │ │ │ └── debugtool │ │ └── nbproject │ │ │ ├── Makefile-default.mk │ │ │ ├── Makefile-genesis.properties │ │ │ ├── Makefile-impl.mk │ │ │ ├── Makefile-local-default.mk │ │ │ ├── Makefile-variables.mk │ │ │ ├── configurations.xml │ │ │ ├── private │ │ │ ├── configurations.xml │ │ │ └── private.xml │ │ │ └── project.xml │ ├── attiny1607-cnano.c │ ├── attiny1607-cnano.h │ ├── main.c │ └── picoRTOSConfig.h ├── attiny817-xplained │ ├── .config │ ├── Makefile │ ├── README.md │ ├── attiny817-xplained.X │ │ ├── Makefile │ │ └── nbproject │ │ │ ├── Makefile-Config1.mk │ │ │ ├── Makefile-Config3.mk │ │ │ ├── Makefile-genesis.properties │ │ │ ├── Makefile-impl.mk │ │ │ ├── Makefile-local-Config1.mk │ │ │ ├── Makefile-local-Config3.mk │ │ │ ├── Makefile-variables.mk │ │ │ ├── configurations.xml │ │ │ ├── private │ │ │ ├── configurations.xml │ │ │ └── private.xml │ │ │ └── project.xml │ ├── attiny817-xplained.c │ ├── attiny817-xplained.h │ ├── configs │ │ ├── attiny817-xplained1_defconfig │ │ ├── attiny817-xplained2_defconfig │ │ └── attiny817-xplained3_defconfig │ └── main.c ├── curiosity-2.0-pic32mz-ef │ ├── Makefile │ ├── README.md │ ├── config.S │ ├── configs │ │ ├── curiosity-2.0-pic32mz-ef_flash_defconfig │ │ └── curiosity-2.0-pic32mz-ef_ram_defconfig │ ├── curiosity-2.0-pic32mz-ef.c │ ├── curiosity-2.0-pic32mz-ef.h │ ├── main.c │ └── openocd.cfg ├── devebox-stm32h7xx_m │ ├── Makefile │ ├── configs │ │ ├── devebox-stm32h7xx_m_flash_defconfig │ │ └── devebox-stm32h7xx_m_ram_defconfig │ ├── main.c │ ├── openocd.cfg │ ├── picoRTOSConfig.h │ ├── stm32h7xx_m.c │ └── stm32h7xx_m.h ├── devkit-mpc5748g │ ├── Makefile │ ├── README.md │ ├── build.sh │ ├── configs │ │ ├── devkit-mpc5748g-SMP_flash_defconfig │ │ ├── devkit-mpc5748g-SMP_ram_defconfig │ │ ├── devkit-mpc5748g_flash_defconfig │ │ └── devkit-mpc5748g_ram_defconfig │ ├── devkit-mpc5748g.c │ ├── devkit-mpc5748g.h │ └── main.c ├── launchxl-f28379d │ ├── .cproject │ ├── .project │ ├── Debug │ │ ├── LAUNCHXL-F28379D CPU1 FLASH.launch │ │ └── LAUNCHXL-F28379D CPU1 RAM.launch │ ├── Makefile │ ├── README.md │ ├── configs │ │ ├── launchxl-f28379d_flash_defconfig │ │ └── launchxl-f28379d_ram_defconfig │ ├── launchxl-f28379d.c │ ├── launchxl-f28379d.ccxml │ ├── launchxl-f28379d.h │ └── main.c ├── pthread-linux │ ├── .config │ ├── Makefile │ ├── main.c │ └── picoRTOSConfig.h ├── raspberry-pico │ ├── CMakeLists.txt │ ├── Makefile │ ├── README.md │ ├── configs │ │ ├── raspberry-pico-SMP_flash_defconfig │ │ ├── raspberry-pico-SMP_ram_defconfig │ │ ├── raspberry-pico_flash_defconfig │ │ └── raspberry-pico_ram_defconfig │ ├── elf2uf2 │ │ ├── CMakeLists.txt │ │ ├── boot │ │ │ └── uf2.h │ │ ├── elf.h │ │ └── main.cpp │ ├── main.c │ ├── openocd-SMP.cfg │ ├── openocd.cfg │ ├── raspberry-pico.c │ └── raspberry-pico.h ├── sipeed-longan-nano │ ├── Makefile │ ├── README.md │ ├── configs │ │ ├── sipeed-longan-nano_flash_defconfig │ │ └── sipeed-longan-nano_ram_defconfig │ ├── main.c │ ├── openocd.cfg │ ├── picoRTOSConfig.h │ ├── sipeed-longan-nano.c │ └── sipeed-longan-nano.h └── win32 │ ├── .config │ ├── Makefile │ ├── main.c │ └── picoRTOSConfig.h ├── docs ├── files │ ├── arch │ │ └── include │ │ │ ├── picoRTOS-SMP_port-h.html │ │ │ └── picoRTOS_port-h.html │ ├── drivers │ │ ├── adc │ │ │ ├── adc-avr-c.html │ │ │ ├── adc-nxp_sar-c.html │ │ │ ├── adc-pic32mx-c.html │ │ │ ├── adc-renesas_ra4-c.html │ │ │ ├── adc-rp2040-c.html │ │ │ ├── adc-sam3x-c.html │ │ │ ├── adc-same5x-c.html │ │ │ ├── adc-ti_type4-c.html │ │ │ └── adc-tinyavr-c.html │ │ ├── can │ │ │ ├── can-nxp_flexcan-c.html │ │ │ ├── can-sam3x-c.html │ │ │ └── can-ti_dcan-c.html │ │ ├── clock │ │ │ ├── clock-cy7c6801xa-c.html │ │ │ ├── clock-f28379x-c.html │ │ │ ├── clock-gd32vf103-c.html │ │ │ ├── clock-mpc574xx-c.html │ │ │ ├── clock-n76e003-c.html │ │ │ ├── clock-nxp_siu-c.html │ │ │ ├── clock-pic32mx-c.html │ │ │ ├── clock-renesas_ra4-c.html │ │ │ ├── clock-rp2040-c.html │ │ │ ├── clock-sam3x_pmc-c.html │ │ │ ├── clock-same5x-c.html │ │ │ ├── clock-stm32h7xx-c.html │ │ │ └── clock-tinyavr-c.html │ │ ├── dma │ │ │ ├── dma-gd32vf103-c.html │ │ │ ├── dma-nxp_edma-c.html │ │ │ ├── dma-rp2040-c.html │ │ │ ├── dma-same5x-c.html │ │ │ ├── dma-stm32h7xx-c.html │ │ │ └── dma-ti_f28x-c.html │ │ ├── eeprom │ │ │ └── eeprom-avr-c.html │ │ ├── flash │ │ │ ├── flash-gd32vf103-c.html │ │ │ ├── flash-pic32mx-c.html │ │ │ └── flash-same5x-c.html │ │ ├── gpio │ │ │ ├── gpio-avr-c.html │ │ │ ├── gpio-gd32vf103-c.html │ │ │ ├── gpio-nxp_siu-c.html │ │ │ ├── gpio-nxp_siul2-c.html │ │ │ ├── gpio-pic32mx-c.html │ │ │ ├── gpio-renesas_ra4-c.html │ │ │ ├── gpio-rp2040_sio-c.html │ │ │ ├── gpio-sam3x_pio-c.html │ │ │ ├── gpio-same5x-c.html │ │ │ ├── gpio-stm32h7xx-c.html │ │ │ ├── gpio-ti_f28x-c.html │ │ │ └── gpio-tinyavr-c.html │ │ ├── include │ │ │ ├── adc-h.html │ │ │ ├── can-h.html │ │ │ ├── clock-h.html │ │ │ ├── dma-h.html │ │ │ ├── dmasg-h.html │ │ │ ├── eeprom-h.html │ │ │ ├── flash-h.html │ │ │ ├── gpio-h.html │ │ │ ├── ipwm-h.html │ │ │ ├── lin-h.html │ │ │ ├── pwm-h.html │ │ │ ├── spi-h.html │ │ │ ├── twi-h.html │ │ │ ├── uart-h.html │ │ │ └── wd-h.html │ │ ├── misc │ │ │ ├── misc-pic32mx-c.html │ │ │ └── misc-stm32h7xx_dmamux-c.html │ │ ├── mux │ │ │ ├── mux-avr-c.html │ │ │ ├── mux-gd32vf103-c.html │ │ │ ├── mux-nxp_siu-c.html │ │ │ ├── mux-nxp_siul2-c.html │ │ │ ├── mux-pic32mx-c.html │ │ │ ├── mux-renesas_ra4-c.html │ │ │ ├── mux-rp2040-c.html │ │ │ ├── mux-sam3x_pio-c.html │ │ │ ├── mux-same5x-c.html │ │ │ ├── mux-stm32h7xx-c.html │ │ │ ├── mux-ti_f28x-c.html │ │ │ └── mux-tinyavr-c.html │ │ ├── pwm │ │ │ ├── pwm-avr-c.html │ │ │ ├── pwm-gd32vf103-c.html │ │ │ ├── pwm-nxp_emios-c.html │ │ │ ├── pwm-pic32mx-c.html │ │ │ ├── pwm-renesas_ra4_gpt-c.html │ │ │ ├── pwm-rp2040-c.html │ │ │ ├── pwm-sam3x-c.html │ │ │ ├── pwm-same5x_tc-c.html │ │ │ ├── pwm-stm32h7xx_tim-c.html │ │ │ ├── pwm-ti_epwm-c.html │ │ │ └── pwm-tinyavr_tca-c.html │ │ ├── spi │ │ │ ├── spi-arm_pl022-c.html │ │ │ ├── spi-atmel_sercom-c.html │ │ │ ├── spi-avr-c.html │ │ │ ├── spi-avr_usart-c.html │ │ │ ├── spi-gd32vf103-c.html │ │ │ ├── spi-nxp_dspi-c.html │ │ │ ├── spi-pic32mx-c.html │ │ │ ├── spi-renesas_ra4-c.html │ │ │ ├── spi-sam3x-c.html │ │ │ ├── spi-stm32h7xx-c.html │ │ │ ├── spi-ti_f28x-c.html │ │ │ └── spi-tinyavr-c.html │ │ ├── twi │ │ │ ├── twi-atmel_sercom-c.html │ │ │ ├── twi-avr-c.html │ │ │ ├── twi-dw_apb_i2c-c.html │ │ │ ├── twi-pic32mx-c.html │ │ │ ├── twi-sam3x-c.html │ │ │ └── twi-ti_f28x-c.html │ │ ├── uart │ │ │ ├── uart-arm_pl011-c.html │ │ │ ├── uart-atmel_sercom-c.html │ │ │ ├── uart-avr-c.html │ │ │ ├── uart-gd32vf103-c.html │ │ │ ├── uart-nxp_linflexd-c.html │ │ │ ├── uart-pic32mx-c.html │ │ │ ├── uart-renesas_ra4_sci-c.html │ │ │ ├── uart-sam3x-c.html │ │ │ ├── uart-stm32h7xx-c.html │ │ │ └── uart-tinyavr_usart-c.html │ │ └── wd │ │ │ ├── wd-avr-c.html │ │ │ ├── wd-gd32vf103_fwdgt-c.html │ │ │ ├── wd-pic32mx-c.html │ │ │ ├── wd-rp2040-c.html │ │ │ ├── wd-sam3x-c.html │ │ │ ├── wd-same5x-c.html │ │ │ ├── wd-stm32h7xx_iwdg-c.html │ │ │ ├── wd-ti_f28x-c.html │ │ │ └── wd-tinyavr-c.html │ ├── etc │ │ └── picoRTOSConfig-h.html │ ├── ipc │ │ ├── picoRTOS_cond-c.html │ │ ├── picoRTOS_futex-c.html │ │ ├── picoRTOS_mutex-c.html │ │ └── picoRTOS_queue-h.html │ ├── picoRTOS-SMP-c.html │ ├── picoRTOS-c.html │ ├── picoRTOS-h.html │ └── scheduler │ │ ├── picoRTOS-SMP-c.html │ │ └── picoRTOS-c.html ├── index.html ├── index │ ├── Constants.html │ ├── Files.html │ ├── Functions.html │ ├── Functions2.html │ ├── Functions3.html │ ├── Functions4.html │ ├── Functions5.html │ ├── Functions6.html │ ├── Functions7.html │ ├── Functions8.html │ ├── General.html │ ├── General2.html │ ├── General3.html │ ├── General4.html │ ├── General5.html │ ├── General6.html │ ├── General7.html │ ├── General8.html │ ├── General9.html │ ├── Macros.html │ └── Types.html ├── javascript │ ├── main.js │ ├── prettify.js │ └── searchdata.js ├── kbuild │ ├── 00-INDEX │ ├── kbuild.txt │ ├── kconfig-language.txt │ ├── kconfig.txt │ └── makefiles.txt ├── search │ ├── ConstantsB.html │ ├── ConstantsC.html │ ├── ConstantsG.html │ ├── ConstantsM.html │ ├── ConstantsP.html │ ├── ConstantsS.html │ ├── ConstantsT.html │ ├── ConstantsU.html │ ├── FilesA.html │ ├── FilesC.html │ ├── FilesD.html │ ├── FilesE.html │ ├── FilesF.html │ ├── FilesG.html │ ├── FilesI.html │ ├── FilesL.html │ ├── FilesM.html │ ├── FilesP.html │ ├── FilesS.html │ ├── FilesT.html │ ├── FilesU.html │ ├── FilesW.html │ ├── FunctionsA.html │ ├── FunctionsC.html │ ├── FunctionsD.html │ ├── FunctionsE.html │ ├── FunctionsF.html │ ├── FunctionsG.html │ ├── FunctionsI.html │ ├── FunctionsL.html │ ├── FunctionsM.html │ ├── FunctionsP.html │ ├── FunctionsS.html │ ├── FunctionsT.html │ ├── FunctionsU.html │ ├── FunctionsW.html │ ├── GeneralA.html │ ├── GeneralB.html │ ├── GeneralC.html │ ├── GeneralD.html │ ├── GeneralE.html │ ├── GeneralF.html │ ├── GeneralG.html │ ├── GeneralI.html │ ├── GeneralL.html │ ├── GeneralM.html │ ├── GeneralP.html │ ├── GeneralS.html │ ├── GeneralT.html │ ├── GeneralU.html │ ├── GeneralW.html │ ├── MacrosA.html │ ├── MacrosP.html │ ├── NoResults.html │ ├── TypesG.html │ ├── TypesP.html │ ├── TypesS.html │ └── TypesU.html └── styles │ └── main.css ├── drivers ├── Kconfig ├── adc │ ├── Kconfig │ ├── Makefile │ ├── adc-avr.c │ ├── adc-avr.h │ ├── adc-nxp_sar.c │ ├── adc-nxp_sar.h │ ├── adc-pic32mx.c │ ├── adc-pic32mx.h │ ├── adc-renesas_ra4.c │ ├── adc-renesas_ra4.h │ ├── adc-rp2040.c │ ├── adc-rp2040.h │ ├── adc-sam3x.c │ ├── adc-sam3x.h │ ├── adc-same5x.c │ ├── adc-same5x.h │ ├── adc-ti_type4.c │ ├── adc-ti_type4.h │ ├── adc-tinyavr.c │ └── adc-tinyavr.h ├── can │ ├── Kconfig │ ├── Makefile │ ├── can-nxp_flexcan.c │ ├── can-nxp_flexcan.h │ ├── can-sam3x.c │ ├── can-sam3x.h │ ├── can-ti_dcan.c │ └── can-ti_dcan.h ├── clock │ ├── Kconfig │ ├── Makefile │ ├── clock-atmega2560.c │ ├── clock-atmega2560.h │ ├── clock-atmega328p.c │ ├── clock-atmega328p.h │ ├── clock-attiny88.c │ ├── clock-attiny88.h │ ├── clock-cy7c6801xa.c │ ├── clock-cy7c6801xa.h │ ├── clock-f28379x.c │ ├── clock-f28379x.h │ ├── clock-gd32vf103.c │ ├── clock-gd32vf103.h │ ├── clock-mpc574xx.c │ ├── clock-mpc574xx.h │ ├── clock-n76e003.c │ ├── clock-n76e003.h │ ├── clock-numicro.c │ ├── clock-numicro.h │ ├── clock-nxp_siu.c │ ├── clock-nxp_siu.h │ ├── clock-pic32mx.c │ ├── clock-pic32mx.h │ ├── clock-renesas_ra4.c │ ├── clock-renesas_ra4.h │ ├── clock-rp2040.c │ ├── clock-rp2040.h │ ├── clock-sam3x_pmc.c │ ├── clock-sam3x_pmc.h │ ├── clock-same5x.c │ ├── clock-same5x.h │ ├── clock-stm32h7xx.c │ ├── clock-stm32h7xx.h │ ├── clock-tinyavr.c │ └── clock-tinyavr.h ├── dma │ ├── Kconfig │ ├── Makefile │ ├── dma-gd32vf103.c │ ├── dma-gd32vf103.h │ ├── dma-nxp_edma.c │ ├── dma-nxp_edma.h │ ├── dma-rp2040.c │ ├── dma-rp2040.h │ ├── dma-same5x.c │ ├── dma-same5x.h │ ├── dma-stm32h7xx.c │ ├── dma-stm32h7xx.h │ ├── dma-ti_f28x.c │ └── dma-ti_f28x.h ├── eeprom │ ├── Kconfig │ ├── Makefile │ ├── eeprom-avr.c │ └── eeprom-avr.h ├── flash │ ├── Kconfig │ ├── Makefile │ ├── flash-gd32vf103.c │ ├── flash-gd32vf103.h │ ├── flash-pic32mx.c │ ├── flash-pic32mx.h │ ├── flash-same5x.c │ └── flash-same5x.h ├── gpio │ ├── Kconfig │ ├── Makefile │ ├── gpio-avr.c │ ├── gpio-avr.h │ ├── gpio-gd32vf103.c │ ├── gpio-gd32vf103.h │ ├── gpio-nxp_siu.c │ ├── gpio-nxp_siu.h │ ├── gpio-nxp_siul2.c │ ├── gpio-nxp_siul2.h │ ├── gpio-pic32mx.c │ ├── gpio-pic32mx.h │ ├── gpio-renesas_ra4.c │ ├── gpio-renesas_ra4.h │ ├── gpio-rp2040_sio.c │ ├── gpio-rp2040_sio.h │ ├── gpio-sam3x_pio.c │ ├── gpio-sam3x_pio.h │ ├── gpio-same5x.c │ ├── gpio-same5x.h │ ├── gpio-stm32h7xx.c │ ├── gpio-stm32h7xx.h │ ├── gpio-ti_f28x.c │ ├── gpio-ti_f28x.h │ ├── gpio-tinyavr.c │ └── gpio-tinyavr.h ├── include │ ├── adc.h │ ├── can.h │ ├── clock.h │ ├── dma-sg.h │ ├── dma.h │ ├── dmasg.h │ ├── eeprom.h │ ├── fifo.h │ ├── flash.h │ ├── gpio.h │ ├── ipwm.h │ ├── lin.h │ ├── mux.h │ ├── pwm.h │ ├── rng.h │ ├── spi.h │ ├── twi.h │ ├── uart.h │ └── wd.h ├── misc │ ├── Kconfig │ ├── Makefile │ ├── misc-pic32mx.c │ ├── misc-pic32mx.h │ ├── misc-rp2040_reset.c │ ├── misc-rp2040_reset.h │ ├── misc-stm32h7xx_dmamux.c │ └── misc-stm32h7xx_dmamux.h ├── mux │ ├── Kconfig │ ├── Makefile │ ├── mux-avr.c │ ├── mux-avr.h │ ├── mux-gd32vf103.c │ ├── mux-gd32vf103.h │ ├── mux-nxp_siu.c │ ├── mux-nxp_siu.h │ ├── mux-nxp_siul2.c │ ├── mux-nxp_siul2.h │ ├── mux-pic32mx.c │ ├── mux-pic32mx.h │ ├── mux-renesas_ra4.c │ ├── mux-renesas_ra4.h │ ├── mux-rp2040.c │ ├── mux-rp2040.h │ ├── mux-sam3x_pio.c │ ├── mux-sam3x_pio.h │ ├── mux-same5x.c │ ├── mux-same5x.h │ ├── mux-stm32h7xx.c │ ├── mux-stm32h7xx.h │ ├── mux-ti_f28x.c │ ├── mux-ti_f28x.h │ ├── mux-tinyavr.c │ └── mux-tinyavr.h ├── pwm │ ├── Kconfig │ ├── Makefile │ ├── pwm-avr.c │ ├── pwm-avr.h │ ├── pwm-gd32vf103.c │ ├── pwm-gd32vf103.h │ ├── pwm-nxp_emios.c │ ├── pwm-nxp_emios.h │ ├── pwm-pic32mx.c │ ├── pwm-pic32mx.h │ ├── pwm-renesas_ra4_gpt.c │ ├── pwm-renesas_ra4_gpt.h │ ├── pwm-rp2040.c │ ├── pwm-rp2040.h │ ├── pwm-sam3x.c │ ├── pwm-sam3x.h │ ├── pwm-sam3x_tc.c │ ├── pwm-sam3x_tc.h │ ├── pwm-same5x_tc.c │ ├── pwm-same5x_tc.h │ ├── pwm-stm32h7xx_tim.c │ ├── pwm-stm32h7xx_tim.h │ ├── pwm-ti_epwm.c │ ├── pwm-ti_epwm.h │ ├── pwm-tinyavr_tca.c │ └── pwm-tinyavr_tca.h ├── rng │ ├── Kconfig │ ├── Makefile │ ├── rng-xorshift32.c │ └── rng-xorshift32.h ├── spi │ ├── Kconfig │ ├── Makefile │ ├── spi-arm_pl022.c │ ├── spi-arm_pl022.h │ ├── spi-atmel_sercom.c │ ├── spi-atmel_sercom.h │ ├── spi-avr.c │ ├── spi-avr.h │ ├── spi-avr_irqdriven.c │ ├── spi-avr_irqdriven.h │ ├── spi-avr_usart.c │ ├── spi-avr_usart.h │ ├── spi-gd32vf103.c │ ├── spi-gd32vf103.h │ ├── spi-nxp_dspi.c │ ├── spi-nxp_dspi.h │ ├── spi-pic32mx.c │ ├── spi-pic32mx.h │ ├── spi-renesas_ra4.c │ ├── spi-renesas_ra4.h │ ├── spi-sam3x.c │ ├── spi-sam3x.h │ ├── spi-stm32h7xx.c │ ├── spi-stm32h7xx.h │ ├── spi-ti_f28x.c │ ├── spi-ti_f28x.h │ ├── spi-tinyavr.c │ └── spi-tinyavr.h ├── twi │ ├── Kconfig │ ├── Makefile │ ├── twi-atmel_sercom.c │ ├── twi-atmel_sercom.h │ ├── twi-avr.c │ ├── twi-avr.h │ ├── twi-dw_apb_i2c.c │ ├── twi-dw_apb_i2c.h │ ├── twi-pic32mx.c │ ├── twi-pic32mx.h │ ├── twi-sam3x.c │ ├── twi-sam3x.h │ ├── twi-ti_f28x.c │ └── twi-ti_f28x.h ├── uart │ ├── Kconfig │ ├── Makefile │ ├── uart-arm_pl011.c │ ├── uart-arm_pl011.h │ ├── uart-atmel_sercom.c │ ├── uart-atmel_sercom.h │ ├── uart-avr.c │ ├── uart-avr.h │ ├── uart-avr_irqdriven.c │ ├── uart-avr_irqdriven.h │ ├── uart-gd32vf103.c │ ├── uart-gd32vf103.h │ ├── uart-nxp_linflexd.c │ ├── uart-nxp_linflexd.h │ ├── uart-pic32mx.c │ ├── uart-pic32mx.h │ ├── uart-renesas_ra4_sci.c │ ├── uart-renesas_ra4_sci.h │ ├── uart-sam3x.c │ ├── uart-sam3x.h │ ├── uart-stm32h7xx.c │ ├── uart-stm32h7xx.h │ ├── uart-tinyavr_usart.c │ └── uart-tinyavr_usart.h └── wd │ ├── Kconfig │ ├── Makefile │ ├── wd-avr.c │ ├── wd-avr.h │ ├── wd-gd32vf103_fwdgt.c │ ├── wd-gd32vf103_fwdgt.h │ ├── wd-pic32mx.c │ ├── wd-pic32mx.h │ ├── wd-rp2040.c │ ├── wd-rp2040.h │ ├── wd-sam3x.c │ ├── wd-sam3x.h │ ├── wd-same5x.c │ ├── wd-same5x.h │ ├── wd-stm32h7xx_iwdg.c │ ├── wd-stm32h7xx_iwdg.h │ ├── wd-ti_f28x.c │ ├── wd-ti_f28x.h │ ├── wd-tinyavr.c │ └── wd-tinyavr.h ├── etc ├── Requirements.md ├── images │ ├── banner.png │ └── make-menuconfig.png ├── naturaldocs │ ├── Languages.txt │ ├── Menu.txt │ └── Topics.txt └── uncrustify.cfg ├── ipc ├── Kconfig ├── Makefile ├── picoRTOS_cond.c ├── picoRTOS_cond.h ├── picoRTOS_futex.c ├── picoRTOS_futex.h ├── picoRTOS_mutex.c ├── picoRTOS_mutex.h ├── picoRTOS_queue.c └── picoRTOS_queue.h ├── picoRTOS-SMP.h ├── picoRTOS.h ├── samples ├── Makefile.template └── ldscripts │ ├── armvx-m_ram_sections.ld │ ├── armvx-m_xip_sections.ld │ ├── atsam3x8e_flash_xip.ld │ ├── atsam3x8e_ram.ld │ ├── atsamd51g18a_flash_xip.ld │ ├── atsamd51g18a_ram.ld │ ├── atsamd51g19a_arduino-boot_flash_xip.ld │ ├── atsamd51g19a_arduino-boot_ram.ld │ ├── atsamd51g19a_flash_xip.ld │ ├── atsamd51g19a_ram.ld │ ├── ch32v003_flash_xip.ld │ ├── ch32v003_ram.ld │ ├── f28379x_flash_xip.cmd │ ├── f28379x_ram.cmd │ ├── gd32vf103c8t6_flash_xip.ld │ ├── gd32vf103c8t6_ram.ld │ ├── gd32vf103cbt6_flash_xip.ld │ ├── gd32vf103cbt6_ram.ld │ ├── mpc5748g_flash_xip.ld │ ├── mpc5748g_ram.ld │ ├── mpc5775e-evb_flash_xip.ld │ ├── mpc5775e-evb_ram.ld │ ├── pic32mz-efm_1024_flash_xip.ld │ ├── pic32mz-efm_1024_ram.ld │ ├── pic32mz-efm_2048_flash_xip.ld │ ├── pic32mz-efm_2048_ram.ld │ ├── ppc-eabivle_flash_xip_sections.ld │ ├── ppc-eabivle_ram_sections.ld │ ├── renesas_ra4_arduino_flash_xip.ld │ ├── renesas_ra4_arduino_ram.ld │ ├── renesas_ra4_flash_xip.ld │ ├── renesas_ra4_ram.ld │ ├── rp2040_flash_xip.ld │ ├── rp2040_ram.ld │ ├── rv32imac_ram_sections.ld │ ├── rv32imac_xip_sections.ld │ ├── stm32f103x8_flash_xip.ld │ ├── stm32f103x8_ram.ld │ ├── stm32f401rc_flash_xip.ld │ ├── stm32f401rc_ram.ld │ ├── stm32h743_flash_xip.ld │ ├── stm32h743_ram.ld │ ├── stm32h750_flash_xip.ld │ ├── stm32h750_ram.ld │ ├── stm32l431rc_flash_xip.ld │ └── stm32l431rc_ram.ld ├── scheduler ├── Kconfig ├── Makefile ├── picoRTOS-SMP.c └── picoRTOS.c ├── scripts ├── Kbuild.include ├── Makefile ├── Makefile.build ├── Makefile.cl2000 ├── Makefile.clean ├── Makefile.deploy ├── Makefile.gcc ├── Makefile.host ├── Makefile.lib ├── Makefile.sdcc ├── Makefile.static ├── Makefile.uncrustify ├── Sources.include ├── basic │ ├── .gitignore │ ├── Makefile │ └── fixdep.c ├── hdr2asm.pl ├── kconfig │ ├── .gitignore │ ├── Makefile │ ├── POTFILES.in │ ├── check.sh │ ├── conf.c │ ├── confdata.c │ ├── expr.c │ ├── expr.h │ ├── gconf.c │ ├── gconf.glade │ ├── images.c │ ├── kconfig_load.c │ ├── kxgettext.c │ ├── lex.zconf.c_shipped │ ├── lkc.h │ ├── lkc_proto.h │ ├── lxdialog │ │ ├── .gitignore │ │ ├── BIG.FAT.WARNING │ │ ├── check-lxdialog.sh │ │ ├── checklist.c │ │ ├── dialog.h │ │ ├── inputbox.c │ │ ├── menubox.c │ │ ├── textbox.c │ │ ├── util.c │ │ └── yesno.c │ ├── mconf.c │ ├── menu.c │ ├── nconf.c │ ├── nconf.gui.c │ ├── nconf.h │ ├── qconf.cc │ ├── qconf.h │ ├── streamline_config.pl │ ├── symbol.c │ ├── util.c │ ├── zconf.gperf │ ├── zconf.hash.c_shipped │ ├── zconf.l │ ├── zconf.tab.c_shipped │ └── zconf.y └── mkmakefile ├── staging ├── Kconfig ├── demo │ ├── arduino-nano-v3-clone │ │ ├── .config │ │ ├── Makefile │ │ ├── README.md │ │ ├── arduino-nano-v3-clone.c │ │ ├── arduino-nano-v3-clone.h │ │ └── main.c │ ├── ch32v003f4p6-r0-1v1 │ │ ├── .config │ │ ├── Makefile │ │ ├── README.md │ │ ├── ch32v003f4p6-r0-1v1.c │ │ ├── ch32v003f4p6-r0-1v1.h │ │ └── main.c │ ├── devebox-stc-c51 │ │ ├── .config │ │ ├── Makefile │ │ ├── devebox-stc-c51.c │ │ ├── devebox-stc-c51.h │ │ └── main.c │ ├── ez-usb-fx2 │ │ ├── .config │ │ ├── Makefile │ │ └── main.c │ ├── mh-tiny │ │ ├── .config │ │ ├── Makefile │ │ ├── Makefile.debug │ │ ├── main.c │ │ ├── mh-tiny.c │ │ └── mh-tiny.h │ ├── mpc5775e-evb │ │ ├── Makefile │ │ ├── README.md │ │ ├── configs │ │ │ ├── mpc5775e-evb-SMP_flash_defconfig │ │ │ ├── mpc5775e-evb-SMP_ram_defconfig │ │ │ ├── mpc5775e-evb_flash_defconfig │ │ │ └── mpc5775e-evb_ram_defconfig │ │ ├── main.c │ │ ├── mpc5775e-evb.c │ │ └── mpc5775e-evb.h │ ├── n76e003 │ │ ├── .config │ │ ├── Makefile │ │ ├── Makefile.debug │ │ ├── config.json │ │ ├── debug.sh │ │ ├── main.c │ │ ├── n76e003.c │ │ └── n76e003.h │ ├── s08pt60-evk-noclk │ │ ├── .config │ │ ├── Makefile │ │ ├── Makefile.debug │ │ ├── main.c │ │ ├── s08pt60-evk.c │ │ └── s08pt60-evk.h │ ├── s08pt60-evk │ │ ├── .config │ │ ├── Makefile │ │ ├── Makefile.debug │ │ ├── README.md │ │ ├── main.c │ │ ├── s08pt60-evk.c │ │ └── s08pt60-evk.h │ ├── stm32f103xx │ │ ├── .config │ │ ├── Makefile │ │ ├── main.c │ │ ├── stm32f103xx.c │ │ └── stm32f103xx.h │ ├── stm32f401rct6 │ │ ├── .config │ │ ├── Makefile │ │ ├── main.c │ │ ├── stm32f401rct6.c │ │ └── stm32f401rct6.h │ ├── stm8s003f3p3 │ │ ├── .config │ │ ├── Makefile │ │ ├── Makefile.debug │ │ ├── main.c │ │ ├── stm8s003f3p3.c │ │ └── stm8s003f3p3.h │ ├── ucsim_51 │ │ ├── .config │ │ ├── Makefile │ │ ├── Makefile.debug │ │ └── main.c │ └── yd-stm32l4431rc │ │ ├── .config │ │ ├── Makefile │ │ ├── main.c │ │ ├── yd-stm32l431rc.c │ │ └── yd-stm32l431rc.h └── drivers │ ├── adc │ ├── Kconfig │ ├── Makefile │ ├── adc-gd32vf103.c │ ├── adc-gd32vf103.h │ ├── adc-mc9s08ptxx.c │ ├── adc-mc9s08ptxx.h │ ├── adc-n76e003_sar.c │ ├── adc-n76e003_sar.h │ ├── adc-nxp_eqadc.c │ └── adc-nxp_eqadc.h │ ├── can │ ├── Kconfig │ ├── Makefile │ ├── can-gd32vf103.c │ ├── can-gd32vf103.h │ ├── can-pic32mx.c │ ├── can-pic32mx.h │ ├── can-same5x.c │ └── can-same5x.h │ ├── clock │ ├── .notempty │ ├── Kconfig │ ├── Makefile │ ├── clock-ch32v003.c │ ├── clock-ch32v003.h │ ├── clock-lgt8fx8p.c │ ├── clock-lgt8fx8p.h │ ├── clock-mc9s08ptxx.c │ ├── clock-mc9s08ptxx.h │ ├── clock-stc12c5axx.c │ ├── clock-stc12c5axx.h │ ├── clock-stm32f10xxx.c │ ├── clock-stm32f10xxx.h │ ├── clock-stm32f401x.c │ ├── clock-stm32f401x.h │ ├── clock-stm32l4x.c │ ├── clock-stm32l4x.h │ ├── clock-stm8.c │ └── clock-stm8.h │ ├── dma │ ├── Kconfig │ ├── Makefile │ ├── dma-stm32h7xx_bdma.c │ └── dma-stm32h7xx_bdma.h │ ├── dmasg │ ├── Kconfig │ ├── Makefile │ ├── dmasg-nxp_edma.c │ └── dmasg-nxp_edma.h │ ├── flash │ ├── Kconfig │ ├── Makefile │ ├── flash-nxp_c55fmc.c │ ├── flash-nxp_c55fmc.h │ ├── flash-sam3x.c │ └── flash-sam3x.h │ ├── gpio │ ├── .notempty │ ├── Kconfig │ ├── Makefile │ ├── gpio-8051.c │ ├── gpio-8051.h │ ├── gpio-mc9s08ptxx.c │ ├── gpio-mc9s08ptxx.h │ ├── gpio-n76e003.c │ ├── gpio-n76e003.h │ ├── gpio-stm32f10xxx.c │ ├── gpio-stm32f10xxx.h │ ├── gpio-stm8.c │ ├── gpio-stm8.h │ ├── gpio-wch_ch32x.c │ └── gpio-wch_ch32x.h │ ├── lin │ ├── Kconfig │ ├── Makefile │ ├── lin-nxp_linflexd.c │ └── lin-nxp_linflexd.h │ ├── misc │ ├── Kconfig │ ├── Makefile │ ├── misc-nxp_igf.c │ └── misc-nxp_igf.h │ ├── mux │ ├── Kconfig │ ├── Makefile │ ├── mux-8051.c │ ├── mux-8051.h │ ├── mux-mc9s08ptxx.c │ ├── mux-mc9s08ptxx.h │ ├── mux-n76e003.c │ ├── mux-n76e003.h │ ├── mux-stm32f10xxx.c │ ├── mux-stm32f10xxx.h │ ├── mux-stm8.c │ ├── mux-stm8.h │ ├── mux-wch_ch32x.c │ └── mux-wch_ch32x.h │ ├── pwm │ ├── .notempty │ ├── Kconfig │ ├── Makefile │ ├── pwm-mc9s08ptxx_ftm.c │ ├── pwm-mc9s08ptxx_ftm.h │ ├── pwm-n76e003.c │ └── pwm-n76e003.h │ ├── rng │ ├── Kconfig │ └── Makefile │ ├── spi │ ├── .notempty │ ├── Kconfig │ ├── Makefile │ ├── spi-mc9s08ptxx.c │ ├── spi-mc9s08ptxx.h │ ├── spi-n76e003.c │ └── spi-n76e003.h │ ├── twi │ ├── Kconfig │ ├── Makefile │ ├── twi-gd32vf103.c │ ├── twi-gd32vf103.h │ ├── twi-mc9s08ptxx.c │ ├── twi-mc9s08ptxx.h │ ├── twi-n76e003.c │ ├── twi-n76e003.h │ ├── twi-nxp_i2c.c │ ├── twi-nxp_i2c.h │ ├── twi-renesas_ra4.c │ ├── twi-renesas_ra4.h │ ├── twi-stm32h7xx.c │ └── twi-stm32h7xx.h │ ├── uart │ ├── .notempty │ ├── Kconfig │ ├── Makefile │ ├── uart-8051.c │ ├── uart-8051.h │ ├── uart-8051_irqdriven.c │ ├── uart-8051_irqdriven.h │ ├── uart-mc9s08ptxx_sci.c │ ├── uart-mc9s08ptxx_sci.h │ ├── uart-n76e003.c │ ├── uart-n76e003.h │ ├── uart-n76e003_irqdriven.c │ └── uart-n76e003_irqdriven.h │ └── wd │ ├── Kconfig │ ├── Makefile │ ├── wd-mc9s08ptxx.c │ ├── wd-mc9s08ptxx.h │ ├── wd-renesas_ra4_wdt.c │ └── wd-renesas_ra4_wdt.h └── test ├── footprint ├── Makefile ├── configs │ ├── armv7-m_defconfig │ ├── armv7e-m_defconfig │ ├── atmega_defconfig │ ├── attiny_defconfig │ ├── c28x_defconfig │ ├── mips_defconfig │ ├── rp2040_defconfig │ └── rv32imac_defconfig ├── footprint ├── main.c └── memory_usage ├── run_demo_amigaball_build.sh ├── run_demo_build.sh ├── run_demo_staticcheck.sh ├── run_staging_demo_build.sh ├── run_staging_demo_staticcheck.sh ├── run_tests.sh ├── static_analysis ├── picoRTOS-SMP │ ├── Makefile │ ├── configs │ │ ├── base.config │ │ ├── mach-mpc574x_defconfig │ │ ├── mach-mpc577x_defconfig │ │ └── mach-rp2040_defconfig │ └── test.c └── picoRTOS │ ├── Makefile │ ├── configs │ ├── base.config │ ├── mach-atmega2560_defconfig │ ├── mach-atmega328p_defconfig │ ├── mach-atmega32u4_defconfig │ ├── mach-atsam3x8e_defconfig │ ├── mach-atsame5x_defconfig │ ├── mach-attiny1607_defconfig │ ├── mach-attiny414_defconfig │ ├── mach-attiny817_defconfig │ ├── mach-ch32v003_defconfig │ ├── mach-f28379x_defconfig │ ├── mach-gd32vf103_defconfig │ ├── mach-mc9s08ptxx_defconfig │ ├── mach-mpc574x_defconfig │ ├── mach-mpc577x_defconfig │ ├── mach-pic32mz_defconfig │ ├── mach-rp2040_defconfig │ ├── mach-stc12c5axx_defconfig │ ├── mach-stm32h7xx_defconfig │ └── mach-stm8s_defconfig │ └── test.c └── unit_tests ├── Makefile ├── stub ├── generated │ └── autoconf.h ├── picoRTOS_device.h ├── picoRTOS_port.c └── picoRTOS_types.h ├── test.c └── unit_test.h /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: jnaulet 4 | -------------------------------------------------------------------------------- /arch/8051/mach-mcs51/interrupt.c: -------------------------------------------------------------------------------- 1 | #include "picoRTOS_device.h" 2 | #include "picoRTOS_port.h" 3 | 4 | void arch_enable_interrupt(picoRTOS_irq_t irq) 5 | { 6 | arch_assert_void(irq < (picoRTOS_irq_t)DEVICE_INTERRUPT_VECTOR_COUNT); 7 | } 8 | 9 | void arch_disable_interrupt(picoRTOS_irq_t irq) 10 | { 11 | arch_assert_void(irq < (picoRTOS_irq_t)DEVICE_INTERRUPT_VECTOR_COUNT); 12 | } 13 | -------------------------------------------------------------------------------- /arch/arm/armv6-m/Kconfig: -------------------------------------------------------------------------------- 1 | choice 2 | prompt "ARMV6-M device" 3 | depends on ARMV6M 4 | 5 | config MACH_RP2040 6 | bool "Raspberry RP2040" 7 | 8 | endchoice 9 | -------------------------------------------------------------------------------- /arch/arm/armv6-m/mach-rp2040/picoRTOS-SMP_portasm.S: -------------------------------------------------------------------------------- 1 | .syntax unified 2 | .cpu cortex-m0plus 3 | 4 | .equ SYSTICK_CVR, 0xe000e018 5 | 6 | .text 7 | 8 | .thumb_func 9 | .type arch_SIO_PROC1, %function 10 | .global arch_SIO_PROC1 11 | arch_SIO_PROC1: 12 | pop {r0} /* get task sp */ 13 | push {lr} /* store lr for return */ 14 | 15 | /* reset local timer */ 16 | ldr r3, =SYSTICK_CVR 17 | str r3, [r3] 18 | 19 | bl picoRTOS_tick 20 | 21 | /* return */ 22 | pop {r1} 23 | push {r0} /* send back new sp */ 24 | bx r1 25 | -------------------------------------------------------------------------------- /arch/arm/armv7-m/Kconfig: -------------------------------------------------------------------------------- 1 | choice 2 | prompt "ARMV7-M device" 3 | depends on ARMV7M 4 | 5 | config MACH_ATSAM3X8E 6 | bool "Atmel ATSAM3X8E" 7 | 8 | config MACH_STM32F10XXX 9 | bool "STMicro STM32F10xxx Series" 10 | 11 | endchoice 12 | -------------------------------------------------------------------------------- /arch/arm/armv7e-m/Kconfig: -------------------------------------------------------------------------------- 1 | choice 2 | prompt "ARMV7E-M device" 3 | depends on ARMV7EM 4 | 5 | config MACH_ATSAME5X 6 | bool "Atmel ATSAME5x/D5x Series" 7 | 8 | config MACH_STM32H7XX 9 | bool "STMicro STM32H7XX Series" 10 | 11 | config MACH_RENESAS_RA4 12 | bool "Renesas RA4 Series" 13 | 14 | config MACH_STM32F401X 15 | bool "STMicro STM32F401x Series" 16 | 17 | config MACH_STM32L4X 18 | bool "STMicro STM32L4x Series" 19 | 20 | endchoice 21 | 22 | choice 23 | depends on ARMV7EM 24 | prompt "FPU support" 25 | 26 | config FPV4_SP_D16 27 | bool "fpv4-sp-d16" 28 | 29 | config FPV5_SP_D16 30 | bool "fpv5-sp-d16" 31 | 32 | endchoice 33 | -------------------------------------------------------------------------------- /arch/arm/stub-newlib-4.4.0.S: -------------------------------------------------------------------------------- 1 | .syntax unified 2 | 3 | /* STUB_NEWLIB */ 4 | .macro STUB_NEWLIB func 5 | .thumb_func 6 | .type \func, %function 7 | .global \func 8 | \func: 9 | bx lr 10 | .endm 11 | 12 | /* To ensure we link */ 13 | STUB_NEWLIB _write 14 | STUB_NEWLIB _sbrk 15 | STUB_NEWLIB _close 16 | STUB_NEWLIB _read 17 | STUB_NEWLIB _lseek 18 | STUB_NEWLIB _fstat 19 | STUB_NEWLIB _getpid 20 | STUB_NEWLIB _isatty 21 | STUB_NEWLIB _kill 22 | -------------------------------------------------------------------------------- /arch/c2000/Kconfig: -------------------------------------------------------------------------------- 1 | menu "TI C2000 architecture" 2 | depends on C2000 3 | 4 | choice 5 | prompt "CPU series" 6 | default C28X 7 | 8 | config C28X 9 | bool "TI C2000/C28x series" 10 | 11 | endchoice 12 | 13 | source arch/c2000/c28x/Kconfig 14 | 15 | endmenu 16 | -------------------------------------------------------------------------------- /arch/c2000/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # TI C2000 platforms 3 | # 4 | arch-c2000 := $(srctree)/arch/c2000 5 | 6 | c_src-$(CONFIG_C28X) += $(arch-c2000)/c28x/picoRTOS_port.c 7 | a_src-$(CONFIG_C28X) += $(arch-c2000)/c28x/picoRTOS_portasm.asm 8 | 9 | a_src-$(CONFIG_MACH_F28379X) += $(arch-c2000)/c28x/mach-f28379x/startup.asm 10 | 11 | # opt 12 | abi-$(CONFIG_C28X_EABI) := --abi=eabi 13 | float_support-$(CONFIG_C28X_FPU) := --float_support=fpu64 14 | 15 | rts-$(CONFIG_C28X) := -lrts2800_ml.lib 16 | rts-$(CONFIG_C28X_EABI) := -lrts2800_ml_eabi.lib 17 | rts-$(CONFIG_C28X_FPU) := -lrts2800_fpu64_eabi.lib 18 | -------------------------------------------------------------------------------- /arch/c2000/c28x/Kconfig: -------------------------------------------------------------------------------- 1 | choice 2 | prompt "C28x device" 3 | depends on C28X 4 | 5 | config MACH_F28379X 6 | bool "TMS320F28379X" 7 | 8 | endchoice 9 | 10 | config C28X_FPU 11 | bool "Support for FPU" 12 | depends on C28X 13 | select C28X_EABI 14 | 15 | config C28X_EABI 16 | bool "Support for EABI" 17 | depends on C28X 18 | default n 19 | 20 | -------------------------------------------------------------------------------- /arch/c2000/include/macros.asm: -------------------------------------------------------------------------------- 1 | ;; Macros for TI C2000 machines 2 | 3 | def_irq_handler .macro handler 4 | .weak handler 5 | .global handler 6 | handler: 7 | estop0 8 | lb handler 9 | .endm 10 | 11 | TURN_WATCHDOG_OFF .macro 12 | eallow 13 | movl XAR4, #(ADDR_WD + 0x29) ; WD_WCSR 14 | mov *XAR4, #0x68 15 | edis 16 | .endm 17 | 18 | TURN_WATCHDOG_ON .macro 19 | eallow 20 | movl XAR4, #(ADDR_WD + 0x29) ; WD_WCSR 21 | mov *XAR4, #0x28 22 | edis 23 | .endm 24 | 25 | COPY_TO_RAM .macro base, start, end 26 | movl XAR4, start 27 | mov ACC, end - 1 28 | subl ACC, XAR4 29 | movl XAR7, base 30 | rpt @AL || pread *XAR4++, *XAR7 31 | .endm 32 | -------------------------------------------------------------------------------- /arch/hcs08/Kconfig: -------------------------------------------------------------------------------- 1 | menu "HCS08 architecture" 2 | depends on HCS08 3 | 4 | choice 5 | prompt "MCU series" 6 | default MACH_MC9S08PT60 7 | 8 | config MACH_MC9S08PT60 9 | bool "NXP MC9S08PT60" 10 | select MACH_MC9S08PTXX 11 | 12 | config MACH_MC9S08PT32 13 | bool "NXP MC9S08PT32" 14 | select MACH_MC9S08PTXX 15 | 16 | endchoice 17 | 18 | config MACH_MC9S08PTXX 19 | bool 20 | 21 | choice 22 | prompt "SysTick clock selection" 23 | default MACH_MC9S08PTXX_MTIM1 24 | depends on MACH_MC9S08PTXX 25 | 26 | config SYSTICK_MC9S08PTXX_MTIM1 27 | bool "Use MTIM1 as SysTick clock" 28 | 29 | config SYSTICK_MC9S08PTXX_RTC 30 | bool "Use RTC as SysTick clock" 31 | 32 | endchoice 33 | 34 | endmenu 35 | -------------------------------------------------------------------------------- /arch/hcs08/include/macros.S: -------------------------------------------------------------------------------- 1 | ;; Generic asm macros for hcs08 2 | ;; 3 | ;; Provides: 4 | ;; 5 | ;; COPY_TO_RAM 6 | ;; INIT_STACK 7 | ;; ZERO_RAM 8 | ;; IRQ_HANDLER 9 | ;; 10 | 11 | .macro COPY_TO_RAM base, start, len, ?loop, ?end 12 | ldhx #0 13 | loop: 14 | cphx len 15 | beq end 16 | lda base,x 17 | sta start,x 18 | aix #1 19 | bra loop 20 | end: 21 | .endm 22 | 23 | .macro INIT_STACK base 24 | ldhx base 25 | txs 26 | .endm 27 | 28 | .macro ZERO_RAM start, len, ?loop, ?end 29 | ldhx #0 30 | clra 31 | loop: 32 | cphx len 33 | beq end 34 | sta start,x 35 | aix #1 36 | bra loop 37 | end: 38 | .endm 39 | 40 | .macro IRQ_HANDLER name, num 41 | .globl name 42 | name: 43 | lda num 44 | jmp Default_Handler 45 | .endm 46 | -------------------------------------------------------------------------------- /arch/mips/Kconfig: -------------------------------------------------------------------------------- 1 | menu "MIPS architecture" 2 | depends on MIPS 3 | 4 | choice 5 | prompt "CPU series" 6 | default M51XX 7 | 8 | config M51XX 9 | bool "MIPS32 M51xx series" 10 | 11 | endchoice 12 | 13 | source arch/mips/m51xx/Kconfig 14 | 15 | endmenu 16 | -------------------------------------------------------------------------------- /arch/mips/Makefile: -------------------------------------------------------------------------------- 1 | # MIPS arch makefile 2 | arch-mips := $(srctree)/arch/mips 3 | 4 | c_src-$(CONFIG_M51XX) += $(arch-mips)/m51xx/picoRTOS_port.c 5 | a_src-$(CONFIG_M51XX) += $(arch-mips)/m51xx/picoRTOS_portasm.S 6 | 7 | # machines 8 | c_src-$(CONFIG_MACH_PIC32MZ) += $(arch-mips)/m51xx/mach-pic32mz/intc.c 9 | a_src-$(CONFIG_MACH_PIC32MZ) += $(arch-mips)/m51xx/mach-pic32mz/startup.S 10 | 11 | # include 12 | include-$(CONFIG_M51XX) += -I$(arch-mips)/m51xx 13 | include-$(CONFIG_MACH_PIC32MZ) += -I$(arch-mips)/m51xx/mach-pic32mz 14 | 15 | ccflags-$(CONFIG_MIPS) += $(include-y) 16 | asflags-$(CONFIG_MIPS) += $(include-y) 17 | ldflags-$(CONFIG_MIPS) += -nostartfiles -nostdlib 18 | 19 | # static analysis improvements 20 | cppcheckflags-$(CONFIG_MIPS) += --platform=mips32 21 | -------------------------------------------------------------------------------- /arch/mips/m51xx/Kconfig: -------------------------------------------------------------------------------- 1 | choice 2 | prompt "M51xx device" 3 | depends on M51XX 4 | 5 | config MACH_PIC32MZ 6 | bool "PIC32MZ Family" 7 | 8 | endchoice 9 | 10 | config M51XX_DSP 11 | depends on M51XX 12 | default y 13 | bool "Support for DSP" 14 | 15 | config M51XX_FPU64 16 | depends on M51XX 17 | default y 18 | bool "Support for FPU64" 19 | -------------------------------------------------------------------------------- /arch/powerpc/Kconfig: -------------------------------------------------------------------------------- 1 | menu "PowerPC architecture" 2 | depends on POWERPC 3 | 4 | choice 5 | prompt "PowerPC series" 6 | 7 | config E200Z4 8 | bool "PowerPC e200z4 series" 9 | 10 | config E200Z7 11 | bool "PowerPC e200z7 series" 12 | 13 | endchoice 14 | 15 | choice 16 | prompt "Device" 17 | 18 | config MACH_MPC574X 19 | bool "NXP MPC574x series" 20 | depends on E200Z4 21 | 22 | config MACH_MPC577X 23 | bool "NXP MPC577x series" 24 | depends on E200Z7 25 | 26 | endchoice 27 | 28 | config CACHE_MAINTENANCE 29 | bool "Cache maintenance operations" 30 | default y if E200Z4 31 | default n if E200Z7 32 | 33 | config DEBUG_AUX_CORE_STARTUP 34 | bool "Debug auxiliary core startup (Warning: not for production)" 35 | depends on SMP 36 | default n 37 | 38 | endmenu 39 | -------------------------------------------------------------------------------- /arch/powerpc/e200z7/mach-mpc577x/core-siu.c: -------------------------------------------------------------------------------- 1 | #include "picoRTOS_device.h" 2 | #include "picoRTOS-SMP_port.h" 3 | 4 | #include 5 | #include 6 | 7 | #define SIU_HLT1 ((volatile uint32_t*)(ADDR_SIU + 0x9a4)) 8 | #define SIU_RSTVEC1 ((volatile uint32_t*)(ADDR_SIU + 0x9b0)) 9 | 10 | #define SIU_RSTVEC1_VLE (1 << 0) 11 | 12 | /* ASM */ 13 | /*@external@*/ extern void arch_core_start(void); 14 | 15 | void arch_core_run(picoRTOS_core_t core) 16 | { 17 | arch_assert_void(core < (picoRTOS_core_t)CONFIG_SMP_CORES); 18 | 19 | /* start (vle mode) */ 20 | *SIU_RSTVEC1 = (uint32_t)arch_core_start | SIU_RSTVEC1_VLE; 21 | } 22 | -------------------------------------------------------------------------------- /arch/pthread/Kconfig: -------------------------------------------------------------------------------- 1 | menu "PTHREAD simulation" 2 | depends on PTHREAD 3 | 4 | choice 5 | prompt "System" 6 | default PTHREAD_LINUX 7 | 8 | config PTHREAD_LINUX 9 | bool "Linux pthreads" 10 | 11 | endchoice 12 | 13 | endmenu 14 | -------------------------------------------------------------------------------- /arch/pthread/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # PTHREAD simulation makefile 3 | # 4 | arch-pthread := $(srctree)/arch/pthread 5 | 6 | c_src-$(CONFIG_PTHREAD_LINUX) += $(arch-pthread)/linux/picoRTOS_port.c 7 | 8 | # static analysis improvements 9 | cppcheckflags-$(CONFIG_PTHREAD_LINUX) += --platform=native 10 | -------------------------------------------------------------------------------- /arch/pthread/linux/picoRTOS_types.h: -------------------------------------------------------------------------------- 1 | #ifndef PICORTOS_TYPES_H 2 | #define PICORTOS_TYPES_H 3 | 4 | typedef unsigned long picoRTOS_stack_t; 5 | typedef unsigned long picoRTOS_priority_t; 6 | typedef unsigned long picoRTOS_pid_t; 7 | typedef unsigned long picoRTOS_tick_t; 8 | typedef unsigned long picoRTOS_atomic_t; 9 | typedef unsigned long picoRTOS_irq_t; 10 | typedef unsigned long picoRTOS_cycles_t; 11 | 12 | typedef long picoRTOS_intptr_t; 13 | typedef unsigned long picoRTOS_uintptr_t; 14 | 15 | #define ARCH_INITIAL_STACK_COUNT 10 16 | #define ARCH_MIN_STACK_COUNT ARCH_INITIAL_STACK_COUNT 17 | #define ARCH_L1_DCACHE_LINESIZE 4 18 | 19 | /* splint doesn't like inline assembly */ 20 | #ifdef S_SPLINT_S 21 | # define ASM(x) {} 22 | #else 23 | # define ASM(x) { __asm__ volatile (x); } 24 | # define arch_break() ASM("int3") 25 | #endif 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /arch/riscv/Kconfig: -------------------------------------------------------------------------------- 1 | menu "RISC-V architecture" 2 | depends on RISCV 3 | 4 | choice 5 | prompt "CPU series" 6 | default RV32IMAC 7 | 8 | config RV32IMAC 9 | bool "RISC-V RV32IMAC series" 10 | 11 | config RV32EC 12 | bool "RISC-V RV32EC series" 13 | 14 | endchoice 15 | 16 | source arch/riscv/rv32imac/Kconfig 17 | source arch/riscv/rv32ec/Kconfig 18 | 19 | endmenu 20 | -------------------------------------------------------------------------------- /arch/riscv/include/macros.S: -------------------------------------------------------------------------------- 1 | /* RISC-V macros & definitions 2 | * Provides a few useful macros: 3 | * COPY_TO_RAM 4 | * ZERO_RAM 5 | */ 6 | #include "regs.h" 7 | 8 | /* COPY_TO_RAM */ 9 | .macro COPY_TO_RAM base, start, end 10 | la t0, \base 11 | la t1, \start 12 | la t2, \end 13 | j 2f 14 | 1: 15 | lw a0, (t0) 16 | sw a0, (t1) 17 | addi t0, t0, 4 18 | addi t1, t1, 4 19 | 2: 20 | bne t1, t2, 1b 21 | .endm 22 | 23 | /* ZERO_RAM */ 24 | .macro ZERO_RAM start, end 25 | la t0, \start 26 | la t1, \end 27 | j 2f 28 | 1: 29 | sw zero, (t0) 30 | addi t0, t0, 4 31 | 2: 32 | bne t0, t1, 1b 33 | .endm 34 | 35 | /* def_irq_handler */ 36 | .macro def_irq_handler handler_name 37 | .align 4 38 | .weak \handler_name 39 | \handler_name: 40 | ebreak 41 | j \handler_name 42 | .endm 43 | -------------------------------------------------------------------------------- /arch/riscv/include/regs.h: -------------------------------------------------------------------------------- 1 | #ifndef RISCV_REGS_H 2 | #define RISCV_REGS_H 3 | 4 | #define zero x0 5 | #define ra x1 6 | #define sp x2 7 | #define gp x3 8 | #define tp x4 9 | #define t0 x5 10 | #define t1 x6 11 | #define t2 x7 12 | #define s0 x8 13 | #define fp x8 14 | #define s1 x9 15 | #define a0 x10 16 | #define a1 x11 17 | #define a2 x12 18 | #define a3 x13 19 | #define a4 x14 20 | #define a5 x15 21 | #define a6 x16 22 | #define a7 x17 23 | #define s2 x18 24 | #define s3 x19 25 | #define s4 x20 26 | #define s5 x21 27 | #define s6 x22 28 | #define s7 x23 29 | #define s8 x24 30 | #define s9 x25 31 | #define s10 x26 32 | #define s11 x27 33 | #define t3 x28 34 | #define t4 x29 35 | #define t5 x30 36 | #define t6 x31 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /arch/riscv/rv32ec/Kconfig: -------------------------------------------------------------------------------- 1 | choice 2 | prompt "RV32EC device" 3 | depends on RV32EC 4 | 5 | config MACH_CH32V003 6 | bool "WinChipHead CH32V003" 7 | 8 | endchoice 9 | 10 | config RV32EC_LIBGCC_DIV_MULT 11 | bool "Provide libgcc files for software div & mult (older GCCs)" 12 | default y 13 | depends on RV32EC 14 | help 15 | On some older versions of GCC, software division & multiplication 16 | is not implemented, this provides the files/hooks 17 | -------------------------------------------------------------------------------- /arch/riscv/rv32imac/Kconfig: -------------------------------------------------------------------------------- 1 | choice 2 | prompt "RV32IMAC device" 3 | depends on RV32IMAC 4 | 5 | config MACH_GD32VF103 6 | bool "GigaDevice GD32VF103" 7 | 8 | endchoice 9 | -------------------------------------------------------------------------------- /arch/stm8/Kconfig: -------------------------------------------------------------------------------- 1 | menu "STM8 architecture" 2 | depends on STM8 3 | 4 | choice 5 | prompt "MCU series" 6 | default MACH_STM8S 7 | 8 | config MACH_STM8S 9 | bool "STMicro STM8S/AF Series" 10 | 11 | endchoice 12 | 13 | endmenu 14 | -------------------------------------------------------------------------------- /arch/stm8/Makefile: -------------------------------------------------------------------------------- 1 | # STM8 platforms makefile 2 | arch-stm8 := $(srctree)/arch/stm8 3 | 4 | # mcu 5 | mcu-$(CONFIG_STM8) := -mstm8 --int-long-reent --out-fmt-elf 6 | 7 | # required 8 | include-$(CONFIG_STM8) += -I$(arch-stm8)/include 9 | 10 | # machines 11 | a_src-$(CONFIG_MACH_STM8S) += $(arch-stm8)/mach-stm8s/startup.S 12 | c_src-$(CONFIG_MACH_STM8S) += $(arch-stm8)/mach-stm8s/timer-awu.c 13 | 14 | # STM8S memory map 15 | mcu-$(CONFIG_MACH_STM8S) += --xram-size 1024 16 | 17 | c_src-$(CONFIG_STM8) += $(arch-stm8)/picoRTOS_port.c 18 | a_src-$(CONFIG_STM8) += $(arch-stm8)/picoRTOS_portasm.S 19 | 20 | # assembler 21 | sdas-$(CONFIG_STM8) := sdasstm8 22 | 23 | ccflags-$(CONFIG_STM8) += $(cinclude-y) $(include-y) $(mcu-y) 24 | asflags-$(CONFIG_STM8) += $(include-y) 25 | ldflags-$(CONFIG_STM8) += $(mcu-y) 26 | -------------------------------------------------------------------------------- /arch/stm8/include/macros.S: -------------------------------------------------------------------------------- 1 | ;; Generic asm macros for stm8 2 | ;; 3 | ;; Provides: 4 | ;; 5 | ;; COPY_TO_RAM 6 | ;; INIT_STACK 7 | ;; ZERO_RAM 8 | ;; IRQ_HANDLER 9 | ;; 10 | 11 | .macro COPY_TO_RAM base, start, len, ?loop, ?end 12 | ldw x, len 13 | jreq end 14 | loop: 15 | ld a, (base - 1, x) 16 | ld (start - 1, x), a 17 | decw x 18 | jrne loop 19 | end: 20 | .endm 21 | 22 | .macro INIT_STACK base 23 | ldw x, base 24 | ldw sp, x 25 | .endm 26 | 27 | .macro ZERO_RAM start, len, ?loop, ?end 28 | ldw x, len 29 | jreq end 30 | loop: 31 | clr (start - 1, x) 32 | decw x 33 | jrne loop 34 | end: 35 | .endm 36 | 37 | .macro VECTOR name 38 | .dw 0x8200 39 | .dw name 40 | .endm 41 | 42 | .macro IRQ_HANDLER name, num 43 | .globl name 44 | name: 45 | ld a, num 46 | jp Default_Handler 47 | .endm 48 | -------------------------------------------------------------------------------- /arch/win32/Kconfig: -------------------------------------------------------------------------------- 1 | menu "WIN32 simulation" 2 | depends on WIN32 3 | 4 | choice 5 | prompt "System" 6 | default WINTHREADS 7 | 8 | config WINTHREADS 9 | bool "Linux pthread" 10 | 11 | endchoice 12 | 13 | endmenu 14 | -------------------------------------------------------------------------------- /arch/win32/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # WIN32 simulation makefile 3 | # 4 | arch-win32 := $(srctree)/arch/win32 5 | 6 | c_src-$(CONFIG_WIN32) += $(arch-win32)/picoRTOS_port.c 7 | 8 | # static analysis improvements 9 | cppcheckflags-$(CONFIG_WIN32) += --platform=win32A 10 | -------------------------------------------------------------------------------- /arch/win32/picoRTOS_types.h: -------------------------------------------------------------------------------- 1 | #ifndef PICORTOS_TYPES_H 2 | #define PICORTOS_TYPES_H 3 | 4 | #include 5 | 6 | typedef unsigned long picoRTOS_stack_t; 7 | typedef unsigned long picoRTOS_priority_t; 8 | typedef unsigned long picoRTOS_pid_t; 9 | typedef unsigned long picoRTOS_tick_t; 10 | typedef unsigned long picoRTOS_atomic_t; 11 | typedef unsigned long picoRTOS_irq_t; 12 | typedef unsigned long picoRTOS_cycles_t; 13 | 14 | typedef long picoRTOS_intptr_t; 15 | typedef unsigned long picoRTOS_uintptr_t; 16 | 17 | #define ARCH_INITIAL_STACK_COUNT 10 18 | #define ARCH_MIN_STACK_COUNT ARCH_INITIAL_STACK_COUNT 19 | #define ARCH_L1_DCACHE_LINESIZE 4 20 | 21 | #define arch_break() __debugbreak() 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /demo/adafruit-itsybitsy-m4/Makefile: -------------------------------------------------------------------------------- 1 | # 1st: sources & targets 2 | target := $(TARGET) 3 | 4 | c_src-y += main.c 5 | c_src-y += adafruit-itsybitsy-m4.c 6 | 7 | # avoid double-inclusion 8 | ifeq ($(skip-makefile),) 9 | PWD := $(shell pwd) 10 | KBUILD_SRC := ../.. 11 | 12 | TARGETS := adafruit-itsybitsy_ram.elf 13 | TARGETS += adafruit-itsybitsy_flash.elf 14 | 15 | defconfig = $(@:%.elf=%_defconfig) 16 | 17 | all: $(TARGETS) 18 | @ 19 | 20 | %.elf: FORCE 21 | $(Q)$(MAKE) -C $(KBUILD_SRC) O=$(PWD) $(defconfig) 22 | $(Q)$(MAKE) -C $(KBUILD_SRC) O=$(PWD) TARGET=$@ 23 | 24 | %: 25 | $(Q)$(MAKE) -C $(KBUILD_SRC) O=$(PWD) $@ 26 | 27 | PHONY += FORCE 28 | FORCE: 29 | 30 | .PHONY: $(PHONY) 31 | endif 32 | -------------------------------------------------------------------------------- /demo/adafruit-itsybitsy-m4/adafruit-itsybitsy-m4.X/nbproject/Makefile-genesis.properties: -------------------------------------------------------------------------------- 1 | # 2 | #Mon Apr 03 18:17:25 CEST 2023 3 | default.languagetoolchain.version=10.2.1 4 | default.com-microchip-mplab-nbide-toolchain-arm-ARMLanguageToolchain.md5=ac2ecfade21354c0103b0a98d2af6ca6 5 | default.Pack.dfplocation=/home/jnaulet/.mchp_packs/Microchip/SAMD51_DFP/3.6.120 6 | default.com-microchip-mplab-mdbcore-AtmelIceScripting-AtmelIceScriptingBase.md5=08c658d7de75da11bc13fd254c7a7ad8 7 | conf.ids=default 8 | default.languagetoolchain.dir=/opt/gcc-arm-none-eabi-10-2020-q4-major/bin 9 | host.id=244g-ildn-ch 10 | configurations-xml=5f80a3de2fa22100b929a9bc933b6b8e 11 | com-microchip-mplab-nbide-embedded-makeproject-MakeProject.md5=5ac7a99e4b1de1ea64248c04a43532ad 12 | proj.dir=/home/jnaulet/Documents/dev/OpenPicoRTOS-dev/demo/adafruit-itsybitsy-m4/adafruit-itsybitsy-m4.X 13 | host.platform=linux 14 | -------------------------------------------------------------------------------- /demo/adafruit-itsybitsy-m4/adafruit-itsybitsy-m4.X/nbproject/Makefile-variables.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Generated - do not edit! 3 | # 4 | # NOCDDL 5 | # 6 | CND_BASEDIR=`pwd` 7 | # default configuration 8 | CND_ARTIFACT_DIR_default=dist/default/production 9 | CND_ARTIFACT_NAME_default=adafruit-itsybitsy-m4.X.production.hex 10 | CND_ARTIFACT_PATH_default=dist/default/production/adafruit-itsybitsy-m4.X.production.hex 11 | -------------------------------------------------------------------------------- /demo/adafruit-itsybitsy-m4/adafruit-itsybitsy-m4.X/nbproject/private/private.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /demo/adafruit-itsybitsy-m4/adafruit-itsybitsy-m4.h: -------------------------------------------------------------------------------- 1 | #ifndef ADAFRUIT_ITSYBITSY_M4_H 2 | #define ADAFRUIT_ITSYBITSY_M4_H 3 | 4 | #include "adc-same5x.h" 5 | #include "flash-same5x.h" 6 | #include "gpio-same5x.h" 7 | #include "spi-atmel_sercom.h" 8 | #include "uart-atmel_sercom.h" 9 | #include "pwm-same5x_tc.h" 10 | #include "twi-atmel_sercom.h" 11 | #include "wd-same5x.h" 12 | 13 | struct adafruit_itsybitsy_m4 { 14 | struct gpio RED; 15 | struct spi SPI; 16 | struct uart UART; 17 | struct pwm D5; 18 | struct adc ADC; 19 | struct wd WDT; 20 | struct flash FLASH; 21 | struct twi I2C; 22 | }; 23 | 24 | int adafruit_itsybitsy_m4_init(/*@out@*/ struct adafruit_itsybitsy_m4 *ctx); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /demo/adafruit-itsybitsy-m4/openocd.cfg: -------------------------------------------------------------------------------- 1 | adapter driver cmsis-dap 2 | transport select swd 3 | adapter speed 5000 4 | 5 | source [find target/atsame5x.cfg] 6 | -------------------------------------------------------------------------------- /demo/amigaball-lcd/Makefile.adafruit-itsybitsy-m4: -------------------------------------------------------------------------------- 1 | board := adafruit-itsybitsy-m4 2 | target := $(board).elf 3 | 4 | include Makefile.common 5 | 6 | ifeq ($(skip-makefile),) 7 | endif 8 | -------------------------------------------------------------------------------- /demo/amigaball-lcd/Makefile.arduino-nano-v3: -------------------------------------------------------------------------------- 1 | # 1st: sources & targets 2 | board := arduino-nano-v3 3 | target := $(board).elf 4 | debug := $(board).debug/$(target) 5 | hex := $(target:%.elf=%.hex) 6 | 7 | include Makefile.common 8 | 9 | # avoid double-inclusion 10 | ifneq ($(skip-makefile),1) 11 | TTY ?= /dev/ttyUSB0 12 | 13 | all: $(hex) 14 | @ 15 | 16 | $(hex): $(target) 17 | avr-objcopy -O ihex -R .eeprom $< $@ 18 | 19 | upload: $(hex) 20 | avrdude -v -pm328p -carduino -P$(TTY) \ 21 | -b57600 -D -Uflash:w:$<:i 22 | 23 | endif 24 | -------------------------------------------------------------------------------- /demo/amigaball-lcd/Makefile.common: -------------------------------------------------------------------------------- 1 | # to include 2 | c_src-y += main.c 3 | c_src-y += lcd.c 4 | c_src-y += amigaball.c 5 | c_src-y += board/$(board).c 6 | 7 | # avoid double-inclusion 8 | ifneq ($(skip-makefile),1) 9 | PWD := $(shell pwd) 10 | PICORTOS_SRC := ../.. 11 | 12 | all: $(target) 13 | @ 14 | 15 | .config: 16 | $(Q)$(MAKE) -C $(PICORTOS_SRC) O=$(PWD) $(board)_defconfig 17 | 18 | $(target): .config FORCE 19 | ln -sf Makefile.$(board) Makefile 20 | $(Q)$(MAKE) -C $(PICORTOS_SRC) O=$(PWD) 21 | 22 | config: FORCE 23 | $(Q)$(MAKE) -C $(PICORTOS_SRC) O=$(PWD) $(board)_defconfig 24 | 25 | %: 26 | $(Q)$(MAKE) -C $(PICORTOS_SRC) O=$(PWD) $@ 27 | 28 | PHONY += FORCE 29 | FORCE: 30 | 31 | endif 32 | 33 | .PHONY: $(PHONY) 34 | -------------------------------------------------------------------------------- /demo/amigaball-lcd/Makefile.devebox-stm32h7xx_m: -------------------------------------------------------------------------------- 1 | board := devebox-stm32h7xx_m 2 | target := $(board).elf 3 | 4 | include Makefile.common 5 | 6 | ifeq ($(skip-makefile),) 7 | endif 8 | -------------------------------------------------------------------------------- /demo/amigaball-lcd/Makefile.launchxl-f28379d: -------------------------------------------------------------------------------- 1 | board := launchxl-f28379d 2 | target := $(board).elf 3 | 4 | include Makefile.common 5 | 6 | ifeq ($(skip-makefile),) 7 | endif 8 | -------------------------------------------------------------------------------- /demo/amigaball-lcd/Makefile.raspberry-pico: -------------------------------------------------------------------------------- 1 | board := raspberry-pico 2 | target := $(board).elf 3 | 4 | include Makefile.common 5 | 6 | ifeq ($(skip-makefile),) 7 | # RP2040 UF2 8 | ELF2UF2 := elf2uf2/elf2uf2 9 | TARGETS += raspberry-pico.uf2 10 | 11 | all: $(board).uf2 12 | @ 13 | 14 | %.uf2: %.elf $(ELF2UF2) 15 | $(ELF2UF2) $< $@ 16 | 17 | $(ELF2UF2): 18 | g++ elf2uf2/main.cpp -o $@ 19 | 20 | endif 21 | -------------------------------------------------------------------------------- /demo/amigaball-lcd/Makefile.sipeed-longan-nano: -------------------------------------------------------------------------------- 1 | board := sipeed-longan-nano 2 | target := $(board).elf 3 | 4 | include Makefile.common 5 | 6 | ifeq ($(skip-makefile),) 7 | endif 8 | -------------------------------------------------------------------------------- /demo/amigaball-lcd/board/board.h: -------------------------------------------------------------------------------- 1 | #ifndef BOARD_H 2 | #define BOARD_H 3 | 4 | #include "gpio.h" 5 | #include "lcd.h" 6 | #include "spi.h" 7 | #include "wd.h" 8 | 9 | struct board { 10 | /*@shared@*/ struct gpio *LED; 11 | /*@shared@*/ struct wd *WD; 12 | struct lcd_phys lcd_phys; 13 | }; 14 | 15 | int board_init(/*@out@*/ struct board *ctx); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /demo/amigaball-lcd/elf2uf2/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | project(elf2uf2) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | add_subdirectory(../../src/common/boot_uf2 boot_uf2_headers) 7 | 8 | add_executable(elf2uf2 main.cpp) 9 | target_link_libraries(elf2uf2 boot_uf2_headers) -------------------------------------------------------------------------------- /demo/amigaball-lcd/openocd/adafruit-itsybitsy-m4.cfg: -------------------------------------------------------------------------------- 1 | adapter driver cmsis-dap 2 | transport select swd 3 | adapter speed 5000 4 | 5 | source [find target/atsame5x.cfg] 6 | -------------------------------------------------------------------------------- /demo/amigaball-lcd/openocd/devebox-stm32h7xx-m.cfg: -------------------------------------------------------------------------------- 1 | adapter driver cmsis-dap 2 | transport select swd 3 | adapter speed 1800 4 | 5 | source [find target/stm32h7x.cfg] 6 | -------------------------------------------------------------------------------- /demo/amigaball-lcd/openocd/raspberry-pico.cfg: -------------------------------------------------------------------------------- 1 | adapter driver cmsis-dap 2 | # adapter driver picoprobe 3 | transport select swd 4 | adapter speed 5000 5 | 6 | source [find target/rp2040.cfg] 7 | -------------------------------------------------------------------------------- /demo/amigaball-lcd/openocd/sipeed-longan-nano.cfg: -------------------------------------------------------------------------------- 1 | adapter driver ftdi 2 | ftdi vid_pid 0x403 0x6014 3 | 4 | ftdi layout_init 0x0030 0x003b 5 | ftdi layout_signal nSRST -data 0x0010 -oe 0x0010 6 | ftdi layout_signal nTRST -data 0x0020 -oe 0x0020 7 | 8 | # AD0 -> TCK 9 | # AD1 -> TDI 10 | # AD2 -> TDO 11 | # AD3 -> TMS 12 | # AD5 -> RST 13 | 14 | transport select jtag 15 | adapter speed 1000 16 | 17 | source [find target/gd32vf103.cfg] 18 | -------------------------------------------------------------------------------- /demo/arduino-due/README.md: -------------------------------------------------------------------------------- 1 | # picoRTOS Arduino Due demo 2 | 3 | ## Description 4 | 5 | This simple demo is a hardware and software test for the Arduino Due platform, it tests: 6 | 7 | - ADCs 8 | - CANs 9 | - GPIOs 10 | - UART 11 | - I2C 12 | - PWMs / IPWMs 13 | - SPI 14 | - Watchdog 15 | 16 | ## Requirements 17 | 18 | Some wiring is required before you can perform this test. 19 | 20 | In order to work properly these connections have to be made: 21 | 22 | - A0 to 3.3V 23 | - PWM2 to PWM3 24 | - ICSP connector pin 1 to 4 (SPI hardware loopback) 25 | - SCL to SCL1 and SDA to SDA1 26 | - CANTX & CANRX to a CAN transceiver 27 | - DAC0 (CANRX1) & DIGITAL53 (CANTX1) to another CAN transceiver 28 | - Loopback between the 2 can transceivers 29 | -------------------------------------------------------------------------------- /demo/arduino-due/openocd.cfg: -------------------------------------------------------------------------------- 1 | # Atmel-ICE JTAG/SWD in-circuit debugger. 2 | adapter driver cmsis-dap 3 | transport select swd 4 | adapter speed 500 5 | 6 | # Chip info 7 | set CHIPNAME atsam3x8e 8 | source [find target/at91sam3ax_8x.cfg] 9 | -------------------------------------------------------------------------------- /demo/arduino-mega2560/Makefile: -------------------------------------------------------------------------------- 1 | # 1st: sources & targets 2 | target := arduino-mega2560.elf 3 | 4 | c_src-y += main.c 5 | c_src-y += arduino-mega2560.c 6 | 7 | # avoid double-inclusion 8 | ifneq ($(skip-makefile),1) 9 | PWD := $(shell pwd) 10 | KBUILD_SRC := ../.. 11 | TTY ?= /dev/ttyACM0 12 | 13 | hex := $(target:%.elf=%.hex) 14 | 15 | all: $(hex) 16 | @ 17 | 18 | $(target): FORCE 19 | $(Q)$(MAKE) -C $(KBUILD_SRC) O=$(PWD) 20 | 21 | $(hex): $(target) 22 | avr-objcopy -O ihex -R .eeprom $< $@ 23 | 24 | upload: $(hex) 25 | avrdude -v -patmega2560 -cwiring -P$(TTY) \ 26 | -b115200 -D -Uflash:w:$<:i 27 | 28 | clean: FORCE 29 | $(Q)$(MAKE) -C $(KBUILD_SRC) O=$(PWD) $@ 30 | @rm -f $(target) $(hex) *.map 31 | 32 | %: 33 | $(Q)$(MAKE) -C $(KBUILD_SRC) O=$(PWD) $@ 34 | 35 | PHONY += FORCE 36 | FORCE: 37 | 38 | .PHONY: $(PHONY) 39 | endif 40 | -------------------------------------------------------------------------------- /demo/arduino-mega2560/README.md: -------------------------------------------------------------------------------- 1 | # picoRTOS Arduino Mega2560 demo 2 | 3 | ## Description 4 | 5 | This simple demo tests the following: 6 | 7 | - ADC 8 | - EEPROM 9 | - GPIOs 10 | - UART 11 | - I2C 12 | - PWM 13 | - SPI 14 | - Watchdog 15 | 16 | ## Requirements 17 | 18 | Some wiring is required before you can perform this test. 19 | 20 | In order to work properly these connections have to be made: 21 | 22 | - A0 to 3.3V 23 | - PWM2 to PWM3 24 | - ICSP connector pin 1 to 4 (SPI hardware loopback) 25 | 26 | -------------------------------------------------------------------------------- /demo/arduino-uno/Makefile: -------------------------------------------------------------------------------- 1 | # 1st: sources & targets 2 | target := arduino-uno.elf 3 | 4 | c_src-y += main.c 5 | c_src-y += arduino-uno.c 6 | 7 | # avoid double-inclusion 8 | ifneq ($(skip-makefile),1) 9 | PWD := $(shell pwd) 10 | KBUILD_SRC := ../.. 11 | TTY ?= /dev/ttyACM0 12 | 13 | hex := $(target:%.elf=%.hex) 14 | 15 | all: $(hex) 16 | @ 17 | 18 | $(target): FORCE 19 | $(Q)$(MAKE) -C $(KBUILD_SRC) O=$(PWD) 20 | 21 | $(hex): $(target) 22 | avr-objcopy -O ihex -R .eeprom $< $@ 23 | 24 | upload: $(hex) 25 | avrdude -v -patmega328p -carduino -P$(TTY) \ 26 | -b57600 -D -Uflash:w:$<:i 27 | 28 | clean: FORCE 29 | $(Q)$(MAKE) -C $(KBUILD_SRC) O=$(PWD) $@ 30 | @rm -f $(target) $(hex) *.map 31 | 32 | %: 33 | $(Q)$(MAKE) -C $(KBUILD_SRC) O=$(PWD) $@ 34 | 35 | PHONY += FORCE 36 | FORCE: 37 | 38 | .PHONY: $(PHONY) 39 | endif 40 | -------------------------------------------------------------------------------- /demo/arduino-uno/README.md: -------------------------------------------------------------------------------- 1 | # picoRTOS Arduino Uno demo 2 | 3 | ## Description 4 | 5 | This simple demo tests the following: 6 | 7 | - ADC 8 | - EEPROM 9 | - GPIO 10 | - I2C 11 | - PWM 12 | - SPI 13 | - UART 14 | - Watchdog 15 | 16 | ## Requirements 17 | 18 | Some wiring is required before you can perform this test. 19 | 20 | In order to work properly these connections have to be made: 21 | 22 | - A0 to 3.3V 23 | - ICSP connector pin 1 to 4 (SPI hardware loopback) 24 | - I2C acts like a slave and will answer 0x5a if it received 0xa5 on addr 0x69 25 | -------------------------------------------------------------------------------- /demo/arduino-uno/arduino-uno.ino: -------------------------------------------------------------------------------- 1 | /* picoRTOS blink demo code for Arduino Uno 2 | * Arduino IDE doesn't allow for complex project structures so you need to add picoRTOS files manually. 3 | * For this, just select Sketch -> Add File... and add the following files: 4 | * - picoRTOS.c 5 | * - picoRTOS.h 6 | * - arch/avr/avr5/picoRTOS_port.c 7 | * - arch/avr/avr5/picoRTOS_portasm.S 8 | * - arch/avr/avr5/picoRTOS_types.h 9 | * 10 | * Alternatively, you can generate the sketch in sketch/arduino-due by typing 11 | * # make sketch 12 | * 13 | * If you have arduino-cli installed you can try : 14 | * # make 15 | * # make upload 16 | * 17 | * Some good soul might be able to make a library for this in the future 18 | */ 19 | 20 | -------------------------------------------------------------------------------- /demo/arduino-uno_r4/README.md: -------------------------------------------------------------------------------- 1 | # picoRTOS Arduino Uno R4 Minima demo 2 | 3 | ## Description 4 | 5 | This simple demo tests the following: 6 | 7 | - ADC 8 | - GPIO 9 | - I2C 10 | - PWM 11 | - SPI 12 | - UART 13 | 14 | ## Requirements 15 | 16 | Some wiring is required before you can perform this test. 17 | 18 | In order to work properly these connections have to be made: 19 | 20 | - A0 to 3.3V 21 | - RX <- 0 to TX -> 1 22 | - I2C acts like a slave and will answer 0x5a if it received 0xa5 on addr 0x69 23 | -------------------------------------------------------------------------------- /demo/arduino-uno_r4/arduino-uno_r4.h: -------------------------------------------------------------------------------- 1 | #ifndef ARDUINO_UNO_R4_H 2 | #define ARDUINO_UNO_R4_H 3 | 4 | #include "adc-renesas_ra4.h" 5 | #include "gpio-renesas_ra4.h" 6 | #include "pwm-renesas_ra4_gpt.h" 7 | #include "spi-renesas_ra4.h" 8 | #include "twi-renesas_ra4.h" 9 | #include "uart-renesas_ra4_sci.h" 10 | 11 | struct arduino_uno_r4 { 12 | struct gpio TICK; 13 | struct spi SPI; 14 | struct pwm L; 15 | struct uart UART; 16 | struct adc A0; 17 | struct twi I2C; 18 | }; 19 | 20 | int arduino_uno_r4_init(/*@out@*/ struct arduino_uno_r4 *ctx); 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /demo/attiny1607-cnano/Makefile: -------------------------------------------------------------------------------- 1 | # 1st: sources & targets 2 | target := attiny1607-cnano.elf 3 | 4 | c_src-y += main.c 5 | c_src-y += attiny1607-cnano.c 6 | 7 | # avoid double-inclusion 8 | ifeq ($(skip-makefile),) 9 | PWD := $(shell pwd) 10 | KBUILD_SRC := ../.. 11 | 12 | all: $(target) 13 | @ 14 | 15 | %.elf: FORCE 16 | $(Q)$(MAKE) -C $(KBUILD_SRC) O=$(PWD) CC=xc8-cc 17 | 18 | %: 19 | $(Q)$(MAKE) -C $(KBUILD_SRC) O=$(PWD) $@ 20 | 21 | PHONY += FORCE 22 | FORCE: 23 | 24 | .PHONY: $(PHONY) 25 | endif 26 | -------------------------------------------------------------------------------- /demo/attiny1607-cnano/README.md: -------------------------------------------------------------------------------- 1 | # picoRTOS Curiosiy Nano ATTiny1607 demo 2 | 3 | ## Description 4 | 5 | This simple demo is a hardware and software test for the ATTIny1607 platform, it can test: 6 | 7 | - ADC 8 | - TCA0 PWM(s) 9 | - GPIOs 10 | - UART 11 | - SPI 12 | - Watchdog 13 | 14 | ## Requirements 15 | 16 | Some wiring is required before you can perform this test. 17 | 18 | In order to work properly these connections have to be made: 19 | 20 | - PA4 to VTG (ADC test) 21 | - PC1 to PC2 (SPI loopback) 22 | - PB5 to PB7 (LED PWM test) 23 | -------------------------------------------------------------------------------- /demo/attiny1607-cnano/attiny1607-cnano.X/.gitignore: -------------------------------------------------------------------------------- 1 | # .gitignore file 2 | 3 | # MPLAB X IDE (Netbeans) specific 4 | **/*.X/~*.* 5 | **/*.X/build/ 6 | **/*.X/debug/ 7 | **/*.X/dist/ 8 | **/*.X/disassembly/ 9 | **/*.X/.generated_files/ 10 | **/*.X/nbproject/private/ 11 | **/*.X/nbproject/*.mk 12 | **/*.X/nbproject/*.bash 13 | **/*.X/nbproject/Makefile-genesis.properties 14 | 15 | # Object files 16 | *.o 17 | *.ko 18 | *.obj 19 | *.elf 20 | 21 | # Executables 22 | *.exe 23 | 24 | 25 | # KDE specific 26 | .directory 27 | 28 | # Misc 29 | .svn 30 | *.bak -------------------------------------------------------------------------------- /demo/attiny1607-cnano/attiny1607-cnano.X/nbproject/Makefile-genesis.properties: -------------------------------------------------------------------------------- 1 | # 2 | #Sat Apr 15 12:13:07 CEST 2023 3 | default.languagetoolchain.version=2.41 4 | default.Pack.dfplocation=/opt/microchip/mplabx/v6.05/packs/Microchip/ATtiny_DFP/3.0.151 5 | conf.ids=default 6 | default.languagetoolchain.dir=/opt/microchip/xc8/v2.41/bin 7 | host.id=244g-ildn-ch 8 | configurations-xml=58c7abd9c208b5aace01542cab65f1e4 9 | com-microchip-mplab-nbide-embedded-makeproject-MakeProject.md5=5ac7a99e4b1de1ea64248c04a43532ad 10 | default.com-micrcohip-mplab-mdbcore-pkob4-PKOB4ToolImpl.md5=dd22c4b79ea45fd5e4e74f71c232a17a 11 | default.com-microchip-mplab-nbide-toolchain-xc8-XC8LanguageToolchain.md5=0e8fad895b9b8299a6c08191595e8207 12 | proj.dir=/home/jnaulet/Documents/dev/OpenPicoRTOS-dev/demo/attiny1607-cnano/attiny1607-cnano.X 13 | host.platform=linux 14 | -------------------------------------------------------------------------------- /demo/attiny1607-cnano/attiny1607-cnano.X/nbproject/Makefile-variables.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Generated - do not edit! 3 | # 4 | # NOCDDL 5 | # 6 | CND_BASEDIR=`pwd` 7 | # default configuration 8 | CND_ARTIFACT_DIR_default=dist/default/production 9 | CND_ARTIFACT_NAME_default=attiny1607-cnano.X.production.hex 10 | CND_ARTIFACT_PATH_default=dist/default/production/attiny1607-cnano.X.production.hex 11 | -------------------------------------------------------------------------------- /demo/attiny1607-cnano/attiny1607-cnano.h: -------------------------------------------------------------------------------- 1 | #ifndef ATTINY1607_CNANO_H 2 | #define ATTINY1607_CNANO_H 3 | 4 | #include "adc-tinyavr.h" 5 | #include "gpio-tinyavr.h" 6 | #include "spi-tinyavr.h" 7 | #include "uart-tinyavr_usart.h" 8 | #include "wd-tinyavr.h" 9 | #include "pwm-tinyavr_tca.h" 10 | 11 | struct attiny1607_cnano { 12 | struct gpio SW0; 13 | struct pwm LED0; 14 | struct uart UART; 15 | struct spi SPI; 16 | struct adc AIN04; 17 | struct wd WDT; 18 | }; 19 | 20 | int attiny1607_cnano_init(/*@out@*/ struct attiny1607_cnano *ctx); 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /demo/attiny1607-cnano/picoRTOSConfig.h: -------------------------------------------------------------------------------- 1 | #ifndef PICORTOSCONFIG_H 2 | #define PICORTOSCONFIG_H 3 | 4 | /* CLOCKS */ 5 | #define CONFIG_SYSCLK_HZ 32768 6 | #define CONFIG_TICK_HZ 1000 7 | 8 | /* TASKS */ 9 | #define CONFIG_TASK_COUNT 5 10 | 11 | /* STACK */ 12 | #define CONFIG_DEFAULT_STACK_COUNT 48 13 | #define CONFIG_EXT_STACK_COUNT 52 14 | 15 | /* DEADLOCK */ 16 | #define CONFIG_DEADLOCK_COUNT 1000 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /demo/attiny817-xplained/Makefile: -------------------------------------------------------------------------------- 1 | # 1st: sources & targets 2 | target := $(TARGET) 3 | 4 | c_src-y += main.c 5 | c_src-y += attiny817-xplained.c 6 | 7 | splintflags-y += -DDEMO_LED -DDEMO_CONSOLE -DDEMO_SPI -DDEMO_ADC -DDEMO_PWM -DDEMO_WDT 8 | cppcheckflags-y += $(splintflags-y) 9 | 10 | # avoid double-inclusion 11 | ifeq ($(skip-makefile),) 12 | PWD := $(shell pwd) 13 | KBUILD_SRC := ../.. 14 | 15 | TARGETS := attiny817-xplained1.elf 16 | TARGETS += attiny817-xplained2.elf 17 | TARGETS += attiny817-xplained3.elf 18 | 19 | defconfig = $(@:%.elf=%_defconfig) 20 | 21 | all: $(TARGETS) 22 | @ 23 | 24 | %.elf: FORCE 25 | $(Q)$(MAKE) -C $(KBUILD_SRC) O=$(PWD) $(defconfig) 26 | $(Q)$(MAKE) -C $(KBUILD_SRC) O=$(PWD) \ 27 | CC=xc8-cc TARGET=$@ 28 | 29 | %: 30 | $(Q)$(MAKE) -C $(KBUILD_SRC) O=$(PWD) $@ 31 | 32 | PHONY += FORCE 33 | FORCE: 34 | 35 | .PHONY: $(PHONY) 36 | endif 37 | -------------------------------------------------------------------------------- /demo/attiny817-xplained/README.md: -------------------------------------------------------------------------------- 1 | # picoRTOS ATTiny817 XPlained Mini demo 2 | 3 | ## Description 4 | 5 | This simple demo is a hardware and software test for the ATTIny817 platform, it can test: 6 | 7 | - ADC 8 | - TCA0 PWM(s) 9 | - GPIOs 10 | - UART 11 | - SPI 12 | - Watchdog 13 | 14 | Due to the obvious lack of RAM (512bytes...) not all peripherals can be tested at once. 15 | The makefile offers 3 configs: 16 | - make config1 -> GPIO/LED, UART/CONSOLE, Watchdog 17 | - make config2 -> GPIO/LED, UART/CONSOLE, SPI 18 | - make config3 -> GPIO/LED, ADC, PWM 19 | 20 | ## Requirements 21 | 22 | Some wiring is required before you can perform this test. 23 | 24 | In order to work properly these connections have to be made: 25 | 26 | - PA4 to 3.3V (ADC test) 27 | - PA1 to PA2 (SPI loopback) 28 | -------------------------------------------------------------------------------- /demo/attiny817-xplained/attiny817-xplained.X/nbproject/Makefile-variables.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Generated - do not edit! 3 | # 4 | # NOCDDL 5 | # 6 | CND_BASEDIR=`pwd` 7 | # Config1 configuration 8 | CND_ARTIFACT_DIR_Config1=dist/Config1/production 9 | CND_ARTIFACT_NAME_Config1=attiny817-xplained.X.production.hex 10 | CND_ARTIFACT_PATH_Config1=dist/Config1/production/attiny817-xplained.X.production.hex 11 | # Config2 configuration 12 | CND_ARTIFACT_DIR_Config2=dist/Config2/production 13 | CND_ARTIFACT_NAME_Config2=attiny817-xplained.X.production.hex 14 | CND_ARTIFACT_PATH_Config2=dist/Config2/production/attiny817-xplained.X.production.hex 15 | # Config3 configuration 16 | CND_ARTIFACT_DIR_Config3=dist/Config3/production 17 | CND_ARTIFACT_NAME_Config3=attiny817-xplained.X.production.hex 18 | CND_ARTIFACT_PATH_Config3=dist/Config3/production/attiny817-xplained.X.production.hex 19 | -------------------------------------------------------------------------------- /demo/attiny817-xplained/attiny817-xplained.X/nbproject/private/private.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | file:/home/jnaulet/Documents/dev/OpenPicoRTOS/arch/avr/avrxmega3/picoRTOS_port.c 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /demo/attiny817-xplained/attiny817-xplained.h: -------------------------------------------------------------------------------- 1 | #ifndef ATTINY817_XPLAINED_H 2 | #define ATTINY817_XPLAINED_H 3 | 4 | #include "adc-tinyavr.h" 5 | #include "gpio-tinyavr.h" 6 | #include "spi-tinyavr.h" 7 | #include "uart-tinyavr_usart.h" 8 | #include "wd-tinyavr.h" 9 | #include "pwm-tinyavr_tca.h" 10 | 11 | struct attiny817_xplained { 12 | struct gpio USER_BUTTON; 13 | struct gpio USER_LED; 14 | struct uart UART; 15 | struct spi SPI; 16 | struct adc AIN04; 17 | struct wd WDT; 18 | /* special case for PWM */ 19 | struct attiny817_xplained_PWM { 20 | struct pwm WO0; 21 | struct pwm WO1; 22 | } PWM; 23 | }; 24 | 25 | int attiny817_xplained_init(/*@out@*/ struct attiny817_xplained *ctx); 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /demo/curiosity-2.0-pic32mz-ef/openocd.cfg: -------------------------------------------------------------------------------- 1 | adapter driver cmsis-dap 2 | transport select swd 3 | adapter speed 5000 4 | 5 | source [find target/pic32mz.cfg] 6 | -------------------------------------------------------------------------------- /demo/devebox-stm32h7xx_m/Makefile: -------------------------------------------------------------------------------- 1 | # 1st: sources & targets 2 | target := $(TARGET) 3 | 4 | c_src-y += main.c 5 | c_src-y += stm32h7xx_m.c 6 | 7 | # avoid double-inclusion 8 | ifeq ($(skip-makefile),) 9 | PWD := $(shell pwd) 10 | KBUILD_SRC := ../.. 11 | 12 | TARGETS := devebox-stm32h7xx_m_ram.elf 13 | TARGETS += devebox-stm32h7xx_m_flash.elf 14 | 15 | defconfig = $(@:%.elf=%_defconfig) 16 | 17 | all: $(TARGETS) 18 | @ 19 | 20 | %.elf: FORCE 21 | $(Q)$(MAKE) -C $(KBUILD_SRC) O=$(PWD) $(defconfig) 22 | $(Q)$(MAKE) -C $(KBUILD_SRC) O=$(PWD) TARGET=$@ 23 | 24 | %: 25 | $(Q)$(MAKE) -C $(KBUILD_SRC) O=$(PWD) $@ 26 | 27 | PHONY += FORCE 28 | FORCE: 29 | 30 | .PHONY: $(PHONY) 31 | endif 32 | -------------------------------------------------------------------------------- /demo/devebox-stm32h7xx_m/openocd.cfg: -------------------------------------------------------------------------------- 1 | adapter driver cmsis-dap 2 | transport select swd 3 | adapter speed 1800 4 | 5 | source [find target/stm32h7x.cfg] 6 | -------------------------------------------------------------------------------- /demo/devebox-stm32h7xx_m/picoRTOSConfig.h: -------------------------------------------------------------------------------- 1 | #ifndef PICORTOSCONFIG_H 2 | #define PICORTOSCONFIG_H 3 | 4 | /* CLOCKS */ 5 | // #define CONFIG_SYSCLK_HZ 16000000 6 | // #define CONFIG_SYSCLK_HZ 25000000 7 | // #define CONFIG_SYSCLK_HZ 128000000 8 | #define CONFIG_SYSCLK_HZ 200000000 9 | // #define CONFIG_SYSCLK_HZ 400000000 10 | #define CONFIG_TICK_HZ 1000 11 | 12 | /* TASKS */ 13 | #define CONFIG_TASK_COUNT 6 14 | 15 | /* STACK */ 16 | #define CONFIG_DEFAULT_STACK_COUNT 128 17 | 18 | /* DEADLOCK */ 19 | #define CONFIG_DEADLOCK_COUNT CONFIG_TICK_HZ 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /demo/devebox-stm32h7xx_m/stm32h7xx_m.h: -------------------------------------------------------------------------------- 1 | #ifndef STM32H7XX_M_H 2 | #define STM32H7XX_M_H 3 | 4 | #include "gpio-stm32h7xx.h" 5 | #include "pwm-stm32h7xx_tim.h" 6 | #include "spi-stm32h7xx.h" 7 | #include "uart-stm32h7xx.h" 8 | 9 | struct stm32h7xx_m { 10 | struct gpio TICK; 11 | struct pwm LED; 12 | struct spi SPI1; 13 | struct uart UART4; 14 | }; 15 | 16 | int stm32h7xx_m_init(/*@out@*/ struct stm32h7xx_m *ctx); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /demo/devkit-mpc5748g/Makefile: -------------------------------------------------------------------------------- 1 | # 1st: sources & targets 2 | target := $(TARGET) 3 | 4 | c_src-y += main.c 5 | c_src-y += devkit-mpc5748g.c 6 | 7 | # avoid double-inclusion 8 | ifneq ($(skip-makefile),1) 9 | PWD := $(shell pwd) 10 | PICORTOS_SRC := ../.. 11 | 12 | TARGETS := devkit-mpc5748g_ram.elf 13 | TARGETS += devkit-mpc5748g_flash.elf 14 | TARGETS += devkit-mpc5748g-SMP_ram.elf 15 | TARGETS += devkit-mpc5748g-SMP_flash.elf 16 | 17 | defconfig = $(@:%.elf=%_defconfig) 18 | 19 | all: $(TARGETS) 20 | @ 21 | 22 | %.elf: FORCE 23 | $(Q)$(MAKE) -C $(PICORTOS_SRC) O=$(PWD) $(defconfig) 24 | $(Q)$(MAKE) -C $(PICORTOS_SRC) O=$(PWD) TARGET=$@ 25 | 26 | %: 27 | $(Q)$(MAKE) -C $(PICORTOS_SRC) O=$(PWD) $@ 28 | 29 | PHONY += FORCE 30 | FORCE: 31 | 32 | .PHONY: $(PHONY) 33 | endif 34 | -------------------------------------------------------------------------------- /demo/devkit-mpc5748g/README.md: -------------------------------------------------------------------------------- 1 | # picoRTOS NXP MPC5748G single core / SMP demo 2 | 3 | ## Description 4 | 5 | This simple demo uses the devkit-mpc5748g & tests the following: 6 | 7 | - ADC 8 | - CAN 9 | - GPIO 10 | - MUX 11 | - UART 12 | - PWM 13 | - SPI 14 | 15 | ## Requirements 16 | 17 | Some wiring is required to perform this standalone test: 18 | 19 | - PA12 to PA13 (DSPI0 MOSI to MISO) 20 | 21 | ## How to build 22 | 23 | To build for all targets, type: 24 | 25 | # make 26 | -------------------------------------------------------------------------------- /demo/devkit-mpc5748g/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | docker run -v /home/${USER}/dev/OpenPicoRTOS-dev:/home/${USER}/dev/OpenPicoRTOS-dev -w $(pwd) -it s32ds-power-v1-2:latest make V=1 3 | -------------------------------------------------------------------------------- /demo/launchxl-f28379d/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | launchxl-f28379d 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 15 | full,incremental, 16 | 17 | 18 | 19 | 20 | 21 | org.eclipse.cdt.core.cnature 22 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 23 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 24 | 25 | 26 | -------------------------------------------------------------------------------- /demo/launchxl-f28379d/Makefile: -------------------------------------------------------------------------------- 1 | # 1st: sources & targets 2 | target := $(TARGET) 3 | 4 | c_src-y += main.c 5 | c_src-y += launchxl-f28379d.c 6 | 7 | # avoid double-inclusion 8 | ifeq ($(skip-makefile),) 9 | PWD := $(shell pwd) 10 | KBUILD_SRC := ../.. 11 | 12 | TARGETS := launchxl-f28379d_ram.elf 13 | TARGETS += launchxl-f28379d_flash.elf 14 | 15 | defconfig = $(@:%.elf=%_defconfig) 16 | 17 | all: $(TARGETS) 18 | @ 19 | 20 | %: 21 | $(Q)$(MAKE) -C $(KBUILD_SRC) O=$(PWD) $@ 22 | 23 | %.elf: FORCE 24 | $(Q)$(MAKE) -C $(KBUILD_SRC) O=$(PWD) $(defconfig) 25 | $(Q)$(MAKE) -C $(KBUILD_SRC) O=$(PWD) TARGET=$@ 26 | 27 | PHONY += FORCE 28 | FORCE: 29 | 30 | .PHONY: $(PHONY) 31 | endif 32 | -------------------------------------------------------------------------------- /demo/launchxl-f28379d/README.md: -------------------------------------------------------------------------------- 1 | # picoRTOS LAUNCHXL-F28379D demo 2 | 3 | ## Description 4 | 5 | This simple demo is a hardware and software test for the Launchxl-f28379d platform, it tests: 6 | 7 | - ADCs 8 | - CAN 9 | - GPIOs 10 | - I2C 11 | - ePWM 12 | - SPI 13 | - Watchdog 14 | 15 | ## Requirements 16 | 17 | Some wiring is required before you can perform this test. 18 | 19 | In order to work properly these connections have to be made: 20 | 21 | - I2CA to I2CB 22 | -------------------------------------------------------------------------------- /demo/launchxl-f28379d/launchxl-f28379d.h: -------------------------------------------------------------------------------- 1 | #ifndef LAUNCHXL_F28379D_H 2 | #define LAUNCHXL_F28379D_H 3 | 4 | #include "gpio-ti_f28x.h" 5 | #include "spi-ti_f28x.h" 6 | #include "pwm-ti_epwm.h" 7 | #include "adc-ti_type4.h" 8 | #include "can-ti_dcan.h" 9 | #include "wd-ti_f28x.h" 10 | #include "twi-ti_f28x.h" 11 | 12 | struct launchxl_f28379d { 13 | struct gpio TICK; 14 | struct f28379x_led { 15 | struct gpio R; 16 | struct gpio B; 17 | } LED; 18 | struct spi SPI; 19 | struct pwm PWM; 20 | struct adc ADCIN13; /* temp sensor */ 21 | struct can CAN; 22 | struct wd WDT; 23 | struct twi I2CA; 24 | struct twi I2CB; 25 | }; 26 | 27 | int launchxl_f28379d_init(/*@out@*/ struct launchxl_f28379d *ctx); 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /demo/pthread-linux/Makefile: -------------------------------------------------------------------------------- 1 | # 1st: sources & targets 2 | target := pthread-linux.elf 3 | 4 | c_src-y += main.c 5 | 6 | # avoid double-inclusion 7 | ifeq ($(skip-makefile),) 8 | PWD := $(shell pwd) 9 | KBUILD_SRC := ../.. 10 | 11 | all: $(target) 12 | @ 13 | 14 | %.elf: FORCE 15 | $(Q)$(MAKE) -C $(KBUILD_SRC) O=$(PWD) TARGET=$@ 16 | 17 | %: 18 | $(Q)$(MAKE) -C $(KBUILD_SRC) O=$(PWD) $@ 19 | 20 | PHONY += FORCE 21 | FORCE: 22 | 23 | .PHONY: $(PHONY) 24 | endif 25 | -------------------------------------------------------------------------------- /demo/pthread-linux/picoRTOSConfig.h: -------------------------------------------------------------------------------- 1 | #ifndef PICORTOS_CONFIG_H 2 | #define PICORTOS_CONFIG_H 3 | 4 | /* CLOCKS */ 5 | #define CONFIG_SYSCLK_HZ 250 6 | #define CONFIG_TICK_HZ 10 7 | 8 | /* TASKS */ 9 | #define CONFIG_TASK_COUNT 5 10 | 11 | #define CONFIG_DEFAULT_STACK_COUNT 128 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /demo/raspberry-pico/README.md: -------------------------------------------------------------------------------- 1 | # picoRTOS Raspberry Pico single core / SMP demo 2 | 3 | ## Description 4 | 5 | This simple demo uses the Rpi Pico & tests the following: 6 | 7 | - ADC 8 | - GPIO 9 | - UART 10 | - I2C 11 | - PWM 12 | - SPI 13 | - Watchdog 14 | 15 | ## Requirements 16 | 17 | Some wiring is required to perform this standalone test: 18 | 19 | - GP20 to GP6 (SDA) 20 | - GP21 to GP7 (SCL) 21 | - GP27 to GP5 (IPWM) 22 | 23 | ## How to build 24 | 25 | To build for single-core, type: 26 | 27 | # make 28 | 29 | To build with support for SMP, type: 30 | 31 | make SMP=1 32 | -------------------------------------------------------------------------------- /demo/raspberry-pico/elf2uf2/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | project(elf2uf2) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | add_subdirectory(../../src/common/boot_uf2 boot_uf2_headers) 7 | 8 | add_executable(elf2uf2 main.cpp) 9 | target_link_libraries(elf2uf2 boot_uf2_headers) -------------------------------------------------------------------------------- /demo/raspberry-pico/openocd-SMP.cfg: -------------------------------------------------------------------------------- 1 | adapter driver cmsis-dap 2 | # adapter driver picoprobe 3 | transport select swd 4 | adapter speed 5000 5 | 6 | source [find target/rp2040.cfg] 7 | -------------------------------------------------------------------------------- /demo/raspberry-pico/openocd.cfg: -------------------------------------------------------------------------------- 1 | adapter driver cmsis-dap 2 | # adapter driver picoprobe 3 | transport select swd 4 | adapter speed 5000 5 | 6 | source [find target/rp2040-core0.cfg] 7 | -------------------------------------------------------------------------------- /demo/sipeed-longan-nano/Makefile: -------------------------------------------------------------------------------- 1 | # 1st: sources & targets 2 | target := $(TARGET) 3 | 4 | c_src-y += main.c 5 | c_src-y += sipeed-longan-nano.c 6 | 7 | # avoid double-inclusion 8 | ifeq ($(skip-makefile),) 9 | PWD := $(shell pwd) 10 | KBUILD_SRC := ../.. 11 | 12 | # TARGETS := sipeed-longan-nano_ram.elf 13 | TARGETS += sipeed-longan-nano_flash.elf 14 | 15 | defconfig = $(@:%.elf=%_defconfig) 16 | 17 | all: $(TARGETS) 18 | @ 19 | 20 | %.elf: FORCE 21 | $(Q)$(MAKE) -C $(KBUILD_SRC) O=$(PWD) $(defconfig) 22 | $(Q)$(MAKE) -C $(KBUILD_SRC) O=$(PWD) TARGET=$@ 23 | 24 | %: 25 | $(Q)$(MAKE) -C $(KBUILD_SRC) O=$(PWD) $@ 26 | 27 | PHONY += FORCE 28 | FORCE: 29 | 30 | .PHONY: $(PHONY) 31 | endif 32 | -------------------------------------------------------------------------------- /demo/sipeed-longan-nano/README.md: -------------------------------------------------------------------------------- 1 | # picoRTOS on GD32VF103 demo 2 | 3 | ## Description 4 | 5 | This simple demo uses the GD32VF103 & tests the following: 6 | 7 | - /ADC/ 8 | - GPIO 9 | - UART 10 | - /I2C/ 11 | - PWM 12 | - SPI 13 | - Watchdog 14 | 15 | ## Requirements 16 | 17 | Some wiring is required to perform this standalone test: 18 | 19 | - R0 to T0 (UART) 20 | - B6 to B10 (SCL) 21 | - B7 to B11 (SDA) 22 | - A6 to A7 (SPI) 23 | -------------------------------------------------------------------------------- /demo/sipeed-longan-nano/openocd.cfg: -------------------------------------------------------------------------------- 1 | adapter driver cmsis-dap 2 | transport select jtag 3 | adapter speed 5000 4 | 5 | source [find target/gd32vf103.cfg] 6 | -------------------------------------------------------------------------------- /demo/sipeed-longan-nano/picoRTOSConfig.h: -------------------------------------------------------------------------------- 1 | #ifndef PICORTOSCONFIG_H 2 | #define PICORTOSCONFIG_H 3 | 4 | /* CLOCKS */ 5 | #define CONFIG_SYSCLK_HZ (108000000 / 4) /* According to clock tree */ 6 | #define CONFIG_TICK_HZ 1000 7 | 8 | /* TASKS */ 9 | #define CONFIG_TASK_COUNT 12 10 | 11 | /* STACK */ 12 | #define CONFIG_DEFAULT_STACK_COUNT 96 13 | 14 | /* DEADLOCK */ 15 | #define CONFIG_DEADLOCK_COUNT CONFIG_TICK_HZ 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /demo/sipeed-longan-nano/sipeed-longan-nano.h: -------------------------------------------------------------------------------- 1 | #ifndef SIPEED_LONGAN_NANO_H 2 | #define SIPEED_LONGAN_NANO_H 3 | 4 | #include "adc-gd32vf103.h" 5 | #include "can-gd32vf103.h" 6 | #include "flash-gd32vf103.h" 7 | #include "gpio-gd32vf103.h" 8 | #include "pwm-gd32vf103.h" 9 | #include "spi-gd32vf103.h" 10 | #include "twi-gd32vf103.h" 11 | #include "uart-gd32vf103.h" 12 | #include "wd-gd32vf103_fwdgt.h" 13 | 14 | struct sipeed_longan_nano { 15 | struct gpio TICK; 16 | struct gpio LED_R; 17 | struct gpio LED_G; 18 | struct pwm LED_B; 19 | struct uart USART0; 20 | struct spi SPI0; 21 | struct wd WDT; 22 | struct can CAN0; 23 | struct flash FLASH; 24 | struct adc TEMP; 25 | struct twi I2C0; 26 | struct twi I2C1; 27 | }; 28 | 29 | int sipeed_longan_nano_init(/*@out@*/ struct sipeed_longan_nano *ctx); 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /demo/win32/Makefile: -------------------------------------------------------------------------------- 1 | # 1st: sources & targets 2 | target := win32.exe 3 | 4 | c_src-y += main.c 5 | 6 | # avoid double-inclusion 7 | ifeq ($(skip-makefile),) 8 | PWD := $(shell pwd) 9 | KBUILD_SRC := ../.. 10 | 11 | all: $(target) 12 | @ 13 | 14 | %.exe: FORCE 15 | $(Q)$(MAKE) -C $(KBUILD_SRC) O=$(PWD) TARGET=$@ 16 | 17 | %: 18 | $(Q)$(MAKE) -C $(KBUILD_SRC) O=$(PWD) $@ 19 | 20 | PHONY += FORCE 21 | FORCE: 22 | 23 | .PHONY: $(PHONY) 24 | endif 25 | -------------------------------------------------------------------------------- /demo/win32/picoRTOSConfig.h: -------------------------------------------------------------------------------- 1 | #ifndef PICORTOS_CONFIG_H 2 | #define PICORTOS_CONFIG_H 3 | 4 | /* CLOCKS */ 5 | #define CONFIG_SYSCLK_HZ 150 6 | #define CONFIG_TICK_HZ 50 7 | 8 | /* TASKS */ 9 | #define CONFIG_TASK_COUNT 2 10 | #define TASK_TICK_PRIO 0 11 | #define TASK_BLINK_PRIO 1 12 | 13 | #define CONFIG_DEFAULT_STACK_COUNT 128 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/javascript/main.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jnaulet/OpenPicoRTOS/7fd2abece76bc8ed145d767b42772c465ff14afe/docs/javascript/main.js -------------------------------------------------------------------------------- /docs/javascript/prettify.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jnaulet/OpenPicoRTOS/7fd2abece76bc8ed145d767b42772c465ff14afe/docs/javascript/prettify.js -------------------------------------------------------------------------------- /docs/kbuild/00-INDEX: -------------------------------------------------------------------------------- 1 | 00-INDEX 2 | - this file: info on the kernel build process 3 | kbuild.txt 4 | - developer information on kbuild 5 | kconfig.txt 6 | - usage help for make *config 7 | kconfig-language.txt 8 | - specification of Config Language, the language in Kconfig files 9 | makefiles.txt 10 | - developer information for linux kernel makefiles 11 | modules.txt 12 | - how to build modules and to install them 13 | -------------------------------------------------------------------------------- /docs/styles/main.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jnaulet/OpenPicoRTOS/7fd2abece76bc8ed145d767b42772c465ff14afe/docs/styles/main.css -------------------------------------------------------------------------------- /drivers/Kconfig: -------------------------------------------------------------------------------- 1 | menu "Device drivers" 2 | 3 | source drivers/adc/Kconfig 4 | source drivers/can/Kconfig 5 | source drivers/clock/Kconfig 6 | source drivers/dma/Kconfig 7 | # source drivers/dmasg/Kconfig 8 | source drivers/eeprom/Kconfig 9 | source drivers/flash/Kconfig 10 | source drivers/gpio/Kconfig 11 | source drivers/misc/Kconfig 12 | source drivers/mux/Kconfig 13 | source drivers/pwm/Kconfig 14 | source drivers/rng/Kconfig 15 | source drivers/spi/Kconfig 16 | source drivers/twi/Kconfig 17 | source drivers/uart/Kconfig 18 | source drivers/wd/Kconfig 19 | 20 | endmenu 21 | -------------------------------------------------------------------------------- /drivers/adc/Kconfig: -------------------------------------------------------------------------------- 1 | menu "ADC drivers" 2 | 3 | config ADC_AVR 4 | depends on AVR 5 | bool "AVR/ATMega series ADC" 6 | 7 | config ADC_PIC32MX 8 | depends on MIPS 9 | bool "PIC32Mx series ADC" 10 | 11 | config ADC_RP2040 12 | depends on ARM 13 | bool "RP2040 ADC" 14 | 15 | config ADC_SAM3X 16 | depends on ARM 17 | bool "ATSAM3x series ADC" 18 | 19 | config ADC_SAME5X 20 | depends on ARM 21 | bool "ATSAME5/D5x series ADC" 22 | 23 | config ADC_TINYAVR 24 | depends on AVR 25 | bool "TinyAVR/ATTiny series ADC" 26 | 27 | config ADC_TI_TYPE4 28 | depends on C2000 29 | bool "TI Type4 ADC" 30 | 31 | config ADC_RENESAS_RA4 32 | depends on ARM 33 | bool "Renesas RA4 Series ADC" 34 | 35 | config ADC_NXP_SAR 36 | depends on POWERPC 37 | bool "NXP MPC56/57xx series SAR ADC" 38 | 39 | endmenu 40 | -------------------------------------------------------------------------------- /drivers/adc/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # ADC makefile 3 | # 4 | drivers-adc := $(srctree)/drivers/adc 5 | 6 | c_src-$(CONFIG_ADC_AVR) += $(drivers-adc)/adc-avr.c 7 | c_src-$(CONFIG_ADC_PIC32MX) += $(drivers-adc)/adc-pic32mx.c 8 | c_src-$(CONFIG_ADC_RP2040) += $(drivers-adc)/adc-rp2040.c 9 | c_src-$(CONFIG_ADC_SAM3X) += $(drivers-adc)/adc-sam3x.c 10 | c_src-$(CONFIG_ADC_SAME5X) += $(drivers-adc)/adc-same5x.c 11 | c_src-$(CONFIG_ADC_TINYAVR) += $(drivers-adc)/adc-tinyavr.c 12 | c_src-$(CONFIG_ADC_TI_TYPE4) += $(drivers-adc)/adc-ti_type4.c 13 | c_src-$(CONFIG_ADC_RENESAS_RA4) += $(drivers-adc)/adc-renesas_ra4.c 14 | c_src-$(CONFIG_ADC_NXP_SAR) += $(drivers-adc)/adc-nxp_sar.c 15 | -------------------------------------------------------------------------------- /drivers/adc/adc-sam3x.h: -------------------------------------------------------------------------------- 1 | #ifndef ADC_SAM3X_H 2 | #define ADC_SAM3X_H 3 | 4 | #include "adc.h" 5 | #include 6 | 7 | struct ADC_SAM3X; 8 | 9 | #define ADC_SAM3X_CHANNEL_COUNT 16 10 | 11 | struct adc_sam3x { 12 | /*@temp@*/ struct ADC_SAM3X *base; 13 | }; 14 | 15 | int adc_sam3x_init(/*@out@*/ struct adc_sam3x *ctx, int base); 16 | 17 | struct adc { 18 | /*@temp@*/ struct adc_sam3x *parent; 19 | size_t channel; 20 | /* calibration */ 21 | int multiplier; 22 | int divider; 23 | int offset; 24 | }; 25 | 26 | int adc_sam3x_adc_init(/*@out@*/ struct adc *ctx, struct adc_sam3x *parent, size_t channel); 27 | 28 | /* Runtime calls: 29 | * int adc_setup(struct adc *ctx, struct adc_settings *settings); 30 | * 31 | * int adc_read(struct adc *ctx, int *data); 32 | * int adc_read_multiple(struct adc *ctx, int *data, size_t n); 33 | */ 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /drivers/can/Kconfig: -------------------------------------------------------------------------------- 1 | menu "CAN drivers" 2 | 3 | config CAN_TI_DCAN 4 | depends on C2000 || ARM 5 | bool "TI DCAN" 6 | 7 | config CAN_ATSAM3X 8 | depends on ARM 9 | bool "ATSAM3x series CAN" 10 | 11 | config CAN_NXP_FLEXCAN 12 | depends on POWERPC || ARM 13 | bool "NXP FlexCAN CAN" 14 | 15 | endmenu 16 | -------------------------------------------------------------------------------- /drivers/can/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # CAN makefile 3 | # 4 | drivers-can := $(srctree)/drivers/can 5 | 6 | c_src-$(CONFIG_CAN_TI_DCAN) += $(drivers-can)/can-ti_dcan.c 7 | c_src-$(CONFIG_CAN_ATSAM3X) += $(drivers-can)/can-sam3x.c 8 | c_src-$(CONFIG_CAN_NXP_FLEXCAN) += $(drivers-can)/can-nxp_flexcan.c 9 | -------------------------------------------------------------------------------- /drivers/clock/clock-atmega2560.c: -------------------------------------------------------------------------------- 1 | #include "clock-atmega2560.h" 2 | #include "picoRTOS.h" 3 | 4 | 5 | clock_freq_t clock_get_freq(clock_id_t clkid) 6 | { 7 | picoRTOS_assert(clkid < CLOCK_ATMEGA2560_COUNT, 8 | return (clock_freq_t)-EINVAL); 9 | 10 | /* basically */ 11 | return (clock_freq_t)CONFIG_SYSCLK_HZ; 12 | } 13 | -------------------------------------------------------------------------------- /drivers/clock/clock-atmega2560.h: -------------------------------------------------------------------------------- 1 | #ifndef CLOCK_ATMEGA2560_H 2 | #define CLOCK_ATMEGA2560_H 3 | 4 | #include "clock.h" 5 | 6 | #define CLOCK_ATMEGA2560_CLKCPU CLOCK_SYSCLK 7 | #define CLOCK_ATMEGA2560_CLKFLASH (clock_id_t)1 8 | #define CLOCK_ATMEGA2560_CLKADC (clock_id_t)2 9 | #define CLOCK_ATMEGA2560_CLKIO (clock_id_t)3 10 | #define CLOCK_ATMEGA2560_CLKASY (clock_id_t)4 11 | #define CLOCK_ATMEGA2560_CLKPTC (clock_id_t)5 12 | #define CLOCK_ATMEGA2560_CLKSYS (clock_id_t)6 13 | #define CLOCK_ATMEGA2560_COUNT (clock_id_t)7 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /drivers/clock/clock-atmega328p.c: -------------------------------------------------------------------------------- 1 | #include "clock-atmega328p.h" 2 | #include "picoRTOS.h" 3 | 4 | 5 | clock_freq_t clock_get_freq(clock_id_t clkid) 6 | { 7 | picoRTOS_assert(clkid < CLOCK_ATMEGA328P_COUNT, 8 | return (clock_freq_t)-EINVAL); 9 | 10 | /* basically */ 11 | return (clock_freq_t)CONFIG_SYSCLK_HZ; 12 | } 13 | -------------------------------------------------------------------------------- /drivers/clock/clock-atmega328p.h: -------------------------------------------------------------------------------- 1 | #ifndef CLOCK_ATMEGA328P_H 2 | #define CLOCK_ATMEGA328P_H 3 | 4 | #include "clock.h" 5 | 6 | #define CLOCK_ATMEGA328P_CLKCPU CLOCK_SYSCLK 7 | #define CLOCK_ATMEGA328P_CLKFLASH (clock_id_t)1 8 | #define CLOCK_ATMEGA328P_CLKADC (clock_id_t)2 9 | #define CLOCK_ATMEGA328P_CLKIO (clock_id_t)3 10 | #define CLOCK_ATMEGA328P_CLKASY (clock_id_t)4 11 | #define CLOCK_ATMEGA328P_CLKPTC (clock_id_t)5 12 | #define CLOCK_ATMEGA328P_CLKSYS (clock_id_t)6 13 | #define CLOCK_ATMEGA328P_COUNT (clock_id_t)7 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /drivers/clock/clock-attiny88.c: -------------------------------------------------------------------------------- 1 | #include "clock-attiny88.h" 2 | #include "picoRTOS.h" 3 | 4 | clock_freq_t clock_get_freq(clock_id_t clkid) 5 | { 6 | picoRTOS_assert(clkid < CLOCK_ATTINY88_COUNT, 7 | return (clock_freq_t)-EINVAL); 8 | 9 | /* basically */ 10 | return (clock_freq_t)CONFIG_SYSCLK_HZ; 11 | } 12 | -------------------------------------------------------------------------------- /drivers/clock/clock-attiny88.h: -------------------------------------------------------------------------------- 1 | #ifndef CLOCK_ATTINY88_H 2 | #define CLOCK_ATTINY88_H 3 | 4 | #include "clock.h" 5 | 6 | #define CLOCK_ATTINY88_CLKCPU CLOCK_SYSCLK 7 | #define CLOCK_ATTINY88_CLKIO (clock_id_t)1 8 | #define CLOCK_ATTINY88_CLKFLASH (clock_id_t)2 9 | #define CLOCK_ATTINY88_CLKADC (clock_id_t)3 10 | #define CLOCK_ATTINY88_CLKTWIHS (clock_id_t)4 11 | #define CLOCK_ATTINY88_COUNT (clock_id_t)5 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /drivers/clock/clock-cy7c6801xa.h: -------------------------------------------------------------------------------- 1 | #ifndef CLOCK_CY7C6801xA_H 2 | #define CLOCK_CY7C6801xA_H 3 | 4 | #include "clock.h" 5 | 6 | #define CLOCK_CY7C6801XA_CPU CLOCK_SYSCLK 7 | 8 | typedef enum { 9 | CLOCK_CY7C6801XA_CLKSPD_12MHZ, 10 | CLOCK_CY7C6801XA_CLKSPD_24MHZ, 11 | CLOCK_CY7C6801XA_CLKSPD_48MHZ, 12 | CLOCK_CY7C6801XA_CLKSPD_COUNT 13 | } clock_cy7c6801xa_clkspd_t; 14 | 15 | struct clock_settings { 16 | clock_cy7c6801xa_clkspd_t clkspd; 17 | }; 18 | 19 | int clock_cy7c6801xa_init(const struct clock_settings *settings); 20 | 21 | /* Implements: 22 | * 23 | * clock_freq_t clock_get_freq(clock_id_t clkid); 24 | */ 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /drivers/dma/Kconfig: -------------------------------------------------------------------------------- 1 | menu "DMA drivers" 2 | 3 | config DMA_GD32VF103 4 | depends on RISCV 5 | bool "GD32VF103 series DMA" 6 | 7 | config DMA_RP2040 8 | depends on ARM 9 | bool "Raspberry RP2040 DMA" 10 | 11 | config DMA_ATSAME5X 12 | depends on ARM 13 | bool "ATSAME5x/D5x series DMA" 14 | 15 | config DMA_STM32H7XX 16 | depends on ARM 17 | bool "STM32H7xx series DMA" 18 | 19 | config DMA_TI_F28X 20 | depends on C2000 21 | bool "TI TMS320F28x series DMA" 22 | 23 | config DMA_NXP_EDMA 24 | depends on POWERPC 25 | bool "NXP eDMA DMA" 26 | 27 | endmenu 28 | -------------------------------------------------------------------------------- /drivers/dma/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # DMA drviers makefile 3 | # 4 | drivers-dma := $(srctree)/drivers/dma 5 | 6 | c_src-$(CONFIG_DMA_GD32VF103) += $(drivers-dma)/dma-gd32vf103.c 7 | c_src-$(CONFIG_DMA_RP2040) += $(drivers-dma)/dma-rp2040.c 8 | c_src-$(CONFIG_DMA_ATSAME5X) += $(drivers-dma)/dma-same5x.c 9 | c_src-$(CONFIG_DMA_STM32H7XX) += $(drivers-dma)/dma-stm32h7xx.c 10 | c_src-$(CONFIG_DMA_TI_F28X) += $(drivers-dma)/dma-ti_f28x.c 11 | c_src-$(CONFIG_DMA_NXP_EDMA) += $(drivers-dma)/dma-nxp_edma.c 12 | -------------------------------------------------------------------------------- /drivers/dma/dma-gd32vf103.h: -------------------------------------------------------------------------------- 1 | #ifndef DMA_GD32VF103_H 2 | #define DMA_GD32VF103_H 3 | 4 | #include "dma.h" 5 | #include 6 | 7 | struct DMA_GD32VF103; 8 | struct DMA_GD32VF103_CH; 9 | 10 | #define DMA_GD32VF103_MAX_CH_COUNT 7 /* DMA0, DMA1 has only 5 */ 11 | 12 | struct dma { 13 | /*@temp@*/ struct DMA_GD32VF103 *base; 14 | /*@temp@*/ struct DMA_GD32VF103_CH *ch; 15 | size_t channel; 16 | }; 17 | 18 | int dma_gd32vf103_init(/*@out@*/ struct dma *ctx, int base, size_t channel); 19 | 20 | /* Runtime calls: 21 | * int dma_setup(struct dma *ctx, struct dma_xfer *xfer); 22 | * int dma_xfer(struct dma *ctx, struct dma_xfer *xfer); 23 | * int dma_xfer_done(struct dma *ctx); 24 | */ 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /drivers/dma/dma-nxp_edma.h: -------------------------------------------------------------------------------- 1 | #ifndef DMA_NXP_EDMA_H 2 | #define DMA_NXP_EDMA_H 3 | 4 | #include "dma.h" 5 | 6 | struct DMA_NXP_EDMA; 7 | 8 | #define DMA_NXP_EDMA_CHANNEL_COUNT 64 9 | 10 | struct dma_nxp_edma { 11 | /*@temp@*/ struct DMA_NXP_EDMA *base; 12 | }; 13 | 14 | int dma_nxp_edma_init(/*@out@*/ struct dma_nxp_edma *ctx, int base); 15 | 16 | struct dma { 17 | /*@temp@*/ struct dma_nxp_edma *parent; 18 | size_t channel; 19 | }; 20 | 21 | int dma_nxp_edma_dma_init(/*@out@*/ struct dma *ctx, struct dma_nxp_edma *parent, size_t channel); 22 | 23 | /* Runtime calls: 24 | * int dma_setup(struct dma *ctx, struct dma_xfer *xfer); 25 | * int dma_xfer(struct dma *ctx, struct dma_xfer *xfer); 26 | * int dma_xfer_done(struct dma *ctx); 27 | */ 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /drivers/dma/dma-stm32h7xx.h: -------------------------------------------------------------------------------- 1 | #ifndef DMA_STM32H7XX_H 2 | #define DMA_STM32H7XX_H 3 | 4 | #include "dma.h" 5 | 6 | #define DMA_STM32H7XX_CHANNEL_COUNT 8 7 | 8 | struct DMA_STM32H7XX; 9 | 10 | struct dma { 11 | /*@temp@*/ struct DMA_STM32H7XX *base; 12 | /*@temp@*/ struct DMA_STM32H7XX_CH *ch; 13 | size_t channel; 14 | }; 15 | 16 | int dma_stm32h7xx_init(/*@out@*/ struct dma *ctx, int base, size_t channel); 17 | 18 | /* Runtime calls: 19 | * int dma_setup(struct dma *ctx, struct dma_xfer *xfer); 20 | * int dma_xfer(struct dma *ctx, struct dma_xfer *xfer); 21 | * int dma_xfer_done(struct dma *ctx); 22 | */ 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /drivers/eeprom/Kconfig: -------------------------------------------------------------------------------- 1 | menu "EEPROM drivers" 2 | 3 | config EEPROM_AVR 4 | depends on AVR 5 | bool "AVR EEPROM" 6 | 7 | endmenu 8 | -------------------------------------------------------------------------------- /drivers/eeprom/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # EEPROM drivers 3 | # 4 | drivers-eeprom := $(srctree)/drivers/eeprom 5 | 6 | c_src-$(CONFIG_EEPROM_AVR) += $(drivers-eeprom)/eeprom-avr.c 7 | -------------------------------------------------------------------------------- /drivers/eeprom/eeprom-avr.h: -------------------------------------------------------------------------------- 1 | #ifndef C99_EEPROM_AVR_H 2 | #define C99_EEPROM_AVR_H 3 | 4 | #include "eeprom.h" 5 | #include 6 | 7 | #define C99_EEPROM_AVR_ADDR_COUNT 4096 8 | 9 | struct C99_EEPROM_AVR; 10 | 11 | struct eeprom { 12 | /*@temp@*/ struct C99_EEPROM_AVR *base; 13 | /*@temp@*/ volatile uint8_t *SPMCSR; 14 | }; 15 | 16 | int eeprom_avr_init(/*@out@*/ struct eeprom *ctx, int base, int SPMCSR_base); 17 | 18 | /* Runtime calls: 19 | * int eeprom_read(struct eeprom *ctx, size_t addr, void *buf, size_t n); 20 | * int eeprom_erase(struct eeprom *ctx, size_t addr, size_t n); 21 | * int eeprom_write(struct eeprom *ctx, size_t addr, const void *buf, size_t n); 22 | */ 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /drivers/flash/Kconfig: -------------------------------------------------------------------------------- 1 | menu "Flash drivers" 2 | 3 | config FLASH_GD32VF103 4 | depends on RISCV 5 | bool "GD32VF103 series flash" 6 | 7 | config FLASH_PIC32MX 8 | depends on MIPS 9 | bool "PIC32Mx series flash" 10 | 11 | config FLASH_SAME5X 12 | depends on ARM 13 | bool "SAME5x/D5x series flash" 14 | 15 | endmenu 16 | -------------------------------------------------------------------------------- /drivers/flash/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Flash drivers 3 | # 4 | drivers-flash := $(srctree)/drivers/flash 5 | 6 | c_src-$(CONFIG_FLASH_GD32VF103) += $(drivers-flash)/flash-gd32vf103.c 7 | c_src-$(CONFIG_FLASH_PIC32MX) += $(drivers-flash)/flash-pic32mx.c 8 | c_src-$(CONFIG_FLASH_SAME5X) += $(drivers-flash)/flash-same5x.c 9 | -------------------------------------------------------------------------------- /drivers/gpio/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # GPIO drivers makefile 3 | # 4 | drivers-gpio := $(srctree)/drivers/gpio 5 | 6 | c_src-$(CONFIG_GPIO_AVR) += $(drivers-gpio)/gpio-avr.c 7 | c_src-$(CONFIG_GPIO_GD32VF103) += $(drivers-gpio)/gpio-gd32vf103.c 8 | c_src-$(CONFIG_GPIO_PIC32MX) += $(drivers-gpio)/gpio-pic32mx.c 9 | c_src-$(CONFIG_GPIO_RP2040) += $(drivers-gpio)/gpio-rp2040_sio.c 10 | c_src-$(CONFIG_GPIO_ATSAM3X) += $(drivers-gpio)/gpio-sam3x_pio.c 11 | c_src-$(CONFIG_GPIO_ATSAME5X) += $(drivers-gpio)/gpio-same5x.c 12 | c_src-$(CONFIG_GPIO_STM32H7XX) += $(drivers-gpio)/gpio-stm32h7xx.c 13 | c_src-$(CONFIG_GPIO_TI_F28X) += $(drivers-gpio)/gpio-ti_f28x.c 14 | c_src-$(CONFIG_GPIO_TINYAVR) += $(drivers-gpio)/gpio-tinyavr.c 15 | c_src-$(CONFIG_GPIO_RENESAS_RA4) += $(drivers-gpio)/gpio-renesas_ra4.c 16 | c_src-$(CONFIG_GPIO_NXP_SIUL2) += $(drivers-gpio)/gpio-nxp_siul2.c 17 | c_src-$(CONFIG_GPIO_NXP_SIU) += $(drivers-gpio)/gpio-nxp_siu.c 18 | -------------------------------------------------------------------------------- /drivers/gpio/gpio-avr.h: -------------------------------------------------------------------------------- 1 | #ifndef GPIO_AVR_H 2 | #define GPIO_AVR_H 3 | 4 | #include "gpio.h" 5 | #include 6 | #include 7 | 8 | struct GPIO_AVR; 9 | 10 | struct gpio { 11 | /*@temp@*/ struct GPIO_AVR *base; 12 | uint8_t mask; 13 | bool invert; 14 | }; 15 | 16 | int gpio_avr_init(/*@out@*/ struct gpio *ctx, int base, size_t pin); 17 | 18 | /* Runtime calls: 19 | * int gpio_setup(struct gpio *ctx, struct gpio_settings *settings); 20 | * void gpio_write(struct gpio *ctx, bool value); 21 | * bool gpio_read(struct gpio *ctx); 22 | * void gpio_toggle(struct gpio *ctx); 23 | */ 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /drivers/gpio/gpio-gd32vf103.h: -------------------------------------------------------------------------------- 1 | #ifndef GPIO_GD32VF103_H 2 | #define GPIO_GD32VF103_H 3 | 4 | #include "gpio.h" 5 | #include 6 | #include 7 | 8 | #define GPIO_GD32VF103_PIN_COUNT 16 9 | 10 | struct GPIO_GD32VF103; 11 | 12 | struct gpio { 13 | /*@temp@*/ struct GPIO_GD32VF103 *base; 14 | uint32_t mask; 15 | bool invert; 16 | }; 17 | 18 | int gpio_gd32vf103_init(/*@out@*/ struct gpio *ctx, int base, size_t pin); 19 | 20 | /* Implements: 21 | * int gpio_setup(struct gpio *ctx, struct gpio_settings *settings); 22 | * void gpio_write(struct gpio *ctx, bool value); 23 | * bool gpio_read(struct gpio *ctx); 24 | * void gpio_toggle(struct gpio *ctx); 25 | */ 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /drivers/gpio/gpio-nxp_siu.h: -------------------------------------------------------------------------------- 1 | #ifndef GPIO_NXP_SIU_H 2 | #define GPIO_NXP_SIU_H 3 | 4 | #include "gpio.h" 5 | #include 6 | #include 7 | 8 | #define GPIO_NXP_SIU_PIN_COUNT 32 9 | 10 | struct GPIO_NXP_SIU; 11 | 12 | struct gpio { 13 | /*@temp@*/ struct GPIO_NXP_SIU *base; 14 | uint32_t mask; 15 | bool invert; 16 | }; 17 | 18 | int gpio_nxp_siu_init(/*@out@*/ struct gpio *ctx, int base, size_t pin); 19 | 20 | /* Runtime calls: 21 | * int gpio_setup(struct gpio *ctx, struct gpio_settings *settings); 22 | * void gpio_write(struct gpio *ctx, bool value); 23 | * bool gpio_read(struct gpio *ctx); 24 | * void gpio_toggle(struct gpio *ctx); 25 | */ 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /drivers/gpio/gpio-nxp_siul2.h: -------------------------------------------------------------------------------- 1 | #ifndef GPIO_NXP_SIUL2_H 2 | #define GPIO_NXP_SIUL2_H 3 | 4 | #include "gpio.h" 5 | #include 6 | #include 7 | 8 | struct GPIO_NXP_SIUL2; 9 | 10 | struct gpio { 11 | /*@temp@*/ struct GPIO_NXP_SIUL2 *base; 12 | uint16_t mask; 13 | bool invert; 14 | }; 15 | 16 | #define GPIO_NXP_SIUL2_PIN_COUNT 16 17 | 18 | int gpio_nxp_siul2_init(/*@out@*/ struct gpio *ctx, int base, size_t pin); 19 | 20 | /* Runtime calls: 21 | * int gpio_setup(struct gpio *ctx, struct gpio_settings *settings); 22 | * void gpio_write(struct gpio *ctx, bool value); 23 | * bool gpio_read(struct gpio *ctx); 24 | * void gpio_toggle(struct gpio *ctx); 25 | */ 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /drivers/gpio/gpio-pic32mx.h: -------------------------------------------------------------------------------- 1 | #ifndef GPIO_PIC32MX_H 2 | #define GPIO_PIC32MX_H 3 | 4 | #include "gpio.h" 5 | #include 6 | #include 7 | 8 | struct GPIO_PIC32MX; /* PORT */ 9 | 10 | #define GPIO_PIC32MX_PIN_COUNT 16 11 | 12 | struct gpio { 13 | /*@temp@*/ struct GPIO_PIC32MX *base; 14 | uint32_t mask; 15 | bool invert; 16 | }; 17 | 18 | int gpio_pic32mx_init(/*@out@*/ struct gpio *ctx, int base, size_t pin); 19 | 20 | /* Runtime calls: 21 | * int gpio_setup(struct gpio *ctx, struct gpio_settings *settings); 22 | * void gpio_write(struct gpio *ctx, bool value); 23 | * bool gpio_read(struct gpio *ctx); 24 | * void gpio_toggle(struct gpio *ctx); 25 | */ 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /drivers/gpio/gpio-renesas_ra4.h: -------------------------------------------------------------------------------- 1 | #ifndef GPIO_RENESAS_RA4_H 2 | #define GPIO_RENESAS_RA4_H 3 | 4 | #include "gpio.h" 5 | #include 6 | #include 7 | #include 8 | 9 | #define GPIO_RENESAS_RA4_PIN_COUNT 16 10 | 11 | struct GPIO_RENESAS_RA4; 12 | 13 | struct gpio { 14 | /*@temp@*/ struct GPIO_RENESAS_RA4 *base; 15 | uint32_t mask; 16 | bool invert; 17 | }; 18 | 19 | int gpio_renesas_ra4_init(/*@out@*/ struct gpio *ctx, int base, size_t pin); 20 | 21 | /* Runtime calls: 22 | * int gpio_setup(struct gpio *ctx, struct gpio_settings *settings); 23 | * void gpio_write(struct gpio *ctx, bool value); 24 | * bool gpio_read(struct gpio *ctx); 25 | * void gpio_toggle(struct gpio *ctx); 26 | */ 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /drivers/gpio/gpio-sam3x_pio.h: -------------------------------------------------------------------------------- 1 | #ifndef GPIO_SAM3X_PIO_H 2 | #define GPIO_SAM3X_PIO_H 3 | 4 | #include "gpio.h" 5 | #include 6 | 7 | struct GPIO_SAM3X_PIO; 8 | 9 | #define GPIO_SAM3X_PIO_PIN_COUNT 32 10 | 11 | struct gpio { 12 | /*@temp@*/ struct GPIO_SAM3X_PIO *base; 13 | uint32_t mask; 14 | bool invert; 15 | }; 16 | 17 | int gpio_sam3x_pio_init(/*@out@*/ struct gpio *ctx, int base, size_t pin); 18 | 19 | /* Runtime calls: 20 | * int gpio_setup(struct gpio *ctx, struct gpio_settings *settings); 21 | * void gpio_write(struct gpio *ctx, bool value); 22 | * bool gpio_read(struct gpio *ctx); 23 | * void gpio_toggle(struct gpio *ctx); 24 | */ 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /drivers/gpio/gpio-same5x.h: -------------------------------------------------------------------------------- 1 | #ifndef GPIO_SAME5X_H 2 | #define GPIO_SAME5X_H 3 | 4 | #include "gpio.h" 5 | #include 6 | 7 | struct GPIO_SAME5X; /* PORT */ 8 | 9 | #define GPIO_SAME5X_PIN_COUNT 32 10 | 11 | struct gpio { 12 | /*@temp@*/ struct GPIO_SAME5X *base; 13 | uint32_t mask; 14 | bool invert; 15 | }; 16 | 17 | int gpio_same5x_init(/*@out@*/ struct gpio *ctx, int base, size_t pin); 18 | 19 | /* Runtime calls: 20 | * int gpio_setup(struct gpio *ctx, struct gpio_settings *settings); 21 | * void gpio_write(struct gpio *ctx, bool value); 22 | * bool gpio_read(struct gpio *ctx); 23 | * void gpio_toggle(struct gpio *ctx); 24 | */ 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /drivers/gpio/gpio-stm32h7xx.h: -------------------------------------------------------------------------------- 1 | #ifndef GPIO_STM32H7XX_H 2 | #define GPIO_STM32H7XX_H 3 | 4 | #include "gpio.h" 5 | #include 6 | #include 7 | 8 | #define GPIO_STM32H7XX_PIN_COUNT 16 9 | 10 | struct GPIO_STM32H7XX; 11 | 12 | struct gpio { 13 | /*@temp@*/ struct GPIO_STM32H7XX *base; 14 | uint32_t mask; 15 | bool invert; 16 | }; 17 | 18 | int gpio_stm32h7xx_init(/*@out@*/ struct gpio *ctx, int base, size_t pin); 19 | 20 | /* Runtime calls: 21 | * int gpio_setup(struct gpio *ctx, struct gpio_settings *settings); 22 | * void gpio_write(struct gpio *ctx, bool value); 23 | * bool gpio_read(struct gpio *ctx); 24 | * void gpio_toggle(struct gpio *ctx); 25 | */ 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /drivers/gpio/gpio-ti_f28x.h: -------------------------------------------------------------------------------- 1 | #ifndef GPIO_TI_F28X_H 2 | #define GPIO_TI_F28X_H 3 | 4 | /* GPIO driver for TI Ti_F28x family */ 5 | 6 | #include "gpio.h" 7 | #include 8 | #include 9 | 10 | #define GPIO_TI_F28X_PIN_COUNT 32 11 | 12 | struct GPIO_DATA_REGS; 13 | 14 | struct gpio { 15 | uint32_t mask; 16 | /*@temp@*/ struct GPIO_DATA_REGS *base; 17 | bool invert; 18 | }; 19 | 20 | int gpio_ti_f28x_init(/*@out@*/ struct gpio *ctx, int base, size_t pin); 21 | 22 | /* Runtime calls: 23 | * int gpio_setup(struct gpio *ctx, struct gpio_settings *settings); 24 | * void gpio_write(struct gpio *ctx, bool value); 25 | * bool gpio_read(struct gpio *ctx); 26 | * void gpio_toggle(struct gpio *ctx); 27 | */ 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /drivers/gpio/gpio-tinyavr.h: -------------------------------------------------------------------------------- 1 | #ifndef GPIO_TINYAVR_H 2 | #define GPIO_TINYAVR_H 3 | 4 | /* GPIO driver for tinyAVR 1-series */ 5 | 6 | #include "gpio.h" 7 | #include 8 | #include 9 | 10 | #define GPIO_TINYAVR_PIN_COUNT 8 11 | 12 | struct GPIO_TINYAVR; 13 | 14 | struct gpio { 15 | /*@temp@*/ struct GPIO_TINYAVR *base; 16 | size_t pin; 17 | uint8_t mask; 18 | bool invert; 19 | }; 20 | 21 | int gpio_tinyavr_init(/*@out@*/ struct gpio *ctx, int base, size_t pin); 22 | 23 | /* Runtime calls: 24 | * int gpio_setup(struct gpio *ctx, struct gpio_settings *settings); 25 | * void gpio_write(struct gpio *ctx, bool value); 26 | * bool gpio_read(struct gpio *ctx); 27 | * void gpio_toggle(struct gpio *ctx); 28 | */ 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /drivers/include/clock.h: -------------------------------------------------------------------------------- 1 | #ifndef HAL_CLOCK_H 2 | #define HAL_CLOCK_H 3 | 4 | #include 5 | 6 | typedef long clock_freq_t; 7 | typedef unsigned int clock_id_t; 8 | 9 | /* Constants: Main system clock 10 | * 11 | * CLOCK_SYSCLK - Main system clock ID 12 | */ 13 | #define CLOCK_SYSCLK (clock_id_t)0 /* always */ 14 | 15 | /* Function: clock_get_freq 16 | * Gets a clock frequency (in hz) 17 | * 18 | * Parameters: 19 | * clkid - Clock identifier 20 | * 21 | * Returns: 22 | * The requested clock frequency if success, -errno otherwise 23 | */ 24 | clock_freq_t clock_get_freq(clock_id_t clkid); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /drivers/include/ipwm.h: -------------------------------------------------------------------------------- 1 | #ifndef HAL_IPWM_H 2 | #define HAL_IPWM_H 3 | 4 | #include 5 | #include "pwm.h" 6 | 7 | struct ipwm; 8 | 9 | /* Function: ipwm_get_period 10 | * Measures the period of a train of pulses 11 | * 12 | * Parameters: 13 | * ctx - A IPWM instance 14 | * period - A buffer where to store the measured data 15 | * 16 | * Returns: 17 | * 0 in case of success, -errno otherwise 18 | */ 19 | int ipwm_get_period(struct ipwm *ctx, pwm_period_us_t *period); 20 | 21 | /* Function: ipwm_get_duty_cycle 22 | * Measures the duty cycle of a PWM 23 | * 24 | * Parameters: 25 | * ctx - A IPWM instance 26 | * duty_cycle - A buffer where to store the measured data 27 | * 28 | * Returns: 29 | * 0 in case of success, -errno otherwise 30 | */ 31 | int ipwm_get_duty_cycle(struct ipwm *ctx, pwm_duty_cycle_t *duty_cycle); 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /drivers/include/mux.h: -------------------------------------------------------------------------------- 1 | #ifndef HAL_MUX_H 2 | #define HAL_MUX_H 3 | 4 | #include 5 | 6 | struct mux; 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /drivers/include/rng.h: -------------------------------------------------------------------------------- 1 | #ifndef HAL_RNG_H 2 | #define HAL_RNG_H 3 | 4 | #include 5 | #include 6 | 7 | struct rng; 8 | 9 | /* Function: rng_read 10 | * Read an arbitrary number of bytes from a RNG 11 | * 12 | * Parameters: 13 | * rng - A rng instance 14 | * 15 | * Returns: 16 | * The number of bytes read if success, -errno otherwise 17 | */ 18 | int rng_read(struct rng *ctx, void *buf, size_t n); 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /drivers/include/wd.h: -------------------------------------------------------------------------------- 1 | #ifndef HAL_WD_H 2 | #define HAL_WD_H 3 | 4 | #include 5 | 6 | struct wd; 7 | 8 | /* Function: wd_start 9 | * Starts the watchdog 10 | * 11 | * Parameters: 12 | * ctx - A watchdog instance 13 | * 14 | * Returns: 15 | * 0 in case of success, -errno otherwise 16 | */ 17 | int wd_start(struct wd *ctx); 18 | 19 | /* Function: wd_stop 20 | * Stops the watchdog 21 | * 22 | * Parameters: 23 | * ctx - A watchdog instance 24 | * 25 | * Returns: 26 | * 0 in case of success, -errno otherwise 27 | */ 28 | int wd_stop(struct wd *ctx); 29 | 30 | /* Function: wd_refresh 31 | * Refreshes the watchdog 32 | * 33 | * Parameters: 34 | * ctx - A watchdog instance 35 | */ 36 | void wd_refresh(struct wd *ctx); 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /drivers/misc/Kconfig: -------------------------------------------------------------------------------- 1 | menu "Misc. drivers" 2 | 3 | config MISC_PIC32MX 4 | depends on MIPS 5 | bool "PIC32Mx system protected registers support" 6 | 7 | config MISC_RP2040_RESET 8 | depends on ARM 9 | bool "RP2040 reset system support" 10 | 11 | config MISC_STM32H7XX_DMAMUX 12 | depends on ARM 13 | bool "STM32H7XX DMAMUX support" 14 | 15 | endmenu 16 | -------------------------------------------------------------------------------- /drivers/misc/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # MISC drivers makefile 3 | # 4 | drivers-misc := $(srctree)/drivers/misc 5 | 6 | c_src-$(CONFIG_MISC_PIC32MX) += $(drivers-misc)/misc-pic32mx.c 7 | c_src-$(CONFIG_MISC_RP2040_RESET) += $(drivers-misc)/misc-rp2040_reset.c 8 | c_src-$(CONFIG_MISC_STM32H7XX_DMAMUX) += $(drivers-misc)/misc-stm32h7xx_dmamux.c 9 | -------------------------------------------------------------------------------- /drivers/misc/misc-pic32mx.c: -------------------------------------------------------------------------------- 1 | #include "misc-pic32mx.h" 2 | #include "picoRTOS.h" 3 | #include "picoRTOS_device.h" 4 | 5 | #define CONFIG_CFGCON ((volatile uint32_t*)(ADDR_CONFIGURATION + 0x0)) 6 | #define CONFIG_SYSKEY ((volatile uint32_t*)(ADDR_CONFIGURATION + 0x30)) 7 | 8 | /* Function: pic32mx_unlock 9 | * Unlocks system protected registers 10 | */ 11 | void pic32mx_unlock(void) 12 | { 13 | #define KEY1 0xaa996655 14 | #define KEY2 0x556699aa 15 | 16 | *CONFIG_SYSKEY = (uint32_t)KEY1; 17 | *CONFIG_SYSKEY = (uint32_t)KEY2; 18 | } 19 | 20 | /* Function: pic32mx_lock 21 | * Locks system protected registers 22 | */ 23 | void pic32mx_lock(void) 24 | { 25 | #define KEY3 0x33333333 26 | 27 | *CONFIG_SYSKEY = (uint32_t)KEY3; 28 | } 29 | -------------------------------------------------------------------------------- /drivers/misc/misc-pic32mx.h: -------------------------------------------------------------------------------- 1 | #ifndef MISC_PIC32MX_H 2 | #define MISC_PIC32MX_H 3 | 4 | #include 5 | 6 | /* This access model will be used by a lot of drivers */ 7 | struct PIC32MX_CLR_SET_INV { 8 | volatile uint32_t REG; 9 | volatile uint32_t CLR; 10 | volatile uint32_t SET; 11 | volatile uint32_t INV; 12 | }; 13 | 14 | /* System lock/unlock */ 15 | void pic32mx_unlock(void); 16 | void pic32mx_lock(void); 17 | 18 | /* MMU */ 19 | #define KVA_M 0x1fffffffu 20 | #define KVA_TO_PA(x) ((uint32_t)(x) & KVA_M) 21 | #define KVA_BASE(x) ((uint32_t)(x) & ~KVA_M) 22 | #define PA_TO_KVA(x, base) ((x) | (base)) 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /drivers/misc/misc-stm32h7xx_dmamux.h: -------------------------------------------------------------------------------- 1 | #ifndef MISC_STM32H7XX_DMAMUX_H 2 | #define MISC_STM32H7XX_DMAMUX_H 3 | 4 | #include 5 | #include 6 | 7 | #define DMAMUX_STM32H7XX_CHANNEL_MAX 16 8 | 9 | struct DMAMUX_STM32H7XX; 10 | 11 | struct dmamux { 12 | /*@temp@*/ struct DMAMUX_STM32H7XX *base; 13 | size_t channel; 14 | }; 15 | 16 | int dmamux_stm32h7xx_init(/*@out@*/ struct dmamux *ctx, int base, size_t channel); 17 | int dmamux_stm32h7xx_set_dmareq_id(struct dmamux *ctx, unsigned long id); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /drivers/mux/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # MUX drivers makefile 3 | # 4 | drivers-mux := $(srctree)/drivers/mux 5 | 6 | c_src-$(CONFIG_MUX_AVR) += $(drivers-mux)/mux-avr.c 7 | c_src-$(CONFIG_MUX_GD32VF103) += $(drivers-mux)/mux-gd32vf103.c 8 | c_src-$(CONFIG_MUX_PIC32MX) += $(drivers-mux)/mux-pic32mx.c 9 | c_src-$(CONFIG_MUX_RP2040) += $(drivers-mux)/mux-rp2040.c 10 | c_src-$(CONFIG_MUX_ATSAM3X) += $(drivers-mux)/mux-sam3x_pio.c 11 | c_src-$(CONFIG_MUX_ATSAME5X) += $(drivers-mux)/mux-same5x.c 12 | c_src-$(CONFIG_MUX_STM32H7XX) += $(drivers-mux)/mux-stm32h7xx.c 13 | c_src-$(CONFIG_MUX_TI_F28X) += $(drivers-mux)/mux-ti_f28x.c 14 | c_src-$(CONFIG_MUX_TINYAVR) += $(drivers-mux)/mux-tinyavr.c 15 | c_src-$(CONFIG_MUX_RENESAS_RA4) += $(drivers-mux)/mux-renesas_ra4.c 16 | c_src-$(CONFIG_MUX_NXP_SIUL2) += $(drivers-mux)/mux-nxp_siul2.c 17 | c_src-$(CONFIG_MUX_NXP_SIU) += $(drivers-mux)/mux-nxp_siu.c 18 | -------------------------------------------------------------------------------- /drivers/mux/mux-avr.h: -------------------------------------------------------------------------------- 1 | #ifndef MUX_AVR_H 2 | #define MUX_AVR_H 3 | 4 | #include "mux.h" 5 | #include 6 | #include 7 | 8 | struct MUX_AVR; 9 | 10 | #define MUX_AVR_PIN_COUNT 8 11 | 12 | struct mux { 13 | /*@temp@*/ struct MUX_AVR *base; 14 | }; 15 | 16 | int mux_avr_init(/*@out@*/ struct mux *ctx, int base); 17 | 18 | int mux_avr_input(struct mux *ctx, size_t pin); 19 | int mux_avr_output(struct mux *ctx, size_t pin, bool value); 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /drivers/mux/mux-renesas_ra4.h: -------------------------------------------------------------------------------- 1 | #ifndef MUX_RENESAS_RA4_H 2 | #define MUX_RENESAS_RA4_H 3 | 4 | #include "mux.h" 5 | #include 6 | 7 | #define MUX_RENESAS_RA4_PORT_COUNT 10 8 | #define MUX_RENESAS_RA4_PIN_COUNT 16 9 | #define MUX_RENESAS_RA4_PSEL_COUNT 32 10 | 11 | struct MUX_RENESAS_RA4; 12 | 13 | struct mux { 14 | /*@temp@*/ struct MUX_RENESAS_RA4 *base; 15 | size_t port; 16 | }; 17 | 18 | int mux_renesas_ra4_init(/*@out@*/ struct mux *ctx, int base, size_t port); 19 | 20 | int mux_renesas_ra4_output(struct mux *ctx, size_t pin); 21 | int mux_renesas_ra4_input(struct mux *ctx, size_t pin); 22 | int mux_renesas_ra4_analog(struct mux *ctx, size_t pin); 23 | int mux_renesas_ra4_periph(struct mux *ctx, size_t pin, size_t psel); 24 | 25 | int mux_renesas_ra4_pull_up(struct mux *ctx, size_t pin); 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /drivers/mux/mux-sam3x_pio.h: -------------------------------------------------------------------------------- 1 | #ifndef MUX_SAM3X_PIO_H 2 | #define MUX_SAM3X_PIO_H 3 | 4 | #include "mux.h" 5 | 6 | struct MUX_SAM3X_PIO; 7 | 8 | #define MUX_SAM3X_PIN_COUNT 32 9 | 10 | struct mux_sam3x_pio { 11 | /*@temp@*/ struct MUX_SAM3X_PIO *base; 12 | }; 13 | 14 | typedef enum { 15 | MUX_SAM3X_PIO_DISABLE, 16 | MUX_SAM3X_PIO_GPIO, 17 | MUX_SAM3X_PIO_A, 18 | MUX_SAM3X_PIO_B, 19 | MUX_SAM3X_PIO_COUNT 20 | } mux_sam3x_pio_t; 21 | 22 | int mux_sam3x_pio_init(/*@out@*/ struct mux_sam3x_pio *ctx, int base); 23 | 24 | int mux_sam3x_pio_input(struct mux_sam3x_pio *ctx, size_t pin, mux_sam3x_pio_t mux); 25 | int mux_sam3x_pio_output(struct mux_sam3x_pio *ctx, size_t pin, mux_sam3x_pio_t mux); 26 | 27 | int mux_sam3x_pio_pull_up(struct mux_sam3x_pio *ctx, size_t pin); 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /drivers/mux/mux-stm32h7xx.h: -------------------------------------------------------------------------------- 1 | #ifndef MUX_STM32H7XX_H 2 | #define MUX_STM32H7XX_H 3 | 4 | #include "mux.h" 5 | #include 6 | 7 | #define MUX_STM32H7XX_PIN_COUNT 16 8 | #define MUX_STM32H7XX_ALT_COUNT 16 9 | 10 | struct MUX_STM32H7XX; 11 | 12 | struct mux { 13 | /*@temp@*/ struct MUX_STM32H7XX *base; 14 | }; 15 | 16 | int mux_stm32h7xx_init(/*@out@*/ struct mux *ctx, int base); 17 | 18 | int mux_stm32h7xx_analog(struct mux *ctx, size_t pin); 19 | int mux_stm32h7xx_output(struct mux *ctx, size_t pin); 20 | int mux_stm32h7xx_input(struct mux *ctx, size_t pin); 21 | int mux_stm32h7xx_alt(struct mux *ctx, size_t pin, size_t alt); 22 | 23 | int mux_stm32h7xx_pull_up(struct mux *ctx, size_t pin); 24 | int mux_stm32h7xx_pull_down(struct mux *ctx, size_t pin); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /drivers/pwm/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # PWM drivers makefile 3 | # 4 | drivers-pwm := $(srctree)/drivers/pwm 5 | 6 | c_src-$(CONFIG_PWM_AVR) += $(drivers-pwm)/pwm-avr.c 7 | c_src-$(CONFIG_PWM_GD32VF103) += $(drivers-pwm)/pwm-gd32vf103.c 8 | c_src-$(CONFIG_PWM_PIC32MX) += $(drivers-pwm)/pwm-pic32mx.c 9 | c_src-$(CONFIG_PWM_RP2040) += $(drivers-pwm)/pwm-rp2040.c 10 | c_src-$(CONFIG_PWM_ATSAM3X) += $(drivers-pwm)/pwm-sam3x.c 11 | c_src-$(CONFIG_PWM_ATSAM3X_TC) += $(drivers-pwm)/pwm-sam3x_tc.c 12 | c_src-$(CONFIG_PWM_ATSAME5X) += $(drivers-pwm)/pwm-same5x_tc.c 13 | c_src-$(CONFIG_PWM_STM32H7XX) += $(drivers-pwm)/pwm-stm32h7xx_tim.c 14 | c_src-$(CONFIG_PWM_TI_EPWM) += $(drivers-pwm)/pwm-ti_epwm.c 15 | c_src-$(CONFIG_PWM_TINYAVR) += $(drivers-pwm)/pwm-tinyavr_tca.c 16 | c_src-$(CONFIG_PWM_RENESAS_RA4_GPT) += $(drivers-pwm)/pwm-renesas_ra4_gpt.c 17 | c_src-$(CONFIG_PWM_NXP_EMIOS) += $(drivers-pwm)/pwm-nxp_emios.c 18 | -------------------------------------------------------------------------------- /drivers/rng/Kconfig: -------------------------------------------------------------------------------- 1 | menu "RNG drivers" 2 | 3 | config RNG_XORSHIFT32 4 | bool "George Marsaglia's xorshift32 pseudo-random RNG" 5 | 6 | endmenu 7 | -------------------------------------------------------------------------------- /drivers/rng/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Staging rng drivers 3 | # 4 | drivers-rng := $(srctree)/drivers/rng 5 | 6 | c_src-$(CONFIG_RNG_XORSHIFT32) += $(drivers-rng)/rng-xorshift32.c 7 | -------------------------------------------------------------------------------- /drivers/rng/rng-xorshift32.h: -------------------------------------------------------------------------------- 1 | #ifndef RNG_XORSHIFT32_H 2 | #define RNG_XORSHIFT32_H 3 | 4 | #include "rng.h" 5 | #include 6 | 7 | struct rng { 8 | uint32_t pool; 9 | }; 10 | 11 | int rng_xorshift32_init(/*@out@*/ struct rng *ctx, uint32_t seed); 12 | 13 | /* Implements: 14 | * int rng_read(struct rng *ctx, void *buf, size_t n); 15 | */ 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /drivers/spi/spi-avr.h: -------------------------------------------------------------------------------- 1 | #ifndef SPI_AVR_H 2 | #define SPI_AVR_H 3 | 4 | #include "spi.h" 5 | #include "clock.h" 6 | 7 | struct SPI_AVR; 8 | 9 | typedef enum { 10 | SPI_AVR_STATE_START, 11 | SPI_AVR_STATE_XFER, 12 | SPI_AVR_STATE_COUNT 13 | } spi_avr_state_t; 14 | 15 | struct spi { 16 | /*@temp@*/ struct SPI_AVR *base; 17 | clock_id_t clkid; 18 | spi_avr_state_t state; 19 | }; 20 | 21 | int spi_avr_init(/*@out@*/ struct spi *ctx, int base, clock_id_t clkid); 22 | 23 | /* Runtime calls: 24 | * int spi_setup(struct spi *ctx, const struct spi_settings *settings); 25 | * int spi_xfer(struct spi *ctx, void *rx, const void *tx, size_t n); 26 | */ 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /drivers/spi/spi-avr_usart.h: -------------------------------------------------------------------------------- 1 | #ifndef SPI_AVR_USART_H 2 | #define SPI_AVR_USART_H 3 | 4 | #include "spi.h" 5 | #include "clock.h" 6 | 7 | struct MSPIM_AVR_USART; 8 | 9 | typedef enum { 10 | SPI_AVR_USART_STATE_START, 11 | SPI_AVR_USART_STATE_XFER, 12 | SPI_AVR_USART_STATE_COUNT 13 | } spi_avr_usart_state_t; 14 | 15 | struct spi { 16 | /*@temp@*/ struct MSPIM_AVR_USART *base; 17 | clock_id_t clkid; 18 | spi_avr_usart_state_t state; 19 | }; 20 | 21 | int spi_avr_usart_init(/*@out@*/ struct spi *ctx, int base, clock_id_t clkid); 22 | 23 | /* Runtime calls: 24 | * int spi_setup(struct spi *ctx, const struct spi_settings *settings); 25 | * int spi_xfer(struct spi *ctx, void *rx, const void *tx, size_t n); 26 | */ 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /drivers/spi/spi-nxp_dspi.h: -------------------------------------------------------------------------------- 1 | #ifndef SPI_NXP_DSPI_H 2 | #define SPI_NXP_DSPI_H 3 | 4 | /* NXP_DSPI / SPI driver for NXP MPC5x series */ 5 | 6 | #include "spi.h" 7 | #include "clock.h" 8 | 9 | #include 10 | 11 | struct SPI_NXP_DSPI; 12 | 13 | struct spi { 14 | /*@temp@*/ struct SPI_NXP_DSPI *base; 15 | clock_id_t clkid; 16 | size_t cs; 17 | size_t frame_size; 18 | size_t frame_width; 19 | int balance; 20 | }; 21 | 22 | int spi_nxp_dspi_init(/*@out@*/ struct spi *ctx, int base, clock_id_t clkid); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /drivers/spi/spi-pic32mx.h: -------------------------------------------------------------------------------- 1 | #ifndef SPI_PIC32MX_H 2 | #define SPI_PIC32MX_H 3 | 4 | #include "spi.h" 5 | #include "clock.h" 6 | 7 | struct SPI_PIC32MX; 8 | 9 | struct spi { 10 | /*@temp@*/ struct SPI_PIC32MX *base; 11 | clock_id_t clkid; 12 | size_t frame_size; 13 | size_t frame_width; 14 | int balance; 15 | }; 16 | 17 | int spi_pic32mx_init(/*@out@*/ struct spi *ctx, int base, clock_id_t clkid); 18 | 19 | /* Runtime calls: 20 | * int spi_setup(struct spi *ctx, const struct spi_settings *settings); 21 | * int spi_xfer(struct spi *ctx, void *rx, const void *tx, size_t n); 22 | */ 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /drivers/spi/spi-sam3x.h: -------------------------------------------------------------------------------- 1 | #ifndef SPI_SAM3X_H 2 | #define SPI_SAM3X_H 3 | 4 | #include "spi.h" 5 | #include "clock.h" 6 | 7 | #include 8 | #include 9 | 10 | struct SPI_SAM3X; 11 | 12 | #define SPI_SAM3X_CS_COUNT 4 /* TODO: move to device ? */ 13 | #define SPI_SAM3X_FRAME_SIZE_MIN 8 14 | #define SPI_SAM3X_FRAME_SIZE_MAX 16 15 | 16 | struct spi { 17 | /*@temp@*/ struct SPI_SAM3X *base; 18 | clock_id_t clkid; 19 | int balance; 20 | size_t frame_size; 21 | size_t frame_width; 22 | uint32_t pcs; 23 | }; 24 | 25 | int spi_sam3x_init(/*@out@*/ struct spi *ctx, int base, clock_id_t clkid); 26 | 27 | /* for tests */ 28 | int spi_sam3x_set_loopback(struct spi *ctx, bool loopback); 29 | 30 | /* Runtime calls: 31 | * int spi_setup(struct spi *ctx, const struct spi_settings *settings); 32 | * int spi_xfer(struct spi *ctx, void *rx, const void *tx, size_t n); 33 | */ 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /drivers/spi/spi-tinyavr.h: -------------------------------------------------------------------------------- 1 | #ifndef SPI_TINYAVR_H 2 | #define SPI_TINYAVR_H 3 | 4 | #include "spi.h" 5 | #include "clock.h" 6 | 7 | struct SPI_TINYAVR; 8 | 9 | struct spi { 10 | /*@temp@*/ struct SPI_TINYAVR *base; 11 | clock_id_t clkid; 12 | int balance; 13 | }; 14 | 15 | int spi_tinyavr_init(/*@out@*/ struct spi *ctx, int base, clock_id_t clkid); 16 | 17 | /* Runtime calls: 18 | * int spi_setup(struct spi *ctx, const struct spi_settings *settings); 19 | * int spi_xfer(struct spi *ctx, void *rx, const void *tx, size_t n); 20 | */ 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /drivers/twi/Kconfig: -------------------------------------------------------------------------------- 1 | menu "TWI/I2C drivers" 2 | 3 | config TWI_ATMEL_SERCOM 4 | depends on ARM 5 | bool "Atmel SERCOM TWI" 6 | 7 | config TWI_AVR 8 | depends on AVR 9 | bool "AVR/ATMega series TWI" 10 | 11 | config TWI_DW_APB_I2C 12 | depends on ARM 13 | bool "Synopsis DW APB I2C" 14 | 15 | config TWI_PIC32MX 16 | depends on MIPS 17 | bool "PIC32Mx series TWI" 18 | 19 | config TWI_ATSAM3X 20 | depends on ARM 21 | bool "ATSAM3x series TWI" 22 | 23 | config TWI_TI_F28X 24 | depends on C2000 25 | bool "TI TMS320F28x series TWI" 26 | 27 | endmenu 28 | -------------------------------------------------------------------------------- /drivers/twi/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # TWI drivers makefile 3 | # 4 | drivers-twi := $(srctree)/drivers/twi 5 | 6 | c_src-$(CONFIG_TWI_ATMEL_SERCOM) += $(drivers-twi)/twi-atmel_sercom.c 7 | c_src-$(CONFIG_TWI_AVR) += $(drivers-twi)/twi-avr.c 8 | c_src-$(CONFIG_TWI_DW_APB_I2C) += $(drivers-twi)/twi-dw_apb_i2c.c 9 | c_src-$(CONFIG_TWI_PIC32MX) += $(drivers-twi)/twi-pic32mx.c 10 | c_src-$(CONFIG_TWI_ATSAM3X) += $(drivers-twi)/twi-sam3x.c 11 | c_src-$(CONFIG_TWI_TI_F28X) += $(drivers-twi)/twi-ti_f28x.c 12 | -------------------------------------------------------------------------------- /drivers/twi/twi-avr.h: -------------------------------------------------------------------------------- 1 | #ifndef TWI_AVR_H 2 | #define TWI_AVR_H 3 | 4 | #include "twi.h" 5 | #include "clock.h" 6 | 7 | struct TWI_AVR; 8 | 9 | typedef enum { 10 | TWI_AVR_STATE_IDLE, 11 | TWI_AVR_STATE_START, 12 | TWI_AVR_STATE_SLA, 13 | TWI_AVR_STATE_DATA, 14 | TWI_AVR_STATE_STOP, 15 | TWI_AVR_STATE_COUNT 16 | } twi_avr_state_t; 17 | 18 | struct twi { 19 | /*@temp@*/ struct TWI_AVR *base; 20 | clock_id_t clkid; 21 | twi_mode_t mode; 22 | twi_avr_state_t state; 23 | twi_addr_t slave_addr; 24 | int last; 25 | }; 26 | 27 | int twi_avr_init(/*@out@*/ struct twi *ctx, int base, clock_id_t clkid); 28 | 29 | /* Runtime calls: 30 | * int twi_setup(struct twi *ctx, struct twi_settings *settings); 31 | * 32 | * int twi_write(struct twi *ctx, const void *buf, size_t n); 33 | * int twi_read(struct twi *ctx, void *buf, size_t n); 34 | */ 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /drivers/twi/twi-sam3x.h: -------------------------------------------------------------------------------- 1 | #ifndef TWI_SAM3X_H 2 | #define TWI_SAM3X_H 3 | 4 | #include "twi.h" 5 | #include "clock.h" 6 | 7 | #include 8 | 9 | struct TWI_SAM3X; 10 | 11 | typedef enum { 12 | TWI_SAM3X_STATE_IDLE, 13 | TWI_SAM3X_STATE_XFER, 14 | TWI_SAM3X_STATE_COUNT 15 | } twi_sam3x_state_t; 16 | 17 | struct twi { 18 | /*@temp@*/ struct TWI_SAM3X *base; 19 | clock_id_t clkid; 20 | twi_mode_t mode; 21 | twi_sam3x_state_t state; 22 | uint32_t twi_cr; 23 | }; 24 | 25 | int twi_sam3x_init(/*@out@*/ struct twi *ctx, int base, clock_id_t clkid); 26 | 27 | /* Runtime calls: 28 | * int twi_setup(struct twi *ctx, struct twi_settings *settings); 29 | * 30 | * int twi_write(struct twi *ctx, const void *buf, size_t n); 31 | * int twi_read(struct twi *ctx, void *buf, size_t n); 32 | */ 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /drivers/twi/twi-ti_f28x.h: -------------------------------------------------------------------------------- 1 | #ifndef TWI_TI_F28X_H 2 | #define TWI_TI_F28X_H 3 | 4 | #include "twi.h" 5 | #include "clock.h" 6 | 7 | struct I2C_REGS; 8 | 9 | typedef enum { 10 | TWI_TI_F28X_STATE_IDLE, 11 | TWI_TI_F28X_STATE_XFER, 12 | TWI_TI_F28X_STATE_COUNT 13 | } twi_ti_f28x_state_t; 14 | 15 | struct twi { 16 | /*@temp@*/ struct I2C_REGS *base; 17 | clock_id_t clkid; 18 | twi_mode_t mode; 19 | twi_ti_f28x_state_t state; 20 | }; 21 | 22 | int twi_ti_f28x_init(/*@out@*/ struct twi *ctx, int base, clock_id_t clkid); 23 | 24 | /* Runtime calls: 25 | * int twi_setup(struct twi *ctx, struct twi_settings *settings); 26 | * 27 | * int twi_write(struct twi *ctx, const void *buf, size_t n); 28 | * int twi_read(struct twi *ctx, void *buf, size_t n); 29 | */ 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /drivers/uart/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # UART drivers makefile 3 | # 4 | drivers-uart := $(srctree)/drivers/uart 5 | 6 | c_src-$(CONFIG_UART_ARM_PL011) += $(drivers-uart)/uart-arm_pl011.c 7 | c_src-$(CONFIG_UART_ATMEL_SERCOM) += $(drivers-uart)/uart-atmel_sercom.c 8 | c_src-$(CONFIG_UART_AVR) += $(drivers-uart)/uart-avr$(CONFIG_UART_AVR_IRQDRIVEN:y=_irqdriven).c 9 | c_src-$(CONFIG_UART_GD32VF103) += $(drivers-uart)/uart-gd32vf103.c 10 | c_src-$(CONFIG_UART_PIC32MX) += $(drivers-uart)/uart-pic32mx.c 11 | c_src-$(CONFIG_UART_ATSAM3X) += $(drivers-uart)/uart-sam3x.c 12 | c_src-$(CONFIG_UART_STM32H7XX) += $(drivers-uart)/uart-stm32h7xx.c 13 | c_src-$(CONFIG_UART_TINYAVR_USART) += $(drivers-uart)/uart-tinyavr_usart.c 14 | c_src-$(CONFIG_UART_RENESAS_RA4_SCI) += $(drivers-uart)/uart-renesas_ra4_sci.c 15 | c_src-$(CONFIG_UART_NXP_LINFLEXD) += $(drivers-uart)/uart-nxp_linflexd.c 16 | -------------------------------------------------------------------------------- /drivers/uart/uart-arm_pl011.h: -------------------------------------------------------------------------------- 1 | #ifndef UART_ARM_PL011_H 2 | #define UART_ARM_PL011_H 3 | 4 | /* UART driver for ARM PrimeCell */ 5 | 6 | #include "uart.h" 7 | #include "clock.h" 8 | 9 | #include 10 | 11 | struct UART_ARM_PL011; 12 | 13 | #define UART_ARM_PL011_CS_MIN 5 14 | #define UART_ARM_PL011_CS_MAX 8 15 | 16 | struct uart { 17 | /*@temp@*/ struct UART_ARM_PL011 *base; 18 | clock_id_t clkid; 19 | }; 20 | 21 | int uart_arm_pl011_init(struct uart *ctx, int base, clock_id_t clkid); 22 | 23 | /* test */ 24 | int uart_arm_pl011_set_loopback(struct uart *ctx, bool loopback); 25 | 26 | /* Implements: 27 | * 28 | * int uart_setup(struct uart *ctx, const struct uart_settings *settings); 29 | * int uart_write(struct uart *ctx, const char *buf, size_t n); 30 | * int uart_read(struct uart *ctx, char *buf, size_t n); 31 | */ 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /drivers/uart/uart-atmel_sercom.h: -------------------------------------------------------------------------------- 1 | #ifndef UART_ATMEL_SERCOM_H 2 | #define UART_ATMEL_SERCOM_H 3 | 4 | #include "uart.h" 5 | #include "clock.h" 6 | 7 | #define UART_ATMEL_SERCOM_CS_MIN 5 8 | #define UART_ATMEL_SERCOM_CS_MAX 9 9 | 10 | struct UART_ATMEL_SERCOM; 11 | 12 | struct uart { 13 | /*@temp@*/ struct UART_ATMEL_SERCOM *base; 14 | clock_id_t clkid; 15 | }; 16 | 17 | int uart_atmel_sercom_init(/*@out@*/ struct uart *ctx, int base, clock_id_t clkid); 18 | 19 | /* Implements: 20 | * 21 | * int uart_setup(struct uart *ctx, const struct uart_settings *settings); 22 | * int uart_write(struct uart *ctx, const char *buf, size_t n); 23 | * int uart_read(struct uart *ctx, char *buf, size_t n); 24 | */ 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /drivers/uart/uart-avr.h: -------------------------------------------------------------------------------- 1 | #ifndef UART_AVR_H 2 | #define UART_AVR_H 3 | 4 | #include "uart.h" 5 | #include "clock.h" 6 | 7 | #define UART_AVR_CS_MIN 5 8 | #define UART_AVR_CS_MAX 8 9 | 10 | struct USART_AVR; 11 | 12 | struct uart { 13 | /*@temp@*/ struct USART_AVR *base; 14 | clock_id_t clkid; 15 | }; 16 | 17 | int uart_avr_init(/*@out@*/ struct uart *ctx, int base, clock_id_t clkid); 18 | 19 | /* Runtime calls: 20 | * int uart_setup(struct uart *ctx, const struct uart_settings *settings); 21 | * int uart_write(struct uart *ctx, const char *buf, size_t n); 22 | * int uart_read(struct uart *ctx, char *buf, size_t n); 23 | */ 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /drivers/uart/uart-gd32vf103.h: -------------------------------------------------------------------------------- 1 | #ifndef UART_GD32VF103_H 2 | #define UART_GD32VF103_H 3 | 4 | #include "uart.h" 5 | #include "clock.h" 6 | 7 | struct UART_GD32VF103_USART; 8 | 9 | #define UART_GD32VF103_CS_MIN 8 10 | #define UART_GD32VF103_CS_MAX 9 11 | 12 | struct uart { 13 | /*@temp@*/ struct UART_GD32VF103_USART *base; 14 | clock_id_t clkid; 15 | }; 16 | 17 | int uart_gd32vf103_init(/*@out@*/ struct uart *ctx, int base, clock_id_t clkid); 18 | 19 | /* Implements: 20 | * int uart_setup(struct uart *ctx, const struct uart_settings *settings); 21 | * int uart_write(struct uart *ctx, const char *buf, size_t n); 22 | * int uart_read(struct uart *ctx, char *buf, size_t n); 23 | */ 24 | #endif 25 | -------------------------------------------------------------------------------- /drivers/uart/uart-nxp_linflexd.h: -------------------------------------------------------------------------------- 1 | #ifndef UART_NXP_LINFLEXD_H 2 | #define UART_NXP_LINFLEXD_H 3 | 4 | #include "uart.h" 5 | #include "clock.h" 6 | 7 | struct UART_NXP_LINFLEXD; 8 | 9 | typedef enum { 10 | UART_NXP_LINFLEXD_STATE_START, 11 | UART_NXP_LINFLEXD_STATE_XFER, 12 | UART_NXP_LINFLEXD_STATE_COUNT 13 | } uart_nxp_linflexd_state_t; 14 | 15 | struct uart { 16 | /*@temp@*/ struct UART_NXP_LINFLEXD *base; 17 | clock_id_t clkid; 18 | uart_nxp_linflexd_state_t state; 19 | }; 20 | 21 | int uart_nxp_linflexd_init(/*@out@*/ struct uart *ctx, int base, clock_id_t clkid); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /drivers/uart/uart-pic32mx.h: -------------------------------------------------------------------------------- 1 | #ifndef UART_PIC32MX_H 2 | #define UART_PIC32MX_H 3 | 4 | #include "uart.h" 5 | #include "clock.h" 6 | 7 | struct UART_PIC32MX; 8 | 9 | struct uart { 10 | /*@temp@*/ struct UART_PIC32MX *base; 11 | clock_id_t clkid; 12 | }; 13 | 14 | int uart_pic32mx_init(/*@out@*/ struct uart *ctx, int base, clock_id_t clkid); 15 | 16 | /* Runtime calls: 17 | * int uart_setup(struct uart *ctx, const struct uart_settings *settings); 18 | * int uart_write(struct uart *ctx, const char *buf, size_t n); 19 | * int uart_read(struct uart *ctx, char *buf, size_t n); 20 | */ 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /drivers/uart/uart-renesas_ra4_sci.h: -------------------------------------------------------------------------------- 1 | #ifndef UART_RENESAS_RA4_SCI_H 2 | #define UART_RENESAS_RA4_SCI_H 3 | 4 | #include "uart.h" 5 | #include "clock.h" 6 | 7 | #define UART_RENESAS_RA4_SCI_CS_MIN 7 8 | #define UART_RENESAS_RA4_SCI_CS_MAX 9 9 | 10 | struct UART_RENESAS_RA4_SCI; 11 | 12 | struct uart { 13 | /*@temp@*/ struct UART_RENESAS_RA4_SCI *base; 14 | clock_id_t clkid; 15 | }; 16 | 17 | int uart_renesas_ra4_sci_init(/*@out@*/ struct uart *ctx, int base, clock_id_t clkid); 18 | 19 | /* Implements: 20 | * int uart_setup(struct uart *ctx, const struct uart_settings *settings); 21 | * int uart_write(struct uart *ctx, const char *buf, size_t n); 22 | * int uart_read(struct uart *ctx, char *buf, size_t n); 23 | */ 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /drivers/uart/uart-sam3x.h: -------------------------------------------------------------------------------- 1 | #ifndef UART_SAM3X_H 2 | #define UART_SAM3X_H 3 | 4 | #include "uart.h" 5 | #include "clock.h" 6 | 7 | struct UART_SAM3X; 8 | 9 | struct uart { 10 | /*@temp@*/ struct UART_SAM3X *base; 11 | clock_id_t clkid; 12 | }; 13 | 14 | int uart_sam3x_init(/*@out@*/ struct uart *ctx, int base, clock_id_t clkid); 15 | 16 | /* Runtime calls: 17 | * int uart_setup(struct uart *ctx, const struct uart_settings *settings); 18 | * int uart_write(struct uart *ctx, const char *buf, size_t n); 19 | * int uart_read(struct uart *ctx, char *buf, size_t n); 20 | */ 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /drivers/uart/uart-stm32h7xx.h: -------------------------------------------------------------------------------- 1 | #ifndef UART_STM32H7XX_H 2 | #define UART_STM32H7XX_H 3 | 4 | #include "uart.h" 5 | #include "clock.h" 6 | 7 | #define UART_STM32H7XX_CS_MIN 7 8 | #define UART_STM32H7XX_CS_MAX 8 9 | 10 | struct UART_STM32H7XX; 11 | 12 | struct uart { 13 | /*@temp@*/ struct UART_STM32H7XX *base; 14 | clock_id_t clkid; 15 | }; 16 | 17 | int uart_stm32h7xx_init(/*@out@*/ struct uart *ctx, int base, clock_id_t clkid); 18 | 19 | /* Implements: 20 | * int uart_setup(struct uart *ctx, const struct uart_settings *settings); 21 | * int uart_write(struct uart *ctx, const char *buf, size_t n); 22 | * int uart_read(struct uart *ctx, char *buf, size_t n); 23 | */ 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /drivers/uart/uart-tinyavr_usart.h: -------------------------------------------------------------------------------- 1 | #ifndef UART_TINYAVR_USART_H 2 | #define UART_TINYAVR_USART_H 3 | 4 | #include "uart.h" 5 | #include "clock.h" 6 | 7 | #define USART_TINYAVR_CS_MIN 5 8 | #define USART_TINYAVR_CS_MAX 8 9 | 10 | struct USART_TINYAVR_UART; 11 | 12 | struct uart { 13 | /*@temp@*/ struct USART_TINYAVR_UART *base; 14 | clock_id_t clkid; 15 | }; 16 | 17 | int uart_tinyavr_usart_init(/*@out@*/ struct uart *ctx, int base, clock_id_t clkid); 18 | 19 | /* Implements: 20 | * int uart_setup(struct uart *ctx, const struct uart_settings *settings); 21 | * int uart_write(struct uart *ctx, const char *buf, size_t n); 22 | * int uart_read(struct uart *ctx, char *buf, size_t n); 23 | */ 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /drivers/wd/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # WD drivers makefile 3 | # 4 | drivers-wd := $(srctree)/drivers/wd 5 | 6 | c_src-$(CONFIG_WD_AVR) += $(drivers-wd)/wd-avr.c 7 | c_src-$(CONFIG_WD_GD32VF103_FWDGT) += $(drivers-wd)/wd-gd32vf103_fwdgt.c 8 | c_src-$(CONFIG_WD_PIC32MX) += $(drivers-wd)/wd-pic32mx.c 9 | c_src-$(CONFIG_WD_RP2040) += $(drivers-wd)/wd-rp2040.c 10 | c_src-$(CONFIG_WD_ATSAM3X) += $(drivers-wd)/wd-sam3x.c 11 | c_src-$(CONFIG_WD_ATSAME5X) += $(drivers-wd)/wd-same5x.c 12 | c_src-$(CONFIG_WD_STM32H7XX_IWDG) += $(drivers-wd)/wd-stm32h7xx_iwdg.c 13 | c_src-$(CONFIG_WD_TI_F28X) += $(drivers-wd)/wd-ti_f28x.c 14 | c_src-$(CONFIG_WD_TINYAVR) += $(drivers-wd)/wd-tinyavr.c 15 | -------------------------------------------------------------------------------- /drivers/wd/wd-gd32vf103_fwdgt.h: -------------------------------------------------------------------------------- 1 | #ifndef WD_GD32VF103_FWDGT_H 2 | #define WD_GD32VF103_FWDGT_H 3 | 4 | #include "wd.h" 5 | #include "clock.h" 6 | 7 | struct WD_GD32VF103_FWDGT; 8 | 9 | struct wd { 10 | /*@temp@*/ struct WD_GD32VF103_FWDGT *base; 11 | clock_id_t clkid; 12 | }; 13 | 14 | struct wd_gd32vf103_fwdgt_settings { 15 | unsigned long timeout_us; 16 | }; 17 | 18 | int wd_gd32vf103_fwdgt_init(/*@out@*/ struct wd *ctx, int base, clock_id_t clkid); 19 | int wd_gd32vf103_fwdgt_setup(struct wd *ctx, const struct wd_gd32vf103_fwdgt_settings *settings); 20 | 21 | /* Implements: 22 | * int wd_start(struct wd *ctx); 23 | * int wd_stop(struct wd *ctx); 24 | * void wd_refresh(struct wd *ctx); 25 | */ 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /drivers/wd/wd-rp2040.h: -------------------------------------------------------------------------------- 1 | #ifndef WD_RP2040_H 2 | #define WD_RP2040_H 3 | 4 | #include "wd.h" 5 | #include "clock.h" 6 | 7 | #include 8 | 9 | struct WD_RP2040; 10 | 11 | struct wd { 12 | /*@temp@*/ struct WD_RP2040 *base; 13 | clock_id_t clkid; 14 | uint32_t load; 15 | }; 16 | 17 | struct wd_rp2040_settings { 18 | unsigned long timeout_us; 19 | }; 20 | 21 | int wd_rp2040_init(/*@out@*/ struct wd *ctx, int base, clock_id_t clkid); 22 | int wd_rp2040_setup(struct wd *ctx, const struct wd_rp2040_settings *settings); 23 | 24 | /* Runtime calls: 25 | * int wd_start(struct wd *ctx); 26 | * int wd_stop(struct wd *ctx); 27 | * void wd_refresh(struct wd *ctx); 28 | */ 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /drivers/wd/wd-sam3x.h: -------------------------------------------------------------------------------- 1 | #ifndef WD_SAM3X_H 2 | #define WD_SAM3X_H 3 | 4 | #include "wd.h" 5 | #include "clock.h" 6 | 7 | struct WD_SAM3X; 8 | 9 | struct wd { 10 | /*@temp@*/ struct WD_SAM3X *base; 11 | clock_id_t clkid; 12 | }; 13 | 14 | struct wd_sam3x_settings { 15 | unsigned long timeout_ms; 16 | }; 17 | 18 | int wd_sam3x_init(/*@out@*/ struct wd *ctx, int base, clock_id_t clkid); 19 | int wd_sam3x_setup(struct wd *ctx, const struct wd_sam3x_settings *settings); 20 | 21 | /* Runtime calls: 22 | * int wd_start(struct wd *ctx); 23 | * int wd_stop(struct wd *ctx); 24 | * void wd_refresh(struct wd *ctx); 25 | */ 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /drivers/wd/wd-stm32h7xx_iwdg.h: -------------------------------------------------------------------------------- 1 | #ifndef Wd_STM32H7XX_IWDG_H 2 | #define Wd_STM32H7XX_IWDG_H 3 | 4 | #include "wd.h" 5 | #include "clock.h" 6 | 7 | struct WD_STM32H7XX_IWDG; 8 | 9 | struct wd { 10 | /*@temp@*/ struct WD_STM32H7XX_IWDG *base; 11 | clock_id_t clkid; 12 | }; 13 | 14 | struct wd_stm32h7xx_iwdg_settings { 15 | unsigned long timeout_ms; 16 | unsigned long window_ms; 17 | }; 18 | 19 | int wd_stm32h7xx_iwdg_init(/*@out@*/ struct wd *ctx, int base, clock_id_t clkid); 20 | int wd_stm32h7xx_iwdg_setup(struct wd *ctx, const struct wd_stm32h7xx_iwdg_settings *settings); 21 | 22 | /* Implements: 23 | * 24 | * int wd_start(struct wd *ctx); 25 | * int wd_stop(struct wd *ctx); 26 | * void wd_refresh(struct wd *ctx); 27 | */ 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /etc/images/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jnaulet/OpenPicoRTOS/7fd2abece76bc8ed145d767b42772c465ff14afe/etc/images/banner.png -------------------------------------------------------------------------------- /etc/images/make-menuconfig.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jnaulet/OpenPicoRTOS/7fd2abece76bc8ed145d767b42772c465ff14afe/etc/images/make-menuconfig.png -------------------------------------------------------------------------------- /ipc/Kconfig: -------------------------------------------------------------------------------- 1 | menu "Inter-Process communications" 2 | 3 | config FUTEX 4 | bool "Support for futexes (fast mutexes)" 5 | default n 6 | help 7 | Futexes are the most basic IPC you can think of. They 8 | are non re-entrant. 9 | 10 | config MUTEX 11 | bool "Support for mutexes" 12 | default n 13 | help 14 | On OpenPicoRTOS, mutexes are similar to futexes, but 15 | re-entrant. 16 | 17 | config COND 18 | bool "Support for conditions" 19 | default n 20 | select MUTEX 21 | help 22 | Conditions are similar to POSIX conditions & require 23 | mutexes 24 | 25 | config QUEUE 26 | bool "Support for queues" 27 | default n 28 | select FUTEX 29 | help 30 | Queues are used to make FIFOs. Warning: issues with 31 | caches are not solved yet 32 | 33 | endmenu 34 | -------------------------------------------------------------------------------- /ipc/Makefile: -------------------------------------------------------------------------------- 1 | # IPCs makefile 2 | ipc := $(srctree)/ipc 3 | 4 | c_src-$(CONFIG_FUTEX) += $(ipc)/picoRTOS_futex.c 5 | c_src-$(CONFIG_MUTEX) += $(ipc)/picoRTOS_mutex.c 6 | c_src-$(CONFIG_COND) += $(ipc)/picoRTOS_cond.c 7 | c_src-$(CONFIG_QUEUE) += $(ipc)/picoRTOS_queue.c 8 | -------------------------------------------------------------------------------- /ipc/picoRTOS_futex.h: -------------------------------------------------------------------------------- 1 | #ifndef PICORTOS_FUTEX_H 2 | #define PICORTOS_FUTEX_H 3 | 4 | #include 5 | #include "picoRTOS.h" 6 | 7 | typedef picoRTOS_atomic_t picoRTOS_futex_t; 8 | 9 | /* macro for static init */ 10 | #define PICORTOS_FUTEX_INITIALIZER (picoRTOS_futex_t)0 11 | 12 | void picoRTOS_futex_init(/*@out@*/ picoRTOS_futex_t *futex); /* init futex */ 13 | 14 | /*@unused@*/ int picoRTOS_futex_trylock(picoRTOS_futex_t *futex); /* try ot lock futex */ 15 | void picoRTOS_futex_lock(picoRTOS_futex_t *futex); /* lock futex */ 16 | void picoRTOS_futex_unlock(picoRTOS_futex_t *futex); /* unlock futex */ 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /picoRTOS-SMP.h: -------------------------------------------------------------------------------- 1 | #ifndef PICORTOS_SMP_H 2 | #define PICORTOS_SMP_H 3 | 4 | /* SMP extensions for picoRTOS */ 5 | 6 | #include "picoRTOS.h" 7 | 8 | /* CORES */ 9 | 10 | /* TASKS (potentially unused) */ 11 | 12 | /*@unused@*/ void picoRTOS_SMP_add_task(struct picoRTOS_task *task, 13 | picoRTOS_priority_t prio, 14 | picoRTOS_mask_t core_mask); 15 | 16 | /* INTERRUPT MANAGEMENT (optional) */ 17 | 18 | void picoRTOS_SMP_enable_interrupt(picoRTOS_irq_t irq, 19 | picoRTOS_mask_t core_mask); 20 | void picoRTOS_SMP_disable_interrupt(picoRTOS_irq_t irq, 21 | picoRTOS_mask_t core_mask); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /samples/Makefile.template: -------------------------------------------------------------------------------- 1 | # OpenPicoRTOS basic makefile template 2 | # 'target' is the binary OpenPicoRTOS build system will create 3 | target := myproject.elf 4 | 5 | # All your sources can be put insinde 'c_src-y' for c and 'a_src-y' for assembly 6 | c_src-y += myproject.c 7 | c_src-y += some_other_sources.c 8 | 9 | # This makefile will be included by OpenPicoRTOS during build, it is safer to use 10 | # the 'skip-makefile' keyword to avoid local targets inclusion 11 | ifneq ($(skip-makefile),1) 12 | PWD := $(shell pwd) 13 | # 'PICORTOS_SRC' is the directory containing the OpenPicoRTOS original sources 14 | PICORTOS_SRC := path/to/OpenPicoRTOS 15 | 16 | all: $(target) 17 | @ 18 | 19 | $(target): FORCE 20 | $(Q)$(MAKE) -C $(PICORTOS_SRC) O=$(PWD) 21 | 22 | %: 23 | $(Q)$(MAKE) -C $(PICORTOS_SRC) O=$(PWD) $@ 24 | 25 | PHONY += FORCE 26 | FORCE: 27 | 28 | .PHONY: $(PHONY) 29 | endif 30 | -------------------------------------------------------------------------------- /samples/ldscripts/atsam3x8e_flash_xip.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * SAM3X8E memory mapping for ROM 3 | */ 4 | 5 | MEMORY 6 | { 7 | flash(rx) : ORIGIN = 0x00080000, LENGTH = 512k 8 | ram(rwx) : ORIGIN = 0x20000000, LENGTH = 96k 9 | } 10 | 11 | PROVIDE(__relocate_text = 0x0); 12 | STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x100; 13 | 14 | ENTRY(Reset_Handler) 15 | REGION_ALIAS("FLASH", flash); 16 | REGION_ALIAS("RAM", ram); 17 | 18 | /* common sections definition */ 19 | INCLUDE armvx-m_xip_sections.ld 20 | /* user-defined sections definitions */ 21 | SECTIONS 22 | { 23 | .stack (NOLOAD): 24 | { 25 | . = ALIGN(8); 26 | __stack_start__ = .; 27 | . = . + STACK_SIZE; 28 | . = ALIGN(8); 29 | __stack_end__ = .; 30 | } > ram 31 | 32 | __StackTop = __stack_end__; 33 | __StackBottom = __stack_start__; 34 | } 35 | -------------------------------------------------------------------------------- /samples/ldscripts/atsam3x8e_ram.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * SAM3X8E memory mapping for RAM 3 | */ 4 | 5 | MEMORY 6 | { 7 | flash(rx) : ORIGIN = 0x00080000, LENGTH = 512k 8 | ram(rwx) : ORIGIN = 0x20000000, LENGTH = 96k 9 | } 10 | 11 | PROVIDE(__relocate_text = 0x1); 12 | STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x100; 13 | 14 | ENTRY(Reset_Handler) 15 | REGION_ALIAS("FLASH", flash); 16 | REGION_ALIAS("RAM", ram); 17 | 18 | /* common sections definition */ 19 | INCLUDE armvx-m_ram_sections.ld 20 | /* user-defined sections definitions */ 21 | SECTIONS 22 | { 23 | .stack (NOLOAD): 24 | { 25 | . = ALIGN(8); 26 | __stack_start__ = .; 27 | . = . + STACK_SIZE; 28 | . = ALIGN(8); 29 | __stack_end__ = .; 30 | } > ram 31 | 32 | __StackTop = __stack_end__; 33 | __StackBottom = __stack_start__; 34 | } 35 | -------------------------------------------------------------------------------- /samples/ldscripts/atsamd51g18a_flash_xip.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * SAMD51G18A memory mapping for ROM (XIP) 3 | */ 4 | 5 | MEMORY 6 | { 7 | flash(rx) : ORIGIN = 0x00000000, LENGTH = 256k 8 | ram(rwx) : ORIGIN = 0x20000000, LENGTH = 128k 9 | } 10 | 11 | PROVIDE(__relocate_text = 0x0); 12 | STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x100; 13 | 14 | ENTRY(Reset_Handler) 15 | REGION_ALIAS("FLASH", flash); 16 | REGION_ALIAS("RAM", ram); 17 | 18 | /* common sections definition */ 19 | INCLUDE armvx-m_xip_sections.ld 20 | /* user-defined sections definitions */ 21 | SECTIONS 22 | { 23 | .stack (NOLOAD): 24 | { 25 | . = ALIGN(8); 26 | __stack_start__ = .; 27 | . = . + STACK_SIZE; 28 | . = ALIGN(8); 29 | __stack_end__ = .; 30 | } > ram 31 | 32 | __StackTop = __stack_end__; 33 | __StackBottom = __stack_start__; 34 | } 35 | -------------------------------------------------------------------------------- /samples/ldscripts/atsamd51g18a_ram.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * SAMD51G18A memory mapping for RAM 3 | */ 4 | 5 | MEMORY 6 | { 7 | flash(rx) : ORIGIN = 0x00000000, LENGTH = 256k 8 | ram(rwx) : ORIGIN = 0x20000000, LENGTH = 128k 9 | } 10 | 11 | PROVIDE(__relocate_text = 0x1); 12 | STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x100; 13 | 14 | ENTRY(Reset_Handler) 15 | REGION_ALIAS("FLASH", flash); 16 | REGION_ALIAS("RAM", ram); 17 | 18 | /* common sections definition */ 19 | INCLUDE armvx-m_ram_sections.ld 20 | /* user-defined sections definitions */ 21 | SECTIONS 22 | { 23 | .stack (NOLOAD): 24 | { 25 | . = ALIGN(8); 26 | __stack_start__ = .; 27 | . = . + STACK_SIZE; 28 | . = ALIGN(8); 29 | __stack_end__ = .; 30 | } > ram 31 | 32 | __StackTop = __stack_end__; 33 | __StackBottom = __stack_start__; 34 | } 35 | -------------------------------------------------------------------------------- /samples/ldscripts/atsamd51g19a_flash_xip.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * SAMD51G19A memory mapping for ROM (XIP) 3 | */ 4 | 5 | MEMORY 6 | { 7 | flash(rx) : ORIGIN = 0x00000000, LENGTH = 512k 8 | ram(rwx) : ORIGIN = 0x20000000, LENGTH = 192k 9 | } 10 | 11 | PROVIDE(__relocate_text = 0x0); 12 | STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x100; 13 | 14 | ENTRY(Reset_Handler) 15 | REGION_ALIAS("FLASH", flash); 16 | REGION_ALIAS("RAM", ram); 17 | 18 | /* common sections definition */ 19 | INCLUDE armvx-m_xip_sections.ld 20 | /* user-defined sections definitions */ 21 | SECTIONS 22 | { 23 | .stack (NOLOAD): 24 | { 25 | . = ALIGN(8); 26 | __stack_start__ = .; 27 | . = . + STACK_SIZE; 28 | . = ALIGN(8); 29 | __stack_end__ = .; 30 | } > ram 31 | 32 | __StackTop = __stack_end__; 33 | __StackBottom = __stack_start__; 34 | } 35 | -------------------------------------------------------------------------------- /samples/ldscripts/atsamd51g19a_ram.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * SAMD51G19A memory mapping for RAM 3 | */ 4 | 5 | MEMORY 6 | { 7 | flash(rx) : ORIGIN = 0x00000000, LENGTH = 512k 8 | ram(rwx) : ORIGIN = 0x20000000, LENGTH = 192k 9 | } 10 | 11 | PROVIDE(__relocate_text = 0x1); 12 | STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x100; 13 | 14 | ENTRY(Reset_Handler) 15 | REGION_ALIAS("FLASH", flash); 16 | REGION_ALIAS("RAM", ram); 17 | 18 | /* common sections definition */ 19 | INCLUDE armvx-m_ram_sections.ld 20 | /* user-defined sections definitions */ 21 | SECTIONS 22 | { 23 | .stack (NOLOAD): 24 | { 25 | . = ALIGN(8); 26 | __stack_start__ = .; 27 | . = . + STACK_SIZE; 28 | . = ALIGN(8); 29 | __stack_end__ = .; 30 | } > ram 31 | 32 | __StackTop = __stack_end__; 33 | __StackBottom = __stack_start__; 34 | } 35 | -------------------------------------------------------------------------------- /samples/ldscripts/ch32v003_flash_xip.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * CH32V003 memory mapping for ROM 3 | */ 4 | 5 | MEMORY 6 | { 7 | boot(rx) : ORIGIN = 0x1ffff000, LENGTH = 1920 8 | rom(rx) : ORIGIN = 0x00000000, LENGTH = 16k 9 | ram(rwx) : ORIGIN = 0x20000000, LENGTH = 2k 10 | } 11 | 12 | PROVIDE(__relocate_text = 0x0); 13 | STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x100; 14 | 15 | ENTRY(Reset_Handler) 16 | REGION_ALIAS("FLASH", rom); 17 | REGION_ALIAS("RAM", ram); 18 | 19 | /* Section Definitions */ 20 | INCLUDE rv32imac_xip_sections.ld 21 | -------------------------------------------------------------------------------- /samples/ldscripts/ch32v003_ram.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * CH32V003 memory mapping for RAM 3 | */ 4 | 5 | MEMORY 6 | { 7 | boot(rx) : ORIGIN = 0x1ffff000, LENGTH = 1920 8 | rom(rx) : ORIGIN = 0x00000000, LENGTH = 16k 9 | ram(rwx) : ORIGIN = 0x20000000, LENGTH = 2k 10 | } 11 | 12 | PROVIDE(__relocate_text = 0x1); 13 | STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x100; 14 | 15 | ENTRY(Reset_Handler) 16 | REGION_ALIAS("FLASH", rom); 17 | REGION_ALIAS("RAM", ram); 18 | 19 | /* Section Definitions */ 20 | INCLUDE rv32imac_ram_sections.ld 21 | -------------------------------------------------------------------------------- /samples/ldscripts/gd32vf103c8t6_flash_xip.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * GD32VF103C8T6 (lite) memory mapping for ROM 3 | */ 4 | 5 | MEMORY 6 | { 7 | boot(rx) : ORIGIN = 0x1fffb000, LENGTH = 18k 8 | rom(rx) : ORIGIN = 0x08000000, LENGTH = 64k 9 | ram(rwx) : ORIGIN = 0x20000000, LENGTH = 20k 10 | } 11 | 12 | PROVIDE(__relocate_text = 0x0); 13 | STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x100; 14 | 15 | ENTRY(Reset_Handler) 16 | REGION_ALIAS("FLASH", flash); 17 | REGION_ALIAS("RAM", ram); 18 | 19 | /* Section Definitions */ 20 | INCLUDE rv32imac_xip_sections.ld 21 | -------------------------------------------------------------------------------- /samples/ldscripts/gd32vf103c8t6_ram.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * GD32VF103C8T6 (lite) memory mapping for RAM 3 | */ 4 | 5 | MEMORY 6 | { 7 | boot(rx) : ORIGIN = 0x1fffb000, LENGTH = 18k 8 | rom(rx) : ORIGIN = 0x08000000, LENGTH = 64k 9 | ram(rwx) : ORIGIN = 0x20000000, LENGTH = 20k 10 | } 11 | 12 | PROVIDE(__relocate_text = 0x1); 13 | STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x100; 14 | 15 | ENTRY(Reset_Handler) 16 | REGION_ALIAS("FLASH", flash); 17 | REGION_ALIAS("RAM", ram); 18 | 19 | /* Section Definitions */ 20 | INCLUDE rv32imac_ram_sections.ld 21 | -------------------------------------------------------------------------------- /samples/ldscripts/gd32vf103cbt6_flash_xip.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * GD32VF103CBT6 memory mapping for ROM 3 | */ 4 | 5 | MEMORY 6 | { 7 | boot(rx) : ORIGIN = 0x1fffb000, LENGTH = 18k 8 | flash(rx) : ORIGIN = 0x08000000, LENGTH = 128k 9 | ram(rwx) : ORIGIN = 0x20000000, LENGTH = 32k 10 | } 11 | 12 | PROVIDE(__relocate_text = 0x0); 13 | STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x100; 14 | 15 | ENTRY(Reset_Handler) 16 | REGION_ALIAS("FLASH", flash); 17 | REGION_ALIAS("RAM", ram); 18 | 19 | /* Section Definitions */ 20 | INCLUDE rv32imac_xip_sections.ld 21 | -------------------------------------------------------------------------------- /samples/ldscripts/gd32vf103cbt6_ram.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * GD32VF103CBT6 memory mapping for RAM 3 | */ 4 | 5 | MEMORY 6 | { 7 | boot(rx) : ORIGIN = 0x1fffb000, LENGTH = 18k 8 | flash(rx) : ORIGIN = 0x08000000, LENGTH = 128k 9 | ram(rwx) : ORIGIN = 0x20000000, LENGTH = 32k 10 | } 11 | 12 | PROVIDE(__relocate_text = 0x1); 13 | STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x100; 14 | 15 | ENTRY(Reset_Handler) 16 | REGION_ALIAS("FLASH", flash); 17 | REGION_ALIAS("RAM", ram); 18 | 19 | /* Section Definitions */ 20 | INCLUDE rv32imac_ram_sections.ld 21 | -------------------------------------------------------------------------------- /samples/ldscripts/mpc5775e-evb_flash_xip.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * MPC5775E memory mapping for ROM 3 | */ 4 | 5 | MEMORY 6 | { 7 | flash(rx) : ORIGIN = 0x00800000, LENGTH = 4096k 8 | ram(rwx) : ORIGIN = 0x40000000, LENGTH = 512k 9 | } 10 | 11 | PROVIDE(__relocate_text = 0x0); 12 | STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x100; 13 | 14 | ENTRY(Reset_Handler) 15 | REGION_ALIAS("FLASH", flash); 16 | REGION_ALIAS("RAM", ram); 17 | PROVIDE(__interrupt_vector_count = 512); 18 | 19 | /* ECC RAM */ 20 | PROVIDE(__ram_start__ = 0x40000000); 21 | PROVIDE(__ram_end__ = 0x4007fffc); 22 | 23 | /* common sections definition */ 24 | INCLUDE ppc-eabivle_flash_xip_sections.ld 25 | -------------------------------------------------------------------------------- /samples/ldscripts/mpc5775e-evb_ram.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * MPC5775E memory mapping for RAM 3 | */ 4 | 5 | MEMORY 6 | { 7 | flash(rx) : ORIGIN = 0x00800000, LENGTH = 4096k 8 | ram(rwx) : ORIGIN = 0x40000000, LENGTH = 512k 9 | } 10 | 11 | PROVIDE(__relocate_text = 0x1); 12 | STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x100; 13 | 14 | ENTRY(Reset_Handler) 15 | REGION_ALIAS("FLASH", flash); 16 | REGION_ALIAS("RAM", ram); 17 | PROVIDE(__interrupt_vector_count = 512); 18 | 19 | /* ECC RAM */ 20 | PROVIDE(__ram_start__ = 0x40000000); 21 | PROVIDE(__ram_end__ = 0x4007fffc); 22 | 23 | /* common sections definition */ 24 | INCLUDE ppc-eabivle_ram_sections.ld 25 | -------------------------------------------------------------------------------- /samples/ldscripts/renesas_ra4_flash_xip.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * SAM3X8E memory mapping for ROM 3 | */ 4 | 5 | MEMORY 6 | { 7 | flash(rx) : ORIGIN = 0x00000000, LENGTH = 256k 8 | ram(rwx) : ORIGIN = 0x20000000, LENGTH = 32k 9 | } 10 | 11 | PROVIDE(__relocate_text = 0x0); 12 | STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x100; 13 | 14 | ENTRY(Reset_Handler) 15 | REGION_ALIAS("FLASH", flash); 16 | REGION_ALIAS("RAM", ram); 17 | 18 | /* common sections definition */ 19 | INCLUDE armvx-m_xip_sections.ld 20 | /* user-defined sections definitions */ 21 | SECTIONS 22 | { 23 | .stack (NOLOAD): 24 | { 25 | . = ALIGN(8); 26 | __stack_start__ = .; 27 | . = . + STACK_SIZE; 28 | . = ALIGN(8); 29 | __stack_end__ = .; 30 | } > ram 31 | 32 | __StackTop = __stack_end__; 33 | __StackBottom = __stack_start__; 34 | } 35 | -------------------------------------------------------------------------------- /samples/ldscripts/renesas_ra4_ram.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * Renesas RA4M1 memory mapping for RAM 3 | */ 4 | 5 | MEMORY 6 | { 7 | flash(rx) : ORIGIN = 0x00000000, LENGTH = 256k 8 | ram(rwx) : ORIGIN = 0x20000000, LENGTH = 32k 9 | } 10 | 11 | PROVIDE(__relocate_text = 0x1); 12 | STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x100; 13 | 14 | ENTRY(Reset_Handler) 15 | REGION_ALIAS("FLASH", flash); 16 | REGION_ALIAS("RAM", ram); 17 | 18 | /* common sections definition */ 19 | INCLUDE armvx-m_ram_sections.ld 20 | /* user-defined sections definitions */ 21 | SECTIONS 22 | { 23 | .stack (NOLOAD): 24 | { 25 | . = ALIGN(8); 26 | __stack_start__ = .; 27 | . = . + STACK_SIZE; 28 | . = ALIGN(8); 29 | __stack_end__ = .; 30 | } > ram 31 | 32 | __StackTop = __stack_end__; 33 | __StackBottom = __stack_start__; 34 | } 35 | -------------------------------------------------------------------------------- /samples/ldscripts/stm32f103x8_flash_xip.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * STM342F103xx memory mapping for ROM 3 | */ 4 | 5 | MEMORY 6 | { 7 | flash(rx) : ORIGIN = 0x08000000, LENGTH = 64k 8 | ram(rwx) : ORIGIN = 0x20000000, LENGTH = 20k 9 | } 10 | 11 | PROVIDE(__relocate_text = 0x0); 12 | STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x100; 13 | 14 | ENTRY(Reset_Handler) 15 | REGION_ALIAS("FLASH", flash); 16 | REGION_ALIAS("RAM", ram); 17 | 18 | /* common sections definition */ 19 | INCLUDE armvx-m_xip_sections.ld 20 | /* user-defined sections definitions */ 21 | SECTIONS 22 | { 23 | .stack (NOLOAD): 24 | { 25 | . = ALIGN(8); 26 | __stack_start__ = .; 27 | . = . + STACK_SIZE; 28 | . = ALIGN(8); 29 | __stack_end__ = .; 30 | } > ram 31 | 32 | __StackTop = __stack_end__; 33 | __StackBottom = __stack_start__; 34 | } 35 | -------------------------------------------------------------------------------- /samples/ldscripts/stm32f103x8_ram.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * STM32F103xx memory mapping for RAM 3 | */ 4 | 5 | MEMORY 6 | { 7 | flash(rx) : ORIGIN = 0x08000000, LENGTH = 64k 8 | ram(rwx) : ORIGIN = 0x20000000, LENGTH = 20k 9 | } 10 | 11 | PROVIDE(__relocate_text = 0x1); 12 | STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x100; 13 | 14 | ENTRY(Reset_Handler) 15 | REGION_ALIAS("FLASH", flash); 16 | REGION_ALIAS("RAM", ram); 17 | 18 | /* common sections definition */ 19 | INCLUDE armvx-m_ram_sections.ld 20 | /* user-defined sections definitions */ 21 | SECTIONS 22 | { 23 | .stack (NOLOAD): 24 | { 25 | . = ALIGN(8); 26 | __stack_start__ = .; 27 | . = . + STACK_SIZE; 28 | . = ALIGN(8); 29 | __stack_end__ = .; 30 | } > ram 31 | 32 | __StackTop = __stack_end__; 33 | __StackBottom = __stack_start__; 34 | } 35 | -------------------------------------------------------------------------------- /samples/ldscripts/stm32f401rc_flash_xip.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * STM32F401RC memory mapping for ROM 3 | */ 4 | 5 | MEMORY 6 | { 7 | flash(rx) : ORIGIN = 0x08000000, LENGTH = 256k 8 | ram(rwx) : ORIGIN = 0x20000000, LENGTH = 64k 9 | } 10 | 11 | PROVIDE(__relocate_text = 0x0); 12 | STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x100; 13 | 14 | ENTRY(Reset_Handler) 15 | REGION_ALIAS("FLASH", flash); 16 | REGION_ALIAS("RAM", ram); 17 | 18 | /* common sections definition */ 19 | INCLUDE armvx-m_xip_sections.ld 20 | /* user-defined sections definitions */ 21 | SECTIONS 22 | { 23 | .stack (NOLOAD): 24 | { 25 | . = ALIGN(8); 26 | __stack_start__ = .; 27 | . = . + STACK_SIZE; 28 | . = ALIGN(8); 29 | __stack_end__ = .; 30 | } > ram 31 | 32 | __StackTop = __stack_end__; 33 | __StackBottom = __stack_start__; 34 | } 35 | -------------------------------------------------------------------------------- /samples/ldscripts/stm32f401rc_ram.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * STM32F401RC memory mapping for RAM 3 | */ 4 | 5 | MEMORY 6 | { 7 | flash(rx) : ORIGIN = 0x08000000, LENGTH = 256k 8 | ram(rwx) : ORIGIN = 0x20000000, LENGTH = 64k 9 | } 10 | 11 | PROVIDE(__relocate_text = 0x1); 12 | STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x100; 13 | 14 | ENTRY(Reset_Handler) 15 | REGION_ALIAS("FLASH", flash); 16 | REGION_ALIAS("RAM", ram); 17 | 18 | /* common sections definition */ 19 | INCLUDE armvx-m_ram_sections.ld 20 | /* user-defined sections definitions */ 21 | SECTIONS 22 | { 23 | .stack (NOLOAD): 24 | { 25 | . = ALIGN(8); 26 | __stack_start__ = .; 27 | . = . + STACK_SIZE; 28 | . = ALIGN(8); 29 | __stack_end__ = .; 30 | } > ram 31 | 32 | __StackTop = __stack_end__; 33 | __StackBottom = __stack_start__; 34 | } 35 | -------------------------------------------------------------------------------- /scheduler/Kconfig: -------------------------------------------------------------------------------- 1 | menu "Scheduler options" 2 | 3 | choice 4 | prompt "Main scheduler" 5 | 6 | config SINGLE_CORE 7 | bool "picoRTOS (single core)" 8 | 9 | config SMP 10 | bool "picoRTOS-SMP (SMP)" 11 | 12 | endchoice 13 | 14 | config SMP_CORES 15 | int "Number of SMP cores" 16 | depends on SMP 17 | default 2 18 | help 19 | The numbers of cores on which the system will run 20 | 21 | endmenu 22 | -------------------------------------------------------------------------------- /scheduler/Makefile: -------------------------------------------------------------------------------- 1 | # scheduler makefile 2 | scheduler := $(srctree)/scheduler 3 | 4 | c_src-$(CONFIG_SINGLE_CORE) += $(scheduler)/picoRTOS.c 5 | c_src-$(CONFIG_SMP) += $(scheduler)/picoRTOS-SMP.c 6 | -------------------------------------------------------------------------------- /scripts/basic/.gitignore: -------------------------------------------------------------------------------- 1 | fixdep 2 | -------------------------------------------------------------------------------- /scripts/basic/Makefile: -------------------------------------------------------------------------------- 1 | ### 2 | # Makefile.basic lists the most basic programs used during the build process. 3 | # The programs listed herein are what are needed to do the basic stuff, 4 | # such as fix file dependencies. 5 | # This initial step is needed to avoid files to be recompiled 6 | # when kernel configuration changes (which is what happens when 7 | # .config is included by main Makefile. 8 | # --------------------------------------------------------------------------- 9 | # fixdep: Used to generate dependency information during build process 10 | 11 | hostprogs-y := fixdep 12 | always := $(hostprogs-y) 13 | 14 | # fixdep is needed to compile other host programs 15 | $(addprefix $(obj)/,$(filter-out fixdep,$(always))): $(obj)/fixdep 16 | -------------------------------------------------------------------------------- /scripts/kconfig/.gitignore: -------------------------------------------------------------------------------- 1 | # 2 | # Generated files 3 | # 4 | config* 5 | lex.*.c 6 | *.tab.c 7 | *.tab.h 8 | zconf.hash.c 9 | *.moc 10 | lkc_defs.h 11 | gconf.glade.h 12 | *.pot 13 | *.mo 14 | 15 | # 16 | # configuration programs 17 | # 18 | conf 19 | mconf 20 | nconf 21 | qconf 22 | gconf 23 | kxgettext 24 | -------------------------------------------------------------------------------- /scripts/kconfig/POTFILES.in: -------------------------------------------------------------------------------- 1 | scripts/kconfig/lxdialog/checklist.c 2 | scripts/kconfig/lxdialog/inputbox.c 3 | scripts/kconfig/lxdialog/menubox.c 4 | scripts/kconfig/lxdialog/textbox.c 5 | scripts/kconfig/lxdialog/util.c 6 | scripts/kconfig/lxdialog/yesno.c 7 | scripts/kconfig/mconf.c 8 | scripts/kconfig/conf.c 9 | scripts/kconfig/confdata.c 10 | scripts/kconfig/gconf.c 11 | scripts/kconfig/gconf.glade.h 12 | scripts/kconfig/qconf.cc 13 | -------------------------------------------------------------------------------- /scripts/kconfig/check.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Needed for systems without gettext 3 | $* -xc -o /dev/null - > /dev/null 2>&1 << EOF 4 | #include 5 | int main() 6 | { 7 | gettext(""); 8 | return 0; 9 | } 10 | EOF 11 | if [ ! "$?" -eq "0" ]; then 12 | echo -DKBUILD_NO_NLS; 13 | fi 14 | 15 | -------------------------------------------------------------------------------- /scripts/kconfig/kconfig_load.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "lkc.h" 6 | 7 | #define P(name,type,arg) type (*name ## _p) arg 8 | #include "lkc_proto.h" 9 | #undef P 10 | 11 | void kconfig_load(void) 12 | { 13 | void *handle; 14 | char *error; 15 | 16 | handle = dlopen("./libkconfig.so", RTLD_LAZY); 17 | if (!handle) { 18 | handle = dlopen("./scripts/kconfig/libkconfig.so", RTLD_LAZY); 19 | if (!handle) { 20 | fprintf(stderr, "%s\n", dlerror()); 21 | exit(1); 22 | } 23 | } 24 | 25 | #define P(name,type,arg) \ 26 | { \ 27 | name ## _p = dlsym(handle, #name); \ 28 | if ((error = dlerror())) { \ 29 | fprintf(stderr, "%s\n", error); \ 30 | exit(1); \ 31 | } \ 32 | } 33 | #include "lkc_proto.h" 34 | #undef P 35 | } 36 | -------------------------------------------------------------------------------- /scripts/kconfig/lxdialog/.gitignore: -------------------------------------------------------------------------------- 1 | # 2 | # Generated files 3 | # 4 | lxdialog 5 | -------------------------------------------------------------------------------- /scripts/kconfig/lxdialog/BIG.FAT.WARNING: -------------------------------------------------------------------------------- 1 | This is NOT the official version of dialog. This version has been 2 | significantly modified from the original. It is for use by the Linux 3 | kernel configuration script. Please do not bother Savio Lam with 4 | questions about this program. 5 | -------------------------------------------------------------------------------- /staging/Kconfig: -------------------------------------------------------------------------------- 1 | config STAGING 2 | bool "Support for staging tree" 3 | 4 | menu "Staging tree" 5 | depends on STAGING 6 | 7 | source staging/drivers/adc/Kconfig 8 | source staging/drivers/can/Kconfig 9 | source staging/drivers/clock/Kconfig 10 | source staging/drivers/dma/Kconfig 11 | source staging/drivers/dmasg/Kconfig 12 | source staging/drivers/flash/Kconfig 13 | source staging/drivers/gpio/Kconfig 14 | source staging/drivers/lin/Kconfig 15 | source staging/drivers/misc/Kconfig 16 | source staging/drivers/mux/Kconfig 17 | source staging/drivers/pwm/Kconfig 18 | source staging/drivers/rng/Kconfig 19 | source staging/drivers/spi/Kconfig 20 | source staging/drivers/twi/Kconfig 21 | source staging/drivers/uart/Kconfig 22 | source staging/drivers/wd/Kconfig 23 | 24 | endmenu 25 | -------------------------------------------------------------------------------- /staging/demo/arduino-nano-v3-clone/Makefile: -------------------------------------------------------------------------------- 1 | # 1st: sources & targets 2 | target := arduino-nano-v3-clone.elf 3 | 4 | c_src-y += main.c 5 | c_src-y += arduino-nano-v3-clone.c 6 | 7 | # avoid double-inclusion 8 | ifneq ($(skip-makefile),1) 9 | PWD := $(shell pwd) 10 | PICORTOS_SRC := ../../.. 11 | TTY ?= /dev/ttyUSB0 12 | 13 | hex := $(target:%.elf=%.hex) 14 | 15 | all: $(hex) 16 | @ 17 | 18 | $(target): FORCE 19 | $(Q)$(MAKE) -C $(PICORTOS_SRC) O=$(PWD) 20 | 21 | $(hex): $(target) 22 | avr-objcopy -O ihex -R .eeprom $< $@ 23 | 24 | upload: $(hex) 25 | avrdude -v -patmega328p -carduino -P$(TTY) \ 26 | -b57600 -D -Uflash:w:$<:i 27 | 28 | clean: FORCE 29 | $(Q)$(MAKE) -C $(PICORTOS_SRC) O=$(PWD) $@ 30 | @rm -f $(target) $(hex) *.map 31 | 32 | %: 33 | $(Q)$(MAKE) -C $(PICORTOS_SRC) O=$(PWD) $@ 34 | 35 | PHONY += FORCE 36 | FORCE: 37 | 38 | .PHONY: $(PHONY) 39 | endif 40 | -------------------------------------------------------------------------------- /staging/demo/arduino-nano-v3-clone/README.md: -------------------------------------------------------------------------------- 1 | # picoRTOS Arduino Uno demo 2 | 3 | ## Description 4 | 5 | This simple demo tests the following: 6 | 7 | - ADC 8 | - EEPROM 9 | - GPIO 10 | - I2C 11 | - PWM 12 | - SPI 13 | - UART 14 | - Watchdog 15 | 16 | ## Requirements 17 | 18 | Some wiring is required before you can perform this test. 19 | 20 | In order to work properly these connections have to be made: 21 | 22 | - A0 to 3.3V 23 | - ICSP connector pin 1 to 4 (SPI hardware loopback) 24 | - I2C acts like a slave and will answer 0x5a if it received 0xa5 on addr 0x69 25 | -------------------------------------------------------------------------------- /staging/demo/arduino-nano-v3-clone/arduino-nano-v3-clone.h: -------------------------------------------------------------------------------- 1 | #ifndef ARDUINO_NANO_V3_CLONE_H 2 | #define ARDUINO_NANO_V3_CLONE_H 3 | 4 | #include "picoRTOS_device.h" 5 | 6 | #include "clock-lgt8fx8p.h" 7 | #include "gpio-avr.h" 8 | #include "mux-avr.h" 9 | #include "pwm-avr.h" 10 | #include "spi-avr_irqdriven.h" 11 | #include "uart-avr_irqdriven.h" 12 | #include "wd-avr.h" 13 | 14 | struct arduino_nano_v3_clone { 15 | struct gpio TICK; 16 | struct gpio L; 17 | struct uart SERIAL; 18 | struct spi SPI; 19 | struct pwm PWM3; 20 | struct pwm PWM9; 21 | struct wd WDT; 22 | }; 23 | 24 | int arduino_nano_v3_clone_init(/*@out@*/ struct arduino_nano_v3_clone *ctx); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /staging/demo/ch32v003f4p6-r0-1v1/README.md: -------------------------------------------------------------------------------- 1 | # picoRTOS CH32V003 demo 2 | 3 | ## Description 4 | 5 | This simple demo tests the following: 6 | 7 | - Clocks 8 | - GPIO 9 | - MUX 10 | 11 | ## Requirements 12 | 13 | Some wiring is required before you can perform this test. 14 | 15 | In order to work properly these connections have to be made: 16 | 17 | - PD4 to LED2 18 | 19 | ## More info 20 | 21 | I recommend you use gdb-multiarch & the excellent picoRVD probe system from aappleby: https://github.com/aappleby/picorvd 22 | -------------------------------------------------------------------------------- /staging/demo/ch32v003f4p6-r0-1v1/ch32v003f4p6-r0-1v1.h: -------------------------------------------------------------------------------- 1 | #ifndef CH32V00F4P6_R0_1V1_H 2 | #define CH32V00F4P6_R0_1V1_H 3 | 4 | #include "gpio-wch_ch32x.h" 5 | 6 | struct ch32v003f4p6 { 7 | struct gpio TICK; 8 | struct gpio LED1; 9 | }; 10 | 11 | int ch32v003f4p6_init(/*@out@*/ struct ch32v003f4p6 *ctx); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /staging/demo/devebox-stc-c51/Makefile: -------------------------------------------------------------------------------- 1 | target := devebox-stc-c51.hex 2 | 3 | c_src-y += main.c 4 | c_src-y += devebox-stc-c51.c 5 | 6 | ifneq ($(skip-makefile),1) 7 | PWD := $(shell pwd) 8 | PICORTOS_SRC := ../../.. 9 | 10 | all: $(target) 11 | @ 12 | 13 | $(target): FORCE 14 | $(Q)$(MAKE) -C $(PICORTOS_SRC) O=$(PWD) 15 | 16 | upload: $(target) 17 | stcgal -P stc12 $(target) 18 | 19 | %: 20 | $(Q)$(MAKE) -C $(PICORTOS_SRC) O=$(PWD) $@ 21 | 22 | PHONY += FORCE upload 23 | FORCE: 24 | 25 | .PHONY: $(PHONY) 26 | 27 | endif 28 | -------------------------------------------------------------------------------- /staging/demo/devebox-stc-c51/devebox-stc-c51.h: -------------------------------------------------------------------------------- 1 | #ifndef DEVEBOX_STC_C51_H 2 | #define DEVEBOX_STC_C51_H 3 | 4 | #include "gpio-8051.h" 5 | #include "uart-8051_irqdriven.h" 6 | 7 | struct devebox_stc_c51 { 8 | struct gpio TICK; 9 | struct gpio D2; 10 | struct gpio R; 11 | struct gpio T; 12 | /* serial */ 13 | struct uart UART; 14 | }; 15 | 16 | int devebox_stc_c51_init(/*@out@*/ struct devebox_stc_c51 *ctx); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /staging/demo/ez-usb-fx2/Makefile: -------------------------------------------------------------------------------- 1 | target := build/ez-usb-fx2.ihx 2 | 3 | c_src-y += main.c 4 | 5 | ifneq ($(skip-makefile),1) 6 | PWD := $(shell pwd) 7 | PICORTOS_SRC := ../../.. 8 | 9 | all: $(target) 10 | @ 11 | 12 | $(target): FORCE 13 | $(Q)$(MAKE) -C $(PICORTOS_SRC) O=$(PWD) 14 | 15 | %: 16 | $(Q)$(MAKE) -C $(PICORTOS_SRC) O=$(PWD) $@ 17 | 18 | run: $(target) 19 | cycfx2prog prg:$< 20 | sleep 1 21 | cycfx2prog run 22 | # delay:10 dbulk:6,-512,5 23 | # cycfx2prog dbulk:6,-512 24 | 25 | PHONY += FORCE 26 | FORCE: 27 | 28 | .PHONY: $(PHONY) 29 | endif 30 | -------------------------------------------------------------------------------- /staging/demo/mh-tiny/mh-tiny.h: -------------------------------------------------------------------------------- 1 | #ifndef MH_TINY_H 2 | #define MH_TINY_H 3 | 4 | #include "gpio-avr.h" 5 | #include "mux-avr.h" 6 | #include "spi-avr_irqdriven.h" 7 | #include "wd-avr.h" 8 | 9 | struct mh_tiny { 10 | struct gpio TICK; 11 | struct gpio LED; 12 | // struct uart UART; 13 | struct spi SPI; 14 | struct wd WD; 15 | }; 16 | 17 | int mh_tiny_init(/*@out@*/ struct mh_tiny *ctx); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /staging/demo/mpc5775e-evb/Makefile: -------------------------------------------------------------------------------- 1 | # 1st: sources & targets 2 | target := $(TARGET) 3 | 4 | c_src-y += main.c 5 | c_src-y += mpc5775e-evb.c 6 | 7 | # avoid double-inclusion 8 | ifneq ($(skip-makefile),1) 9 | PWD := $(shell pwd) 10 | KBUILD_SRC := ../../.. 11 | 12 | TARGETS := mpc5775e-evb_ram.elf 13 | TARGETS += mpc5775e-evb_flash.elf 14 | TARGETS += mpc5775e-evb-SMP_ram.elf 15 | TARGETS += mpc5775e-evb-SMP_flash.elf 16 | 17 | defconfig = $(@:%.elf=%_defconfig) 18 | 19 | all: $(TARGETS) 20 | @ 21 | 22 | %.elf: FORCE 23 | $(Q)$(MAKE) -C $(KBUILD_SRC) O=$(PWD) $(defconfig) 24 | $(Q)$(MAKE) -C $(KBUILD_SRC) O=$(PWD) TARGET=$@ 25 | 26 | %: 27 | $(Q)$(MAKE) -C $(KBUILD_SRC) O=$(PWD) $@ 28 | 29 | PHONY += FORCE 30 | FORCE: 31 | 32 | .PHONY: $(PHONY) 33 | endif 34 | -------------------------------------------------------------------------------- /staging/demo/mpc5775e-evb/README.md: -------------------------------------------------------------------------------- 1 | # picoRTOS NXP MPC5775B/E single core / SMP demo 2 | 3 | ## Description 4 | 5 | This simple demo uses the mpc5775b/e-evb & tests the following: 6 | 7 | - ADC 8 | - CAN 9 | - GPIO 10 | - MUX 11 | - PWM 12 | - SPI 13 | 14 | ## Requirements 15 | 16 | Some wiring is required to perform this standalone test: 17 | 18 | - J125, PIN1 (eMIOS0) to D20 for GPIO 19 | - J125, PIN2 (eMIOS1) to D21 for GPIO 20 | - J125, PIN3 (eMIOS2) to D22 for PWM 21 | - J125, PIN12 (eMIOS11) to J125, PIN14 (eMIOS13) for SPI loopback 22 | 23 | ## How to build 24 | 25 | To build for all targets, type: 26 | 27 | # make 28 | -------------------------------------------------------------------------------- /staging/demo/mpc5775e-evb/mpc5775e-evb.h: -------------------------------------------------------------------------------- 1 | #ifndef MPC5775E_EVB_H 2 | #define MPC5775E_EVB_H 3 | 4 | #include "adc-nxp_eqadc.h" 5 | #include "gpio-nxp_siu.h" 6 | #include "pwm-nxp_emios.h" 7 | #include "spi-nxp_dspi.h" 8 | #include "can-nxp_flexcan.h" 9 | 10 | #define MPC5775E_LED_COUNT 4 11 | 12 | struct mpc5775e_evb { 13 | struct adc ADC; 14 | struct gpio TICK; 15 | struct gpio LED0; 16 | struct gpio LED1; 17 | struct pwm PWM; 18 | struct ipwm IPWM; 19 | struct spi SPI; 20 | struct can CAN; 21 | }; 22 | 23 | int mpc5775e_evb_init(/*@out@*/ struct mpc5775e_evb *ctx); 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /staging/demo/n76e003/Makefile: -------------------------------------------------------------------------------- 1 | target := n76e003.ihx 2 | 3 | c_src-y += main.c 4 | c_src-y += n76e003.c 5 | 6 | #ccflags-y += --out-fmt-elf 7 | #ldflags-y += --out-fmt-elf 8 | NUVOPROG := ~/go/bin/nuvoprog 9 | 10 | ifneq ($(skip-makefile),1) 11 | PWD := $(shell pwd) 12 | PICORTOS_SRC := ../../.. 13 | 14 | all: $(target) 15 | @ 16 | 17 | $(target): FORCE 18 | $(Q)$(MAKE) -C $(PICORTOS_SRC) O=$(PWD) 19 | 20 | %: 21 | $(Q)$(MAKE) -C $(PICORTOS_SRC) O=$(PWD) $@ 22 | 23 | upload: $(target) 24 | $(NUVOPROG) program -i $< -t n76e003 -c @config.json 25 | 26 | PHONY += FORCE 27 | FORCE: 28 | 29 | .PHONY: $(PHONY) 30 | 31 | endif 32 | -------------------------------------------------------------------------------- /staging/demo/n76e003/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "boot_select": "aprom", 3 | "pwm_enabled_during_ocd": false, 4 | "ocd_enabled": true, 5 | "reset_pin_disabled": false, 6 | "locked": false, 7 | "ldrom_size": "0kb", 8 | "bod_disabled": false, 9 | "bod_voltage": "2v2", 10 | "iap_enabled_in_brownout": false, 11 | "bod_reset_disabled": false, 12 | "wdt": "disabled" 13 | } 14 | -------------------------------------------------------------------------------- /staging/demo/n76e003/debug.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | mkdir -p debug 3 | # picoRTOS files 4 | make deploy 5 | find picoRTOS -type f -exec mv {} $(pwd)/debug \; 6 | # local files 7 | cp *.[ch] debug 8 | cp include/generated debug -fR 9 | cp ../../../arch/8051/include/macros.S debug/ 10 | cp Makefile.debug debug/Makefile 11 | -------------------------------------------------------------------------------- /staging/demo/n76e003/n76e003.h: -------------------------------------------------------------------------------- 1 | #ifndef N76E003_H 2 | #define N76E003_H 3 | 4 | #include "gpio-n76e003.h" 5 | #include "uart-n76e003.h" 6 | #include "pwm-n76e003.h" 7 | 8 | struct n76e003 { 9 | struct gpio TICK; 10 | struct gpio D2; 11 | /* uart */ 12 | struct uart UART0; 13 | /* Relays */ 14 | struct gpio OUT0; 15 | struct gpio OUT1; 16 | /* PWMs */ 17 | struct pwm PWM; 18 | }; 19 | 20 | int n76e003_init(/*@out@*/ struct n76e003 *ctx); 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /staging/demo/s08pt60-evk-noclk/s08pt60-evk.h: -------------------------------------------------------------------------------- 1 | #ifndef S08PT60_EVK_H 2 | #define S08PT60_EVK_H 3 | 4 | #include "wd-mc9s08ptxx.h" 5 | #include "gpio-mc9s08ptxx.h" 6 | 7 | struct s08pt60_evk { 8 | struct gpio TICK; 9 | struct gpio GREEN; 10 | struct gpio RED; 11 | /* watchdog */ 12 | struct wd WD; 13 | }; 14 | 15 | int s08pt60_evk_init(/*@out@*/ struct s08pt60_evk *ctx); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /staging/demo/s08pt60-evk/README.md: -------------------------------------------------------------------------------- 1 | # picoRTOS NXP S08PT60-EVK demo 2 | 3 | ## Description 4 | 5 | This simple demo tests the following: 6 | 7 | - ADC 8 | - GPIOs 9 | - UART 10 | - PWM 11 | - SPI 12 | - Watchdog 13 | 14 | ## Requirements 15 | 16 | Some wiring is required before you can perform this test. 17 | 18 | In order to work properly these connections have to be made: 19 | 20 | - PTD1 to PTD2 (SPI1 loopback) 21 | -------------------------------------------------------------------------------- /staging/demo/s08pt60-evk/s08pt60-evk.h: -------------------------------------------------------------------------------- 1 | #ifndef S08PT60_EVK_H 2 | #define S08PT60_EVK_H 3 | 4 | #include "wd-mc9s08ptxx.h" 5 | #include "gpio-mc9s08ptxx.h" 6 | #include "uart-mc9s08ptxx_sci.h" 7 | #include "spi-mc9s08ptxx.h" 8 | #include "pwm-mc9s08ptxx_ftm.h" 9 | #include "adc-mc9s08ptxx.h" 10 | 11 | struct s08pt60_evk { 12 | struct gpio TICK; 13 | struct gpio RED; 14 | struct gpio GREEN; 15 | /* struct gpio BLUE; */ 16 | /* UART */ 17 | struct uart UART2; 18 | /* SPI */ 19 | struct spi SPI1; 20 | /* PWM & ADC */ 21 | struct s08pt60_evk_ana { 22 | struct pwm FTM2CH5; 23 | struct adc ADP1; 24 | } ANA; 25 | /* watchdog */ 26 | struct wd WD; 27 | }; 28 | 29 | int s08pt60_evk_init(/*@out@*/ struct s08pt60_evk *ctx); 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /staging/demo/stm32f103xx/Makefile: -------------------------------------------------------------------------------- 1 | # OpenPicoRTOS basic makefile template 2 | # 'target' is the binary OpenPicoRTOS build system will create 3 | target := stm32f103xx.elf 4 | 5 | # All your sources can be put insinde 'c_src-y' for c and 'a_src-y' for assembly 6 | c_src-y += main.c 7 | c_src-y += stm32f103xx.c 8 | 9 | # This makefile will be included by OpenPicoRTOS during build, it is safer to use 10 | # the 'skip-makefile' keyword to avoid local targets inclusion 11 | ifneq ($(skip-makefile),1) 12 | PWD := $(shell pwd) 13 | # 'PICORTOS_SRC' is the directory containing the OpenPicoRTOS original sources 14 | PICORTOS_SRC := ../../.. 15 | 16 | all: $(target) 17 | @ 18 | 19 | $(target): FORCE 20 | $(Q)$(MAKE) -C $(PICORTOS_SRC) O=$(PWD) 21 | 22 | %: 23 | $(Q)$(MAKE) -C $(PICORTOS_SRC) O=$(PWD) $@ 24 | 25 | PHONY += FORCE 26 | FORCE: 27 | 28 | endif 29 | 30 | .PHONY: $(PHONY) 31 | -------------------------------------------------------------------------------- /staging/demo/stm32f103xx/stm32f103xx.h: -------------------------------------------------------------------------------- 1 | #ifndef STM32F103XX_H 2 | #define STM32F103XX_H 3 | 4 | #include "gpio-stm32f10xxx.h" 5 | 6 | struct stm32f103xx { 7 | struct gpio TICK; 8 | struct gpio LED; 9 | }; 10 | 11 | int stm32f103xx_init(/*@out@*/ struct stm32f103xx *ctx); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /staging/demo/stm32f401rct6/Makefile: -------------------------------------------------------------------------------- 1 | # OpenPicoRTOS basic makefile template 2 | # 'target' is the binary OpenPicoRTOS build system will create 3 | target := stm32f401rct6.elf 4 | 5 | # All your sources can be put insinde 'c_src-y' for c and 'a_src-y' for assembly 6 | c_src-y += main.c 7 | c_src-y += stm32f401rct6.c 8 | 9 | # This makefile will be included by OpenPicoRTOS during build, it is safer to use 10 | # the 'skip-makefile' keyword to avoid local targets inclusion 11 | ifneq ($(skip-makefile),1) 12 | PWD := $(shell pwd) 13 | # 'PICORTOS_SRC' is the directory containing the OpenPicoRTOS original sources 14 | PICORTOS_SRC := ../../.. 15 | 16 | all: $(target) 17 | @ 18 | 19 | $(target): FORCE 20 | $(Q)$(MAKE) -C $(PICORTOS_SRC) O=$(PWD) 21 | 22 | %: 23 | $(Q)$(MAKE) -C $(PICORTOS_SRC) O=$(PWD) $@ 24 | 25 | PHONY += FORCE 26 | FORCE: 27 | 28 | endif 29 | 30 | .PHONY: $(PHONY) 31 | -------------------------------------------------------------------------------- /staging/demo/stm32f401rct6/stm32f401rct6.h: -------------------------------------------------------------------------------- 1 | #ifndef STM32F401RCT6_H 2 | #define STM32F401RCT6_H 3 | 4 | #include "gpio-stm32h7xx.h" 5 | 6 | struct stm32f401rct6 { 7 | struct gpio TICK; 8 | struct gpio LED; 9 | }; 10 | 11 | int stm32f401rct6_init(/*@out@*/ struct stm32f401rct6 *ctx); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /staging/demo/stm8s003f3p3/Makefile.debug: -------------------------------------------------------------------------------- 1 | AS := sdasstm8 -j -y -los 2 | CC := sdcc 3 | BASENAME := stm8s003f3p3 4 | 5 | CFLAGS := --std-c99 -I. -mstm8 --int-long-reent --xram-size 1024 --out-fmt-elf --debug -D"__ATTRIBUTE_ALIGNED__(x)=" -D"__ATTRIBUTE_UNUSED__=" -D"__ATTRIBUTE_NAKED__=__naked" -D"__ATTRIBUTE_PACKED__=" 6 | 7 | a_files := startup.S picoRTOS_portasm.S 8 | c_files := $(wildcard *.c) 9 | 10 | rel_files := $(a_files:%.S=%.rel) 11 | rel_files += $(c_files:%.c=%.rel) 12 | 13 | all: $(BASENAME).elf 14 | 15 | $(BASENAME).elf: $(rel_files) 16 | $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) 17 | 18 | %.rel: %.S 19 | $(AS) $@ $< 20 | 21 | %.rel: %.c 22 | $(CC) $(CFLAGS) -c $< -o $@ 23 | 24 | clean: 25 | rm -f *.elf *.cdb *.hex *.ihx *.lk *.map *.mem *.omf 26 | rm -f *.adb *.asm *.lst *.rel *.rst *.sym 27 | 28 | help: 29 | sdcc -h 30 | sdas6808 -h 31 | 32 | .PHONY: clean 33 | -------------------------------------------------------------------------------- /staging/demo/stm8s003f3p3/stm8s003f3p3.h: -------------------------------------------------------------------------------- 1 | #ifndef STM8S003F3P3_H 2 | #define STM8S003F3P3_H 3 | 4 | #include "gpio-stm8.h" 5 | 6 | struct stm8s003f3p3 { 7 | struct gpio TICK; 8 | struct gpio TEST; 9 | }; 10 | 11 | int stm8s003f3p3_init(/*@out@*/ struct stm8s003f3p3 *ctx); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /staging/demo/yd-stm32l4431rc/Makefile: -------------------------------------------------------------------------------- 1 | # OpenPicoRTOS basic makefile template 2 | # 'target' is the binary OpenPicoRTOS build system will create 3 | target := yd-stm32l431rc.elf 4 | 5 | # All your sources can be put insinde 'c_src-y' for c and 'a_src-y' for assembly 6 | c_src-y += main.c 7 | c_src-y += yd-stm32l431rc.c 8 | 9 | # This makefile will be included by OpenPicoRTOS during build, it is safer to use 10 | # the 'skip-makefile' keyword to avoid local targets inclusion 11 | ifneq ($(skip-makefile),1) 12 | PWD := $(shell pwd) 13 | # 'PICORTOS_SRC' is the directory containing the OpenPicoRTOS original sources 14 | PICORTOS_SRC := ../../.. 15 | 16 | all: $(target) 17 | @ 18 | 19 | $(target): FORCE 20 | $(Q)$(MAKE) -C $(PICORTOS_SRC) O=$(PWD) 21 | 22 | %: 23 | $(Q)$(MAKE) -C $(PICORTOS_SRC) O=$(PWD) $@ 24 | 25 | PHONY += FORCE 26 | FORCE: 27 | 28 | endif 29 | 30 | .PHONY: $(PHONY) 31 | -------------------------------------------------------------------------------- /staging/demo/yd-stm32l4431rc/yd-stm32l431rc.h: -------------------------------------------------------------------------------- 1 | #ifndef YD_STM32L431RC_H 2 | #define YD_STM32L431RC_H 3 | 4 | #include "gpio-stm32h7xx.h" 5 | 6 | struct yd_stm32l431rc { 7 | struct gpio TICK; 8 | struct gpio LED; 9 | }; 10 | 11 | int yd_stm32l431rc_init(/*@out@*/ struct yd_stm32l431rc *ctx); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /staging/drivers/adc/Kconfig: -------------------------------------------------------------------------------- 1 | menu "ADC drivers" 2 | 3 | config ADC_GD32VF103 4 | depends on RISCV 5 | bool "GD32VF103 series ADC" 6 | 7 | config ADC_NXP_EQADC 8 | depends on POWERPC 9 | bool "NXP eQADC" 10 | 11 | config ADC_MC9S08PTXX 12 | depends on HCS08 13 | bool "NXP MC9S08PTxx series ADC" 14 | 15 | config ADC_N76E003_SAR 16 | depends on 8051 17 | bool "Nuvoton N76E003 series ADC" 18 | 19 | endmenu 20 | -------------------------------------------------------------------------------- /staging/drivers/adc/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Staging ADC drivers 3 | # 4 | staging-drivers-adc := $(srctree)/staging/drivers/adc 5 | 6 | c_src-$(CONFIG_ADC_GD32VF103) += $(staging-drivers-adc)/adc-gd32vf103.c 7 | c_src-$(CONFIG_ADC_NXP_EQADC) += $(staging-drivers-adc)/adc-nxp_eqadc.c 8 | c_src-$(CONFIG_ADC_MC9S08PTXX) += $(staging-drivers-adc)/adc-mc9s08ptxx.c 9 | c_src-$(CONFIG_ADC_N76E003_SAR) += $(staging-drivers-adc)/adc-n76e003_sar.c 10 | -------------------------------------------------------------------------------- /staging/drivers/adc/adc-n76e003_sar.h: -------------------------------------------------------------------------------- 1 | #ifndef ADC_N76E003_SAR_H 2 | #define ADC_N76E003_SAR_H 3 | 4 | #include "adc.h" 5 | 6 | #define ADC_N76E003_SAR_CHANNEL_COUNT 8 7 | 8 | struct adc_n76e003 { 9 | int dummy; 10 | }; 11 | 12 | int adc_n76e003_init(/*@out@*/ struct adc_n76e003 *ctx); 13 | 14 | struct adc { 15 | unsigned char channel; 16 | /* calibration */ 17 | int multiplier; 18 | int divider; 19 | int offset; 20 | }; 21 | 22 | int adc_n76e003_adc_init(/*@out@*/ struct adc *ctx, size_t channel); 23 | 24 | /* 25 | * Implements: 26 | * int adc_setup(struct adc *ctx, const struct adc_settings *settings); 27 | * int adc_read(struct adc *ctx, int *data); 28 | * int adc_read_multiple(struct adc *ctx, int *data, size_t n); 29 | */ 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /staging/drivers/can/Kconfig: -------------------------------------------------------------------------------- 1 | menu "CAN drivers" 2 | 3 | config CAN_GD32VF103 4 | depends on RISCV 5 | bool "GD32VF103 series CAN" 6 | 7 | config CAN_PIC32MX 8 | depends on MIPS 9 | bool "PIC32Mx series CAN" 10 | 11 | config CAN_ATSAME5X 12 | depends on ARM 13 | bool "ATSAME5X series CAN" 14 | 15 | endmenu 16 | -------------------------------------------------------------------------------- /staging/drivers/can/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Staging CAN drivers 3 | # 4 | staging-drivers-can := $(srctree)/staging/drivers/can 5 | 6 | c_src-$(CONFIG_CAN_GD32VF103) += $(staging-drivers-can)/can-gd32vf103.c 7 | c_src-$(CONFIG_CAN_PIC32MX) += $(staging-drivers-can)/can-pic32mx.c 8 | c_src-$(CONFIG_CAN_ATSAME5X) += $(staging-drivers-can)/can-same5x.c 9 | -------------------------------------------------------------------------------- /staging/drivers/can/can-gd32vf103.h: -------------------------------------------------------------------------------- 1 | #ifndef CAN_GD32VF103_H 2 | #define CAN_GD32VF103_H 3 | 4 | #include "can.h" 5 | #include "clock.h" 6 | 7 | struct CAN_GD32VF103; 8 | 9 | struct can { 10 | /*@temp@*/ struct CAN_GD32VF103 *base; 11 | clock_id_t clkid; 12 | /* filters (CAN0) */ 13 | size_t filter_count; 14 | }; 15 | 16 | int can_gd32vf103_init(/*@out@*/ struct can *ctx, int base, clock_id_t clkid); 17 | 18 | /* Implements: 19 | * int can_setup(struct can *ctx, struct can_settings *settings); 20 | * int can_accept(struct can *ctx, can_id_t id, can_id_t accept_mask); 21 | * int can_write(struct can *ctx, can_id_t id, const void *buf, size_t n); 22 | * int can_read(struct can *ctx, can_id_t *id, void *buf, size_t n); 23 | * int can_request_frame(struct can *ctx, can_id_t id); 24 | */ 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /staging/drivers/clock/.notempty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jnaulet/OpenPicoRTOS/7fd2abece76bc8ed145d767b42772c465ff14afe/staging/drivers/clock/.notempty -------------------------------------------------------------------------------- /staging/drivers/clock/Kconfig: -------------------------------------------------------------------------------- 1 | menu "Clock drivers" 2 | 3 | config CLOCK_LGT8FX8P 4 | depends on AVR 5 | bool "LogicGreen LGT8FX8P clock" 6 | 7 | config CLOCK_STM32F10XXX 8 | depends on ARM 9 | bool "STMicro STM32F10xxx series clock" 10 | 11 | config CLOCK_STM32F401X 12 | depends on ARM 13 | bool "STMicro STM32F401x series clock" 14 | 15 | config CLOCK_STM32L4X 16 | depends on ARM 17 | bool "STMicro STM32L4x series clock" 18 | 19 | config CLOCK_STC12C5AXX 20 | depends on 8051 21 | bool "STC MCU STC12C5Axx series clock" 22 | 23 | config CLOCK_CH32V003 24 | depends on RISCV 25 | bool "WCH CH32V003 series clock" 26 | 27 | config CLOCK_MC9S08PTXX 28 | depends on HCS08 29 | bool "NXP MC9S08PTxx series clock" 30 | 31 | config CLOCK_STM8 32 | depends on STM8 33 | bool "STMicro STM8 series clock" 34 | 35 | endmenu 36 | -------------------------------------------------------------------------------- /staging/drivers/clock/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Staging clock drivers 3 | # 4 | staging-drivers-clock := $(srctree)/staging/drivers/clock 5 | 6 | c_src-$(CONFIG_CLOCK_LGT8FX8P) += $(staging-drivers-clock)/clock-lgt8fx8p.c 7 | c_src-$(CONFIG_CLOCK_STM32F10XXX) += $(staging-drivers-clock)/clock-stm32f10xxx.c 8 | c_src-$(CONFIG_CLOCK_STM32F401X) += $(staging-drivers-clock)/clock-stm32f401x.c 9 | c_src-$(CONFIG_CLOCK_STM32L4X) += $(staging-drivers-clock)/clock-stm32l4x.c 10 | c_src-$(CONFIG_CLOCK_STC12C5AXX) += $(staging-drivers-clock)/clock-stc12c5axx.c 11 | c_src-$(CONFIG_CLOCK_CH32V003) += $(staging-drivers-clock)/clock-ch32v003.c 12 | c_src-$(CONFIG_CLOCK_MC9S08PTXX) += $(staging-drivers-clock)/clock-mc9s08ptxx.c 13 | c_src-$(CONFIG_CLOCK_STM8) += $(staging-drivers-clock)/clock-stm8.c 14 | -------------------------------------------------------------------------------- /staging/drivers/clock/clock-stc12c5axx.h: -------------------------------------------------------------------------------- 1 | #ifndef CLOCK_STC12CA5XX_H 2 | #define CLOCK_STC12CA5XX_H 3 | 4 | #include "clock.h" 5 | 6 | #define CLOCK_STC12C5AXX_FSYS CLOCK_SYSCLK 7 | #define CLOCK_STC12C5AXX_T1 (clock_id_t)1 8 | #define CLOCK_STC12C5AXX_BRT (clock_id_t)2 9 | 10 | typedef enum { 11 | CLOCK_STC12C5AXX_X1 = 0, 12 | CLOCK_STC12C5AXX_X12 = 1, 13 | CLOCK_STC12C5AXX_XCOUNT 14 | } clock_stc12c5axx_x_t; 15 | 16 | struct clock_settings { 17 | clock_stc12c5axx_x_t t1; 18 | clock_stc12c5axx_x_t brt; 19 | }; 20 | 21 | int clock_stc12c5axx_init(const struct clock_settings *settings); 22 | 23 | /* Implements: 24 | * 25 | * clock_freq_t clock_get_freq(clock_id_t clkid); 26 | */ 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /staging/drivers/dma/Kconfig: -------------------------------------------------------------------------------- 1 | menu "DMA drivers" 2 | 3 | endmenu 4 | -------------------------------------------------------------------------------- /staging/drivers/dma/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Staging dma drivers 3 | # 4 | staging-drivers-dma := $(srctree)/staging/drivers/dma 5 | -------------------------------------------------------------------------------- /staging/drivers/dma/dma-stm32h7xx_bdma.h: -------------------------------------------------------------------------------- 1 | #ifndef DMA_STM32H7XX_BDMA_H 2 | #define DMA_STM32H7XX_BDMA_H 3 | 4 | #include "dma.h" 5 | 6 | #define DMA_STM32H7XX_BDMA_CHANNEL_COUNT 8 7 | 8 | struct DMA_STM32H7XX_BDMA; 9 | 10 | struct dma { 11 | /*@temp@*/ struct DMA_STM32H7XX_BDMA *base; 12 | size_t channel; 13 | }; 14 | 15 | int dma_stm32h7xx_bdma_init(/*@out@*/ struct dma *ctx, int base, size_t channel); 16 | 17 | /* Runtime calls: 18 | * int dma_setup(struct dma *ctx, struct dma_xfer *xfer); 19 | * int dma_xfer(struct dma *ctx, struct dma_xfer *xfer); 20 | * int dma_xfer_done(struct dma *ctx); 21 | */ 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /staging/drivers/dmasg/Kconfig: -------------------------------------------------------------------------------- 1 | menu "DMA-SG drivers" 2 | 3 | config DMASG_NXP_EDMA 4 | depends on POWERPC 5 | bool "NXP eDMA DMA-SG" 6 | 7 | endmenu 8 | -------------------------------------------------------------------------------- /staging/drivers/dmasg/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Staging dmasg drivers 3 | # 4 | staging-drivers-dmasg := $(srctree)/staging/drivers/dmasg 5 | 6 | c_src-$(CONFIG_DMASG_NXP_EDMA) += $(staging-drivers-dmasg)/dmasg-nxp_edma.c 7 | -------------------------------------------------------------------------------- /staging/drivers/dmasg/dmasg-nxp_edma.h: -------------------------------------------------------------------------------- 1 | #ifndef DMASG_NXP_EDMA_H 2 | #define DMASG_NXP_EDMA_H 3 | 4 | #include "dmasg.h" 5 | 6 | #define DMASG_NXP_EDMA_CHANNEL_COUNT 64 7 | 8 | struct DMASG_NXP_EDMA; 9 | 10 | struct dmasg_nxp_edma { 11 | /*@temp@*/ struct DMASG_NXP_EDMA *base; 12 | }; 13 | 14 | int dmasg_nxp_edma_init(struct dmasg_nxp_edma *ctx, int base); 15 | 16 | struct dmasg { 17 | /*@temp@*/ struct dmasg_nxp_edma *parent; 18 | size_t channel; 19 | }; 20 | 21 | int dmasg_nxp_edma_dmasg_init(struct dmasg *ctx, struct dmasg_nxp_edma *parent, size_t channel); 22 | int dmasg_nxp_edma_dmasg_setup(struct dmasg *ctx, const struct dmasg_xfer *xfer); 23 | 24 | /* Runtime calls: 25 | * int dmasg_xfer(struct dmasg *ctx, struct dmasg_xfer *xfer); 26 | * int dmasg_xfer_done(struct dmasg *ctx); 27 | */ 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /staging/drivers/flash/Kconfig: -------------------------------------------------------------------------------- 1 | menu "FLash drivers" 2 | 3 | config FLASH_NXP_C55FMC 4 | depends on POWERPC 5 | bool "NXP C55FMC Flash" 6 | 7 | config FLASH_ATSAM3X 8 | depends on ARM 9 | bool "Atmel SAM3x Flash" 10 | 11 | endmenu 12 | -------------------------------------------------------------------------------- /staging/drivers/flash/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Staging flash drivers 3 | # 4 | staging-drivers-flash := $(srctree)/staging/drivers/flash 5 | 6 | c_src-$(CONFIG_FLASH_NXP_C55FMC) += $(staging-drivers-flash)/flash-nxp_c55fmc.c 7 | c_src-$(CONFIG_FLASH_ATSAM3X) += $(staging-drivers-flash)/flash-sam3x.c 8 | -------------------------------------------------------------------------------- /staging/drivers/flash/flash-nxp_c55fmc.h: -------------------------------------------------------------------------------- 1 | #ifndef FLASH_NXP_C55FMC_H 2 | #define FLASH_NXP_C55FMC_H 3 | 4 | #include "flash.h" 5 | 6 | typedef enum { 7 | FLASH_NXP_C55FMC_STATE_IDLE, 8 | FLASH_NXP_C55FMC_STATE_BUSY, 9 | FLASH_NXP_C55FMC_STATE_COUNT 10 | } flash_nxp_c55fmc_state; 11 | 12 | struct FLASH_NXP_C55FMC; 13 | 14 | struct flash { 15 | /*@temp@*/ struct FLASH_NXP_C55FMC *base; 16 | flash_nxp_c55fmc_state state; 17 | int last; 18 | }; 19 | 20 | int flash_nxp_c55fmc_init(/*@out@*/ struct flash *ctx, int base); 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /staging/drivers/gpio/.notempty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jnaulet/OpenPicoRTOS/7fd2abece76bc8ed145d767b42772c465ff14afe/staging/drivers/gpio/.notempty -------------------------------------------------------------------------------- /staging/drivers/gpio/Kconfig: -------------------------------------------------------------------------------- 1 | menu "GPIO drivers" 2 | 3 | config GPIO_8051 4 | depends on 8051 5 | bool "8051-compatible GPIOs" 6 | 7 | config GPIO_N76E003 8 | depends on 8051 9 | bool "Nuvoton N76E003 series GPIOs" 10 | 11 | config GPIO_STM32F10XXX 12 | depends on ARM 13 | bool "STMicro STM32F10XXX series GPIOs" 14 | 15 | config GPIO_WCH_CH32X 16 | depends on RISCV 17 | bool "WCH CH32x series GPIOs" 18 | 19 | config GPIO_MC9S08PTXX 20 | depends on HCS08 21 | bool "NXP MC9S08PTxx series GPIOs" 22 | 23 | config GPIO_STM8 24 | depends on STM8 25 | bool "STMicro STM8 series GPIOs" 26 | 27 | endmenu 28 | -------------------------------------------------------------------------------- /staging/drivers/gpio/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Staging gpio drivers 3 | # 4 | staging-drivers-gpio := $(srctree)/staging/drivers/gpio 5 | 6 | c_src-$(CONFIG_GPIO_8051) += $(staging-drivers-gpio)/gpio-8051.c 7 | c_src-$(CONFIG_GPIO_N76E003) += $(staging-drivers-gpio)/gpio-n76e003.c 8 | c_src-$(CONFIG_GPIO_STM32F10XXX) += $(staging-drivers-gpio)/gpio-stm32f10xxx.c 9 | c_src-$(CONFIG_GPIO_WCH_CH32X) += $(staging-drivers-gpio)/gpio-wch_ch32x.c 10 | c_src-$(CONFIG_GPIO_MC9S08PTXX) += $(staging-drivers-gpio)/gpio-mc9s08ptxx.c 11 | c_src-$(CONFIG_GPIO_STM8) += $(staging-drivers-gpio)/gpio-stm8.c 12 | -------------------------------------------------------------------------------- /staging/drivers/gpio/gpio-8051.h: -------------------------------------------------------------------------------- 1 | #ifndef GPIO_8051_H 2 | #define GPIO_8051_H 3 | 4 | #include "gpio.h" 5 | 6 | #include 7 | #include 8 | 9 | struct gpio { 10 | size_t port; 11 | uint8_t mask; 12 | bool invert; 13 | }; 14 | 15 | #define GPIO_8051_PIN_COUNT 8 16 | 17 | int gpio_8051_init(/*@out@*/ struct gpio *ctx, size_t port, size_t pin); 18 | 19 | /* Runtime calls: 20 | * int gpio_setup(struct gpio *ctx, struct gpio_settings *settings); 21 | * void gpio_write(struct gpio *ctx, bool value); 22 | * bool gpio_read(struct gpio *ctx); 23 | * void gpio_toggle(struct gpio *ctx); 24 | */ 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /staging/drivers/gpio/gpio-n76e003.h: -------------------------------------------------------------------------------- 1 | #ifndef GPIO_N76E003_H 2 | #define GPIO_N76E003_H 3 | 4 | #include "gpio.h" 5 | 6 | #include 7 | #include 8 | 9 | struct gpio { 10 | size_t port; 11 | uint8_t mask; 12 | bool invert; 13 | }; 14 | 15 | #define GPIO_N76E003_PORT_COUNT 4 16 | #define GPIO_N76E003_PIN_COUNT 8 17 | 18 | int gpio_n76e003_init(/*@out@*/ struct gpio *ctx, size_t port, size_t pin); 19 | 20 | /* Runtime calls: 21 | * int gpio_setup(struct gpio *ctx, struct gpio_settings *settings); 22 | * void gpio_write(struct gpio *ctx, bool value); 23 | * bool gpio_read(struct gpio *ctx); 24 | * void gpio_toggle(struct gpio *ctx); 25 | */ 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /staging/drivers/gpio/gpio-stm32f10xxx.h: -------------------------------------------------------------------------------- 1 | #ifndef GPIO_STM32F10XXX_H 2 | #define GPIO_STM32F10XXX_H 3 | 4 | #include "gpio.h" 5 | #include 6 | #include 7 | 8 | #define GPIO_STM32F10XXX_PIN_COUNT 16 9 | 10 | struct GPIO_STM32F10XXX; 11 | 12 | struct gpio { 13 | /*@temp@*/ struct GPIO_STM32F10XXX *base; 14 | uint32_t mask; 15 | bool invert; 16 | }; 17 | 18 | int gpio_stm32f10xxx_init(/*@out@*/ struct gpio *ctx, int base, size_t pin); 19 | 20 | /* Runtime calls: 21 | * int gpio_setup(struct gpio *ctx, struct gpio_settings *settings); 22 | * void gpio_write(struct gpio *ctx, bool value); 23 | * bool gpio_read(struct gpio *ctx); 24 | * void gpio_toggle(struct gpio *ctx); 25 | */ 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /staging/drivers/gpio/gpio-stm8.h: -------------------------------------------------------------------------------- 1 | #ifndef GPIO_STM8_H 2 | #define GPIO_STM8_H 3 | 4 | #include "gpio.h" 5 | #include 6 | #include 7 | #include 8 | 9 | #define GPIO_STM8_PIN_COUNT 8 10 | 11 | struct GPIO_STM8; 12 | 13 | struct gpio { 14 | /*@temp@*/ struct GPIO_STM8 *base; 15 | uint8_t mask; 16 | bool invert; 17 | }; 18 | 19 | int gpio_stm8_init(/*@out@*/ struct gpio *ctx, int base, size_t pin); 20 | 21 | /* Runtime calls: 22 | * int gpio_setup(struct gpio *ctx, struct gpio_settings *settings); 23 | * void gpio_write(struct gpio *ctx, bool value); 24 | * bool gpio_read(struct gpio *ctx); 25 | * void gpio_toggle(struct gpio *ctx); 26 | */ 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /staging/drivers/gpio/gpio-wch_ch32x.h: -------------------------------------------------------------------------------- 1 | #ifndef GPIO_WCH_CH32X_H 2 | #define GPIO_WCH_CH32X_H 3 | 4 | #include "gpio.h" 5 | #include 6 | #include 7 | 8 | #define GPIO_WCH_CH32X_PIN_COUNT 16 9 | 10 | struct GPIO_WCH_CH32X; 11 | 12 | struct gpio { 13 | /*@temp@*/ struct GPIO_WCH_CH32X *base; 14 | uint32_t mask; 15 | bool invert; 16 | }; 17 | 18 | int gpio_wch_ch32x_init(/*@out@*/ struct gpio *ctx, int base, size_t pin); 19 | 20 | /* Runtime calls: 21 | * int gpio_setup(struct gpio *ctx, struct gpio_settings *settings); 22 | * void gpio_write(struct gpio *ctx, bool value); 23 | * bool gpio_read(struct gpio *ctx); 24 | * void gpio_toggle(struct gpio *ctx); 25 | */ 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /staging/drivers/lin/Kconfig: -------------------------------------------------------------------------------- 1 | menu "LIN drivers" 2 | 3 | config LIN_NXP_LINFLEXD 4 | depends on POWERPC 5 | bool "NXP LinFlexD LIN" 6 | 7 | endmenu 8 | -------------------------------------------------------------------------------- /staging/drivers/lin/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Staging lin drivers 3 | # 4 | staging-drivers-lin := $(srctree)/staging/drivers/lin 5 | 6 | c_src-$(CONFIG_LIN_NXP_LINFLEXD) += $(staging-drivers-lin)/lin-nxp_linflexd.c 7 | -------------------------------------------------------------------------------- /staging/drivers/lin/lin-nxp_linflexd.h: -------------------------------------------------------------------------------- 1 | #ifndef LIN_NXP_LINFLEXD_H 2 | #define LIN_NXP_LINFLEXD_H 3 | 4 | #include "lin.h" 5 | #include "clock.h" 6 | 7 | typedef enum { 8 | LIN_NXP_LINFLEXD_STATE_IDLE, 9 | LIN_NXP_LINFLEXD_STATE_XFER, 10 | LIN_NXP_LINFLEXD_STATE_COUNT 11 | } lin_nxp_linflexd_state; 12 | 13 | struct LIN_NXP_LINFLEXD; 14 | 15 | struct lin { 16 | /*@temp@*/ struct LIN_NXP_LINFLEXD *base; 17 | clock_id_t clkid; 18 | lin_mode_t mode; 19 | lin_nxp_linflexd_state state; 20 | }; 21 | 22 | int lin_nxp_linflexd_init(/*@out@*/ struct lin *ctx, int base, clock_id_t clkid); 23 | 24 | /* Implements: 25 | * int lin_setup(struct lin *ctx, struct lin_settings *settings); 26 | * int lin_write(struct lin *ctx, uint8_t id, const void *buf, size_t n): 27 | * int lin_read(struct lin *ctx, uint8_t *id, void *buf, size_t n); 28 | */ 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /staging/drivers/misc/Kconfig: -------------------------------------------------------------------------------- 1 | menu "Misc. drivers" 2 | 3 | config MISC_NXP_IGF 4 | depends on POWERPC 5 | bool "NXP IGF filter" 6 | 7 | endmenu 8 | -------------------------------------------------------------------------------- /staging/drivers/misc/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Staging misc drivers 3 | # 4 | staging-drivers-misc := $(srctree)/staging/drivers/misc 5 | 6 | c_src-$(CONFIG_MISC_NXP_IGF) += $(staging-drivers-misc)/misc-nxp_igf.c 7 | -------------------------------------------------------------------------------- /staging/drivers/misc/misc-nxp_igf.h: -------------------------------------------------------------------------------- 1 | #ifndef MISC_NXP_IGF_H 2 | #define MISC_NXP_IGF_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #define NXP_IGF_CHANNEL_COUNT 46 9 | 10 | struct NXP_IGF; 11 | 12 | struct nxp_igf { 13 | /*@temp@*/ struct NXP_IGF *base; 14 | size_t channel; 15 | }; 16 | 17 | struct nxp_igf_settings { 18 | bool invert; 19 | }; 20 | 21 | int nxp_igf_init(struct nxp_igf *ctx, int base, size_t channel); 22 | int nxp_igf_setup(struct nxp_igf *ctx, const struct nxp_igf_settings *settings); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /staging/drivers/mux/Kconfig: -------------------------------------------------------------------------------- 1 | menu "MUX drivers" 2 | 3 | config MUX_8051 4 | depends on 8051 5 | bool "8051-compatible MUX" 6 | 7 | config MUX_N76E003 8 | depends on 8051 9 | bool "Nuvoton N76E003 series MUX" 10 | 11 | config MUX_STM32F10XXX 12 | depends on ARM 13 | bool "STMicro STM32F10XXX series MUX" 14 | 15 | config MUX_WCH_CH32X 16 | depends on RISCV 17 | bool "WCH CH32x series MUX" 18 | 19 | config MUX_MC9S08PTXX 20 | depends on HCS08 21 | bool "NXP MC9S08PTxx series MUX" 22 | 23 | config MUX_STM8 24 | depends on STM8 25 | bool "STMicro STM8 series MUX" 26 | 27 | endmenu 28 | -------------------------------------------------------------------------------- /staging/drivers/mux/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Staging mux drivers 3 | # 4 | staging-drivers-mux := $(srctree)/staging/drivers/mux 5 | 6 | c_src-$(CONFIG_MUX_8051) += $(staging-drivers-mux)/mux-8051.c 7 | c_src-$(CONFIG_MUX_N76E003) += $(staging-drivers-mux)/mux-n76e003.c 8 | c_src-$(CONFIG_MUX_STM32F10XXX) += $(staging-drivers-mux)/mux-stm32f10xxx.c 9 | c_src-$(CONFIG_MUX_WCH_CH32X) += $(staging-drivers-mux)/mux-wch_ch32x.c 10 | c_src-$(CONFIG_MUX_MC9S08PTXX) += $(staging-drivers-mux)/mux-mc9s08ptxx.c 11 | c_src-$(CONFIG_MUX_STM8) += $(staging-drivers-mux)/mux-stm8.c 12 | -------------------------------------------------------------------------------- /staging/drivers/mux/mux-8051.h: -------------------------------------------------------------------------------- 1 | #ifndef MUX_8051_H 2 | #define MUX_8051_H 3 | 4 | #include "mux.h" 5 | #include 6 | #include 7 | 8 | #define MUX_8051_PIN_COUNT 8 9 | 10 | typedef enum { 11 | MUX_8051_MODE_QUASIBDIR = 0, 12 | MUX_8051_MODE_PUSHPULL = 1, 13 | MUX_8051_MODE_INPUTONLY = 2, 14 | MUX_8051_MODE_OPENDRAIN = 3, 15 | MUX_8051_MODE_COUNT 16 | } mux_8051_mode_t; 17 | 18 | struct mux { 19 | size_t port; 20 | }; 21 | 22 | int mux_8051_init(/*@out@*/ struct mux *ctx, size_t port); 23 | int mux_8051_mode(struct mux *ctx, size_t pin, mux_8051_mode_t mode); 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /staging/drivers/mux/mux-n76e003.h: -------------------------------------------------------------------------------- 1 | #ifndef MUX_N76E003_H 2 | #define MUX_N76E003_H 3 | 4 | #include "mux.h" 5 | #include 6 | #include 7 | 8 | #define MUX_N76E003_PORT_COUNT 4 9 | #define MUX_N76E003_PIN_COUNT 8 10 | 11 | typedef enum { 12 | MUX_N76E003_MODE_QUASIBDIR = 0, 13 | MUX_N76E003_MODE_PUSHPULL = 1, 14 | MUX_N76E003_MODE_INPUTONLY = 2, 15 | MUX_N76E003_MODE_OPENDRAIN = 3, 16 | MUX_N76E003_MODE_COUNT 17 | } mux_n76e003_mode_t; 18 | 19 | struct mux { 20 | size_t port; 21 | }; 22 | 23 | int mux_n76e003_init(/*@out@*/ struct mux *ctx, size_t port); 24 | int mux_n76e003_mode(struct mux *ctx, size_t pin, mux_n76e003_mode_t mode); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /staging/drivers/mux/mux-stm8.h: -------------------------------------------------------------------------------- 1 | #ifndef MUX_STM8_H 2 | #define MUX_STM8_H 3 | 4 | #include "mux.h" 5 | #include 6 | 7 | #define MUX_STM8_PIN_COUNT 8 8 | 9 | struct MUX_STM8; 10 | 11 | struct mux { 12 | /*@temp@*/ struct MUX_STM8 *base; 13 | }; 14 | 15 | typedef enum { 16 | MUX_STM8_INPUT_FLOATING, 17 | MUX_STM8_INPUT_PULL_UP, 18 | MUX_STM8_INPUT_COUNT 19 | } mux_stm8_input_t; 20 | 21 | typedef enum { 22 | MUX_STM8_OUTPUT_OPEN_DRAIN, 23 | MUX_STM8_OUTPUT_PUSH_PULL, 24 | MUX_STM8_OUTPUT_COUNT 25 | } mux_stm8_output_t; 26 | 27 | int mux_stm8_init(/*@out@*/ struct mux *ctx, int base); 28 | 29 | int mux_stm8_output(struct mux *ctx, size_t pin, mux_stm8_output_t type); 30 | int mux_stm8_input(struct mux *ctx, size_t pin, mux_stm8_input_t type); 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /staging/drivers/pwm/.notempty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jnaulet/OpenPicoRTOS/7fd2abece76bc8ed145d767b42772c465ff14afe/staging/drivers/pwm/.notempty -------------------------------------------------------------------------------- /staging/drivers/pwm/Kconfig: -------------------------------------------------------------------------------- 1 | menu "PWM drivers" 2 | 3 | config PWM_MC9S08PTXX_FTM 4 | depends on HCS08 5 | bool "NXP MC9S08PTxx FTM series PWMs" 6 | 7 | config PWM_N76E003 8 | depends on 8051 9 | bool "Nuvoton N76E003 series PWMs" 10 | 11 | endmenu 12 | -------------------------------------------------------------------------------- /staging/drivers/pwm/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Staging pwm drivers 3 | # 4 | staging-drivers-pwm := $(srctree)/staging/drivers/pwm 5 | 6 | c_src-$(CONFIG_PWM_MC9S08PTXX_FTM) += $(staging-drivers-pwm)/pwm-mc9s08ptxx_ftm.c 7 | c_src-$(CONFIG_PWM_N76E003) += $(staging-drivers-pwm)/pwm-n76e003.c 8 | -------------------------------------------------------------------------------- /staging/drivers/rng/Kconfig: -------------------------------------------------------------------------------- 1 | menu "RNG drivers" 2 | 3 | endmenu 4 | -------------------------------------------------------------------------------- /staging/drivers/rng/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Staging rng drivers 3 | # 4 | staging-drivers-rng := $(srctree)/staging/drivers/rng 5 | 6 | # c_src-$(CONFIG_RNG_XORSHIFT32) += $(staging-drivers-rng)/rng-xorshift32.c 7 | -------------------------------------------------------------------------------- /staging/drivers/spi/.notempty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jnaulet/OpenPicoRTOS/7fd2abece76bc8ed145d767b42772c465ff14afe/staging/drivers/spi/.notempty -------------------------------------------------------------------------------- /staging/drivers/spi/Kconfig: -------------------------------------------------------------------------------- 1 | menu "SPI drivers" 2 | 3 | config SPI_MC9S08PTXX 4 | depends on HCS08 5 | bool "NXP MC9S08PTxx Series SPI" 6 | 7 | config SPI_N76E003 8 | depends on 8051 9 | bool "Nuvoton N76E003 Series SPI" 10 | 11 | endmenu 12 | -------------------------------------------------------------------------------- /staging/drivers/spi/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Staging spi drivers 3 | # 4 | staging-drivers-spi := $(srctree)/staging/drivers/spi 5 | 6 | c_src-$(CONFIG_SPI_MC9S08PTXX) += $(staging-drivers-spi)/spi-mc9s08ptxx.c 7 | c_src-$(CONFIG_SPI_N76E003) += $(staging-drivers-spi)/spi-n76e003.c 8 | -------------------------------------------------------------------------------- /staging/drivers/spi/spi-mc9s08ptxx.h: -------------------------------------------------------------------------------- 1 | #ifndef SPI_MC9S08PTXX_H 2 | #define SPI_MC9S08PTXX_H 3 | 4 | #include "spi.h" 5 | #include "clock.h" 6 | 7 | #include 8 | 9 | struct SPI_MC9S08PTXX; 10 | 11 | #define SPI_MC9S08PTXX_FRAME_SIZE_MIN 8 12 | #define SPI_MC9S08PTXX_FRAME_SIZE_MAX 16 /* only SPI1 */ 13 | 14 | struct spi { 15 | /*@temp@*/ struct SPI_MC9S08PTXX *base; 16 | clock_id_t clkid; 17 | size_t frame_width; 18 | }; 19 | 20 | int spi_mc9s08ptxx_init(/*@out@*/ struct spi *ctx, int base, clock_id_t clkid); 21 | 22 | /* Runtime calls: 23 | * int spi_setup(struct spi *ctx, const struct spi_settings *settings); 24 | * int spi_xfer(struct spi *ctx, void *rx, const void *tx, size_t n); 25 | */ 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /staging/drivers/spi/spi-n76e003.h: -------------------------------------------------------------------------------- 1 | #ifndef SPI_N76E003_H 2 | #define SPI_N76E003_H 3 | 4 | #include "spi.h" 5 | #include "clock.h" 6 | 7 | struct spi { 8 | clock_id_t clkid; 9 | }; 10 | 11 | int spi_n76e003_init(/*@out@*/ struct spi *ctx, clock_id_t clkid); 12 | 13 | /* Implements: 14 | * int spi_setup(struct spi *ctx, const struct spi_settings *settings); 15 | * int spi_xfer(struct spi *ctx, void *rx, const void *tx, size_t n); 16 | */ 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /staging/drivers/twi/Kconfig: -------------------------------------------------------------------------------- 1 | menu "TWI drivers" 2 | 3 | config TWI_GD32VF103 4 | depends on RISCV 5 | bool "GD32VF103 series TWI" 6 | 7 | config TWI_NXP_I2C 8 | depends on POWERPC 9 | bool "NXP I2C" 10 | 11 | config TWI_STM32H7XX 12 | depends on ARM 13 | bool "STM32H7xx series TWI" 14 | 15 | config TWI_RENESAS_RA4 16 | depends on ARM 17 | bool "Renesas RA4 series TWI" 18 | 19 | config TWI_MC9S08PTXX 20 | depends on HCS08 21 | bool "NXP MC9S08PTxx series TWI/I2C" 22 | 23 | config TWI_N76E003 24 | depends on 8051 25 | bool "Nuvoton N76E003 series TWI/I2C" 26 | 27 | endmenu 28 | -------------------------------------------------------------------------------- /staging/drivers/twi/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Staging TWI drivers 3 | # 4 | staging-drivers-twi := $(srctree)/staging/drivers/twi 5 | 6 | c_src-$(CONFIG_TWI_GD32VF103) += $(staging-drivers-twi)/twi-gd32vf103.c 7 | c_src-$(CONFIG_TWI_NXP_I2C) += $(staging-drivers-twi)/twi-nxp_i2c.c 8 | c_src-$(CONFIG_TWI_STM32H7XX) += $(staging-drivers-twi)/twi-stm32h7xx.c 9 | c_src-$(CONFIG_TWI_RENESAS_RA4) += $(staging-drivers-twi)/twi-renesas_ra4.c 10 | c_src-$(CONFIG_TWI_MC9S08PTXX) += $(staging-drivers-twi)/twi-mc9s08ptxx.c 11 | c_src-$(CONFIG_TWI_N76E003) += $(staging-drivers-twi)/twi-n76e003.c 12 | -------------------------------------------------------------------------------- /staging/drivers/twi/twi-n76e003.h: -------------------------------------------------------------------------------- 1 | #ifndef TWI_N76E003_H 2 | #define TWI_N76E003_H 3 | 4 | #include "twi.h" 5 | #include "clock.h" 6 | 7 | #include 8 | #include 9 | 10 | typedef enum { 11 | TWI_N76E003_STATE_IDLE, 12 | TWI_N76E003_STATE_START, 13 | TWI_N76E003_STATE_DATA, 14 | TWI_N76E003_STATE_STOP, 15 | TWI_N76E003_STATE_COUNT 16 | } twi_n76e003_state_t; 17 | 18 | struct twi { 19 | clock_id_t clkid; 20 | bool pending; 21 | twi_n76e003_state_t state; 22 | unsigned char addr; 23 | }; 24 | 25 | int twi_n76e003_init(/*@out@*/ struct twi *ctx, clock_id_t clkid, bool i2cpx); 26 | 27 | /* 28 | * Implements 29 | * int twi_setup(struct twi *ctx, const struct twi_settings *settings); 30 | * int twi_write(struct twi *ctx, const void *buf, size_t n, int flags); 31 | * int twi_read(struct twi *ctx, void *buf, size_t n, int flags); 32 | */ 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /staging/drivers/twi/twi-nxp_i2c.h: -------------------------------------------------------------------------------- 1 | #ifndef TWI_NXP_I2C_H 2 | #define TWI_NXP_I2C_H 3 | 4 | /* TWI driver for NXP I2C */ 5 | 6 | #include "twi.h" 7 | #include "clock.h" 8 | 9 | struct TWI_NXP_I2C; 10 | 11 | typedef enum { 12 | TWI_NXP_I2C_STATE_IDLE, 13 | TWI_NXP_I2C_STATE_DATA, 14 | TWI_NXP_I2C_STATE_STOP, 15 | TWI_NXP_I2C_STATE_COUNT 16 | } twi_nxp_i2c_state_t; 17 | 18 | struct twi { 19 | /*@temp@*/ struct TWI_NXP_I2C *base; 20 | clock_id_t clkid; 21 | twi_nxp_i2c_state_t state; 22 | twi_mode_t mode; 23 | twi_addr_t slave_addr; 24 | int last; 25 | }; 26 | 27 | int twi_nxp_i2c_init(/*@out@*/ struct twi *ctx, int base, clock_id_t clkid); 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /staging/drivers/twi/twi-stm32h7xx.h: -------------------------------------------------------------------------------- 1 | #ifndef TWI_STM32H7XX_H 2 | #define TWI_STM32H7XX_H 3 | 4 | #include "twi.h" 5 | #include "clock.h" 6 | 7 | struct TWI_STM32H7XX; 8 | 9 | struct twi { 10 | /*@temp@*/ struct TWI_STM32H7XX *base; 11 | clock_id_t clkid; 12 | }; 13 | 14 | int twi_stm32h7xx_init(/*@out@*/ struct twi *ctx, int base, clock_id_t clkid); 15 | 16 | /* Implements: 17 | * int twi_setup(struct twi *ctx, struct twi_settings *settings); 18 | * int twi_poll(struct twi *ctx); 19 | * int twi_write(struct twi *ctx, const void *buf, size_t n); 20 | * int twi_read(struct twi *ctx, void *buf, size_t n); 21 | */ 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /staging/drivers/uart/.notempty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jnaulet/OpenPicoRTOS/7fd2abece76bc8ed145d767b42772c465ff14afe/staging/drivers/uart/.notempty -------------------------------------------------------------------------------- /staging/drivers/uart/Kconfig: -------------------------------------------------------------------------------- 1 | menu "UART drivers" 2 | 3 | config UART_N76E003 4 | depends on 8051 5 | bool "Nuvoton N76E003 series UART" 6 | 7 | config UART_N76E003_IRQDRIVEN 8 | depends on UART_N76E003 9 | bool "Support for IRQ-driven options" 10 | 11 | config UART_8051 12 | depends on 8051 13 | bool "8051-compatible UART" 14 | 15 | config UART_8051_IRQDRIVEN 16 | depends on UART_8051 17 | bool "Support for IRQ-driven options" 18 | 19 | config UART_MC9S08PTXX 20 | depends on HCS08 21 | bool "NXP MC9S08PTxx series SCI UART" 22 | 23 | endmenu 24 | -------------------------------------------------------------------------------- /staging/drivers/uart/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Staging uart drivers 3 | # 4 | staging-drivers-uart := $(srctree)/staging/drivers/uart 5 | 6 | c_src-$(CONFIG_UART_N76E003) += $(staging-drivers-uart)/uart-n76e003$(CONFIG_UART_8051_IRQDRIVEN:y=_irqdriven).c 7 | c_src-$(CONFIG_UART_8051) += $(staging-drivers-uart)/uart-8051$(CONFIG_UART_8051_IRQDRIVEN:y=_irqdriven).c 8 | c_src-$(CONFIG_UART_MC9S08PTXX) += $(staging-drivers-uart)/uart-mc9s08ptxx_sci.c 9 | -------------------------------------------------------------------------------- /staging/drivers/uart/uart-8051.h: -------------------------------------------------------------------------------- 1 | #ifndef UART_8051_H 2 | #define UART_8051_H 3 | 4 | #include "uart.h" 5 | #include "clock.h" 6 | 7 | #include 8 | #include 9 | 10 | #include "picoRTOS_types.h" 11 | 12 | struct uart { 13 | uart_8051_mode_t mode; 14 | clock_id_t clkid; 15 | bool tx_trig; 16 | }; 17 | 18 | int uart_8051_init(/*@out@*/ struct uart *ctx, clock_id_t clkid); 19 | /* Runtime calls: 20 | * int uart_setup(struct uart *ctx, const struct uart_settings *settings); 21 | * int uart_write(struct uart *ctx, const char *buf, size_t n); 22 | * int uart_read(struct uart *ctx, char *buf, size_t n); 23 | */ 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /staging/drivers/uart/uart-mc9s08ptxx_sci.h: -------------------------------------------------------------------------------- 1 | #ifndef UART_MC9S08PTXX_SCI_H 2 | #define UART_MC9S08PTXX_SCI_H 3 | 4 | #include "uart.h" 5 | #include "clock.h" 6 | 7 | struct UART_MC9S08PTXX_SCI; 8 | 9 | struct uart { 10 | /*@temp@*/ struct UART_MC9S08PTXX_SCI *base; 11 | clock_id_t clkid; 12 | }; 13 | 14 | int uart_mc9s08ptxx_sci_init(/*@out@*/ struct uart *ctx, int base, clock_id_t clkid); 15 | 16 | /* Runtime calls: 17 | * int uart_setup(struct uart *ctx, const struct uart_settings *settings); 18 | * int uart_write(struct uart *ctx, const char *buf, size_t n); 19 | * int uart_read(struct uart *ctx, char *buf, size_t n); 20 | */ 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /staging/drivers/uart/uart-n76e003.h: -------------------------------------------------------------------------------- 1 | #ifndef UART_N76E003_H 2 | #define UART_N76E003_H 3 | 4 | #include "uart.h" 5 | #include "clock.h" 6 | 7 | #include 8 | #include 9 | 10 | typedef enum { 11 | UART_N76E003_UART0_T1, 12 | UART_N76E003_UART0_T3, 13 | UART_N76E003_UART1_T3, 14 | UART_N76E003_COUNT 15 | } uart_n76e003_t; 16 | 17 | struct uart { 18 | uart_n76e003_t uart; 19 | bool first_tx; 20 | }; 21 | 22 | int uart_n76e003_init(/*@out@*/ struct uart *ctx, uart_n76e003_t uart); 23 | 24 | /* Runtime calls: 25 | * int uart_setup(struct uart *ctx, const struct uart_settings *settings); 26 | * int uart_write(struct uart *ctx, const char *buf, size_t n); 27 | * int uart_read(struct uart *ctx, char *buf, size_t n); 28 | */ 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /staging/drivers/wd/Kconfig: -------------------------------------------------------------------------------- 1 | menu "Watchdog drivers" 2 | 3 | config WD_RENESAS_RA4_WDT 4 | depends on ARM 5 | bool "Renesas RA4 WDT Watchdog" 6 | 7 | config WD_MC9S08PTXX_WDOG 8 | depends on HCS08 9 | bool "NXP MC9S08PTxx Series Watchdog" 10 | 11 | endmenu 12 | -------------------------------------------------------------------------------- /staging/drivers/wd/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Staging wd drivers 3 | # 4 | staging-drivers-wd := $(srctree)/staging/drivers/wd 5 | 6 | c_src-$(CONFIG_WD_RENESAS_RA4_WDT) += $(staging-drivers-wd)/wd-renesas_ra4_wdt.c 7 | c_src-$(CONFIG_WD_MC9S08PTXX_WDOG) += $(staging-drivers-wd)/wd-mc9s08ptxx.c 8 | -------------------------------------------------------------------------------- /staging/drivers/wd/wd-mc9s08ptxx.h: -------------------------------------------------------------------------------- 1 | #ifndef WD_MC9S08PTXX_H 2 | #define WD_MC9S08PTXX_H 3 | 4 | #include "wd.h" 5 | #include "clock.h" 6 | 7 | struct WD_MC9S08PTXX; 8 | 9 | struct wd { 10 | /*@temp@*/ struct WD_MC9S08PTXX *base; 11 | clock_id_t clkid; 12 | }; 13 | 14 | int wd_mc9s08ptxx_init(/*@out@*/ struct wd *ctx, clock_id_t clkid); 15 | 16 | /* Implements: 17 | * int wd_start(struct wd *ctx); 18 | * int wd_stop(struct wd *ctx); 19 | * void wd_refresh(struct wd *ctx); 20 | */ 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /staging/drivers/wd/wd-renesas_ra4_wdt.h: -------------------------------------------------------------------------------- 1 | #ifndef WD_RENESAS_RA4_WDT_H 2 | #define WD_RENESAS_RA4_WDT_H 3 | 4 | #include "wd.h" 5 | #include "clock.h" 6 | 7 | struct WD_RENESAS_RA4_WDT; 8 | 9 | struct wd { 10 | /*@temp@*/ struct WD_RENESAS_RA4_WDT *base; 11 | clock_id_t clkid; 12 | }; 13 | 14 | int wd_renesas_ra4_wdt_init(/*@out@*/ struct wd *ctx, clock_id_t clkid); 15 | 16 | /* Implements: 17 | * int wd_start(struct wd *ctx); 18 | * int wd_stop(struct wd *ctx); 19 | * void wd_refresh(struct wd *ctx); 20 | */ 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /test/footprint/Makefile: -------------------------------------------------------------------------------- 1 | # 1st: sources & targets 2 | target := $(TARGET) 3 | c_src-y += main.c 4 | 5 | # avoid double-inclusion 6 | ifeq ($(skip-makefile),) 7 | PWD := $(shell pwd) 8 | KBUILD_SRC := ../.. 9 | 10 | ARCHS := armv7e-m armv7-m atmega attiny c28x rp2040 e200z4 e200z7 11 | TARGETS := $(ARCHS:%=%.out) 12 | 13 | all: $(TARGETS) 14 | 15 | %: 16 | $(Q)$(MAKE) -C $(KBUILD_SRC) O=$(PWD) $@ 17 | 18 | target: FORCE 19 | $(Q)$(MAKE) -C $(KBUILD_SRC) O=$(PWD) \ 20 | EXTRA_CFLAGS=-DDEVICE_INTERRUPT_COUNT=0 \ 21 | EXTRA_AFLAGS=-DDEVICE_INTERRUPT_COUNT=0 \ 22 | TARGET=$@ 23 | 24 | %.out: FORCE 25 | $(Q)$(MAKE) -C $(KBUILD_SRC) O=$(PWD) $(@:%.out=%)_defconfig 26 | $(Q)$(MAKE) -C $(KBUILD_SRC) O=$(PWD) \ 27 | EXTRA_CFLAGS=-DDEVICE_INTERRUPT_COUNT=0 \ 28 | EXTRA_AFLAGS=-DDEVICE_INTERRUPT_COUNT=0 \ 29 | TARGET=$@ 30 | 31 | PHONY += FORCE 32 | FORCE: 33 | 34 | .PHONY: $(PHONY) 35 | endif 36 | -------------------------------------------------------------------------------- /test/footprint/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Very minimal picoRTOS application (only running idle) 3 | */ 4 | #include "picoRTOS.h" 5 | 6 | int main(void) 7 | { 8 | picoRTOS_init(); 9 | picoRTOS_start(); 10 | 11 | /* we're not supposed to end here */ 12 | picoRTOS_assert_void(false); 13 | return -1; 14 | } 15 | -------------------------------------------------------------------------------- /test/footprint/memory_usage: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Print elf memory usage estimate 4 | # Usage: memory_usage -s section [ - s section ] elf_file 5 | # 6 | total=0 7 | eval elf=\$$(($#)) 8 | 9 | section_size() 10 | { 11 | # $1: section 12 | # $2: elf 13 | 14 | start=$(objdump -t $2 | grep "__${1}_start" | cut -d " " -f1 | tr 'a-f' 'A-F') 15 | end=$(objdump -t $2 | grep "__${1}_end" | cut -d " " -f1 | tr 'a-f' 'A-F') 16 | echo -n "ibase=16\n${end} - ${start}\n" | bc 17 | } 18 | 19 | while getopts 's:h' opt; do 20 | case "$opt" in 21 | s) 22 | section=$(section_size $OPTARG $elf) 23 | total=$(expr $total + $section) 24 | echo "$OPTARG: " $section 25 | ;; 26 | 27 | ?) 28 | echo "Usage: $(basename $0) -s section [ -s section ] elf_file" 29 | exit 1 30 | ;; 31 | esac 32 | done 33 | 34 | echo "Total: " $total 35 | -------------------------------------------------------------------------------- /test/run_demo_amigaball_build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | DIR=$(pwd)/../demo/amigaball-lcd 4 | cd $DIR 5 | 6 | for m in $(find . -maxdepth 1 -name "Makefile.*"); do 7 | 8 | # exclude these 9 | # [ ! -z $(echo $m | grep pthread-linux) ] && continue 10 | # [ ! -z $(echo $m | grep win32) ] && continue 11 | [ ! -z $(echo $m | grep common) ] && continue 12 | 13 | echo "" 14 | echo "*** Building $m ***" 15 | echo "" 16 | 17 | make -f $m config V=1 || exit 1 18 | make -f $m V=1 || exit 1 19 | done 20 | -------------------------------------------------------------------------------- /test/run_demo_build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | DIR=$(pwd)/../demo 4 | 5 | for d in $(find $DIR -mindepth 1 -maxdepth 1 -type d); do 6 | 7 | # exclude these 8 | # [ ! -z $(echo $d | grep pthread-linux) ] && continue 9 | # [ ! -z $(echo $d | grep win32) ] && continue 10 | 11 | cd $d && make V=1 || exit 1 12 | done 13 | -------------------------------------------------------------------------------- /test/run_demo_staticcheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | DIR=$(pwd)/../demo 4 | 5 | for d in $(find $DIR -mindepth 1 -maxdepth 1 -type d); do 6 | 7 | echo "" 8 | echo "*** Executing staticcheck in $d ***" 9 | echo "" 10 | 11 | # exclude these 12 | [ ! -z $(echo $d | grep pthread-linux) ] && continue 13 | [ ! -z $(echo $d | grep win32) ] && continue 14 | # FIXME: EXTRA_CFLAGS issue 15 | [ ! -z $(echo $d | grep pic32mz) ] && continue 16 | 17 | cd $d && make staticcheck V=1 || exit 1 18 | done 19 | -------------------------------------------------------------------------------- /test/run_staging_demo_build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | DIR=$(pwd)/../staging/demo 4 | 5 | for d in $(find $DIR -mindepth 1 -maxdepth 1 -type d); do 6 | 7 | # exclude these 8 | # [ ! -z $(echo $d | grep pthread-linux) ] && continue 9 | # [ ! -z $(echo $d | grep win32) ] && continue 10 | 11 | cd $d && make V=1 || exit 1 12 | done 13 | -------------------------------------------------------------------------------- /test/run_staging_demo_staticcheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | DIR=$(pwd)/../staging/demo 4 | 5 | for d in $(find $DIR -mindepth 1 -maxdepth 1 -type d); do 6 | 7 | echo "" 8 | echo "*** Executing staticcheck in $d ***" 9 | echo "" 10 | 11 | # exclude these 12 | [ ! -z $(echo $d | grep pthread-linux) ] && continue 13 | [ ! -z $(echo $d | grep win32) ] && continue 14 | 15 | cd $d && make staticcheck V=1 || exit 1 16 | done 17 | -------------------------------------------------------------------------------- /test/run_tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # STATIC ANALYSIS 4 | DIR=static_analysis 5 | 6 | # Scheduler 7 | make -C $DIR/picoRTOS V=1 || exit 1 8 | make -C $DIR/picoRTOS-SMP V=1 || exit 1 9 | 10 | # UNIT TESTS 11 | DIR=unit_tests 12 | 13 | # first: no output 14 | make -C $DIR 15 | ./$DIR/test_picoRTOS > $DIR.log 16 | ./$DIR/test_picoRTOS-SMP > $DIR.log 17 | 18 | # second: only show failures 19 | FAIL=$(grep FAIL $DIR.log) 20 | if [ ! -z "$FAIL" ]; then 21 | cat $DIR.log | grep FAIL 22 | exit 1 23 | fi 24 | 25 | echo "" 26 | echo "*** Test Completed ***" 27 | -------------------------------------------------------------------------------- /test/static_analysis/picoRTOS-SMP/Makefile: -------------------------------------------------------------------------------- 1 | # 1st: sources & targets 2 | target := dummy 3 | c_src-y += test.c 4 | 5 | # avoid double-inclusion 6 | ifneq ($(skip-makefile),1) 7 | PWD := $(shell pwd) 8 | KBUILD_SRC := ../../.. 9 | 10 | TARGETS := $(notdir $(wildcard configs/*_defconfig)) 11 | 12 | all: $(TARGETS) 13 | @ 14 | 15 | %: 16 | $(Q)$(MAKE) -C $(KBUILD_SRC) O=$(PWD) $@ 17 | 18 | $(TARGETS): FORCE 19 | @cat configs/$@ configs/base.config > .config 20 | $(Q)$(MAKE) -C $(KBUILD_SRC) O=$(PWD) oldnoconfig 21 | $(Q)$(MAKE) -C $(KBUILD_SRC) O=$(PWD) staticcheck 22 | 23 | PHONY += FORCE 24 | FORCE: 25 | 26 | .PHONY: $(PHONY) 27 | endif 28 | -------------------------------------------------------------------------------- /test/static_analysis/picoRTOS-SMP/configs/base.config: -------------------------------------------------------------------------------- 1 | CONFIG_TICK_HZ=1000 2 | CONFIG_EXTRA_CFLAGS="" 3 | CONFIG_SMP_CORES=2 4 | CONFIG_CC_NO_OPTIMIZATION=y 5 | CONFIG_FUTEX=y 6 | CONFIG_DEADLOCK_COUNT=1000 7 | CONFIG_LDSCRIPT="" 8 | CONFIG_QUEUE=y 9 | CONFIG_DEFAULT_STACK_COUNT=256 10 | CONFIG_SMP=y 11 | CONFIG_MUTEX=y 12 | CONFIG_SYSCLK_HZ=100000000 13 | CONFIG_TASK_COUNT=5 14 | CONFIG_COND=y 15 | CONFIG_EXTRA_LDFLAGS="" 16 | CONFIG_DEBUG=y 17 | CONFIG_CROSS_COMPILE="" 18 | -------------------------------------------------------------------------------- /test/static_analysis/picoRTOS-SMP/configs/mach-mpc574x_defconfig: -------------------------------------------------------------------------------- 1 | CONFIG_POWERPC=y 2 | CONFIG_CACHE_MAINTENANCE=y 3 | CONFIG_E200Z4=y 4 | CONFIG_MACH_MPC574X=y 5 | -------------------------------------------------------------------------------- /test/static_analysis/picoRTOS-SMP/configs/mach-mpc577x_defconfig: -------------------------------------------------------------------------------- 1 | CONFIG_POWERPC=y 2 | CONFIG_E200Z7=y 3 | CONFIG_MACH_MPC577X=y 4 | -------------------------------------------------------------------------------- /test/static_analysis/picoRTOS-SMP/configs/mach-rp2040_defconfig: -------------------------------------------------------------------------------- 1 | CONFIG_ARM=y 2 | CONFIG_ARMV6M=y 3 | CONFIG_MACH_RP2040=y 4 | -------------------------------------------------------------------------------- /test/static_analysis/picoRTOS/Makefile: -------------------------------------------------------------------------------- 1 | # 1st: sources & targets 2 | target := dummy 3 | c_src-y += test.c 4 | 5 | # avoid double-inclusion 6 | ifneq ($(skip-makefile),1) 7 | PWD := $(shell pwd) 8 | KBUILD_SRC := ../../.. 9 | 10 | TARGETS := $(notdir $(wildcard configs/*_defconfig)) 11 | 12 | all: $(TARGETS) 13 | @ 14 | 15 | %: 16 | $(Q)$(MAKE) -C $(KBUILD_SRC) O=$(PWD) $@ 17 | 18 | $(TARGETS): FORCE 19 | @cat configs/$@ configs/base.config > .config 20 | $(Q)$(MAKE) -C $(KBUILD_SRC) O=$(PWD) oldnoconfig 21 | $(Q)$(MAKE) -C $(KBUILD_SRC) O=$(PWD) staticcheck 22 | 23 | PHONY += FORCE 24 | FORCE: 25 | 26 | .PHONY: $(PHONY) 27 | endif 28 | -------------------------------------------------------------------------------- /test/static_analysis/picoRTOS/configs/base.config: -------------------------------------------------------------------------------- 1 | CONFIG_TICK_HZ=1000 2 | CONFIG_EXTRA_CFLAGS="" 3 | CONFIG_CC_NO_OPTIMIZATION=y 4 | CONFIG_FUTEX=y 5 | CONFIG_DEADLOCK_COUNT=1000 6 | CONFIG_LDSCRIPT="" 7 | CONFIG_QUEUE=y 8 | CONFIG_DEFAULT_STACK_COUNT=256 9 | CONFIG_MUTEX=y 10 | CONFIG_SYSCLK_HZ=100000000 11 | CONFIG_MACH_RP2040=y 12 | CONFIG_SINGLE_CORE=y 13 | CONFIG_TASK_COUNT=5 14 | CONFIG_COND=y 15 | CONFIG_EXTRA_LDFLAGS="" 16 | CONFIG_DEBUG=y 17 | CONFIG_CROSS_COMPILE="" 18 | -------------------------------------------------------------------------------- /test/static_analysis/picoRTOS/configs/mach-atmega2560_defconfig: -------------------------------------------------------------------------------- 1 | CONFIG_AVR=y 2 | CONFIG_ATMEGA=y 3 | CONFIG_MACH_ATMEGA2560=y 4 | -------------------------------------------------------------------------------- /test/static_analysis/picoRTOS/configs/mach-atmega328p_defconfig: -------------------------------------------------------------------------------- 1 | CONFIG_AVR=y 2 | CONFIG_ATMEGA=y 3 | CONFIG_MACH_ATMEGA328P=y 4 | -------------------------------------------------------------------------------- /test/static_analysis/picoRTOS/configs/mach-atmega32u4_defconfig: -------------------------------------------------------------------------------- 1 | CONFIG_AVR=y 2 | CONFIG_ATMEGA=y 3 | CONFIG_MACH_ATMEGA32U4=y 4 | -------------------------------------------------------------------------------- /test/static_analysis/picoRTOS/configs/mach-atsam3x8e_defconfig: -------------------------------------------------------------------------------- 1 | CONFIG_ARM=y 2 | CONFIG_ARMV7M=y 3 | CONFIG_MACH_ATSAM3X8E=y 4 | -------------------------------------------------------------------------------- /test/static_analysis/picoRTOS/configs/mach-atsame5x_defconfig: -------------------------------------------------------------------------------- 1 | CONFIG_ARM=y 2 | CONFIG_ARMV7EM=y 3 | CONFIG_FPV4_SP_D16=y 4 | CONFIG_L1_CACHE_LINESIZE=16 5 | -------------------------------------------------------------------------------- /test/static_analysis/picoRTOS/configs/mach-attiny1607_defconfig: -------------------------------------------------------------------------------- 1 | CONFIG_AVR=y 2 | CONFIG_ATTINY=y 3 | CONFIG_MACH_ATTINY1607=y 4 | -------------------------------------------------------------------------------- /test/static_analysis/picoRTOS/configs/mach-attiny414_defconfig: -------------------------------------------------------------------------------- 1 | CONFIG_AVR=y 2 | CONFIG_ATTINY=y 3 | CONFIG_MACH_ATTINY414=y 4 | -------------------------------------------------------------------------------- /test/static_analysis/picoRTOS/configs/mach-attiny817_defconfig: -------------------------------------------------------------------------------- 1 | CONFIG_AVR=y 2 | CONFIG_ATTINY=y 3 | CONFIG_MACH_ATTINY817=y 4 | -------------------------------------------------------------------------------- /test/static_analysis/picoRTOS/configs/mach-ch32v003_defconfig: -------------------------------------------------------------------------------- 1 | CONFIG_RISCV=y 2 | CONFIG_RV32EC=y 3 | CONFIG_MACH_CH32V003=y 4 | CONFIG_RV32EC_LIBGCC_DIV_MULT=y 5 | -------------------------------------------------------------------------------- /test/static_analysis/picoRTOS/configs/mach-f28379x_defconfig: -------------------------------------------------------------------------------- 1 | CONFIG_C2000=y 2 | CONFIG_C28X=y 3 | CONFIG_MACH_F28379X=y 4 | -------------------------------------------------------------------------------- /test/static_analysis/picoRTOS/configs/mach-gd32vf103_defconfig: -------------------------------------------------------------------------------- 1 | CONFIG_RISCV=y 2 | CONFIG_RV32IMAC=y 3 | CONFIG_MACH_GD32VF103=y 4 | -------------------------------------------------------------------------------- /test/static_analysis/picoRTOS/configs/mach-mc9s08ptxx_defconfig: -------------------------------------------------------------------------------- 1 | CONFIG_HCS08=y 2 | CONFIG_MACH_MC9S08PT60=y 3 | CONFIG_MACH_MC9S08PTXX=y 4 | CONFIG_SYSTICK_MC9S08PTXX_RTC=y 5 | -------------------------------------------------------------------------------- /test/static_analysis/picoRTOS/configs/mach-mpc574x_defconfig: -------------------------------------------------------------------------------- 1 | CONFIG_POWERPC=y 2 | CONFIG_CACHE_MAINTENANCE=y 3 | CONFIG_E200Z4=y 4 | CONFIG_MACH_MPC574X=y 5 | -------------------------------------------------------------------------------- /test/static_analysis/picoRTOS/configs/mach-mpc577x_defconfig: -------------------------------------------------------------------------------- 1 | CONFIG_POWERPC=y 2 | CONFIG_E200Z7=y 3 | CONFIG_MACH_MPC577X=y 4 | -------------------------------------------------------------------------------- /test/static_analysis/picoRTOS/configs/mach-pic32mz_defconfig: -------------------------------------------------------------------------------- 1 | CONFIG_MIPS=y 2 | CONFIG_M51XX=y 3 | CONFIG_MACH_PIC32MZ=y 4 | CONFIG_M51XX_DSP=y 5 | CONFIG_M51XX_FPU64=y 6 | -------------------------------------------------------------------------------- /test/static_analysis/picoRTOS/configs/mach-rp2040_defconfig: -------------------------------------------------------------------------------- 1 | CONFIG_ARM=y 2 | CONFIG_ARMV6M=y 3 | CONFIG_MACH_RP2040=y 4 | -------------------------------------------------------------------------------- /test/static_analysis/picoRTOS/configs/mach-stc12c5axx_defconfig: -------------------------------------------------------------------------------- 1 | CONFIG_8051=y 2 | CONFIG_MACH_STC12C5AXX=y 3 | CONFIG_SYSCLK_HZ=22100000 4 | CONFIG_SYSCLK_DIV=1 5 | -------------------------------------------------------------------------------- /test/static_analysis/picoRTOS/configs/mach-stm32h7xx_defconfig: -------------------------------------------------------------------------------- 1 | CONFIG_ARM=y 2 | CONFIG_ARMV7EM=y 3 | CONFIG_MACH_STM32H7XX=y 4 | CONFIG_FPV4_SP_D16=y 5 | CONFIG_L1_CACHE_LINESIZE=32 6 | CONFIG_CACHE_MAINTENANCE=y 7 | -------------------------------------------------------------------------------- /test/static_analysis/picoRTOS/configs/mach-stm8s_defconfig: -------------------------------------------------------------------------------- 1 | CONFIG_STM8=y 2 | CONFIG_MACH_STM8S=y 3 | -------------------------------------------------------------------------------- /test/unit_tests/Makefile: -------------------------------------------------------------------------------- 1 | TESTS := test_picoRTOS test_picoRTOS-SMP 2 | 3 | CC := gcc 4 | 5 | PICORTOS_DIR := $(abspath ../..) 6 | BUILD_DIR = build 7 | 8 | CFLAGS := -I. -Istub -I$(PICORTOS_DIR) -g3 -O0 9 | CFLAGS += -I$(PICORTOS_DIR)/arch/include 10 | CFLAGS += -D"__ATTRIBUTE_ALIGNED__(x)=__attribute__((aligned(x)))" 11 | 12 | LDFLAGS := 13 | 14 | SRC += stub/picoRTOS_port.c 15 | OBJ := $(SRC:%.c=$(BUILD_DIR)/%.o) 16 | 17 | all: $(TESTS) 18 | 19 | test_picoRTOS: $(OBJ) 20 | $(CC) $(CFLAGS) -c test.c -o $@.o 21 | $(CC) $^ $@.o -o $@ $(LDFLAGS) 22 | 23 | test_picoRTOS-SMP: $(OBJ) 24 | $(CC) $(CFLAGS) -DTEST_PICORTOS_SMP -c test.c -o $@.o 25 | $(CC) $^ $@.o -o $@ $(LDFLAGS) 26 | 27 | $(BUILD_DIR)/%.o: %.c 28 | -mkdir -p $(@D) 29 | $(CC) $(CFLAGS) -c $< -o $@ 30 | 31 | clean: 32 | -rm -rf $(BUILD_DIR) 33 | -rm -f $(TESTS) *.o 34 | 35 | .PHONY: $(TESTS) 36 | -------------------------------------------------------------------------------- /test/unit_tests/stub/generated/autoconf.h: -------------------------------------------------------------------------------- 1 | #define CONFIG_SYSCLK_HZ 1000 2 | #define CONFIG_TICK_HZ 10 3 | #define CONFIG_SMP_CORES 2 4 | #define CONFIG_TASK_COUNT 99 5 | #define CONFIG_DEFAULT_STACK_COUNT 100 6 | #define CONFIG_DEADLOCK_COUNT 1000 7 | -------------------------------------------------------------------------------- /test/unit_tests/stub/picoRTOS_device.h: -------------------------------------------------------------------------------- 1 | #ifndef PICORTOS_DEVICE_H 2 | #define PICORTOS_DEVICE_H 3 | 4 | /* #define DEVICE_HAS_SOFTWARE_CACHE_COHERENCY */ 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /test/unit_tests/stub/picoRTOS_types.h: -------------------------------------------------------------------------------- 1 | #ifndef PICORTOS_TYPES_H 2 | #define PICORTOS_TYPES_H 3 | 4 | typedef unsigned long picoRTOS_stack_t; 5 | typedef unsigned long picoRTOS_priority_t; 6 | typedef unsigned long picoRTOS_pid_t; 7 | typedef unsigned long picoRTOS_tick_t; 8 | typedef unsigned long picoRTOS_atomic_t; 9 | typedef unsigned long picoRTOS_irq_t; 10 | typedef unsigned long picoRTOS_cycles_t; 11 | typedef unsigned long picoRTOS_mask_t; 12 | typedef unsigned long picoRTOS_core_t; 13 | 14 | typedef long picoRTOS_intptr_t; 15 | typedef unsigned long picoRTOS_uintptr_t; 16 | 17 | #define ARCH_L1_DCACHE_LINESIZE sizeof(unsigned long) 18 | 19 | #define ARCH_INITIAL_STACK_COUNT 10 20 | #define ARCH_MIN_STACK_COUNT ARCH_INITIAL_STACK_COUNT 21 | #define ARCH_SMP_MIN_STACK_COUNT ARCH_INITIAL_STACK_COUNT 22 | 23 | #define arch_break() ({ halted = true; }) 24 | 25 | #endif 26 | --------------------------------------------------------------------------------