├── .github └── workflows │ └── release.yml ├── .gitignore ├── .gitmodules ├── CMakeLists.txt ├── Doxyfile ├── README.md ├── cmsis ├── CMakeLists.txt └── dsp │ ├── include │ ├── arm_common_tables.h │ ├── arm_const_structs.h │ └── arm_math.h │ └── src │ ├── CommonTables │ ├── arm_common_tables.c │ └── arm_const_structs.c │ ├── FastMathFunctions │ ├── arm_cos_f32.c │ ├── arm_cos_q15.c │ ├── arm_cos_q31.c │ ├── arm_sin_f32.c │ ├── arm_sin_q15.c │ ├── arm_sin_q31.c │ ├── arm_sqrt_q15.c │ └── arm_sqrt_q31.c │ └── MatrixFunctions │ ├── arm_mat_add_f32.c │ ├── arm_mat_add_q15.c │ ├── arm_mat_add_q31.c │ ├── arm_mat_cmplx_mult_f32.c │ ├── arm_mat_cmplx_mult_q15.c │ ├── arm_mat_cmplx_mult_q31.c │ ├── arm_mat_init_f32.c │ ├── arm_mat_init_q15.c │ ├── arm_mat_init_q31.c │ ├── arm_mat_inverse_f32.c │ ├── arm_mat_inverse_f64.c │ ├── arm_mat_mult_f32.c │ ├── arm_mat_mult_fast_q15.c │ ├── arm_mat_mult_fast_q31.c │ ├── arm_mat_mult_q15.c │ ├── arm_mat_mult_q31.c │ ├── arm_mat_scale_f32.c │ ├── arm_mat_scale_q15.c │ ├── arm_mat_scale_q31.c │ ├── arm_mat_sub_f32.c │ ├── arm_mat_sub_q15.c │ ├── arm_mat_sub_q31.c │ ├── arm_mat_trans_f32.c │ ├── arm_mat_trans_q15.c │ └── arm_mat_trans_q31.c ├── compile_cli.sh ├── config ├── Makefile ├── RM_Board_F3X.cfg ├── RM_F4_Stlink.cfg ├── buzzer_sound_array_generator │ ├── 0.c │ ├── buzzer_sound_array_generator.py │ └── one.json ├── cmsis-dap.cfg ├── compile_options.cmake ├── null_run.sh ├── openocd_connect_with_pipe.sh ├── openocd_flash.sh └── toolchain.cmake ├── dev ├── application │ ├── param_adjusts │ │ ├── pa_gimbal.json │ │ ├── pa_hero │ │ │ ├── README.md │ │ │ ├── can_motor_config.cpp │ │ │ ├── can_motor_config.h │ │ │ ├── hardware_conf.h │ │ │ ├── pa_hero.cpp │ │ │ └── thread_priorities.h │ │ ├── pa_infantry.json │ │ └── pa_infantry │ │ │ ├── README.md │ │ │ ├── can_motor_config.cpp │ │ │ ├── can_motor_config.h │ │ │ ├── hardware_conf.h │ │ │ ├── pa_infantry.cpp │ │ │ └── thread_priorities.h │ ├── unit_tests │ │ ├── ut_ahrs │ │ │ ├── ca_ahrs.cpp │ │ │ ├── hardware_conf.h │ │ │ ├── ut_ahrs.cpp │ │ │ └── ut_ahrs_ext.cpp │ │ ├── ut_buzzer │ │ │ ├── hardware_conf.h │ │ │ └── ut_buzzer.cpp │ │ ├── ut_chassis │ │ │ ├── can_motor_config.cpp │ │ │ ├── can_motor_config.h │ │ │ ├── hardware_conf.h │ │ │ └── ut_chassis.cpp │ │ ├── ut_damiao_motor │ │ │ ├── damiao_motor_config.h │ │ │ ├── hardware_conf.h │ │ │ └── main.cpp │ │ ├── ut_led │ │ │ ├── hardware_conf.h │ │ │ └── ut_led.cpp │ │ ├── ut_oled │ │ │ ├── hardware_conf.h │ │ │ └── ut_oled.cpp │ │ ├── ut_referee_if │ │ │ ├── hardware_conf.h │ │ │ └── ut_referee_if.cpp │ │ ├── ut_remote_if │ │ │ ├── hardware_conf.h │ │ │ └── ut_remoteIF.cpp │ │ ├── ut_rudder │ │ │ ├── hardware_conf.h │ │ │ └── main.cpp │ │ ├── ut_sd_card │ │ │ ├── hardware_conf.h │ │ │ └── ut_sd_card.cpp │ │ ├── ut_sentry_chassis │ │ │ ├── can_motor_config.cpp │ │ │ ├── can_motor_config.h │ │ │ ├── hardware_conf.h │ │ │ ├── senry_chassis_readme.txt │ │ │ └── ut_sentry_chassis.cpp │ │ ├── ut_steer_chassis │ │ │ ├── can_motor_config.cpp │ │ │ ├── can_motor_config.h │ │ │ ├── hardware_conf.h │ │ │ └── ut_chassis.cpp │ │ ├── ut_template.cpp │ │ └── ut_usb_com │ │ │ ├── hardware_conf.h │ │ │ └── ut_usb.cpp │ └── vehicles │ │ ├── aerial │ │ ├── inspector_aerial.cpp │ │ ├── inspector_aerial.h │ │ ├── main_aerial.cpp │ │ ├── settings_aerial.cpp │ │ ├── settings_aerial.h │ │ ├── user_aerial.cpp │ │ ├── user_aerial.h │ │ └── vehicle_aerial.h │ │ ├── auto_sentry │ │ ├── auto_sentry.cpp │ │ ├── can_motor_config.cpp │ │ ├── can_motor_config.h │ │ └── hardware_conf.h │ │ ├── dart │ │ ├── can_motor_config.cpp │ │ ├── can_motor_config.h │ │ ├── damiao_motor_config.h │ │ ├── hardware_conf.h │ │ ├── main_dart.cpp │ │ ├── thread_priorities.h │ │ ├── user_dart.cpp │ │ └── user_dart.h │ │ ├── engineer │ │ ├── inspector_engineer.cpp │ │ ├── inspector_engineer.h │ │ ├── main_engineer.cpp │ │ ├── settings_engineer.cpp │ │ ├── settings_engineer.h │ │ ├── user_engineer.cpp │ │ ├── user_engineer.h │ │ └── vehicle_engineer.h │ │ ├── haptic_device │ │ ├── AHRS_PARAMS.h │ │ ├── Communicator.cpp │ │ ├── Communicator.h │ │ ├── DEBUG_CHECK.h │ │ ├── Inspector.cpp │ │ ├── Inspector.h │ │ ├── can_motor_config.cpp │ │ ├── can_motor_config.h │ │ ├── hardware_conf.h │ │ ├── main_haptic.cpp │ │ └── thread_priorities.h │ │ ├── hero │ │ ├── can_motor_config.cpp │ │ ├── can_motor_config.h │ │ ├── hardware_conf.h │ │ ├── inspector_hero.cpp │ │ ├── inspector_hero.h │ │ ├── main_hero.cpp │ │ ├── setting_hero.json │ │ ├── settings_hero.cpp │ │ ├── thread_priorities.h │ │ ├── user_hero.cpp │ │ ├── user_hero.h │ │ └── vehicle_hero.h │ │ ├── infantry │ │ ├── can_motor_config.cpp │ │ ├── can_motor_config.h │ │ ├── hardware_conf.h │ │ ├── inspector_infantry.cpp │ │ ├── inspector_infantry.h │ │ ├── main_infantry.cpp │ │ ├── setting_infantry.json │ │ ├── settings_infantry.cpp │ │ ├── thread_priorities.h │ │ ├── user_infantry.cpp │ │ ├── user_infantry.h │ │ └── vehicle_infantry.h │ │ └── sentry │ │ ├── can_motor_config.cpp │ │ ├── can_motor_config.h │ │ ├── hardware_conf.h │ │ ├── inspector_sentry.cpp │ │ ├── inspector_sentry.h │ │ ├── main_sentry.cpp │ │ ├── settings_sentry.cpp │ │ ├── settings_sentry.h │ │ ├── thread_priorities.h │ │ ├── user_sentry.cpp │ │ ├── user_sentry.h │ │ └── vehicle_sentry.h ├── board_pin │ ├── rm_board_2017 │ │ ├── board.c │ │ ├── board.h │ │ ├── board.mk │ │ └── mcuconf.h │ └── rm_board_2018_a │ │ ├── board.c │ │ ├── board.h │ │ ├── board.mk │ │ └── mcuconf.h ├── chconf.h ├── common │ ├── CRC16.cpp │ ├── CRC16.h │ ├── CRC8.cpp │ ├── CRC8.h │ └── common_macro.h ├── halconf.h ├── interface │ ├── README.md │ ├── ahrs │ │ ├── ahrs.cpp │ │ ├── ahrs.h │ │ ├── ahrs_abstract.h │ │ ├── ahrs_ext.cpp │ │ ├── ahrs_ext.h │ │ ├── ahrs_lib.h │ │ ├── ahrs_lib.lib │ │ ├── ahrs_lib_middleware.c │ │ ├── ahrs_lib_middleware.h │ │ ├── ahrs_math.hpp │ │ ├── imu_on_board.cpp │ │ ├── imu_on_board.h │ │ ├── ist8310_reg.h │ │ └── mpu6500_reg.h │ ├── button │ │ ├── button_monitor.cpp │ │ └── button_monitor.h │ ├── buzzer │ │ ├── README.md │ │ ├── buzzer_interface.cpp │ │ ├── buzzer_interface.h │ │ ├── buzzer_scheduler.cpp │ │ └── buzzer_scheduler.h │ ├── can │ │ ├── can_interface.cpp │ │ └── can_interface.h │ ├── can_motor │ │ ├── README.md │ │ ├── can_motor_controller.cpp │ │ ├── can_motor_controller.h │ │ ├── can_motor_feedback.cpp │ │ ├── can_motor_feedback.h │ │ ├── can_motor_interface.cpp │ │ └── can_motor_interface.h │ ├── capacitor │ │ ├── capacitor_interface.cpp │ │ └── capacitor_interface.h │ ├── damiao_motor │ │ ├── README.md │ │ ├── damiao_motor_controller.cpp │ │ ├── damiao_motor_controller.h │ │ ├── damiao_motor_feedback.cpp │ │ ├── damiao_motor_feedback.h │ │ ├── damiao_motor_interface.cpp │ │ └── damiao_motor_interface.h │ ├── led │ │ ├── led.cpp │ │ └── led.h │ ├── lidar │ │ ├── lidar_interface.cpp │ │ └── lidar_interface.h │ ├── oled │ │ ├── oled_interface.cpp │ │ └── oled_interface.h │ ├── referee │ │ ├── referee_interface.cpp │ │ └── referee_interface.h │ ├── remote │ │ ├── remote_interpreter.cpp │ │ └── remote_interpreter.h │ ├── rudder │ │ ├── rudder_interface.cpp │ │ └── rudder_interface.h │ ├── sd_card │ │ ├── sd_card_interface.cpp │ │ └── sd_card_interface.h │ ├── shell │ │ ├── chprintf_core.c │ │ ├── printf.c │ │ ├── printf.h │ │ ├── shell.cpp │ │ ├── shell.h │ │ ├── shell_base.c │ │ ├── shell_base.h │ │ ├── shell_base_cmd.c │ │ ├── shell_base_cmd.h │ │ ├── shell_dbg_cmd.cpp │ │ ├── shell_dbg_cmd.h │ │ └── shellconf.h │ ├── usb_com │ │ ├── usb_serial_interface.cpp │ │ └── usb_serial_interface.h │ └── vision │ │ ├── vision_interface.cpp │ │ └── vision_interface.h ├── logic │ ├── chassis_logic.cpp │ ├── chassis_logic.h │ ├── gimbalLGArchive.cpp │ ├── gimbalLGArchive.h │ ├── gimbal_logic.cpp │ ├── gimbal_logic.h │ ├── haptic_logic.cpp │ ├── haptic_logic.h │ ├── referee_UI_logic.cpp │ ├── referee_UI_logic.h │ ├── sentry_chassis_logic.cpp │ ├── sentry_chassis_logic.h │ ├── shoot_logic.cpp │ └── shoot_logic.h ├── module │ ├── kalman_filter.hpp │ ├── low_pass_filter.hpp │ ├── pid_controller.hpp │ ├── position_kalman_filter.hpp │ └── trajectory_calculator.hpp └── scheduler │ ├── gimbal_scheduler.cpp │ ├── gimbal_scheduler.h │ ├── mecanum_chassis_scheduler.cpp │ ├── mecanum_chassis_scheduler.h │ ├── referee_UI_update_scheduler.cpp │ ├── referee_UI_update_scheduler.h │ ├── scheduler_base.h │ ├── sentry_chassis_scheduler.cpp │ ├── sentry_chassis_scheduler.h │ ├── shoot_scheduler.cpp │ ├── shoot_scheduler.h │ ├── steering_chassis_scheduler.cpp │ ├── steering_chassis_scheduler.h │ ├── vision_scheduler.cpp │ └── vision_scheduler.h └── os ├── ch.cmake ├── common ├── abstractions │ ├── cmsis_os │ │ ├── cmsis_os.c │ │ ├── cmsis_os.h │ │ └── cmsis_os.mk │ └── nasa_cfe │ │ ├── osal │ │ ├── cfe_osal.mk │ │ ├── include │ │ │ ├── common_types.h │ │ │ ├── osapi-os-core.h │ │ │ ├── osapi-os-custom.h │ │ │ ├── osapi-os-filesys.h │ │ │ ├── osapi-os-loader.h │ │ │ ├── osapi-os-net.h │ │ │ ├── osapi-os-timer.h │ │ │ ├── osapi-version.h │ │ │ └── osapi.h │ │ └── src │ │ │ └── osapi.c │ │ └── psp │ │ ├── cfe_psp.mk │ │ ├── include │ │ ├── cfe_psp.h │ │ ├── cfe_psp_config.h │ │ └── psp_version.h │ │ └── src │ │ ├── cfe_psp_exception.c │ │ ├── cfe_psp_memory.c │ │ ├── cfe_psp_support.c │ │ └── cfe_psp_timer.c ├── ext │ ├── ARM │ │ └── CMSIS │ │ │ ├── Core │ │ │ └── Include │ │ │ │ ├── cmsis_armcc.h │ │ │ │ ├── cmsis_armclang.h │ │ │ │ ├── cmsis_compiler.h │ │ │ │ ├── cmsis_gcc.h │ │ │ │ ├── cmsis_version.h │ │ │ │ ├── core_armv8mbl.h │ │ │ │ ├── core_armv8mml.h │ │ │ │ ├── core_cm0.h │ │ │ │ ├── core_cm0plus.h │ │ │ │ ├── core_cm23.h │ │ │ │ ├── core_cm3.h │ │ │ │ ├── core_cm33.h │ │ │ │ ├── core_cm4.h │ │ │ │ ├── core_cm7.h │ │ │ │ ├── core_sc000.h │ │ │ │ ├── core_sc300.h │ │ │ │ ├── mpu_armv7.h │ │ │ │ └── tz_context.h │ │ │ ├── Core_A │ │ │ ├── Include │ │ │ │ ├── ARMCA5.h │ │ │ │ ├── cmsis_armcc.h │ │ │ │ ├── cmsis_armclang.h │ │ │ │ ├── cmsis_compiler.h │ │ │ │ ├── cmsis_gcc.h │ │ │ │ ├── core_ca.h │ │ │ │ ├── irq_ctrl.h │ │ │ │ └── system_ARMCA5.h │ │ │ └── Source │ │ │ │ └── irq_ctrl_gic.c │ │ │ └── readme.txt │ ├── ST │ │ └── STM32F4xx │ │ │ ├── stm32f427xx.h │ │ │ ├── stm32f4xx.h │ │ │ └── system_stm32f4xx.h │ └── readme.txt ├── oslib │ ├── include │ │ ├── chbsem.h │ │ ├── chfactory.h │ │ ├── chfifo.h │ │ ├── chheap.h │ │ ├── chmboxes.h │ │ ├── chmemcore.h │ │ └── chmempools.h │ ├── readme.txt │ └── src │ │ ├── chfactory.c │ │ ├── chheap.c │ │ ├── chmboxes.c │ │ ├── chmemcore.c │ │ └── chmempools.c ├── portability │ ├── CW │ │ └── ccportab.h │ ├── GCC │ │ └── ccportab.h │ └── GHS │ │ └── ccportab.h ├── ports │ ├── ARM │ │ ├── chcore.c │ │ ├── chcore.h │ │ ├── chcore_timer.h │ │ └── compilers │ │ │ └── GCC │ │ │ ├── chcoreasm.S │ │ │ ├── chtypes.h │ │ │ └── mk │ │ │ └── port_generic.mk │ ├── ARMCMx │ │ ├── chcore.c │ │ ├── chcore.h │ │ ├── chcore_timer.h │ │ ├── chcore_v6m.c │ │ ├── chcore_v6m.h │ │ ├── chcore_v7m.c │ │ ├── chcore_v7m.h │ │ ├── compilers │ │ │ ├── GCC │ │ │ │ ├── chcoreasm_v6m.S │ │ │ │ ├── chcoreasm_v7m.S │ │ │ │ ├── chtypes.h │ │ │ │ └── mk │ │ │ │ │ ├── port_v6m.mk │ │ │ │ │ └── port_v7m.mk │ │ │ ├── IAR │ │ │ │ ├── chcoreasm_v6m.s │ │ │ │ ├── chcoreasm_v7m.s │ │ │ │ └── chtypes.h │ │ │ └── RVCT │ │ │ │ ├── chcoreasm_v6m.s │ │ │ │ ├── chcoreasm_v7m.s │ │ │ │ └── chtypes.h │ │ └── mpu.h │ ├── AVR │ │ ├── chcore.c │ │ ├── chcore.h │ │ ├── chcore_timer.h │ │ └── compilers │ │ │ └── GCC │ │ │ ├── chtypes.h │ │ │ ├── mk │ │ │ └── port.mk │ │ │ └── rules.mk │ ├── SIMIA32 │ │ ├── chcore.c │ │ ├── chcore.h │ │ └── compilers │ │ │ └── GCC │ │ │ ├── chtypes.h │ │ │ └── port.mk │ ├── e200 │ │ ├── chcore.c │ │ ├── chcore.h │ │ └── compilers │ │ │ ├── CW │ │ │ ├── chcoreasm.s │ │ │ ├── chtypes.h │ │ │ └── ivor.s │ │ │ ├── GCC │ │ │ ├── chcoreasm.S │ │ │ ├── chtypes.h │ │ │ ├── ivor.S │ │ │ └── mk │ │ │ │ └── port.mk │ │ │ └── GHS │ │ │ ├── chcoreasm.s │ │ │ ├── chtypes.h │ │ │ ├── ivor.s │ │ │ └── mk │ │ │ └── port.mk │ ├── readme.txt │ └── templates │ │ ├── chcore.c │ │ ├── chcore.h │ │ └── chtypes.h └── startup │ ├── ARM │ ├── compilers │ │ └── GCC │ │ │ ├── crt0.S │ │ │ ├── crt1.c │ │ │ ├── ld │ │ │ ├── LPC2148.ld │ │ │ └── rules.ld │ │ │ ├── mk │ │ │ └── startup_lpc214x.mk │ │ │ ├── rules.mk │ │ │ └── vectors.S │ └── devices │ │ └── LPC214x │ │ ├── armparams.h │ │ └── lpc214x.h │ ├── ARMCMx │ ├── compilers │ │ ├── GCC │ │ │ ├── crt0_v6m.S │ │ │ ├── crt0_v7m.S │ │ │ ├── crt1.c │ │ │ ├── ld │ │ │ │ ├── STM32F030x4.ld │ │ │ │ ├── STM32F030x6.ld │ │ │ │ ├── STM32F030x8.ld │ │ │ │ ├── STM32F031x6.ld │ │ │ │ ├── STM32F042x6.ld │ │ │ │ ├── STM32F051x8.ld │ │ │ │ ├── STM32F070xB.ld │ │ │ │ ├── STM32F072xB.ld │ │ │ │ ├── STM32F091xC.ld │ │ │ │ ├── STM32F100xB.ld │ │ │ │ ├── STM32F103x8.ld │ │ │ │ ├── STM32F103xB.ld │ │ │ │ ├── STM32F103xB_maplemini_bootloader.ld │ │ │ │ ├── STM32F103xD.ld │ │ │ │ ├── STM32F103xE.ld │ │ │ │ ├── STM32F103xG.ld │ │ │ │ ├── STM32F107xC.ld │ │ │ │ ├── STM32F207xG.ld │ │ │ │ ├── STM32F302x8.ld │ │ │ │ ├── STM32F303x8.ld │ │ │ │ ├── STM32F303xC.ld │ │ │ │ ├── STM32F303xE.ld │ │ │ │ ├── STM32F334x8.ld │ │ │ │ ├── STM32F373xC.ld │ │ │ │ ├── STM32F401xC.ld │ │ │ │ ├── STM32F401xE.ld │ │ │ │ ├── STM32F405xG.ld │ │ │ │ ├── STM32F407xE.ld │ │ │ │ ├── STM32F407xG.ld │ │ │ │ ├── STM32F410x8.ld │ │ │ │ ├── STM32F410xB.ld │ │ │ │ ├── STM32F411xC.ld │ │ │ │ ├── STM32F411xE.ld │ │ │ │ ├── STM32F412xE.ld │ │ │ │ ├── STM32F412xG.ld │ │ │ │ ├── STM32F429xI.ld │ │ │ │ ├── STM32F446xC.ld │ │ │ │ ├── STM32F446xE.ld │ │ │ │ ├── STM32F469xI.ld │ │ │ │ ├── STM32F722xE.ld │ │ │ │ ├── STM32F746xG.ld │ │ │ │ ├── STM32F746xG_ETH.ld │ │ │ │ ├── STM32F746xG_MAX.ld │ │ │ │ ├── STM32F76xxG.ld │ │ │ │ ├── STM32F76xxI.ld │ │ │ │ ├── STM32H743xI.ld │ │ │ │ ├── STM32L011x3.ld │ │ │ │ ├── STM32L011x4.ld │ │ │ │ ├── STM32L031x4.ld │ │ │ │ ├── STM32L031x6.ld │ │ │ │ ├── STM32L052x6.ld │ │ │ │ ├── STM32L052x8.ld │ │ │ │ ├── STM32L053x6.ld │ │ │ │ ├── STM32L053x8.ld │ │ │ │ ├── STM32L073x8.ld │ │ │ │ ├── STM32L073xB.ld │ │ │ │ ├── STM32L073xZ.ld │ │ │ │ ├── STM32L151x6.ld │ │ │ │ ├── STM32L152xB.ld │ │ │ │ ├── STM32L152xE.ld │ │ │ │ ├── STM32L432xB.ld │ │ │ │ ├── STM32L432xC.ld │ │ │ │ ├── STM32L476xG.ld │ │ │ │ ├── STM32L496xG.ld │ │ │ │ ├── rules.ld │ │ │ │ ├── rules_code.ld │ │ │ │ ├── rules_data.ld │ │ │ │ └── rules_stacks.ld │ │ │ ├── mk │ │ │ │ ├── startup_stm32f0xx.mk │ │ │ │ ├── startup_stm32f1xx.mk │ │ │ │ ├── startup_stm32f2xx.mk │ │ │ │ ├── startup_stm32f3xx.mk │ │ │ │ ├── startup_stm32f4xx.mk │ │ │ │ ├── startup_stm32f7xx.mk │ │ │ │ ├── startup_stm32h7xx.mk │ │ │ │ ├── startup_stm32l0xx.mk │ │ │ │ ├── startup_stm32l1xx.mk │ │ │ │ └── startup_stm32l4xx.mk │ │ │ ├── rules.mk │ │ │ └── vectors.S │ │ ├── IAR │ │ │ ├── cstartup.s │ │ │ └── vectors.s │ │ └── RVCT │ │ │ ├── cstartup.s │ │ │ └── vectors.s │ └── devices │ │ ├── STM32F0xx │ │ └── cmparams.h │ │ ├── STM32F1xx │ │ └── cmparams.h │ │ ├── STM32F2xx │ │ └── cmparams.h │ │ ├── STM32F3xx │ │ └── cmparams.h │ │ ├── STM32F4xx │ │ └── cmparams.h │ │ ├── STM32F7xx │ │ └── cmparams.h │ │ ├── STM32H7xx │ │ └── cmparams.h │ │ ├── STM32L0xx │ │ └── cmparams.h │ │ ├── STM32L1xx │ │ └── cmparams.h │ │ └── STM32L4xx │ │ └── cmparams.h │ ├── SIMIA32 │ └── compilers │ │ └── GCC │ │ └── rules.mk │ └── e200 │ ├── compilers │ ├── CW │ │ ├── crt0.s │ │ ├── unhandled.s │ │ ├── vectors.h │ │ └── vectors.s │ ├── GCC │ │ ├── crt0.S │ │ ├── ld │ │ │ ├── SPC560B50.ld │ │ │ ├── SPC560B60.ld │ │ │ ├── SPC560B64.ld │ │ │ ├── SPC560D40.ld │ │ │ ├── SPC560P50.ld │ │ │ ├── SPC563M64.ld │ │ │ ├── SPC564A70.ld │ │ │ ├── SPC564A80.ld │ │ │ ├── SPC56EC74.ld │ │ │ ├── SPC56EL54_LSM.ld │ │ │ ├── SPC56EL60_LSM.ld │ │ │ ├── SPC56EL70_LSM.ld │ │ │ ├── SPC57EM80_HSM.ld │ │ │ ├── rules_z0.ld │ │ │ ├── rules_z3.ld │ │ │ └── rules_z4.ld │ │ ├── mk │ │ │ ├── startup_spc560bcxx.mk │ │ │ ├── startup_spc560bxx.mk │ │ │ ├── startup_spc560dxx.mk │ │ │ ├── startup_spc560pxx.mk │ │ │ ├── startup_spc563mxx.mk │ │ │ ├── startup_spc564axx.mk │ │ │ ├── startup_spc56ecxx.mk │ │ │ └── startup_spc56elxx.mk │ │ ├── rules.mk │ │ ├── vectors.S │ │ └── vectors.h │ └── GHS │ │ ├── crt0.s │ │ ├── ld │ │ ├── SPC560B50.ld │ │ ├── SPC560B60.ld │ │ ├── SPC560B64.ld │ │ ├── SPC560D40.ld │ │ ├── SPC560P50.ld │ │ └── SPC56EC74.ld │ │ ├── mk │ │ ├── startup_spc560bcxx.mk │ │ ├── startup_spc560bxx.mk │ │ ├── startup_spc560dxx.mk │ │ ├── startup_spc560pxx.mk │ │ ├── startup_spc563mxx.mk │ │ ├── startup_spc564axx.mk │ │ ├── startup_spc56ecxx.mk │ │ └── startup_spc56elxx.mk │ │ ├── rules.mk │ │ ├── vectors.h │ │ └── vectors.s │ └── devices │ ├── SPC560BCxx │ ├── boot.S │ ├── boot.h │ ├── intc.h │ └── ppcparams.h │ ├── SPC560Bxx │ ├── boot.S │ ├── boot.h │ ├── intc.h │ └── ppcparams.h │ ├── SPC560Dxx │ ├── boot.S │ ├── boot.h │ ├── boot_cw.s │ ├── boot_ghs.s │ ├── intc.h │ └── ppcparams.h │ ├── SPC560Pxx │ ├── boot.S │ ├── boot.h │ ├── intc.h │ └── ppcparams.h │ ├── SPC563Mxx │ ├── boot.S │ ├── boot.h │ ├── intc.h │ └── ppcparams.h │ ├── SPC564Axx │ ├── boot.S │ ├── boot.h │ ├── intc.h │ └── ppcparams.h │ ├── SPC56ECxx │ ├── boot.S │ ├── boot.h │ ├── boot_cw.s │ ├── boot_ghs.s │ ├── intc.h │ └── ppcparams.h │ └── SPC56ELxx │ ├── boot.S │ ├── boot.h │ ├── intc.h │ └── ppcparams.h ├── hal ├── hal.mk ├── include │ ├── hal.h │ ├── hal_adc.h │ ├── hal_buffers.h │ ├── hal_can.h │ ├── hal_channels.h │ ├── hal_crypto.h │ ├── hal_dac.h │ ├── hal_ext.h │ ├── hal_files.h │ ├── hal_gpt.h │ ├── hal_i2c.h │ ├── hal_i2s.h │ ├── hal_icu.h │ ├── hal_ioblock.h │ ├── hal_mac.h │ ├── hal_mii.h │ ├── hal_mmc_spi.h │ ├── hal_mmcsd.h │ ├── hal_objects.h │ ├── hal_pal.h │ ├── hal_pwm.h │ ├── hal_qspi.h │ ├── hal_queues.h │ ├── hal_rtc.h │ ├── hal_sdc.h │ ├── hal_serial.h │ ├── hal_serial_usb.h │ ├── hal_spi.h │ ├── hal_st.h │ ├── hal_streams.h │ ├── hal_uart.h │ ├── hal_usb.h │ ├── hal_usb_cdc.h │ └── hal_wdg.h ├── lib │ ├── complex │ │ ├── mfs │ │ │ ├── mfs.c │ │ │ ├── mfs.h │ │ │ └── mfs.mk │ │ └── readme.txt │ ├── fallback │ │ └── I2C │ │ │ ├── hal_i2c_lld.c │ │ │ └── hal_i2c_lld.h │ ├── peripherals │ │ ├── displays │ │ │ └── hal_displays.h │ │ ├── flash │ │ │ ├── hal_flash.c │ │ │ ├── hal_flash.h │ │ │ ├── hal_jesd216_flash.c │ │ │ └── hal_jesd216_flash.h │ │ └── sensors │ │ │ ├── hal_accelerometer.h │ │ │ ├── hal_barometer.h │ │ │ ├── hal_compass.h │ │ │ ├── hal_gyroscope.h │ │ │ ├── hal_hygrometer.h │ │ │ ├── hal_sensors.h │ │ │ └── hal_thermometer.h │ └── streams │ │ ├── chprintf.c │ │ ├── chprintf.h │ │ ├── memstreams.c │ │ ├── memstreams.h │ │ ├── nullstreams.c │ │ ├── nullstreams.h │ │ └── streams.mk ├── osal │ ├── lib │ │ ├── osal_vt.c │ │ └── osal_vt.h │ ├── nil │ │ ├── osal.c │ │ ├── osal.h │ │ └── osal.mk │ ├── os-less │ │ └── ARMCMx │ │ │ ├── osal.c │ │ │ ├── osal.h │ │ │ └── osal.mk │ └── rt │ │ ├── osal.c │ │ ├── osal.h │ │ └── osal.mk ├── ports │ ├── STM32 │ │ ├── LLD │ │ │ ├── ADCv1 │ │ │ │ ├── driver.mk │ │ │ │ ├── hal_adc_lld.c │ │ │ │ ├── hal_adc_lld.h │ │ │ │ └── notes.txt │ │ │ ├── ADCv2 │ │ │ │ ├── driver.mk │ │ │ │ ├── hal_adc_lld.c │ │ │ │ ├── hal_adc_lld.h │ │ │ │ └── notes.txt │ │ │ ├── ADCv3 │ │ │ │ ├── driver.mk │ │ │ │ ├── hal_adc_lld.c │ │ │ │ ├── hal_adc_lld.h │ │ │ │ └── notes.txt │ │ │ ├── ADCv4 │ │ │ │ ├── driver.mk │ │ │ │ ├── hal_adc_lld.c │ │ │ │ ├── hal_adc_lld.h │ │ │ │ └── notes.txt │ │ │ ├── BDMAv1 │ │ │ │ ├── driver.mk │ │ │ │ ├── notes.txt │ │ │ │ ├── stm32_bdma.c │ │ │ │ └── stm32_bdma.h │ │ │ ├── CANv1 │ │ │ │ ├── driver.mk │ │ │ │ ├── hal_can_lld.c │ │ │ │ └── hal_can_lld.h │ │ │ ├── CRYPv1 │ │ │ │ ├── driver.mk │ │ │ │ ├── hal_crypto_lld.c │ │ │ │ └── hal_crypto_lld.h │ │ │ ├── DACv1 │ │ │ │ ├── driver.mk │ │ │ │ ├── hal_dac_lld.c │ │ │ │ └── hal_dac_lld.h │ │ │ ├── DMAv1 │ │ │ │ ├── driver.mk │ │ │ │ ├── notes.txt │ │ │ │ ├── stm32_dma.c │ │ │ │ └── stm32_dma.h │ │ │ ├── DMAv2 │ │ │ │ ├── driver.mk │ │ │ │ ├── notes.txt │ │ │ │ ├── stm32_dma.c │ │ │ │ └── stm32_dma.h │ │ │ ├── DMAv3 │ │ │ │ ├── driver.mk │ │ │ │ ├── notes.txt │ │ │ │ ├── stm32_dma.c │ │ │ │ └── stm32_dma.h │ │ │ ├── EXTIv1 │ │ │ │ ├── driver.mk │ │ │ │ ├── hal_ext_lld.c │ │ │ │ ├── hal_ext_lld.h │ │ │ │ └── notes.txt │ │ │ ├── GPIOv1 │ │ │ │ ├── driver.mk │ │ │ │ ├── hal_pal_lld.c │ │ │ │ └── hal_pal_lld.h │ │ │ ├── GPIOv2 │ │ │ │ ├── driver.mk │ │ │ │ ├── hal_pal_lld.c │ │ │ │ ├── hal_pal_lld.h │ │ │ │ └── stm32_gpio.h │ │ │ ├── GPIOv3 │ │ │ │ ├── driver.mk │ │ │ │ ├── hal_pal_lld.c │ │ │ │ ├── hal_pal_lld.h │ │ │ │ └── stm32_gpio.h │ │ │ ├── I2Cv1 │ │ │ │ ├── driver.mk │ │ │ │ ├── hal_i2c_lld.c │ │ │ │ └── hal_i2c_lld.h │ │ │ ├── I2Cv2 │ │ │ │ ├── driver.mk │ │ │ │ ├── hal_i2c_lld.c │ │ │ │ └── hal_i2c_lld.h │ │ │ ├── I2Cv3 │ │ │ │ ├── driver.mk │ │ │ │ ├── hal_i2c_lld.c │ │ │ │ └── hal_i2c_lld.h │ │ │ ├── MACv1 │ │ │ │ ├── driver.mk │ │ │ │ ├── hal_mac_lld.c │ │ │ │ └── hal_mac_lld.h │ │ │ ├── OTGv1 │ │ │ │ ├── driver.mk │ │ │ │ ├── hal_usb_lld.c │ │ │ │ ├── hal_usb_lld.h │ │ │ │ └── stm32_otg.h │ │ │ ├── QUADSPIv1 │ │ │ │ ├── driver.mk │ │ │ │ ├── hal_qspi_lld.c │ │ │ │ └── hal_qspi_lld.h │ │ │ ├── RTCv1 │ │ │ │ ├── driver.mk │ │ │ │ ├── hal_rtc_lld.c │ │ │ │ └── hal_rtc_lld.h │ │ │ ├── RTCv2 │ │ │ │ ├── driver.mk │ │ │ │ ├── hal_rtc_lld.c │ │ │ │ └── hal_rtc_lld.h │ │ │ ├── SDIOv1 │ │ │ │ ├── driver.mk │ │ │ │ ├── hal_sdc_lld.c │ │ │ │ └── hal_sdc_lld.h │ │ │ ├── SDMMCv1 │ │ │ │ ├── driver.mk │ │ │ │ ├── hal_sdc_lld.c │ │ │ │ └── hal_sdc_lld.h │ │ │ ├── SPIv1 │ │ │ │ ├── driver.mk │ │ │ │ ├── hal_i2s_lld.c │ │ │ │ ├── hal_i2s_lld.h │ │ │ │ ├── hal_spi_lld.c │ │ │ │ └── hal_spi_lld.h │ │ │ ├── SPIv2 │ │ │ │ ├── driver.mk │ │ │ │ ├── hal_i2s_lld.c │ │ │ │ ├── hal_i2s_lld.h │ │ │ │ ├── hal_spi_lld.c │ │ │ │ └── hal_spi_lld.h │ │ │ ├── SPIv3 │ │ │ │ ├── driver.mk │ │ │ │ ├── hal_i2s_lld.c │ │ │ │ ├── hal_i2s_lld.h │ │ │ │ ├── hal_spi_lld.c │ │ │ │ └── hal_spi_lld.h │ │ │ ├── TIMv1 │ │ │ │ ├── driver.mk │ │ │ │ ├── hal_gpt_lld.c │ │ │ │ ├── hal_gpt_lld.h │ │ │ │ ├── hal_icu_lld.c │ │ │ │ ├── hal_icu_lld.h │ │ │ │ ├── hal_pwm_lld.c │ │ │ │ ├── hal_pwm_lld.h │ │ │ │ ├── hal_st_lld.c │ │ │ │ ├── hal_st_lld.h │ │ │ │ ├── stm32_tim.h │ │ │ │ └── tim_irq_mapping.txt │ │ │ ├── USARTv1 │ │ │ │ ├── driver.mk │ │ │ │ ├── hal_serial_lld.c │ │ │ │ ├── hal_serial_lld.h │ │ │ │ ├── hal_uart_lld.c │ │ │ │ └── hal_uart_lld.h │ │ │ ├── USARTv2 │ │ │ │ ├── driver.mk │ │ │ │ ├── hal_serial_lld.c │ │ │ │ ├── hal_serial_lld.h │ │ │ │ ├── hal_uart_lld.c │ │ │ │ └── hal_uart_lld.h │ │ │ ├── USBv1 │ │ │ │ ├── driver.mk │ │ │ │ ├── hal_usb_lld.c │ │ │ │ ├── hal_usb_lld.h │ │ │ │ └── stm32_usb.h │ │ │ └── xWDGv1 │ │ │ │ ├── driver.mk │ │ │ │ ├── hal_wdg_lld.c │ │ │ │ └── hal_wdg_lld.h │ │ └── STM32F4xx │ │ │ ├── hal_lld.c │ │ │ ├── hal_lld.h │ │ │ ├── platform.mk │ │ │ ├── stm32_isr.c │ │ │ ├── stm32_isr.h │ │ │ ├── stm32_rcc.h │ │ │ └── stm32_registry.h │ └── common │ │ └── ARMCMx │ │ ├── cache.h │ │ ├── mpu_v7m.h │ │ ├── nvic.c │ │ └── nvic.h ├── src │ ├── hal.c │ ├── hal_adc.c │ ├── hal_buffers.c │ ├── hal_can.c │ ├── hal_crypto.c │ ├── hal_dac.c │ ├── hal_ext.c │ ├── hal_gpt.c │ ├── hal_i2c.c │ ├── hal_i2s.c │ ├── hal_icu.c │ ├── hal_mac.c │ ├── hal_mmc_spi.c │ ├── hal_mmcsd.c │ ├── hal_pal.c │ ├── hal_pwm.c │ ├── hal_qspi.c │ ├── hal_queues.c │ ├── hal_rtc.c │ ├── hal_sdc.c │ ├── hal_serial.c │ ├── hal_serial_usb.c │ ├── hal_spi.c │ ├── hal_st.c │ ├── hal_uart.c │ ├── hal_usb.c │ └── hal_wdg.c └── templates │ ├── board │ ├── board.c │ ├── board.h │ └── board.mk │ ├── hal_adc_lld.c │ ├── hal_adc_lld.h │ ├── hal_can_lld.c │ ├── hal_can_lld.h │ ├── hal_crypto_lld.c │ ├── hal_crypto_lld.h │ ├── hal_dac_lld.c │ ├── hal_dac_lld.h │ ├── hal_ext_lld.c │ ├── hal_ext_lld.h │ ├── hal_gpt_lld.c │ ├── hal_gpt_lld.h │ ├── hal_i2c_lld.c │ ├── hal_i2c_lld.h │ ├── hal_i2s_lld.c │ ├── hal_i2s_lld.h │ ├── hal_icu_lld.c │ ├── hal_icu_lld.h │ ├── hal_lld.c │ ├── hal_lld.h │ ├── hal_mac_lld.c │ ├── hal_mac_lld.h │ ├── hal_pal_lld.c │ ├── hal_pal_lld.h │ ├── hal_pwm_lld.c │ ├── hal_pwm_lld.h │ ├── hal_qspi_lld.c │ ├── hal_qspi_lld.h │ ├── hal_rtc_lld.c │ ├── hal_rtc_lld.h │ ├── hal_sdc_lld.c │ ├── hal_sdc_lld.h │ ├── hal_serial_lld.c │ ├── hal_serial_lld.h │ ├── hal_spi_lld.c │ ├── hal_spi_lld.h │ ├── hal_st_lld.c │ ├── hal_st_lld.h │ ├── hal_uart_lld.c │ ├── hal_uart_lld.h │ ├── hal_usb_lld.c │ ├── hal_usb_lld.h │ ├── hal_wdg_lld.c │ ├── hal_wdg_lld.h │ ├── halconf.h │ ├── mcuconf.h │ ├── osal │ ├── osal.c │ ├── osal.h │ └── osal.mk │ └── platform.mk ├── license ├── chcustomer.h ├── chlicense.h ├── chversion.h └── license.mk ├── nil ├── include │ └── ch.h ├── nil.mk ├── src │ └── ch.c └── templates │ └── chconf.h ├── readme.txt ├── rt ├── include │ ├── ch.h │ ├── chalign.h │ ├── chchecks.h │ ├── chcond.h │ ├── chdebug.h │ ├── chdynamic.h │ ├── chevents.h │ ├── chmsg.h │ ├── chmtx.h │ ├── chregistry.h │ ├── chrestrictions.h │ ├── chschd.h │ ├── chsem.h │ ├── chstats.h │ ├── chsys.h │ ├── chsystypes.h │ ├── chthreads.h │ ├── chtime.h │ ├── chtm.h │ ├── chtrace.h │ └── chvt.h ├── rt.mk ├── src │ ├── chcond.c │ ├── chdebug.c │ ├── chdynamic.c │ ├── chevents.c │ ├── chmsg.c │ ├── chmtx.c │ ├── chregistry.c │ ├── chschd.c │ ├── chsem.c │ ├── chstats.c │ ├── chsys.c │ ├── chthreads.c │ ├── chtm.c │ ├── chtrace.c │ └── chvt.c └── templates │ ├── chconf.h │ └── meta │ ├── module.c │ └── module.h └── various ├── cpp_wrappers ├── ch.cpp ├── ch.hpp ├── chcpp.mk ├── syscalls_cpp.cpp └── syscalls_cpp.hpp ├── evtimer.c ├── evtimer.h ├── fatfs_bindings ├── fatfs.mk ├── fatfs_diskio.c ├── fatfs_syscall.c └── readme.txt ├── lwip_bindings ├── arch │ ├── cc.h │ ├── perf.h │ ├── sys_arch.c │ └── sys_arch.h ├── lwip.mk ├── lwipthread.c ├── lwipthread.h ├── readme.txt └── static_lwipopts.h ├── shell ├── shell.c ├── shell.h ├── shell.mk ├── shell_cmd.c └── shell_cmd.h ├── syscalls.c └── wolfssl_bindings ├── hwrng.c ├── user_settings.h ├── wolfssl.mk ├── wolfssl_chibios.c └── wolfssl_chibios.h /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: ReleaseBuildTest 2 | 3 | on: 4 | push: 5 | branches: [ "master" ] 6 | pull_request: 7 | branches: [ "master" ] 8 | 9 | env: 10 | BUILD_TYPE: Release 11 | 12 | jobs: 13 | build: 14 | runs-on: ubuntu-latest 15 | 16 | steps: 17 | - name: Install Arm GNU Toolchain (arm-none-eabi-gcc 2021.10) 18 | uses: carlosperate/arm-none-eabi-gcc-action@v1 19 | with: 20 | release: '10.3-2021.10' # <-- The compiler release to use 21 | 22 | - name: Install Ninja build system 23 | run: | 24 | sudo apt install ninja-build 25 | 26 | - name: Checkout `master` branch 27 | uses: actions/checkout@v3 28 | with: 29 | ref: 'master' 30 | 31 | - name: Configure CMake 32 | # Leave SDK_CLEAR_ENV to be unset to use the default compiler in this action 33 | run: cmake -B $GITHUB_WORKSPACE/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -GNinja $GITHUB_WORKSPACE 34 | 35 | - name: Build 36 | run: cmake --build $GITHUB_WORKSPACE/build --config ${{env.BUILD_TYPE}} 37 | 38 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Compiled Object files 5 | *.slo 6 | *.lo 7 | *.o 8 | *.obj 9 | 10 | # Precompiled Headers 11 | *.gch 12 | *.pch 13 | 14 | # Compiled Dynamic libraries 15 | *.so 16 | *.dylib 17 | *.dll 18 | 19 | # Fortran module files 20 | *.mod 21 | *.smod 22 | 23 | # Compiled Static libraries 24 | *.lai 25 | *.la 26 | *.a 27 | *.lib 28 | 29 | # Executables 30 | *.exe 31 | *.out 32 | *.app 33 | 34 | dev/.build 35 | build/ 36 | cmake-build-*/ 37 | .idea/ 38 | .metadata/ 39 | html/ 40 | 41 | .DS_Store 42 | openocd.log 43 | # to prevent adding cache 44 | .cache/ 45 | .vscode/ 46 | .editorconfig 47 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "Meta-Remote"] 2 | path = Meta-Remote 3 | url = git@github.com:Meta-Team/Meta-Remote.git 4 | branch = master 5 | -------------------------------------------------------------------------------- /cmsis/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB COMMON_FILES "dsp/src/CommonTables/*.c") 2 | file(GLOB MATRIX_FP32_FILES "dsp/src/MatrixFunctions/*f32.c") 3 | file(GLOB FAST_MATH_FP32_FILES "dsp/src/FastMathFunctions/*f32.c") 4 | add_library(CMSIS_DSP OBJECT ${COMMON_FILES} ${MATRIX_FP32_FILES} ${FAST_MATH_FP32_FILES}) 5 | target_include_directories(CMSIS_DSP PUBLIC 6 | ${CMAKE_CURRENT_SOURCE_DIR}/dsp/include) 7 | target_compile_definitions(CMSIS_DSP PUBLIC 8 | ARM_MATH_CM4 9 | ARM_MATH_MATRIX_CHECK 10 | ARM_MATH_ROUNDING 11 | __FPU_PRESENT=1U 12 | ) 13 | set_target_properties(CMSIS_DSP PROPERTIES LINKER_LANGUAGE C) -------------------------------------------------------------------------------- /compile_cli.sh: -------------------------------------------------------------------------------- 1 | repo_base=$(dirname $(realpath $0)) 2 | cd $repo_base 3 | # rm -rf build 4 | cmake -GNinja -Bbuild -DSDK_CLEAR_ENV=ON . 5 | cmake --build build 6 | -------------------------------------------------------------------------------- /config/RM_Board_F3X.cfg: -------------------------------------------------------------------------------- 1 | source [find interface/stlink.cfg] 2 | 3 | 4 | transport select hla_swd 5 | 6 | 7 | source [find target/stm32f3x.cfg] 8 | -------------------------------------------------------------------------------- /config/RM_F4_Stlink.cfg: -------------------------------------------------------------------------------- 1 | source [find interface/stlink.cfg] 2 | 3 | set WORKAREASIZE 0x8000 4 | 5 | transport select hla_swd 6 | 7 | # Enable debug when in low power modes 8 | set ENABLE_LOW_POWER 1 9 | 10 | # Stop Watchdog counters when halt 11 | set STOP_WATCHDOG 1 12 | 13 | # STLink Debug clock frequency 14 | set CLOCK_FREQ 1800 15 | 16 | # Use software system reset 17 | reset_config trst_only combined 18 | set CONNECT_UNDER_RESET 0 19 | 20 | source [find target/stm32f4x.cfg] 21 | 22 | stm32f4x.cpu configure -rtos chibios -------------------------------------------------------------------------------- /config/buzzer_sound_array_generator/buzzer_sound_array_generator.py: -------------------------------------------------------------------------------- 1 | import json 2 | 3 | """ 4 | This program convert Tone.js-friendly JSON into array of '{frequency, duration[ms]}, ' for buzzer. 5 | Each track is separated into different file 'id.c' 6 | 7 | [MidiConvert](https://tonejs.github.io/MidiConvert) 8 | [MIDI tuning standard - Wikipedia](https://en.wikipedia.org/wiki/MIDI_tuning_standard) 9 | 10 | """ 11 | 12 | note_counter = 0 # count to 7 and then print a new line 13 | 14 | 15 | def write_note(out_file, feq, duration): 16 | global note_counter 17 | out_file.write("{%4d, %4d}, " % (feq, duration)) 18 | print("%d, %d" % (feq, silent_time)) 19 | note_counter += 1 20 | if note_counter >= 7: 21 | out_file.write("\n") 22 | note_counter = 0 23 | 24 | 25 | with open("one.json", "r") as in_file: 26 | data = json.load(in_file) 27 | 28 | last_end_time = 0 29 | duration_factor = 0.9 # every duration is scaled by this factor 30 | 31 | for track in data["tracks"]: 32 | 33 | out_file = open("%s.c" % track["id"], "w") 34 | 35 | for note in track["notes"]: 36 | 37 | silent_time = round((float(note["time"]) - last_end_time) * duration_factor * 1000) 38 | if silent_time > 0: 39 | write_note(out_file, 0, silent_time) 40 | 41 | write_note(out_file, 42 | int((2 ** ((int(note["midi"]) - 69) / 12.0)) * 440), # frequency formula for MIDI 43 | round(float(note["duration"]) * duration_factor * 1000)) 44 | 45 | last_end_time = float(note["time"]) + float(note["duration"]) 46 | 47 | out_file.close() 48 | -------------------------------------------------------------------------------- /config/cmsis-dap.cfg: -------------------------------------------------------------------------------- 1 | source [find interface/cmsis-dap.cfg] 2 | 3 | set WORKAREASIZE 0x8000 4 | 5 | transport select swd 6 | 7 | # Enable debug when in low power modes 8 | set ENABLE_LOW_POWER 1 9 | 10 | # Stop Watchdog counters when halt 11 | set STOP_WATCHDOG 1 12 | 13 | # STLink Debug clock frequency 14 | set CLOCK_FREQ 1800 15 | 16 | # Use software system reset 17 | reset_config trst_only combined 18 | set CONNECT_UNDER_RESET 0 19 | 20 | source [find target/stm32f4x.cfg] 21 | 22 | stm32f4x.cpu configure -rtos chibios -------------------------------------------------------------------------------- /config/null_run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # ---------------------------------------------------------------- 4 | # This script do nothing 5 | # Set it as the executable for CLion target to enable "Run" command to perform as "Build" command 6 | # 7 | # Author: liuzikai 8 | # Date: July 17 2018 9 | # ---------------------------------------------------------------- -------------------------------------------------------------------------------- /config/openocd_connect_with_pipe.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # ---------------------------------------------------------------- 4 | # This script invokes openocd as the dbg server using pipe 5 | # 6 | # Author: liuzikai 7 | # Date: Aug 6 2018 8 | # 9 | # NOTICE: Please change the following directory to the absolute path of the project root BEFORE using this script. 10 | # ---------------------------------------------------------------- 11 | 12 | cd /Users/liuzikai/Documents/RoboMaster/Meta-Infantry 13 | openocd -l openocd.log -c "gdb_port pipe" -f config/RM_Board_Mac.cfg 14 | -------------------------------------------------------------------------------- /dev/application/param_adjusts/pa_gimbal.json: -------------------------------------------------------------------------------- 1 | { 2 | "project": "Infantry", 3 | "motor_config": [ 4 | { 5 | "motor_id": 0, 6 | "motor_name": "yaw" 7 | }, 8 | { 9 | "motor_id": 1, 10 | "motor_name": "pitch" 11 | }, 12 | { 13 | "motor_id": 2, 14 | "motor_name": "sub_pitch" 15 | }, 16 | { 17 | "motor_id": 3, 18 | "motor_name": "bullet" 19 | }, 20 | { 21 | "motor_id": 4, 22 | "motor_name": "fw_left" 23 | }, 24 | { 25 | "motor_id": 5, 26 | "motor_name": "fw_right" 27 | }, 28 | { 29 | "motor_id": 6, 30 | "motor_name": "ahrs" 31 | }, 32 | { 33 | "motor_id": 7, 34 | "motor_name": "gyro" 35 | }, 36 | { 37 | "motor_id": 8, 38 | "motor_name": "accel" 39 | }, 40 | { 41 | "motor_id": 9, 42 | "motor_name": "magnet" 43 | } 44 | ], 45 | "commands": [ 46 | "set_enable motor_id -> yaw pitch sub_pitch bullet fw_left fw_right", 47 | "set_disable motor_id -> yaw pitch sub_pitch bullet fw_left fw_right", 48 | "get_sid -> yaw pitch sub_pitch bullet fw_left fw_right", 49 | "fb_enable motor_id", 50 | "fb_disable motor_id", 51 | "set_pid motor_id pid_id ki kp kd i_limit out_limit -> yaw pitch sub_pitch bullet fw_left fw_right", 52 | "echo_pid motor_id pid_id -> yaw pitch sub_pitch bullet fw_left fw_right", 53 | "set_target_angle motor_id angle -> yaw pitch sub_pitch bullet", 54 | "echo_target_angle motor_id -> yaw pitch sub_pitch bullet", 55 | "echo_actual_angle motor_id -> yaw pitch sub_pitch bullet", 56 | "echo_raw_angle motor_id -> yaw pitch sub_pitch bullet" 57 | ] 58 | } -------------------------------------------------------------------------------- /dev/application/param_adjusts/pa_hero/can_motor_config.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by 钱晨 on 11/14/21. 3 | // 4 | 5 | #ifndef META_INFANTRY_CANBUS_MOTOR_CFG_H 6 | #define META_INFANTRY_CANBUS_MOTOR_CFG_H 7 | 8 | #include "can_motor_feedback.h" 9 | #include "pid_controller.hpp" 10 | 11 | class CANMotorCFG { 12 | public: 13 | enum motor_id_t { 14 | FL, 15 | FR, 16 | BR, 17 | BL, 18 | YAW, 19 | PITCH, 20 | SUB_PITCH, 21 | BULLET_LOADER, 22 | FW_UP, 23 | FW_DOWN, 24 | MOTOR_COUNT 25 | }; 26 | static CANMotorBase CANMotorProfile[MOTOR_COUNT]; 27 | 28 | // Parameters for double loop PID control. 29 | static PIDController::pid_params_t a2vParams [MOTOR_COUNT]; 30 | static PIDController::pid_params_t v2iParams [MOTOR_COUNT]; 31 | static bool enable_a2v[MOTOR_COUNT]; 32 | static bool enable_v2i[MOTOR_COUNT]; 33 | }; 34 | 35 | #endif //META_INFANTRY_CANBUS_MOTOR_CFG_H 36 | -------------------------------------------------------------------------------- /dev/application/param_adjusts/pa_hero/hardware_conf.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by 钱晨 on 3/16/22. 3 | // This file contains some feature enabling masks. 4 | // 5 | 6 | #ifndef META_INFANTRY_HARDWARE_CONF_H 7 | #define META_INFANTRY_HARDWARE_CONF_H 8 | 9 | #if !defined(ENABLE_VISION) || defined(__DOXYGEN__) 10 | #define ENABLE_VISION FALSE 11 | #endif 12 | 13 | #if !defined(ENABLE_REFEREE) || defined(__DOXYGEN__) 14 | #define ENABLE_REFEREE FALSE 15 | #endif 16 | 17 | #if !defined(ENABLE_AHRS) || defined(__DOXYGEN__) 18 | #define ENABLE_AHRS TRUE 19 | #endif 20 | 21 | #if !defined(ENABLE_SUBPITCH) || defined(__DOXYGEN__) 22 | #define ENABLE_SUBPITCH FALSE 23 | #endif 24 | 25 | #if !defined(ENABLE_CAPACITOR) || defined(__DOXYGEN__) 26 | #define ENABLE_CAPACITOR TRUE 27 | #endif 28 | 29 | #if !defined(ENABLE_USB_SHELL) || defined(__DOXYGEN__) 30 | #define ENABLE_USB_SHELL FALSE 31 | #endif 32 | 33 | #endif //META_INFANTRY_HARDWARE_CONF_H 34 | -------------------------------------------------------------------------------- /dev/application/param_adjusts/pa_hero/thread_priorities.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by liuzikai on 7/29/21. 3 | // 4 | 5 | #ifndef META_INFANTRY_THREAD_PRIORITIES_H 6 | #define META_INFANTRY_THREAD_PRIORITIES_H 7 | 8 | /// Thread Priority List 9 | #define THREAD_CAN1_RX_PRIO (HIGHPRIO - 1) 10 | #define THREAD_CAN2_RX_PRIO (HIGHPRIO - 2) 11 | 12 | #define THREAD_GIMBAL_SKD_PRIO (HIGHPRIO - 3) 13 | #define THREAD_CHASSIS_SKD_PRIO (HIGHPRIO - 4) 14 | #define THREAD_SHOOT_SKD_PRIO (HIGHPRIO - 5) 15 | #define THREAD_AHRS_PRIO (HIGHPRIO - 6) 16 | #define THREAD_MOTOR_SKD_PRIO (HIGHPRIO - 7) 17 | #define THREAD_FEEDBACK_SKD_PRIO (HIGHPRIO - 8) 18 | #define THREAD_BUTTON_DETECT_PRIO (HIGHPRIO - 9) 19 | 20 | #define THREAD_CHASSIS_LG_PRIO (HIGHPRIO - 10) 21 | #define THREAD_GIMBAL_LG_VISION_PRIO (HIGHPRIO - 11) 22 | #define THREAD_GIMBAL_BALLISTIC_PRIO (HIGHPRIO - 12) 23 | #define THREAD_MOTOR_LG_VISION_PRIO (HIGHPRIO - 13) 24 | #define THREAD_USER_PRIO (HIGHPRIO - 14) 25 | #define THREAD_USER_ACTION_PRIO (HIGHPRIO - 15) 26 | 27 | #define THREAD_VIRTUAL_COM_PRIO (NORMALPRIO) 28 | #define THREAD_SUPERCAP_INIT_PRIO (NORMALPRIO-1) 29 | #define THREAD_REFEREE_SKD_PRIO (NORMALPRIO-2) 30 | #define THREAD_VISION_SKD_PRIO (NORMALPRIO-3) 31 | 32 | #define THREAD_INSPECTOR_PRIO (LOWPRIO + 10) 33 | #define THREAD_COMMUNICATOR_PRIO (LOWPRIO + 9) 34 | #define THREAD_STUCK_DETECT_PRIO (LOWPRIO + 4) 35 | #define THREAD_SHOOT_BULLET_COUNTER_PRIO (LOWPRIO + 3) 36 | #define THREAD_SHOOT_LG_VISION_PRIO (LOWPRIO + 2) 37 | #define THREAD_SHELL_PRIO (LOWPRIO + 1) 38 | #define THREAD_BUZZER_SKD_PRIO (LOWPRIO) 39 | 40 | #endif //META_INFANTRY_THREAD_PRIORITIES_H 41 | -------------------------------------------------------------------------------- /dev/application/param_adjusts/pa_infantry.json: -------------------------------------------------------------------------------- 1 | { 2 | "project": "Infantry", 3 | "motor_config": [ 4 | { 5 | "motor_id": 0, 6 | "motor_name": "FL" 7 | }, 8 | { 9 | "motor_id": 1, 10 | "motor_name": "FR" 11 | }, 12 | { 13 | "motor_id": 2, 14 | "motor_name": "BR" 15 | }, 16 | { 17 | "motor_id": 3, 18 | "motor_name": "BL" 19 | }, 20 | { 21 | "motor_id": 4, 22 | "motor_name": "YAW" 23 | }, 24 | { 25 | "motor_id": 5, 26 | "motor_name": "PITCH" 27 | }, 28 | { 29 | "motor_id": 6, 30 | "motor_name": "BULLET_LOADER" 31 | }, 32 | { 33 | "motor_id": 7, 34 | "motor_name": "FW_UP" 35 | }, 36 | { 37 | "motor_id": 8, 38 | "motor_name": "FW_DOWN" 39 | } 40 | ], 41 | "commands": [ 42 | "remote_enable set_enable", 43 | "fb_enable motor_id", 44 | "fb_disable motor_id", 45 | // -> a b c, means only a b c have this command 46 | "set_target_angle motor_id target_angle", 47 | "set_target_vel motor_id target_velocity", 48 | //"set_enable_a motor_id set_enable -> yaw pitch bullet", 49 | "set_enable_v motor_id", 50 | "set_enable_a motor_id", 51 | "set_disable_v motor_id", 52 | "set_disable_a motor_id", 53 | "echo_raw_angle motor_id", 54 | "echo_actual_angle motor_id -> angle", 55 | "echo_pid motor_id pid_id", 56 | "set_pid motor_id pid_id kp ki kd i_limit out_limit" 57 | ] 58 | } -------------------------------------------------------------------------------- /dev/application/param_adjusts/pa_infantry/can_motor_config.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by 钱晨 on 11/14/21. 3 | // 4 | 5 | #ifndef META_INFANTRY_CANBUS_MOTOR_CFG_H 6 | #define META_INFANTRY_CANBUS_MOTOR_CFG_H 7 | 8 | #include "can_motor_feedback.h" 9 | #include "pid_controller.hpp" 10 | 11 | class CANMotorCFG { 12 | public: 13 | enum motor_id_t { 14 | FL, 15 | FR, 16 | BR, 17 | BL, 18 | YAW, 19 | PITCH, 20 | BULLET_LOADER, 21 | FW_UP, 22 | FW_DOWN, 23 | MOTOR_COUNT 24 | }; 25 | static CANMotorBase CANMotorProfile[MOTOR_COUNT]; 26 | 27 | // Parameters for double loop PID control. 28 | static PIDController::pid_params_t a2vParams [MOTOR_COUNT]; 29 | static PIDController::pid_params_t v2iParams [MOTOR_COUNT]; 30 | static bool enable_a2v[MOTOR_COUNT]; 31 | static bool enable_v2i[MOTOR_COUNT]; 32 | }; 33 | 34 | #endif //META_INFANTRY_CANBUS_MOTOR_CFG_H 35 | -------------------------------------------------------------------------------- /dev/application/param_adjusts/pa_infantry/hardware_conf.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by 钱晨 on 3/16/22. 3 | // This file contains some feature enabling masks. 4 | // 5 | 6 | #ifndef META_INFANTRY_HARDWARE_CONF_H 7 | #define META_INFANTRY_HARDWARE_CONF_H 8 | 9 | #if !defined(ENABLE_VISION) || defined(__DOXYGEN__) 10 | #define ENABLE_VISION FALSE 11 | #endif 12 | 13 | #if !defined(ENABLE_REFEREE) || defined(__DOXYGEN__) 14 | #define ENABLE_REFEREE FALSE 15 | #endif 16 | 17 | #if !defined(ENABLE_AHRS) || defined(__DOXYGEN__) 18 | #define ENABLE_AHRS TRUE 19 | #endif 20 | 21 | #if !defined(ENABLE_SUBPITCH) || defined(__DOXYGEN__) 22 | #define ENABLE_SUBPITCH FALSE 23 | #endif 24 | 25 | #if !defined(ENABLE_CAPACITOR) || defined(__DOXYGEN__) 26 | #define ENABLE_CAPACITOR TRUE 27 | #endif 28 | 29 | #if !defined(ENABLE_USB_SHELL) || defined(__DOXYGEN__) 30 | #define ENABLE_USB_SHELL FALSE 31 | #endif 32 | 33 | #endif //META_INFANTRY_HARDWARE_CONF_H 34 | -------------------------------------------------------------------------------- /dev/application/param_adjusts/pa_infantry/thread_priorities.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by liuzikai on 7/29/21. 3 | // 4 | 5 | #ifndef META_INFANTRY_THREAD_PRIORITIES_H 6 | #define META_INFANTRY_THREAD_PRIORITIES_H 7 | 8 | /// Thread Priority List 9 | #define THREAD_CAN1_RX_PRIO (HIGHPRIO - 1) 10 | #define THREAD_CAN2_RX_PRIO (HIGHPRIO - 2) 11 | 12 | #define THREAD_GIMBAL_SKD_PRIO (HIGHPRIO - 3) 13 | #define THREAD_CHASSIS_SKD_PRIO (HIGHPRIO - 4) 14 | #define THREAD_SHOOT_SKD_PRIO (HIGHPRIO - 5) 15 | #define THREAD_AHRS_PRIO (HIGHPRIO - 6) 16 | #define THREAD_MOTOR_SKD_PRIO (HIGHPRIO - 7) 17 | #define THREAD_FEEDBACK_SKD_PRIO (HIGHPRIO - 8) 18 | #define THREAD_BUTTON_DETECT_PRIO (HIGHPRIO - 9) 19 | 20 | #define THREAD_CHASSIS_LG_PRIO (HIGHPRIO - 10) 21 | #define THREAD_GIMBAL_LG_VISION_PRIO (HIGHPRIO - 11) 22 | #define THREAD_GIMBAL_BALLISTIC_PRIO (HIGHPRIO - 12) 23 | #define THREAD_MOTOR_LG_VISION_PRIO (HIGHPRIO - 13) 24 | #define THREAD_USER_PRIO (HIGHPRIO - 14) 25 | #define THREAD_USER_ACTION_PRIO (HIGHPRIO - 15) 26 | 27 | #define THREAD_VIRTUAL_COM_PRIO (NORMALPRIO) 28 | #define THREAD_SUPERCAP_INIT_PRIO (NORMALPRIO-1) 29 | #define THREAD_REFEREE_SKD_PRIO (NORMALPRIO-2) 30 | #define THREAD_VISION_SKD_PRIO (NORMALPRIO-3) 31 | 32 | #define THREAD_INSPECTOR_PRIO (LOWPRIO + 10) 33 | #define THREAD_COMMUNICATOR_PRIO (LOWPRIO + 9) 34 | #define THREAD_STUCK_DETECT_PRIO (LOWPRIO + 4) 35 | #define THREAD_SHOOT_BULLET_COUNTER_PRIO (LOWPRIO + 3) 36 | #define THREAD_SHOOT_LG_VISION_PRIO (LOWPRIO + 2) 37 | #define THREAD_SHELL_PRIO (LOWPRIO + 1) 38 | #define THREAD_BUZZER_SKD_PRIO (LOWPRIO) 39 | 40 | #endif //META_INFANTRY_THREAD_PRIORITIES_H 41 | -------------------------------------------------------------------------------- /dev/application/unit_tests/ut_ahrs/hardware_conf.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by 钱晨 on 3/16/22. 3 | // This file contains some feature enabling masks. 4 | // 5 | 6 | #ifndef META_INFANTRY_HARDWARE_CONF_H 7 | #define META_INFANTRY_HARDWARE_CONF_H 8 | 9 | #if !defined(ENABLE_USB_SHELL) || defined(__DOXYGEN__) 10 | #define ENABLE_USB_SHELL TRUE 11 | #endif 12 | 13 | #endif //META_INFANTRY_HARDWARE_CONF_H 14 | -------------------------------------------------------------------------------- /dev/application/unit_tests/ut_buzzer/hardware_conf.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by 钱晨 on 3/16/22. 3 | // This file contains some feature enabling masks. 4 | // 5 | 6 | #ifndef META_INFANTRY_HARDWARE_CONF_H 7 | #define META_INFANTRY_HARDWARE_CONF_H 8 | 9 | #if !defined(ENABLE_USB_SHELL) || defined(__DOXYGEN__) 10 | #define ENABLE_USB_SHELL TRUE 11 | #endif 12 | 13 | #endif //META_INFANTRY_HARDWARE_CONF_H 14 | -------------------------------------------------------------------------------- /dev/application/unit_tests/ut_chassis/can_motor_config.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by 钱晨 on 11/14/21. 3 | // 4 | 5 | #include "can_motor_config.h" 6 | 7 | CANMotorBase CANMotorCFG::CANMotorProfile[MOTOR_COUNT] = { 8 | {CANMotorBase::can_channel_1, 0x204, CANMotorBase::M3508, 3572}, 9 | {CANMotorBase::can_channel_1, 0x203, CANMotorBase::M3508, 3572}, 10 | {CANMotorBase::can_channel_1, 0x202, CANMotorBase::M3508, 3572}, 11 | {CANMotorBase::can_channel_1, 0x201, CANMotorBase::M3508, 3572} 12 | }; 13 | 14 | PIDController::pid_params_t CANMotorCFG::a2vParams[MOTOR_COUNT] = { 15 | {10, 0.0f, 0.2, 100, 500}, 16 | {10, 0.0f, 0.2, 100, 500}, 17 | {10, 0.0f, 0.2, 100, 500}, 18 | {10, 0.0f, 0.2, 100, 500} 19 | }; 20 | 21 | PIDController::pid_params_t CANMotorCFG::v2iParams[MOTOR_COUNT] = { 22 | {26.0f,0.1f,0.02f,2000.0,6000.0}, 23 | {26.0f,0.1f,0.02f,2000.0,6000.0}, 24 | {26.0f,0.1f,0.02f,2000.0,6000.0}, 25 | {26.0f,0.1f,0.02f,2000.0,6000.0} 26 | }; 27 | 28 | bool CANMotorCFG::enable_a2v[MOTOR_COUNT] { 29 | false, 30 | false, 31 | false, 32 | false 33 | }; 34 | 35 | bool CANMotorCFG::enable_v2i[MOTOR_COUNT] { 36 | false, 37 | false, 38 | false, 39 | false 40 | }; -------------------------------------------------------------------------------- /dev/application/unit_tests/ut_chassis/can_motor_config.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by 钱晨 on 11/14/21. 3 | // 4 | 5 | #ifndef META_INFANTRY_CANBUS_MOTOR_CFG_H 6 | #define META_INFANTRY_CANBUS_MOTOR_CFG_H 7 | 8 | #include "can_motor_feedback.h" 9 | #include "pid_controller.hpp" 10 | 11 | class CANMotorCFG { 12 | public: 13 | enum motor_id_t { 14 | FL, 15 | FR, 16 | BR, 17 | BL, 18 | YAW, 19 | PITCH, 20 | MOTOR_COUNT 21 | }; 22 | static CANMotorBase CANMotorProfile[MOTOR_COUNT]; 23 | enum v2i_PID_status_t { 24 | DISABLED, 25 | WORKING, 26 | FUSION 27 | }; 28 | // Parameters for double loop PID control. 29 | static PIDController::pid_params_t a2vParams [MOTOR_COUNT]; 30 | static PIDController::pid_params_t v2iParams [MOTOR_COUNT]; 31 | static bool enable_a2v[MOTOR_COUNT]; 32 | static bool enable_v2i[MOTOR_COUNT]; 33 | }; 34 | 35 | #endif //META_INFANTRY_CANBUS_MOTOR_CFG_H 36 | -------------------------------------------------------------------------------- /dev/application/unit_tests/ut_chassis/hardware_conf.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by 钱晨 on 3/16/22. 3 | // This file contains some feature enabling masks. 4 | // 5 | 6 | #ifndef META_INFANTRY_HARDWARE_CONF_H 7 | #define META_INFANTRY_HARDWARE_CONF_H 8 | 9 | #if !defined(ENABLE_VISION) || defined(__DOXYGEN__) 10 | #define ENABLE_VISION FALSE 11 | #endif 12 | 13 | #if !defined(ENABLE_REFEREE) || defined(__DOXYGEN__) 14 | #define ENABLE_REFEREE FALSE 15 | #endif 16 | 17 | #if !defined(ENABLE_SUBPITCH) || defined(__DOXYGEN__) 18 | #define ENABLE_SUBPITCH FALSE 19 | #endif 20 | 21 | #if !defined(ENABLE_CAPACITOR) || defined(__DOXYGEN__) 22 | #define ENABLE_CAPACITOR FALSE 23 | #endif 24 | 25 | #if !defined(ENABLE_USB_SHELL) || defined(__DOXYGEN__) 26 | #define ENABLE_USB_SHELL TRUE 27 | #endif 28 | 29 | #endif //META_INFANTRY_HARDWARE_CONF_H 30 | -------------------------------------------------------------------------------- /dev/application/unit_tests/ut_damiao_motor/damiao_motor_config.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Wu Feiyang on 7/13/23. 3 | // 4 | 5 | #ifndef META_DAMIAO_MOTOR_CFG_H 6 | #define META_DAMIAO_MOTOR_CFG_H 7 | 8 | /** 9 | * Damiao 4310 motor. 10 | */ 11 | #include "hal.h" 12 | #define can_channel_1 &CAND1 13 | #define can_channel_2 &CAND2 14 | 15 | typedef enum motor_mode{ 16 | MIT_MODE, 17 | POS_VEL_MODE, 18 | VEL_MODE, 19 | }motor_mode_t; 20 | 21 | class DamiaoMotorBase{ 22 | public: 23 | CANDriver* can_driver; 24 | int masterID; 25 | int slaveID; 26 | float mitKp; 27 | float mitKd; 28 | float V_max; // maximum rotation speed. Unit is Rad/s. 29 | float P_max; // maximum Position. Unit is Rad. 30 | float T_max; // maximum Torque. Unit is N*m. 31 | float initial_encoder_angle; 32 | motor_mode_t mode; 33 | float kp_min; 34 | float kp_max; 35 | float kd_min; 36 | float kd_max; 37 | }; 38 | 39 | class DamiaoMotorCFG{ 40 | public: 41 | enum MotorName{ 42 | YAW, 43 | PITCH, 44 | MOTOR_COUNT, 45 | }motor_usage_t; 46 | /*** 47 | * @brief Motor Configuration 48 | * The unit of all velocity is Rad/s, unit of P_MAX must be exactly identical to the value with that of the Damiao Offical tool, 49 | * whose unit is by defualt Rad. All unit of torque is N * m. The unit of @param initial_encoder_angle is degree. 50 | */ 51 | static constexpr DamiaoMotorBase motorCfg[MOTOR_COUNT] = { 52 | {can_channel_1,0x00,0x01,1.0,0.3,30,3.141953,10.0, 53 | 55.26,POS_VEL_MODE,0.0,500.0,0.0,5.0}, 54 | {can_channel_2,0x00,0x01,0.0,0.0,30,3.141593,10.0, 55 | 0.0,VEL_MODE,0.0,500.0,0.0,5.0} 56 | }; 57 | }; 58 | 59 | #endif //META_DAMIAO_MOTOR_CFG_H 60 | -------------------------------------------------------------------------------- /dev/application/unit_tests/ut_damiao_motor/hardware_conf.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by 钱晨 on 3/16/22. 3 | // This file contains some feature enabling masks. 4 | // 5 | 6 | #ifndef META_INFANTRY_HARDWARE_CONF_H 7 | #define META_INFANTRY_HARDWARE_CONF_H 8 | 9 | #if !defined(ENABLE_VISION) || defined(__DOXYGEN__) 10 | #define ENABLE_VISION FALSE 11 | #endif 12 | 13 | #if !defined(ENABLE_REFEREE) || defined(__DOXYGEN__) 14 | #define ENABLE_REFEREE TRUE 15 | #endif 16 | 17 | #if !defined(ENABLE_AHRS) || defined(__DOXYGEN__) 18 | #define ENABLE_AHRS TRUE 19 | #endif 20 | 21 | #if !defined(ENABLE_SUBPITCH) || defined(__DOXYGEN__) 22 | #define ENABLE_SUBPITCH FALSE 23 | #endif 24 | 25 | #if !defined(ENABLE_CAPACITOR) || defined(__DOXYGEN__) 26 | #define ENABLE_CAPACITOR TRUE 27 | #endif 28 | 29 | #if !defined(ENABLE_USB_SHELL) || defined(__DOXYGEN__) 30 | #define ENABLE_USB_SHELL TRUE 31 | #endif 32 | 33 | #endif //META_INFANTRY_HARDWARE_CONF_H 34 | -------------------------------------------------------------------------------- /dev/application/unit_tests/ut_led/hardware_conf.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by 钱晨 on 3/16/22. 3 | // This file contains some feature enabling masks. 4 | // 5 | 6 | #ifndef META_INFANTRY_HARDWARE_CONF_H 7 | #define META_INFANTRY_HARDWARE_CONF_H 8 | 9 | #if !defined(ENABLE_VISION) || defined(__DOXYGEN__) 10 | #define ENABLE_VISION FALSE 11 | #endif 12 | 13 | #if !defined(ENABLE_REFEREE) || defined(__DOXYGEN__) 14 | #define ENABLE_REFEREE TRUE 15 | #endif 16 | 17 | #if !defined(ENABLE_SUBPITCH) || defined(__DOXYGEN__) 18 | #define ENABLE_SUBPITCH FALSE 19 | #endif 20 | 21 | #if !defined(ENABLE_CAPACITOR) || defined(__DOXYGEN__) 22 | #define ENABLE_CAPACITOR TRUE 23 | #endif 24 | 25 | #if !defined(ENABLE_USB_SHELL) || defined(__DOXYGEN__) 26 | #define ENABLE_USB_SHELL FALSE 27 | #endif 28 | 29 | #endif //META_INFANTRY_HARDWARE_CONF_H 30 | -------------------------------------------------------------------------------- /dev/application/unit_tests/ut_oled/hardware_conf.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by 钱晨 on 3/16/22. 3 | // This file contains some feature enabling masks. 4 | // 5 | 6 | #ifndef META_INFANTRY_HARDWARE_CONF_H 7 | #define META_INFANTRY_HARDWARE_CONF_H 8 | 9 | #if !defined(ENABLE_VISION) || defined(__DOXYGEN__) 10 | #define ENABLE_VISION FALSE 11 | #endif 12 | 13 | #if !defined(ENABLE_REFEREE) || defined(__DOXYGEN__) 14 | #define ENABLE_REFEREE TRUE 15 | #endif 16 | 17 | #if !defined(ENABLE_SUBPITCH) || defined(__DOXYGEN__) 18 | #define ENABLE_SUBPITCH FALSE 19 | #endif 20 | 21 | #if !defined(ENABLE_CAPACITOR) || defined(__DOXYGEN__) 22 | #define ENABLE_CAPACITOR TRUE 23 | #endif 24 | 25 | #if !defined(ENABLE_USB_SHELL) || defined(__DOXYGEN__) 26 | #define ENABLE_USB_SHELL FALSE 27 | #endif 28 | 29 | #endif //META_INFANTRY_HARDWARE_CONF_H 30 | -------------------------------------------------------------------------------- /dev/application/unit_tests/ut_referee_if/hardware_conf.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by 钱晨 on 3/16/22. 3 | // This file contains some feature enabling masks. 4 | // 5 | 6 | #ifndef META_INFANTRY_HARDWARE_CONF_H 7 | #define META_INFANTRY_HARDWARE_CONF_H 8 | 9 | #if !defined(ENABLE_VISION) || defined(__DOXYGEN__) 10 | #define ENABLE_VISION FALSE 11 | #endif 12 | 13 | #if !defined(ENABLE_REFEREE) || defined(__DOXYGEN__) 14 | #define ENABLE_REFEREE TRUE 15 | #endif 16 | 17 | #if !defined(ENABLE_SUBPITCH) || defined(__DOXYGEN__) 18 | #define ENABLE_SUBPITCH FALSE 19 | #endif 20 | 21 | #if !defined(ENABLE_CAPACITOR) || defined(__DOXYGEN__) 22 | #define ENABLE_CAPACITOR TRUE 23 | #endif 24 | 25 | #if !defined(ENABLE_USB_SHELL) || defined(__DOXYGEN__) 26 | #define ENABLE_USB_SHELL TRUE 27 | #endif 28 | 29 | #endif //META_INFANTRY_HARDWARE_CONF_H 30 | -------------------------------------------------------------------------------- /dev/application/unit_tests/ut_remote_if/hardware_conf.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by 钱晨 on 3/16/22. 3 | // This file contains some feature enabling masks. 4 | // 5 | 6 | #ifndef META_INFANTRY_HARDWARE_CONF_H 7 | #define META_INFANTRY_HARDWARE_CONF_H 8 | 9 | #if !defined(ENABLE_VISION) || defined(__DOXYGEN__) 10 | #define ENABLE_VISION FALSE 11 | #endif 12 | 13 | #if !defined(ENABLE_REFEREE) || defined(__DOXYGEN__) 14 | #define ENABLE_REFEREE TRUE 15 | #endif 16 | 17 | #if !defined(ENABLE_SUBPITCH) || defined(__DOXYGEN__) 18 | #define ENABLE_SUBPITCH FALSE 19 | #endif 20 | 21 | #if !defined(ENABLE_CAPACITOR) || defined(__DOXYGEN__) 22 | #define ENABLE_CAPACITOR TRUE 23 | #endif 24 | 25 | #if !defined(ENABLE_USB_SHELL) || defined(__DOXYGEN__) 26 | #define ENABLE_USB_SHELL TRUE 27 | #endif 28 | 29 | #endif //META_INFANTRY_HARDWARE_CONF_H 30 | -------------------------------------------------------------------------------- /dev/application/unit_tests/ut_rudder/hardware_conf.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by 钱晨 on 3/16/22. 3 | // This file contains some feature enabling masks. 4 | // 5 | 6 | #ifndef META_INFANTRY_HARDWARE_CONF_H 7 | #define META_INFANTRY_HARDWARE_CONF_H 8 | 9 | #if !defined(ENABLE_VISION) || defined(__DOXYGEN__) 10 | #define ENABLE_VISION FALSE 11 | #endif 12 | 13 | #if !defined(ENABLE_REFEREE) || defined(__DOXYGEN__) 14 | #define ENABLE_REFEREE TRUE 15 | #endif 16 | 17 | #if !defined(ENABLE_SUBPITCH) || defined(__DOXYGEN__) 18 | #define ENABLE_SUBPITCH FALSE 19 | #endif 20 | 21 | #if !defined(ENABLE_CAPACITOR) || defined(__DOXYGEN__) 22 | #define ENABLE_CAPACITOR TRUE 23 | #endif 24 | 25 | #if !defined(ENABLE_USB_SHELL) || defined(__DOXYGEN__) 26 | #define ENABLE_USB_SHELL TRUE 27 | #endif 28 | 29 | #endif //META_INFANTRY_HARDWARE_CONF_H 30 | -------------------------------------------------------------------------------- /dev/application/unit_tests/ut_rudder/main.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Wu Feiyang on 2023/7/11. 3 | // 4 | 5 | /** 6 | * @brief This is example code to use the Rudder Interface. 7 | */ 8 | 9 | #include "hal.h" 10 | #include "ch.hpp" 11 | #include "rudder_interface.h" 12 | 13 | 14 | int main(){ 15 | halInit(); 16 | chibios_rt::System::init(); 17 | 18 | Rudder::init(); 19 | Rudder rudder1(&PWMD4,0,Rudder::MG995); 20 | Rudder rudder2(&PWMD4,1,Rudder::MG995); 21 | rudder1.enable(); 22 | rudder2.enable(); 23 | Rudder::start(&PWMD4, nullptr); 24 | rudder1.set_rudder_angle(0); 25 | rudder2.set_rudder_angle(90); 26 | while(1){ 27 | chThdSleepMilliseconds(2000); 28 | rudder1.set_rudder_angle(60); 29 | rudder2.set_rudder_angle(0); 30 | chThdSleepMilliseconds(2000); 31 | rudder1.set_rudder_angle(120); 32 | rudder2.set_rudder_angle(90); 33 | chThdSleepMilliseconds(2000); 34 | rudder1.set_rudder_angle(60); 35 | rudder2.set_rudder_angle(180); 36 | chThdSleepMilliseconds(2000); 37 | rudder1.set_rudder_angle(0); 38 | rudder2.set_rudder_angle(90); 39 | 40 | 41 | } 42 | } 43 | 44 | -------------------------------------------------------------------------------- /dev/application/unit_tests/ut_sd_card/hardware_conf.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by 钱晨 on 3/16/22. 3 | // This file contains some feature enabling masks. 4 | // 5 | 6 | #ifndef META_INFANTRY_HARDWARE_CONF_H 7 | #define META_INFANTRY_HARDWARE_CONF_H 8 | 9 | #if !defined(ENABLE_VISION) || defined(__DOXYGEN__) 10 | #define ENABLE_VISION FALSE 11 | #endif 12 | 13 | #if !defined(ENABLE_REFEREE) || defined(__DOXYGEN__) 14 | #define ENABLE_REFEREE TRUE 15 | #endif 16 | 17 | #if !defined(ENABLE_SUBPITCH) || defined(__DOXYGEN__) 18 | #define ENABLE_SUBPITCH FALSE 19 | #endif 20 | 21 | #if !defined(ENABLE_CAPACITOR) || defined(__DOXYGEN__) 22 | #define ENABLE_CAPACITOR TRUE 23 | #endif 24 | 25 | #if !defined(ENABLE_USB_SHELL) || defined(__DOXYGEN__) 26 | #define ENABLE_USB_SHELL TRUE 27 | #endif 28 | 29 | #endif //META_INFANTRY_HARDWARE_CONF_H 30 | -------------------------------------------------------------------------------- /dev/application/unit_tests/ut_sentry_chassis/can_motor_config.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Quoke on 8/1/2022. 3 | // 4 | 5 | #include "can_motor_config.h" 6 | 7 | CANMotorBase CANMotorCFG::CANMotorProfile[MOTOR_COUNT] = { 8 | {CANMotorBase::can_channel_1, 0x201, CANMotorBase::M3508, 0}, 9 | {CANMotorBase::can_channel_1, 0x202, CANMotorBase::M3508, 0}, 10 | }; 11 | 12 | PIDController::pid_params_t CANMotorCFG::v2iParams[MOTOR_COUNT] = { 13 | {26.0f,0.1f,0.02f,2000.0,6000.0}, 14 | {26.0f,0.1f,0.02f,2000.0,6000.0}, 15 | }; 16 | 17 | PIDController::pid_params_t CANMotorCFG::a2vParams[MOTOR_COUNT] = { 18 | {10, 0.0f, 0.2, 100, 500}, 19 | {10, 0.0f, 0.2, 100, 500}, 20 | }; 21 | 22 | bool CANMotorCFG::enable_a2v[MOTOR_COUNT] = { 23 | false, 24 | false 25 | }; 26 | 27 | bool CANMotorCFG::enable_v2i[MOTOR_COUNT] = { 28 | false, 29 | false 30 | }; -------------------------------------------------------------------------------- /dev/application/unit_tests/ut_sentry_chassis/can_motor_config.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Quoke on 8/1/2022. 3 | // Added by Tony Zhang 4 | // Note, this Unit test is deprecated since advance of new sentry 5 | 6 | #ifndef META_EMBEDDED_CAN_MOTOR_CONFIG_H 7 | #define META_EMBEDDED_CAN_MOTOR_CONFIG_H 8 | 9 | #include "can_motor_feedback.h" 10 | #include "pid_controller.hpp" 11 | 12 | class CANMotorCFG { 13 | public: 14 | enum motor_id_t { 15 | LEFT, 16 | RIGHT, 17 | MOTOR_COUNT 18 | }; 19 | static CANMotorBase CANMotorProfile[MOTOR_COUNT]; 20 | 21 | // Parameters for double loop PID control. 22 | static PIDController::pid_params_t a2vParams [MOTOR_COUNT]; 23 | static PIDController::pid_params_t v2iParams [MOTOR_COUNT]; 24 | static bool enable_a2v[MOTOR_COUNT]; 25 | static bool enable_v2i[MOTOR_COUNT]; 26 | }; 27 | 28 | 29 | #endif //META_EMBEDDED_CAN_MOTOR_CONFIG_H 30 | -------------------------------------------------------------------------------- /dev/application/unit_tests/ut_sentry_chassis/hardware_conf.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by 钱晨 on 3/16/22. 3 | // This file contains some feature enabling masks. 4 | // 5 | 6 | #ifndef META_INFANTRY_HARDWARE_CONF_H 7 | #define META_INFANTRY_HARDWARE_CONF_H 8 | 9 | #if !defined(ENABLE_VISION) || defined(__DOXYGEN__) 10 | #define ENABLE_VISION FALSE 11 | #endif 12 | 13 | #if !defined(ENABLE_REFEREE) || defined(__DOXYGEN__) 14 | #define ENABLE_REFEREE FALSE 15 | #endif 16 | 17 | #if !defined(ENABLE_SUBPITCH) || defined(__DOXYGEN__) 18 | #define ENABLE_SUBPITCH FALSE 19 | #endif 20 | 21 | #if !defined(ENABLE_CAPACITOR) || defined(__DOXYGEN__) 22 | #define ENABLE_CAPACITOR FALSE 23 | #endif 24 | 25 | #if !defined(ENABLE_USB_SHELL) || defined(__DOXYGEN__) 26 | #define ENABLE_USB_SHELL FALSE 27 | #endif 28 | 29 | #endif //META_INFANTRY_HARDWARE_CONF_H 30 | -------------------------------------------------------------------------------- /dev/application/unit_tests/ut_steer_chassis/can_motor_config.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by 钱晨 on 11/14/21. 3 | // 4 | 5 | #ifndef META_INFANTRY_CANBUS_MOTOR_CFG_H 6 | #define META_INFANTRY_CANBUS_MOTOR_CFG_H 7 | 8 | #include "can_motor_feedback.h" 9 | #include "pid_controller.hpp" 10 | 11 | class CANMotorCFG { 12 | public: 13 | enum motor_id_t { 14 | FL, 15 | FR, 16 | BR, 17 | BL, 18 | FLSTEER, 19 | FRSTEER, 20 | BRSTEER, 21 | BLSTEER, 22 | MOTOR_COUNT 23 | }; 24 | static CANMotorBase CANMotorProfile[MOTOR_COUNT]; 25 | enum v2i_PID_status_t { 26 | DISABLED, 27 | WORKING, 28 | FUSION 29 | }; 30 | // Parameters for double loop PID control. 31 | static PIDController::pid_params_t a2vParams [MOTOR_COUNT]; 32 | static PIDController::pid_params_t v2iParams [MOTOR_COUNT]; 33 | static bool enable_a2v[MOTOR_COUNT]; 34 | static bool enable_v2i[MOTOR_COUNT]; 35 | }; 36 | 37 | #endif //META_INFANTRY_CANBUS_MOTOR_CFG_H 38 | -------------------------------------------------------------------------------- /dev/application/unit_tests/ut_steer_chassis/hardware_conf.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by 钱晨 on 3/16/22. 3 | // This file contains some feature enabling masks. 4 | // 5 | 6 | #ifndef META_INFANTRY_HARDWARE_CONF_H 7 | #define META_INFANTRY_HARDWARE_CONF_H 8 | 9 | #if !defined(ENABLE_VISION) || defined(__DOXYGEN__) 10 | #define ENABLE_VISION FALSE 11 | #endif 12 | 13 | #if !defined(ENABLE_REFEREE) || defined(__DOXYGEN__) 14 | #define ENABLE_REFEREE FALSE 15 | #endif 16 | 17 | #if !defined(ENABLE_SUBPITCH) || defined(__DOXYGEN__) 18 | #define ENABLE_SUBPITCH FALSE 19 | #endif 20 | 21 | #if !defined(ENABLE_CAPACITOR) || defined(__DOXYGEN__) 22 | #define ENABLE_CAPACITOR FALSE 23 | #endif 24 | 25 | #if !defined(ENABLE_USB_SHELL) || defined(__DOXYGEN__) 26 | #define ENABLE_USB_SHELL TRUE 27 | #endif 28 | 29 | #if !defined(ENABLE_AHRS) || defined(__DOXYGEN__) 30 | #define ENABLE_AHRS FALSE 31 | #endif 32 | 33 | #endif //META_INFANTRY_HARDWARE_CONF_H 34 | -------------------------------------------------------------------------------- /dev/application/unit_tests/ut_template.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by ... on YYYY/MM/DD. 3 | // 4 | 5 | /** 6 | * This file contain ... Unit Test. 7 | */ 8 | 9 | #include "ch.hpp" 10 | #include "hal.h" 11 | 12 | #include "interface/led/led.h" 13 | #include "debug/shell/shell.h" 14 | // Other headers here 15 | 16 | using namespace chibios_rt; 17 | 18 | /** 19 | * @brief Shell command template 20 | * @param argc Number of input parameters 21 | * @param argv Input parameters in string. 22 | */ 23 | DEF_SHELL_CMD_START(cmd_template) 24 | Shell::printf("_t:Template" ENDL); 25 | DEF_SHELL_CMD_END 26 | 27 | 28 | // Shell commands to ... 29 | Shell::Command templateShellCommands[] = { 30 | {"_template", "_template [data] [input] [formate]", cmd_template, nullptr}, 31 | {nullptr, nullptr, nullptr, nullptr} // Null command in the end. 32 | }; 33 | 34 | 35 | // Thread to ... 36 | class TemplateThread : public BaseStaticThread <512> { 37 | private: 38 | void main() final { 39 | setName("template"); 40 | while (!shouldTerminate()) { 41 | sleep(TIME_MS2I(100)); 42 | } 43 | } 44 | } template_thread; 45 | 46 | 47 | int main(void) { 48 | halInit(); 49 | System::init(); 50 | 51 | // Start ChibiOS shell at high priority, so even if a thread stucks, we still have access to shell. 52 | Shell::start(HIGHPRIO); 53 | Shell::addCommands(templateShellCommands); 54 | 55 | template_thread.start(NORMALPRIO + 1); 56 | 57 | 58 | #if CH_CFG_NO_IDLE_THREAD // see chconf.h for what this #define means 59 | // ChibiOS idle thread has been disabled, main() should implement infinite loop 60 | while (true) {} 61 | #else 62 | // When main() quits, the main thread will somehow enter an infinite loop, so we set the priority to lowest 63 | // before quitting, to let other threads run normally 64 | BaseThread::setPriority(1); 65 | #endif 66 | return 0; 67 | } 68 | -------------------------------------------------------------------------------- /dev/application/unit_tests/ut_usb_com/hardware_conf.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by 钱晨 on 3/16/22. 3 | // This file contains some feature enabling masks. 4 | // 5 | 6 | #ifndef META_INFANTRY_HARDWARE_CONF_H 7 | #define META_INFANTRY_HARDWARE_CONF_H 8 | 9 | #if !defined(ENABLE_VISION) || defined(__DOXYGEN__) 10 | #define ENABLE_VISION FALSE 11 | #endif 12 | 13 | #if !defined(ENABLE_REFEREE) || defined(__DOXYGEN__) 14 | #define ENABLE_REFEREE FALSE 15 | #endif 16 | 17 | #if !defined(ENABLE_SUBPITCH) || defined(__DOXYGEN__) 18 | #define ENABLE_SUBPITCH FALSE 19 | #endif 20 | 21 | #if !defined(ENABLE_CAPACITOR) || defined(__DOXYGEN__) 22 | #define ENABLE_CAPACITOR FALSE 23 | #endif 24 | 25 | #if !defined(ENABLE_USB_SHELL) || defined(__DOXYGEN__) 26 | #define ENABLE_USB_SHELL FALSE 27 | #endif 28 | 29 | #endif //META_INFANTRY_HARDWARE_CONF_H 30 | -------------------------------------------------------------------------------- /dev/application/unit_tests/ut_usb_com/ut_usb.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Chen Qian on 11/18/21. 3 | // 4 | 5 | #include "ch.hpp" 6 | #include "hal.h" 7 | 8 | #include "interface/led/led.h" 9 | #include "interface/virtual_COM/VirtualCOMPort.h" 10 | #include "shell.h" 11 | // Other headers here 12 | 13 | using namespace chibios_rt; 14 | 15 | SerialUSBDriver SDU; 16 | 17 | class DataSendingThread : public BaseStaticThread<512> { 18 | void main() final { 19 | setName("DSendThd"); 20 | while(!shouldTerminate()) { 21 | sleep(TIME_MS2I(100)); 22 | Shell::printf("Buffer Content:" SHELL_NEWLINE_STR); 23 | for(int i = 0; i < 100; i++) { 24 | Shell::printf("%d ", VirtualCOMPort::rxbuffer[i]); 25 | } 26 | Shell::printf(SHELL_NEWLINE_STR); 27 | sleep(TIME_MS2I(100)); 28 | } 29 | } 30 | } dataSendingThread; 31 | 32 | int main(void) { 33 | halInit(); 34 | System::init(); 35 | VirtualCOMPort::init(&SDU, NORMALPRIO+1); 36 | dataSendingThread.start(NORMALPRIO+5); 37 | // Start ChibiOS shell at high priority, so even if a thread stucks, we still have access to shell. 38 | Shell::start(NORMALPRIO+10); 39 | 40 | #if CH_CFG_NO_IDLE_THREAD // see chconf.h for what this #define means 41 | // ChibiOS idle thread has been disabled, main() should implement infinite loop 42 | while (true) {} 43 | #else 44 | // When main() quits, the main thread will somehow enter an infinite loop, so we set the priority to lowest 45 | // before quitting, to let other threads run normally 46 | BaseThread::setPriority(1); 47 | #endif 48 | return 0; 49 | } 50 | -------------------------------------------------------------------------------- /dev/application/vehicles/aerial/settings_aerial.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Kerui Zhu on 7/19/2019. 3 | // 4 | 5 | #ifndef META_INFANTRY_SETTINGS_AERIAL_H 6 | #define META_INFANTRY_SETTINGS_AERIAL_H 7 | 8 | #include "ch.hpp" 9 | #include "hal.h" 10 | 11 | #include "shell.h" 12 | 13 | #include "user_aerial.h" 14 | 15 | void gimbal_get_config(BaseSequentialStream *chp, int argc, char *argv[]); 16 | void gimbal_set_config(BaseSequentialStream *chp, int argc, char *argv[]); 17 | 18 | void shoot_get_config(BaseSequentialStream *chp, int argc, char *argv[]); 19 | void shoot_set_config(BaseSequentialStream *chp, int argc, char *argv[]); 20 | 21 | extern ShellCommand mainProgramCommands[]; 22 | 23 | #endif //META_INFANTRY_SETTINGS_AERIAL_H 24 | -------------------------------------------------------------------------------- /dev/application/vehicles/auto_sentry/can_motor_config.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by 钱晨 on 11/14/21. 3 | // 4 | 5 | #include "can_motor_config.h" 6 | 7 | CANMotorBase CANMotorCFG::CANMotorProfile[MOTOR_COUNT] = { 8 | {CANMotorBase::can_channel_1, 0x204, CANMotorBase::M3508, 3572}, 9 | {CANMotorBase::can_channel_1, 0x203, CANMotorBase::M3508, 3572}, 10 | {CANMotorBase::can_channel_1, 0x202, CANMotorBase::M3508, 3572}, 11 | {CANMotorBase::can_channel_1, 0x201, CANMotorBase::M3508, 3572} 12 | }; 13 | 14 | PIDController::pid_params_t CANMotorCFG::a2vParams[MOTOR_COUNT] = { 15 | {10, 0.0f, 0.2, 100, 500}, 16 | {10, 0.0f, 0.2, 100, 500}, 17 | {10, 0.0f, 0.2, 100, 500}, 18 | {10, 0.0f, 0.2, 100, 500} 19 | }; 20 | 21 | PIDController::pid_params_t CANMotorCFG::v2iParams[MOTOR_COUNT] = { 22 | {26.0f,0.1f,0.02f,2000.0,6000.0}, 23 | {26.0f,0.1f,0.02f,2000.0,6000.0}, 24 | {26.0f,0.1f,0.02f,2000.0,6000.0}, 25 | {26.0f,0.1f,0.02f,2000.0,6000.0} 26 | }; 27 | 28 | bool CANMotorCFG::enable_a2v[MOTOR_COUNT] { 29 | false, 30 | false, 31 | false, 32 | false 33 | }; 34 | 35 | bool CANMotorCFG::enable_v2i[MOTOR_COUNT] { 36 | false, 37 | false, 38 | false, 39 | false 40 | }; -------------------------------------------------------------------------------- /dev/application/vehicles/auto_sentry/can_motor_config.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by 钱晨 on 11/14/21. 3 | // 4 | 5 | #ifndef META_INFANTRY_CANBUS_MOTOR_CFG_H 6 | #define META_INFANTRY_CANBUS_MOTOR_CFG_H 7 | 8 | #include "can_motor_feedback.h" 9 | #include "pid_controller.hpp" 10 | 11 | class CANMotorCFG { 12 | public: 13 | enum motor_id_t { 14 | FL, 15 | FR, 16 | BR, 17 | BL, 18 | YAW, 19 | PITCH, 20 | MOTOR_COUNT 21 | }; 22 | static CANMotorBase CANMotorProfile[MOTOR_COUNT]; 23 | enum v2i_PID_status_t { 24 | DISABLED, 25 | WORKING, 26 | FUSION 27 | }; 28 | // Parameters for double loop PID control. 29 | static PIDController::pid_params_t a2vParams [MOTOR_COUNT]; 30 | static PIDController::pid_params_t v2iParams [MOTOR_COUNT]; 31 | static bool enable_a2v[MOTOR_COUNT]; 32 | static bool enable_v2i[MOTOR_COUNT]; 33 | }; 34 | 35 | #endif //META_INFANTRY_CANBUS_MOTOR_CFG_H 36 | -------------------------------------------------------------------------------- /dev/application/vehicles/auto_sentry/hardware_conf.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by 钱晨 on 3/16/22. 3 | // This file contains some feature enabling masks. 4 | // 5 | 6 | #ifndef META_INFANTRY_HARDWARE_CONF_H 7 | #define META_INFANTRY_HARDWARE_CONF_H 8 | 9 | #if !defined(ENABLE_VISION) || defined(__DOXYGEN__) 10 | #define ENABLE_VISION FALSE 11 | #endif 12 | 13 | #if !defined(ENABLE_REFEREE) || defined(__DOXYGEN__) 14 | #define ENABLE_REFEREE FALSE 15 | #endif 16 | 17 | #if !defined(ENABLE_SUBPITCH) || defined(__DOXYGEN__) 18 | #define ENABLE_SUBPITCH FALSE 19 | #endif 20 | 21 | #if !defined(ENABLE_CAPACITOR) || defined(__DOXYGEN__) 22 | #define ENABLE_CAPACITOR FALSE 23 | #endif 24 | 25 | #if !defined(ENABLE_USB_SHELL) || defined(__DOXYGEN__) 26 | #define ENABLE_USB_SHELL TRUE 27 | #endif 28 | 29 | #endif //META_INFANTRY_HARDWARE_CONF_H 30 | -------------------------------------------------------------------------------- /dev/application/vehicles/dart/can_motor_config.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Wu Feiyang on 7/6/23. 3 | // 4 | 5 | #include "can_motor_config.h" 6 | 7 | CANMotorBase CANMotorCFG::CANMotorProfile[MOTOR_COUNT] = { 8 | {CANMotorBase::can_channel_1, 0x206, CANMotorBase::GM6020, 1419}, 9 | {CANMotorBase::can_channel_1, 0x201, CANMotorBase::M3508, 0}, 10 | {CANMotorBase::can_channel_1, 0x202, CANMotorBase::M3508, 0}, 11 | {CANMotorBase::can_channel_1, 0x203, CANMotorBase::M2006, 0}, 12 | }; 13 | 14 | PIDController::pid_params_t CANMotorCFG::a2vParams[MOTOR_COUNT] = { 15 | {20, 0.0f, 500, 000, 550}, 16 | {20, 0, 0.2, 100, 3000}, 17 | {20, 0, 0.2, 100, 3000}, 18 | {10, 0, 0.2, 100, 500}, 19 | }; 20 | 21 | PIDController::pid_params_t CANMotorCFG::v2iParams[MOTOR_COUNT] = { 22 | {15.0f,0.0f,5.0f,5000,30000.0}, 23 | {50.0f, 0.1f, 0.02f, 2000.0, 6000.0}, 24 | {50.0f, 0.1f, 0.02f, 2000.0, 6000.0}, 25 | {26.0f, 0.1f, 0.02f, 2000.0, 6000.0}, 26 | }; 27 | 28 | bool CANMotorCFG::enable_a2v[MOTOR_COUNT] {false}; 29 | 30 | bool CANMotorCFG::enable_v2i[MOTOR_COUNT] {false}; -------------------------------------------------------------------------------- /dev/application/vehicles/dart/can_motor_config.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Wu Feiyang on 7/6/23. 3 | // 4 | 5 | #ifndef META_INFANTRY_CANBUS_MOTOR_CFG_H 6 | #define META_INFANTRY_CANBUS_MOTOR_CFG_H 7 | 8 | #include "can_motor_feedback.h" 9 | #include "pid_controller.hpp" 10 | 11 | class CANMotorCFG { 12 | public: 13 | enum motor_id_t { 14 | YAW, 15 | STORE_ENERGY_LEFT, 16 | STORE_ENERGY_RIGHT, 17 | TRIGGER_ADJUST, 18 | MOTOR_COUNT 19 | }; 20 | static CANMotorBase CANMotorProfile[MOTOR_COUNT]; 21 | 22 | // Parameters for double loop PID control. 23 | static PIDController::pid_params_t a2vParams [MOTOR_COUNT]; 24 | static PIDController::pid_params_t v2iParams [MOTOR_COUNT]; 25 | static bool enable_a2v[MOTOR_COUNT]; 26 | static bool enable_v2i[MOTOR_COUNT]; 27 | }; 28 | 29 | #endif //META_INFANTRY_CANBUS_MOTOR_CFG_H 30 | -------------------------------------------------------------------------------- /dev/application/vehicles/dart/damiao_motor_config.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Wu Feiyang on 7/13/23. 3 | // 4 | 5 | #ifndef META_DAMIAO_MOTOR_CFG_H 6 | #define META_DAMIAO_MOTOR_CFG_H 7 | 8 | /** 9 | * Damiao 4310 motor. 10 | */ 11 | #include "hal.h" 12 | #define can_channel_1 &CAND1 13 | #define can_channel_2 &CAND2 14 | 15 | typedef enum motor_mode{ 16 | MIT_MODE, 17 | POS_VEL_MODE, 18 | VEL_MODE, 19 | }motor_mode_t; 20 | 21 | class DamiaoMotorBase{ 22 | public: 23 | CANDriver* can_driver; 24 | int masterID; 25 | int slaveID; 26 | float mitKp; 27 | float mitKd; 28 | float V_max; // maximum rotation speed. Unit is Rad/s. 29 | float P_max; // maximum Position. Unit is Rad. 30 | float T_max; // maximum Torque. Unit is N*m. 31 | float initial_encoder_angle; 32 | motor_mode_t mode; 33 | float kp_min; 34 | float kp_max; 35 | float kd_min; 36 | float kd_max; 37 | }; 38 | 39 | class DamiaoMotorCFG{ 40 | public: 41 | enum MotorName{ 42 | DART_LOADER, 43 | MOTOR_COUNT, 44 | }motor_usage_t; 45 | /*** 46 | * @brief Motor Configuration 47 | * The unit of all velocity is Rad/s, unit of P_MAX must be exactly identical to the value with that of the Damiao Offical tool, 48 | * whose unit is by defualt Rad. All unit of torque is N * m. The unit of @param initial_encoder_angle is degree. 49 | */ 50 | static constexpr DamiaoMotorBase motorCfg[MOTOR_COUNT] = { 51 | {can_channel_2,0x00,0x01,1.0,0.3,30,3.141953,10.0, 52 | -124.74,POS_VEL_MODE,0.0,500.0,0.0,5.0}, 53 | }; 54 | }; 55 | 56 | #endif //META_DAMIAO_MOTOR_CFG_H 57 | -------------------------------------------------------------------------------- /dev/application/vehicles/dart/hardware_conf.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by 钱晨 on 3/16/22. 3 | // This file contains some feature enabling masks. 4 | // 5 | 6 | #ifndef META_INFANTRY_HARDWARE_CONF_H 7 | #define META_INFANTRY_HARDWARE_CONF_H 8 | 9 | #if !defined(ENABLE_VISION) || defined(__DOXYGEN__) 10 | #define ENABLE_VISION FALSE 11 | #endif 12 | 13 | #if !defined(ENABLE_REFEREE) || defined(__DOXYGEN__) 14 | #define ENABLE_REFEREE TRUE 15 | #endif 16 | 17 | #if !defined(ENABLE_AHRS) || defined(__DOXYGEN__) 18 | #define ENABLE_AHRS TRUE 19 | #endif 20 | 21 | #if !defined(ENABLE_SUBPITCH) || defined(__DOXYGEN__) 22 | #define ENABLE_SUBPITCH FALSE 23 | #endif 24 | 25 | #if !defined(ENABLE_CAPACITOR) || defined(__DOXYGEN__) 26 | #define ENABLE_CAPACITOR TRUE 27 | #endif 28 | 29 | #if !defined(ENABLE_USB_SHELL) || defined(__DOXYGEN__) 30 | #define ENABLE_USB_SHELL TRUE 31 | #endif 32 | 33 | #endif //META_INFANTRY_HARDWARE_CONF_H 34 | -------------------------------------------------------------------------------- /dev/application/vehicles/dart/thread_priorities.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Wu Feiyang on 6/26/2023. 3 | // 4 | 5 | #ifndef META_INFANTRY_THREAD_PRIORITIES_H 6 | #define META_INFANTRY_THREAD_PRIORITIES_H 7 | 8 | /// Thread Priority List 9 | #define THREAD_LED (HIGHPRIO - 1) 10 | #define THREAD_ALARM (HIGHPRIO - 2) 11 | 12 | #define THREAD_GIMBAL_SKD_PRIO (HIGHPRIO - 3) 13 | #define THREAD_CHASSIS_SKD_PRIO (HIGHPRIO - 4) 14 | 15 | 16 | #define THREAD_VIRTUAL_COM_PRIO (NORMALPRIO) 17 | #define THREAD_SUPERCAP_INIT_PRIO (NORMALPRIO-1) 18 | 19 | 20 | #define THREAD_INSPECTOR_PRIO (LOWPRIO + 10) 21 | #define THREAD_COMMUNICATOR_PRIO (LOWPRIO + 9) 22 | 23 | 24 | #endif //META_INFANTRY_THREAD_PRIORITIES_H 25 | -------------------------------------------------------------------------------- /dev/application/vehicles/dart/user_dart.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Wu Feiyang on 2023/7/11. 3 | // 4 | #ifndef META_EMBEDDED_USER_DART_H 5 | #define META_EMBEDDED_USER_DART_H 6 | #include "ch.hpp" 7 | #include "can_interface.h" 8 | #include "can_motor_interface.h" 9 | #include "can_motor_feedback.h" 10 | #include "can_motor_controller.h" 11 | #include "remote_interpreter.h" 12 | #include "referee_interface.h" 13 | #include "rudder/rudder_interface.h" 14 | 15 | 16 | class UserDart{ 17 | public: 18 | static void start(tprio_t user_thd_prio); 19 | private: 20 | class UserThread:public BaseStaticThread<512>{ 21 | public: 22 | static bool start_flag; 23 | private: 24 | void main() final; 25 | CANMotorFeedback feedback; 26 | int time; 27 | }; 28 | static bool timer_started; 29 | 30 | static UserThread userThread; 31 | 32 | static void return_puller(); 33 | 34 | 35 | }; 36 | 37 | 38 | #endif //META_EMBEDDED_USER_DART_H 39 | -------------------------------------------------------------------------------- /dev/application/vehicles/engineer/settings_engineer.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by liuzikai on 2019-07-12. 3 | // 4 | 5 | #ifndef META_INFANTRY_SETTINGS_INFANTRY_H 6 | #define META_INFANTRY_SETTINGS_INFANTRY_H 7 | 8 | #include "ch.hpp" 9 | #include "hal.h" 10 | 11 | #include "shell.h" 12 | 13 | #include "user_engineer.h" 14 | #include "engineer_interface.h" 15 | 16 | extern ShellCommand mainProgramCommands[]; 17 | 18 | void cmd_echo_dms(BaseSequentialStream *chp, int argc, char *argv[]); 19 | 20 | void cmd_change_door(BaseSequentialStream *chp, int argc, char *argv[]); 21 | 22 | void cmd_echo_sdcard(BaseSequentialStream *chp, int argc, char *argv[]); 23 | 24 | void cmd_clear_sdcard(BaseSequentialStream *chp, int argc, char *argv[]); 25 | 26 | 27 | 28 | #endif //META_INFANTRY_SETTINGS_INFANTRY_H 29 | -------------------------------------------------------------------------------- /dev/application/vehicles/haptic_device/AHRS_PARAMS.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by 钱晨 on 10/29/21. 3 | // 4 | 5 | #ifndef META_INFANTRY_AHRS_PARAMS_H 6 | #define META_INFANTRY_AHRS_PARAMS_H 7 | 8 | #define GIMBAL_ANGLE_INSTALLATION_MATRIX {{1.0f, 0.0f, 0.0f}, \ 9 | {0.0f, 1.0f, 0.0f}, \ 10 | {0.0f, 0.0f, -1.0f}} 11 | 12 | 13 | #define GIMBAL_GYRO_INSTALLATION_MATRIX {{0.0f, 1.0f, 0.0f}, \ 14 | {0.0f, 0.0f, -1.0f}, \ 15 | {-1.0f, 0.0f, 0.0f}} 16 | 17 | #define ON_BOARD_AHRS_MATRIX {{0.0f, -1.0f, 0.0f}, \ 18 | {1.0f, 0.0f, 0.0f}, \ 19 | {0.0f, 0.0f, 1.0f}} 20 | 21 | #define MPU6500_STORED_GYRO_BIAS {-1.006189346, 0.034967087, 0.724042654} 22 | 23 | #endif //META_INFANTRY_AHRS_PARAMS_H 24 | -------------------------------------------------------------------------------- /dev/application/vehicles/haptic_device/Communicator.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Quoke on 11/24/2021. 3 | // 4 | 5 | #ifndef META_INFANTRY_COMMUNICATOR_H 6 | #define META_INFANTRY_COMMUNICATOR_H 7 | 8 | #include "usb_serial_interface.h" 9 | #include "can_motor_config.h" 10 | #include "haptic_logic.h" 11 | 12 | using namespace chibios_rt; 13 | class Communicator { 14 | public: 15 | 16 | /** 17 | * @brief Initiate the communicator. 18 | */ 19 | static void init(tprio_t communicator_prio_, tprio_t rx_prio_); 20 | 21 | /** 22 | * @brief send_angles 23 | */ 24 | static uint8_t tx_angles[CANMotorCFG::MOTOR_COUNT*2+1]; 25 | 26 | static int16_t target_torque[CANMotorCFG::MOTOR_COUNT]; 27 | 28 | static uint8_t rxmode; 29 | 30 | static time_msecs_t last_update_time; 31 | 32 | static void send_data(uint8_t *data, unsigned int size); 33 | private: 34 | 35 | /** 36 | * @brief Transmit package size through VCP 37 | */ 38 | static const int pak_size = 5; 39 | 40 | /** 41 | * @brief VCP buffer. 42 | */ 43 | static uint8_t buffer[pak_size]; 44 | 45 | /** 46 | * @brief Rx Thread for CDC 47 | */ 48 | class RxThread : public BaseStaticThread<512> { 49 | void main() final; 50 | }; 51 | 52 | static RxThread rx_thd; 53 | /** 54 | * @brief TxRxThread for CDC 55 | */ 56 | class CommunicatorThd : public BaseStaticThread<512> { 57 | void main() final; 58 | }; 59 | 60 | static CommunicatorThd communicator_thd; 61 | 62 | }; 63 | 64 | 65 | #endif //META_INFANTRY_COMMUNICATOR_H 66 | -------------------------------------------------------------------------------- /dev/application/vehicles/haptic_device/DEBUG_CHECK.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by 钱晨 on 10/29/21. 3 | // 4 | 5 | #ifndef META_INFANTRY_DEBUG_CHECK_H 6 | #define META_INFANTRY_DEBUG_CHECK_H 7 | 8 | /// Dev Board LED Usage List 9 | #define DEV_BOARD_LED_SYSTEM_INIT 1 10 | #define DEV_BOARD_LED_CAN 2 11 | #define DEV_BOARD_LED_AHRS 3 12 | #define DEV_BOARD_LED_REMOTE 4 13 | #define DEV_BOARD_LED_GIMBAL 5 14 | #define DEV_BOARD_LED_CHASSIS 6 15 | #define DEV_BOARD_LED_REFEREE 7 // used in infantry ShootLG BulletCounterThread 16 | #define DEV_BOARD_LED_SD_CARD 8 17 | 18 | #endif //META_INFANTRY_DEBUG_CHECK_H 19 | -------------------------------------------------------------------------------- /dev/application/vehicles/haptic_device/Inspector.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by 钱晨 on 10/29/21. 3 | // 4 | 5 | #include "Inspector.h" 6 | #include "led.h" 7 | void Inspector::startup_check_motor() { 8 | time_msecs_t t = SYSTIME; 9 | while (WITHIN_RECENT_TIME(t, 20)) { 10 | for (auto & i : CANMotorIF::motor_feedback) { 11 | if (not WITHIN_RECENT_TIME(i.last_update_time, 5)) { 12 | // No feedback in last 5 ms (normal 1 ms) 13 | LOG_ERR("Startup - Motor offline."); 14 | t = SYSTIME; // reset the counter 15 | } 16 | } 17 | } 18 | } 19 | 20 | void Inspector::startup_check_VCP() { 21 | time_msecs_t t = SYSTIME; 22 | while (WITHIN_RECENT_TIME(t, 20)) { 23 | if(not WITHIN_RECENT_TIME(Communicator::last_update_time, 10)) { 24 | LOG_ERR("Startup - Virtual COM port not connected"); 25 | t = SYSTIME; 26 | } 27 | } 28 | } 29 | 30 | -------------------------------------------------------------------------------- /dev/application/vehicles/haptic_device/Inspector.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by 钱晨 on 10/29/21. 3 | // 4 | 5 | #ifndef META_INFANTRY_INSPECTOR_H 6 | #define META_INFANTRY_INSPECTOR_H 7 | 8 | #include "can_motor_interface.h" 9 | #include "Communicator.h" 10 | 11 | class Inspector { 12 | public: 13 | static void startup_check_VCP(); 14 | 15 | static void startup_check_motor(); 16 | }; 17 | 18 | 19 | #endif //META_INFANTRY_INSPECTOR_H 20 | -------------------------------------------------------------------------------- /dev/application/vehicles/haptic_device/can_motor_config.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Chen Qian on 10/29/21. 3 | // 4 | 5 | #include "can_motor_config.h" 6 | 7 | CANMotorBase CANMotorCFG::CANMotorProfile[MOTOR_COUNT] = { 8 | {CANMotorBase::can_channel_1, 0x205, CANMotorBase::M3508_without_deceleration, 0}, 9 | {CANMotorBase::can_channel_1, 0x202, CANMotorBase::M3508_without_deceleration, 0}, 10 | {CANMotorBase::can_channel_1, 0x203, CANMotorBase::M3508_without_deceleration, 0}, 11 | }; 12 | 13 | PIDController::pid_params_t CANMotorCFG::a2vParams[MOTOR_COUNT] = { 14 | {20, 0.0f, 0.5, 100, 500}, 15 | {20, 0.0f, 0.5, 100, 500}, 16 | {20, 0.0f, 0.5, 100, 500} 17 | }; 18 | 19 | PIDController::pid_params_t CANMotorCFG::v2iParams[MOTOR_COUNT] = { 20 | {25,0.4,0.000,13000.0,16000.0}, 21 | {25,0.4,0.000,13000.0,16000.0}, 22 | {25,0.4,0.000,13000.0,16000.0} 23 | }; 24 | 25 | bool CANMotorCFG::enable_a2v[MOTOR_COUNT] { 26 | false, 27 | false, 28 | false 29 | }; 30 | 31 | bool CANMotorCFG::enable_v2i[MOTOR_COUNT] { 32 | false, 33 | false, 34 | false 35 | }; -------------------------------------------------------------------------------- /dev/application/vehicles/haptic_device/can_motor_config.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by 钱晨 on 10/29/21. 3 | // 4 | 5 | #ifndef META_INFANTRY_CANBUS_MOTOR_CFG_H 6 | #define META_INFANTRY_CANBUS_MOTOR_CFG_H 7 | 8 | #include "can_motor_feedback.h" 9 | #include "pid_controller.hpp" 10 | 11 | class CANMotorCFG { 12 | public: 13 | enum motor_id_t { 14 | YAW, 15 | PITCH_L, 16 | PITCH_R, 17 | MOTOR_COUNT 18 | }; 19 | static CANMotorBase CANMotorProfile[MOTOR_COUNT]; 20 | 21 | // Parameters for double loop PID control. 22 | static PIDController::pid_params_t a2vParams [MOTOR_COUNT]; 23 | static PIDController::pid_params_t v2iParams [MOTOR_COUNT]; 24 | static bool enable_a2v[MOTOR_COUNT]; 25 | static bool enable_v2i[MOTOR_COUNT]; 26 | }; 27 | 28 | #endif //META_INFANTRY_CANBUS_MOTOR_CFG_H -------------------------------------------------------------------------------- /dev/application/vehicles/haptic_device/hardware_conf.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by 钱晨 on 3/16/22. 3 | // This file contains some feature enabling masks. 4 | // 5 | 6 | #ifndef META_INFANTRY_HARDWARE_CONF_H 7 | #define META_INFANTRY_HARDWARE_CONF_H 8 | 9 | #if !defined(ENABLE_VISION) || defined(__DOXYGEN__) 10 | #define ENABLE_VISION FALSE 11 | #endif 12 | 13 | #if !defined(ENABLE_REFEREE) || defined(__DOXYGEN__) 14 | #define ENABLE_REFEREE TRUE 15 | #endif 16 | 17 | #if !defined(ENABLE_SUBPITCH) || defined(__DOXYGEN__) 18 | #define ENABLE_SUBPITCH FALSE 19 | #endif 20 | 21 | #if !defined(ENABLE_CAPACITOR) || defined(__DOXYGEN__) 22 | #define ENABLE_CAPACITOR TRUE 23 | #endif 24 | 25 | #if !defined(ENABLE_USB_SHELL) || defined(__DOXYGEN__) 26 | #define ENABLE_USB_SHELL TRUE 27 | #endif 28 | 29 | #endif //META_INFANTRY_HARDWARE_CONF_H 30 | -------------------------------------------------------------------------------- /dev/application/vehicles/haptic_device/thread_priorities.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by liuzikai on 7/29/21. 3 | // 4 | 5 | #ifndef META_INFANTRY_THREAD_PRIORITIES_H 6 | #define META_INFANTRY_THREAD_PRIORITIES_H 7 | 8 | /// Thread Priority List 9 | #define THREAD_CAN1_RX_PRIO (HIGHPRIO - 1) 10 | #define THREAD_CAN1_TX_PRIO (HIGHPRIO - 2) 11 | #define THREAD_CAN2_RX_PRIO (HIGHPRIO - 3) 12 | #define THREAD_CAN2_TX_PRIO (HIGHPRIO - 4) 13 | #define THREAD_AHRS_PRIO (HIGHPRIO - 5) 14 | #define THREAD_MOTOR_SKD_PRIO (HIGHPRIO - 6) 15 | #define THREAD_FEEDBACK_SKD_PRIO (HIGHPRIO - 7) 16 | #define THREAD_BUTTON_DETECT_PRIO (HIGHPRIO - 8) 17 | #define THREAD_MOTOR_LG_VISION_PRIO (HIGHPRIO - 9) 18 | 19 | #define THREAD_VIRTUAL_COM_PRIO (NORMALPRIO) 20 | #define THREAD_INSPECTOR_PRIO (LOWPRIO + 10) 21 | #define THREAD_COMMUNICATOR_PRIO (LOWPRIO + 9) 22 | #define THREAD_SHOOT_BULLET_COUNTER_PRIO (LOWPRIO + 2) 23 | #define THREAD_SHELL_PRIO (LOWPRIO + 1) 24 | #define THREAD_BUZZER_SKD_PRIO (LOWPRIO) 25 | 26 | #endif //META_INFANTRY_THREAD_PRIORITIES_H 27 | -------------------------------------------------------------------------------- /dev/application/vehicles/hero/can_motor_config.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by 钱晨 on 11/14/21. 3 | // 4 | 5 | #ifndef META_INFANTRY_CANBUS_MOTOR_CFG_H 6 | #define META_INFANTRY_CANBUS_MOTOR_CFG_H 7 | 8 | #include "can_motor_feedback.h" 9 | #include "pid_controller.hpp" 10 | 11 | class CANMotorCFG { 12 | public: 13 | enum motor_id_t { 14 | FL, 15 | FR, 16 | BR, 17 | BL, 18 | YAW, 19 | PITCH, 20 | SUB_PITCH, 21 | BULLET_LOADER, 22 | FW_UP, 23 | FW_DOWN, 24 | MOTOR_COUNT 25 | }; 26 | static CANMotorBase CANMotorProfile[MOTOR_COUNT]; 27 | 28 | // Parameters for double loop PID control. 29 | static PIDController::pid_params_t a2vParams [MOTOR_COUNT]; 30 | static PIDController::pid_params_t v2iParams [MOTOR_COUNT]; 31 | static bool enable_a2v[MOTOR_COUNT]; 32 | static bool enable_v2i[MOTOR_COUNT]; 33 | }; 34 | 35 | #endif //META_INFANTRY_CANBUS_MOTOR_CFG_H 36 | -------------------------------------------------------------------------------- /dev/application/vehicles/hero/hardware_conf.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by 钱晨 on 3/16/22. 3 | // This file contains some feature enabling masks. 4 | // 5 | 6 | #ifndef META_INFANTRY_HARDWARE_CONF_H 7 | #define META_INFANTRY_HARDWARE_CONF_H 8 | 9 | #if !defined(ENABLE_VISION) || defined(__DOXYGEN__) 10 | #define ENABLE_VISION FALSE 11 | #endif 12 | 13 | #if !defined(ENABLE_REFEREE) || defined(__DOXYGEN__) 14 | #define ENABLE_REFEREE TRUE 15 | #endif 16 | 17 | #if !defined(ENABLE_AHRS) || defined(__DOXYGEN__) 18 | #define ENABLE_AHRS TRUE 19 | #endif 20 | 21 | #if !defined(ENABLE_SUBPITCH) || defined(__DOXYGEN__) 22 | #define ENABLE_SUBPITCH FALSE 23 | #endif 24 | 25 | #if !defined(ENABLE_CAPACITOR) || defined(__DOXYGEN__) 26 | #define ENABLE_CAPACITOR TRUE 27 | #endif 28 | 29 | #if !defined(ENABLE_USB_SHELL) || defined(__DOXYGEN__) 30 | #define ENABLE_USB_SHELL FALSE 31 | #endif 32 | 33 | #endif //META_INFANTRY_HARDWARE_CONF_H 34 | -------------------------------------------------------------------------------- /dev/application/vehicles/hero/inspector_hero.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by liuzikai on 2019-06-25. 3 | // Edited by Qian Chen & Mo Kanya on 2019-07-05 4 | // 5 | 6 | #ifndef META_INFANTRY_INSPECTOR_HERO_H 7 | #define META_INFANTRY_INSPECTOR_HERO_H 8 | 9 | #include "ch.hpp" 10 | 11 | #include "buzzer_scheduler.h" 12 | 13 | #include "can_interface.h" 14 | #include "ahrs_abstract.h" 15 | #include "remote_interpreter.h" 16 | #include "can_motor_interface.h" 17 | #include "referee_interface.h" 18 | 19 | #include "vehicle_hero.h" 20 | 21 | class InspectorH { 22 | 23 | public: 24 | 25 | static void init(CANInterface *can1_, CANInterface *can2_, AbstractAHRS *ahrs_); 26 | 27 | static void start_inspection(tprio_t thread_prio); 28 | 29 | static void startup_check_can(); 30 | static void startup_check_mpu(); 31 | static void startup_check_ist(); 32 | static void startup_check_remote(); 33 | 34 | static void startup_check_gimbal_feedback(); 35 | static void startup_check_chassis_feedback(); 36 | 37 | static bool gimbal_failure(); 38 | static bool chassis_failure(); 39 | static bool remote_failure(); 40 | 41 | private: 42 | 43 | static AbstractAHRS *ahrs; 44 | static CANInterface *can1; 45 | static CANInterface *can2; 46 | 47 | static bool gimbal_failure_; 48 | static bool chassis_failure_; 49 | static bool remote_failure_; 50 | 51 | static bool check_gimbal_failure(); 52 | static bool check_chassis_failure(); 53 | static bool check_remote_data_error(); 54 | 55 | /// Inspector Thread 56 | class InspectorThread : public chibios_rt::BaseStaticThread<512> { 57 | static constexpr unsigned INSPECTOR_THREAD_INTERVAL = 20; // [ms] 58 | void main(); 59 | }; 60 | 61 | static InspectorThread inspectorThread; 62 | 63 | }; 64 | 65 | 66 | #endif //META_INFANTRY_INSPECTOR_HERO_H 67 | -------------------------------------------------------------------------------- /dev/application/vehicles/hero/setting_hero.json: -------------------------------------------------------------------------------- 1 | { 2 | "project": "Hero", 3 | "motor_config": [ 4 | { 5 | "motor_id": 0, 6 | "motor_name": "yaw" 7 | }, 8 | { 9 | "motor_id": 1, 10 | "motor_name": "pitch" 11 | }, 12 | { 13 | "motor_id": 2, 14 | "motor_name": "front_right" 15 | }, 16 | { 17 | "motor_id": 3, 18 | "motor_name": "front_left" 19 | }, 20 | { 21 | "motor_id": 4, 22 | "motor_name": "back_left" 23 | }, 24 | { 25 | "motor_id": 5, 26 | "motor_name": "back_right" 27 | }, 28 | { 29 | "motor_id": 6, 30 | "motor_name": "ahrs" 31 | }, 32 | { 33 | "motor_id": 7, 34 | "motor_name": "gyro" 35 | }, 36 | { 37 | "motor_id": 8, 38 | "motor_name": "accel" 39 | }, 40 | { 41 | "motor_id": 9, 42 | "motor_name": "magnet" 43 | }, 44 | { 45 | "motor_id": 10, 46 | "motor_name": "vision_armor" 47 | }, 48 | { 49 | "motor_id": 11, 50 | "motor_name": "vision_velocity" 51 | }, 52 | { 53 | "motor_id": 12, 54 | "motor_name": "vision_last_gimbal" 55 | } 56 | ], 57 | "commands": [ 58 | "fb_enable motor_id", 59 | "fb_disable motor_id", 60 | "set_pid motor_id pid_id ki kp kd i_limit out_limit -> yaw pitch front_right front_left back_left back_right", 61 | "echo_param motor_id pid_id -> yaw pitch front_right front_left back_left back_right" 62 | ] 63 | } -------------------------------------------------------------------------------- /dev/application/vehicles/hero/thread_priorities.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by liuzikai on 7/29/21. 3 | // 4 | 5 | #ifndef META_INFANTRY_THREAD_PRIORITIES_H 6 | #define META_INFANTRY_THREAD_PRIORITIES_H 7 | 8 | /// Thread Priority List 9 | #define THREAD_CAN1_RX_PRIO (HIGHPRIO - 1) 10 | #define THREAD_CAN2_RX_PRIO (HIGHPRIO - 2) 11 | 12 | #define THREAD_GIMBAL_SKD_PRIO (HIGHPRIO - 3) 13 | #define THREAD_CHASSIS_SKD_PRIO (HIGHPRIO - 4) 14 | #define THREAD_SHOOT_SKD_PRIO (HIGHPRIO - 5) 15 | #define THREAD_AHRS_PRIO (HIGHPRIO - 6) 16 | #define THREAD_MOTOR_SKD_PRIO (HIGHPRIO - 7) 17 | #define THREAD_FEEDBACK_SKD_PRIO (HIGHPRIO - 8) 18 | #define THREAD_BUTTON_DETECT_PRIO (HIGHPRIO - 9) 19 | 20 | #define THREAD_CHASSIS_LG_PRIO (HIGHPRIO - 10) 21 | #define THREAD_MOTOR_LG_VISION_PRIO (HIGHPRIO - 11) 22 | #define THREAD_USER_PRIO (HIGHPRIO - 12) 23 | #define THREAD_USER_ACTION_PRIO (HIGHPRIO - 13) 24 | 25 | #define THREAD_VIRTUAL_COM_PRIO (NORMALPRIO) 26 | #define THREAD_SUPERCAP_INIT_PRIO (NORMALPRIO-1) 27 | #define THREAD_REFEREE_SKD_PRIO (NORMALPRIO-2) 28 | 29 | #define THREAD_INSPECTOR_PRIO (LOWPRIO + 10) 30 | #define THREAD_COMMUNICATOR_PRIO (LOWPRIO + 9) 31 | #define THREAD_STUCK_DETECT_PRIO (LOWPRIO + 4) 32 | #define THREAD_SHOOT_BULLET_COUNTER_PRIO (LOWPRIO + 3) 33 | #define THREAD_SHOOT_LG_VISION_PRIO (LOWPRIO + 2) 34 | #define THREAD_SHELL_PRIO (LOWPRIO + 1) 35 | #define THREAD_BUZZER_SKD_PRIO (LOWPRIO) 36 | 37 | #endif //META_INFANTRY_THREAD_PRIORITIES_H 38 | -------------------------------------------------------------------------------- /dev/application/vehicles/infantry/can_motor_config.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by 钱晨 on 11/14/21. 3 | // 4 | 5 | #ifndef META_INFANTRY_CANBUS_MOTOR_CFG_H 6 | #define META_INFANTRY_CANBUS_MOTOR_CFG_H 7 | 8 | #include "can_motor_feedback.h" 9 | #include "pid_controller.hpp" 10 | 11 | class CANMotorCFG { 12 | public: 13 | enum motor_id_t { 14 | FL, 15 | FR, 16 | BR, 17 | BL, 18 | YAW, 19 | PITCH, 20 | BULLET_LOADER, 21 | FW_UP, 22 | FW_DOWN, 23 | MOTOR_COUNT 24 | }; 25 | static CANMotorBase CANMotorProfile[MOTOR_COUNT]; 26 | 27 | // Parameters for double loop PID control. 28 | static PIDController::pid_params_t a2vParams [MOTOR_COUNT]; 29 | static PIDController::pid_params_t v2iParams [MOTOR_COUNT]; 30 | static bool enable_a2v[MOTOR_COUNT]; 31 | static bool enable_v2i[MOTOR_COUNT]; 32 | }; 33 | 34 | #endif //META_INFANTRY_CANBUS_MOTOR_CFG_H 35 | -------------------------------------------------------------------------------- /dev/application/vehicles/infantry/hardware_conf.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by 钱晨 on 3/16/22. 3 | // This file contains some feature enabling masks. 4 | // 5 | 6 | #ifndef META_INFANTRY_HARDWARE_CONF_H 7 | #define META_INFANTRY_HARDWARE_CONF_H 8 | 9 | #if !defined(ENABLE_VISION) || defined(__DOXYGEN__) 10 | #define ENABLE_VISION FALSE 11 | #endif 12 | 13 | #if !defined(ENABLE_REFEREE) || defined(__DOXYGEN__) 14 | #define ENABLE_REFEREE TRUE 15 | #endif 16 | 17 | #if !defined(ENABLE_AHRS) || defined(__DOXYGEN__) 18 | #define ENABLE_AHRS TRUE 19 | #endif 20 | 21 | #if !defined(ENABLE_SUBPITCH) || defined(__DOXYGEN__) 22 | #define ENABLE_SUBPITCH FALSE 23 | #endif 24 | 25 | #if !defined(ENABLE_CAPACITOR) || defined(__DOXYGEN__) 26 | #define ENABLE_CAPACITOR TRUE 27 | #endif 28 | 29 | #if !defined(ENABLE_USB_SHELL) || defined(__DOXYGEN__) 30 | #define ENABLE_USB_SHELL FALSE 31 | #endif 32 | 33 | #endif //META_INFANTRY_HARDWARE_CONF_H 34 | -------------------------------------------------------------------------------- /dev/application/vehicles/infantry/inspector_infantry.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by liuzikai on 2019-06-25. 3 | // 4 | 5 | #ifndef META_INFANTRY_INSPECTOR_INFANTRY_H 6 | #define META_INFANTRY_INSPECTOR_INFANTRY_H 7 | 8 | #include "ch.hpp" 9 | 10 | #include "buzzer_scheduler.h" 11 | 12 | #include "can_interface.h" 13 | #include "ahrs_abstract.h" 14 | #include "remote_interpreter.h" 15 | #include "can_motor_interface.h" 16 | 17 | #include "referee_interface.h" 18 | 19 | #if defined(INFANTRY) 20 | #include "vehicle_infantry.h" 21 | #else 22 | #error "Files inspector_infantry.h/cpp should only be used for Infantry main program" 23 | #endif 24 | 25 | class InspectorI { 26 | 27 | public: 28 | 29 | static void init(CANInterface *can1_, CANInterface *can2_, AbstractAHRS *ahrs_); 30 | 31 | static void start_inspection(tprio_t thread_prio); 32 | 33 | static void startup_check_can(); 34 | static void startup_check_mpu(); 35 | static void startup_check_ist(); 36 | static void startup_check_remote(); 37 | static void startup_check_gimbal_feedback(); 38 | static void startup_check_chassis_feedback(); 39 | 40 | static bool gimbal_failure(); 41 | static bool chassis_failure(); 42 | static bool remote_failure(); 43 | 44 | private: 45 | 46 | static AbstractAHRS *ahrs; 47 | static CANInterface *can1; 48 | static CANInterface *can2; 49 | 50 | static bool gimbal_failure_; 51 | static bool chassis_failure_; 52 | static bool remote_failure_; 53 | 54 | static bool check_gimbal_failure(); 55 | static bool check_chassis_failure(); 56 | static bool check_remote_data_error(); 57 | 58 | /// Inspector Thread 59 | class InspectorThread : public chibios_rt::BaseStaticThread<512> { 60 | static constexpr unsigned INSPECTOR_THREAD_INTERVAL = 20; // [ms] 61 | void main(); 62 | }; 63 | 64 | static InspectorThread inspectorThread; 65 | 66 | }; 67 | 68 | 69 | #endif //META_INFANTRY_INSPECTOR_INFANTRY_H 70 | -------------------------------------------------------------------------------- /dev/application/vehicles/infantry/setting_infantry.json: -------------------------------------------------------------------------------- 1 | { 2 | "project": "Infantry", 3 | "motor_config": [ 4 | { 5 | "motor_id": 0, 6 | "motor_name": "yaw" 7 | }, 8 | { 9 | "motor_id": 1, 10 | "motor_name": "pitch" 11 | }, 12 | { 13 | "motor_id": 2, 14 | "motor_name": "front_right" 15 | }, 16 | { 17 | "motor_id": 3, 18 | "motor_name": "front_left" 19 | }, 20 | { 21 | "motor_id": 4, 22 | "motor_name": "back_left" 23 | }, 24 | { 25 | "motor_id": 5, 26 | "motor_name": "back_right" 27 | }, 28 | { 29 | "motor_id": 6, 30 | "motor_name": "ahrs" 31 | }, 32 | { 33 | "motor_id": 7, 34 | "motor_name": "gyro" 35 | }, 36 | { 37 | "motor_id": 8, 38 | "motor_name": "accel" 39 | }, 40 | { 41 | "motor_id": 9, 42 | "motor_name": "magnet" 43 | }, 44 | { 45 | "motor_id": 10, 46 | "motor_name": "vision_armor" 47 | }, 48 | { 49 | "motor_id": 11, 50 | "motor_name": "vision_velocity" 51 | }, 52 | { 53 | "motor_id": 12, 54 | "motor_name": "vision_shoot" 55 | }, 56 | { 57 | "motor_id": 8, 58 | "motor_id": 13, 59 | "motor_name": "vision_command" 60 | } 61 | ], 62 | "commands": [ 63 | "fb_enable motor_id", 64 | "fb_disable motor_id", 65 | "set_pid motor_id pid_id kp ki kd i_limit out_limit" 66 | "set_pid motor_id pid_id ki kp kd i_limit out_limit -> yaw pitch front_right front_left back_left back_right", 67 | "echo_param motor_id pid_id -> yaw pitch front_right front_left back_left back_right" 68 | ] 69 | } -------------------------------------------------------------------------------- /dev/application/vehicles/infantry/thread_priorities.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by liuzikai on 7/29/21. 3 | // 4 | 5 | #ifndef META_INFANTRY_THREAD_PRIORITIES_H 6 | #define META_INFANTRY_THREAD_PRIORITIES_H 7 | 8 | /// Thread Priority List 9 | #define THREAD_CAN1_RX_PRIO (HIGHPRIO - 1) 10 | #define THREAD_CAN2_RX_PRIO (HIGHPRIO - 2) 11 | 12 | #define THREAD_GIMBAL_SKD_PRIO (HIGHPRIO - 3) 13 | #define THREAD_CHASSIS_SKD_PRIO (HIGHPRIO - 4) 14 | #define THREAD_SHOOT_SKD_PRIO (HIGHPRIO - 5) 15 | #define THREAD_AHRS_PRIO (HIGHPRIO - 6) 16 | #define THREAD_MOTOR_SKD_PRIO (HIGHPRIO - 7) 17 | #define THREAD_FEEDBACK_SKD_PRIO (HIGHPRIO - 8) 18 | #define THREAD_BUTTON_DETECT_PRIO (HIGHPRIO - 9) 19 | 20 | #define THREAD_CHASSIS_LG_PRIO (HIGHPRIO - 10) 21 | #define THREAD_GIMBAL_LG_VISION_PRIO (HIGHPRIO - 11) 22 | #define THREAD_GIMBAL_BALLISTIC_PRIO (HIGHPRIO - 12) 23 | #define THREAD_MOTOR_LG_VISION_PRIO (HIGHPRIO - 13) 24 | #define THREAD_USER_PRIO (HIGHPRIO - 14) 25 | #define THREAD_USER_ACTION_PRIO (HIGHPRIO - 15) 26 | 27 | #define THREAD_VIRTUAL_COM_PRIO (NORMALPRIO) 28 | #define THREAD_SUPERCAP_INIT_PRIO (NORMALPRIO-1) 29 | #define THREAD_REFEREE_SKD_PRIO (NORMALPRIO-2) 30 | #define THREAD_VISION_SKD_PRIO (NORMALPRIO-3) 31 | 32 | #define THREAD_INSPECTOR_PRIO (LOWPRIO + 10) 33 | #define THREAD_COMMUNICATOR_PRIO (LOWPRIO + 9) 34 | #define THREAD_STUCK_DETECT_PRIO (LOWPRIO + 4) 35 | #define THREAD_SHOOT_BULLET_COUNTER_PRIO (LOWPRIO + 3) 36 | #define THREAD_SHOOT_LG_VISION_PRIO (LOWPRIO + 2) 37 | #define THREAD_SHELL_PRIO (LOWPRIO + 1) 38 | #define THREAD_BUZZER_SKD_PRIO (LOWPRIO) 39 | 40 | #endif //META_INFANTRY_THREAD_PRIORITIES_H 41 | -------------------------------------------------------------------------------- /dev/application/vehicles/sentry/can_motor_config.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by 钱晨 on 11/14/21. 3 | // 4 | 5 | #include "can_motor_config.h" 6 | 7 | CANMotorBase CANMotorCFG::CANMotorProfile[MOTOR_COUNT] = { 8 | {CANMotorBase::can_channel_1, 0x202, CANMotorBase::M3508, 3572}, 9 | {CANMotorBase::can_channel_1, 0x201, CANMotorBase::M3508, 3572}, 10 | {CANMotorBase::can_channel_2, 0x205, CANMotorBase::GM6020, 95}, 11 | {CANMotorBase::can_channel_1, 0x209, CANMotorBase::GM6020, 2200}, 12 | {CANMotorBase::can_channel_1, 0x207, CANMotorBase::M2006, 3572}, 13 | {CANMotorBase::can_channel_2, 0x204, CANMotorBase::M3508_without_deceleration, 3572}, 14 | {CANMotorBase::can_channel_2, 0x203, CANMotorBase::M3508_without_deceleration, 3572} 15 | }; 16 | 17 | PIDController::pid_params_t CANMotorCFG::a2vParams[MOTOR_COUNT] = { 18 | {10, 0.0f, 0.2, 100, 500}, 19 | {10, 0.0f, 0.2, 100, 500}, 20 | {25, 0.0f, 1600, 000, 720}, 21 | {20, 0.0f, 10, 000, 720}, 22 | // {30, 0.0f, 400, 000, 720}, 23 | {20, 0.0f, 0.0, 000, 360}, 24 | {10, 0.0f, 0.2, 100, 500}, 25 | {10, 0.0f, 0.2, 100, 500}, 26 | }; 27 | 28 | PIDController::pid_params_t CANMotorCFG::v2iParams[MOTOR_COUNT] = { 29 | {26.0f,0.1f,0.02f,2000.0,6000.0}, 30 | {26.0f,0.1f,0.02f,2000.0,6000.0}, 31 | {25.0f, 0.15f, 0.0f, 5000.0f, 30000.0f}, 32 | { 25.0f, 0.2f, 0.00f, 5000.0f, 30000.0f}, 33 | // { 100.0f, 1.0f, 0.00f, 5000.0f, 30000.0f}, 34 | {55.0f, 5.0f, 0.0f, 10000.0f, 10000.0f}, 35 | {36.0f, 0.2f, 0.02f, 5000.0f, 10000.0f}, 36 | {36.0f, 0.2f, 0.02f, 5000.0f, 10000.0f} 37 | }; 38 | 39 | bool CANMotorCFG::enable_a2v[MOTOR_COUNT] {false}; 40 | 41 | bool CANMotorCFG::enable_v2i[MOTOR_COUNT] {false}; -------------------------------------------------------------------------------- /dev/application/vehicles/sentry/can_motor_config.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by 钱晨 on 11/14/21. 3 | // 4 | 5 | #ifndef META_INFANTRY_CANBUS_MOTOR_CFG_H 6 | #define META_INFANTRY_CANBUS_MOTOR_CFG_H 7 | 8 | #include "can_motor_feedback.h" 9 | #include "pid_controller.hpp" 10 | 11 | class CANMotorCFG { 12 | public: 13 | enum motor_id_t { 14 | MOTOR_LEFT, 15 | MOTOR_RIGHT, 16 | YAW, 17 | PITCH, 18 | BULLET_LOADER, 19 | FW_UP, 20 | FW_DOWN, 21 | MOTOR_COUNT 22 | }; 23 | static CANMotorBase CANMotorProfile[MOTOR_COUNT]; 24 | 25 | // Parameters for double loop PID control. 26 | static PIDController::pid_params_t a2vParams [MOTOR_COUNT]; 27 | static PIDController::pid_params_t v2iParams [MOTOR_COUNT]; 28 | static bool enable_a2v[MOTOR_COUNT]; 29 | static bool enable_v2i[MOTOR_COUNT]; 30 | }; 31 | 32 | #endif //META_INFANTRY_CANBUS_MOTOR_CFG_H 33 | -------------------------------------------------------------------------------- /dev/application/vehicles/sentry/hardware_conf.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by 钱晨 on 3/16/22. 3 | // This file contains some feature enabling masks. 4 | // 5 | 6 | #ifndef META_INFANTRY_HARDWARE_CONF_H 7 | #define META_INFANTRY_HARDWARE_CONF_H 8 | 9 | #if !defined(ENABLE_VISION) || defined(__DOXYGEN__) 10 | #define ENABLE_VISION FALSE 11 | #endif 12 | 13 | #if !defined(ENABLE_REFEREE) || defined(__DOXYGEN__) 14 | #define ENABLE_REFEREE TRUE 15 | #endif 16 | 17 | #if !defined(ENABLE_SUBPITCH) || defined(__DOXYGEN__) 18 | #define ENABLE_SUBPITCH FALSE 19 | #endif 20 | 21 | #if !defined(ENABLE_AHRS) || defined(__DOXYGEN__) 22 | #define ENABLE_AHRS FALSE 23 | #endif 24 | 25 | #if !defined(ENABLE_USB_SHELL) || defined(__DOXYGEN__) 26 | #define ENABLE_USB_SHELL TRUE 27 | #endif 28 | 29 | #endif //META_INFANTRY_HARDWARE_CONF_H 30 | -------------------------------------------------------------------------------- /dev/application/vehicles/sentry/settings_sentry.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by liuzikai on 2019-07-12. 3 | // 4 | 5 | #ifndef META_SENTRY_SETTINGS_H 6 | #define META_SENTRY_SETTINGS_H 7 | 8 | #include "ch.hpp" 9 | #include "hal.h" 10 | 11 | #include "shell.h" 12 | 13 | #include "user_sentry.h" 14 | 15 | void gimbal_get_config(BaseSequentialStream *chp, int argc, char *argv[]); 16 | void gimbal_set_config(BaseSequentialStream *chp, int argc, char *argv[]); 17 | 18 | void chassis_get_config(BaseSequentialStream *chp, int argc, char *argv[]); 19 | void chassis_set_config(BaseSequentialStream *chp, int argc, char *argv[]); 20 | 21 | void shoot_get_config(BaseSequentialStream *chp, int argc, char *argv[]); 22 | void shoot_set_config(BaseSequentialStream *chp, int argc, char *argv[]); 23 | 24 | extern ShellCommand mainProgramCommands[]; 25 | 26 | #endif //META_SENTRY_SETTINGS_H 27 | -------------------------------------------------------------------------------- /dev/application/vehicles/sentry/thread_priorities.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by liuzikai on 7/29/21. 3 | // 4 | 5 | #ifndef META_INFANTRY_THREAD_PRIORITIES_H 6 | #define META_INFANTRY_THREAD_PRIORITIES_H 7 | 8 | /// Thread Priority List 9 | #define THREAD_CAN1_RX_PRIO (HIGHPRIO - 1) 10 | #define THREAD_CAN2_RX_PRIO (HIGHPRIO - 2) 11 | 12 | #define THREAD_GIMBAL_SKD_PRIO (HIGHPRIO - 3) 13 | #define THREAD_CHASSIS_SKD_PRIO (HIGHPRIO - 4) 14 | #define THREAD_SHOOT_SKD_PRIO (HIGHPRIO - 5) 15 | #define THREAD_AHRS_PRIO (HIGHPRIO - 6) 16 | #define THREAD_MOTOR_SKD_PRIO (HIGHPRIO - 7) 17 | #define THREAD_FEEDBACK_SKD_PRIO (HIGHPRIO - 8) 18 | #define THREAD_BUTTON_DETECT_PRIO (HIGHPRIO - 9) 19 | 20 | #define THREAD_CHASSIS_LG_PRIO (HIGHPRIO - 10) 21 | #define THREAD_GIMBAL_LG_VISION_PRIO (HIGHPRIO - 11) 22 | #define THREAD_GIMBAL_BALLISTIC_PRIO (HIGHPRIO - 12) 23 | #define THREAD_MOTOR_LG_VISION_PRIO (HIGHPRIO - 13) 24 | #define THREAD_USER_PRIO (HIGHPRIO - 14) 25 | #define THREAD_USER_ACTION_PRIO (HIGHPRIO - 15) 26 | 27 | #define THREAD_VIRTUAL_COM_PRIO (NORMALPRIO) 28 | #define THREAD_SUPERCAP_INIT_PRIO (NORMALPRIO-1) 29 | #define THREAD_REFEREE_SKD_PRIO (NORMALPRIO-2) 30 | #define THREAD_VISION_SKD_PRIO (NORMALPRIO-3) 31 | 32 | #define THREAD_INSPECTOR_PRIO (LOWPRIO + 10) 33 | #define THREAD_COMMUNICATOR_PRIO (LOWPRIO + 9) 34 | #define THREAD_STUCK_DETECT_PRIO (LOWPRIO + 5) 35 | #define THREAD_SHOOT_BULLET_COUNTER_PRIO (LOWPRIO + 4) 36 | #define THREAD_SHOOT_LG_VISION_PRIO (LOWPRIO + 3) 37 | #define THREAD_CHASSIS_MTN_CTL_PRIO (LOWPRIO + 2) 38 | #define THREAD_SHELL_PRIO (LOWPRIO + 1) 39 | #define THREAD_BUZZER_SKD_PRIO (LOWPRIO) 40 | 41 | #endif //META_INFANTRY_THREAD_PRIORITIES_H 42 | -------------------------------------------------------------------------------- /dev/board_pin/rm_board_2017/board.mk: -------------------------------------------------------------------------------- 1 | # List of all the board related files. 2 | BOARDSRC = $(CHIBIOS)/dev/board/board.c 3 | 4 | # Required include directories 5 | BOARDINC = $(CHIBIOS)/dev/board 6 | 7 | # Shared variables 8 | ALLCSRC += $(BOARDSRC) 9 | ALLINC += $(BOARDINC) 10 | -------------------------------------------------------------------------------- /dev/board_pin/rm_board_2018_a/board.mk: -------------------------------------------------------------------------------- 1 | # List of all the board related files. 2 | BOARDSRC = $(CHIBIOS)/dev/board/board.c 3 | 4 | # Required include directories 5 | BOARDINC = $(CHIBIOS)/dev/board 6 | 7 | # Shared variables 8 | ALLCSRC += $(BOARDSRC) 9 | ALLINC += $(BOARDINC) 10 | -------------------------------------------------------------------------------- /dev/common/CRC16.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Administrator on 2019/1/15 0015. 3 | // 4 | 5 | #ifndef META_INFANTRY_CRC16_H 6 | #define META_INFANTRY_CRC16_H 7 | 8 | #include "ch.hpp" 9 | 10 | uint16_t get_crc16_check_sum(uint8_t *pchMessage, uint32_t dwLength); 11 | 12 | uint32_t verify_crc16_check_sum(uint8_t *pchMessage, uint32_t dwLength); 13 | 14 | void append_crc16_check_sum(uint8_t *pchMessage, uint32_t dwLength); 15 | 16 | #endif //META_INFANTRY_CRC16_H 17 | -------------------------------------------------------------------------------- /dev/common/CRC8.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Administrator on 2019/1/17 0017. 3 | // 4 | 5 | #ifndef META_INFANTRY_CRC8_H 6 | #define META_INFANTRY_CRC8_H 7 | 8 | unsigned char get_crc8_check_sum(unsigned char *pchMessage, unsigned int dwLength); 9 | 10 | unsigned int verify_crc8_check_sum(unsigned char *pchMessage, unsigned int dwLength); 11 | 12 | void append_crc8_check_sum(unsigned char *pchMessage, unsigned int dwLength); 13 | 14 | #endif //META_INFANTRY_CRC8_H 15 | -------------------------------------------------------------------------------- /dev/common/common_macro.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by liuzikai on 2018-12-28. 3 | // 4 | 5 | #ifndef META_INFANTRY_COMMON_MACRO_H 6 | #define META_INFANTRY_COMMON_MACRO_H 7 | 8 | #include "random" 9 | 10 | #define ABS_CROP(n, limit) do { \ 11 | if (n > limit) n = limit; \ 12 | if (n < -(limit)) n = -(limit); \ 13 | } while(0) 14 | 15 | #define VAL_CROP(n, max, min) do { \ 16 | if (n > max) n = max; \ 17 | if (n < min) n = min; \ 18 | } while(0) 19 | 20 | #define ABS_IN_RANGE(n, abs_limit) ((n) >= -(abs_limit) && (n) <= (abs_limit)) 21 | 22 | #define ABS(n) ((n) >= 0 ? (n):(-n)) 23 | 24 | #define SIGN(n) (n == 0 ? 0 : (n > 0 ? 1 : -1)) 25 | 26 | #define SYSTIME (TIME_I2MS(chVTGetSystemTimeX())) 27 | // X indicates that this function can be call in all conditions (Thread, ISR, and their critical sections) 28 | 29 | #define WITHIN_RECENT_TIME(value, ms) ((int) SYSTIME - (int) (value) < (int) (ms)) 30 | #define WITHIN_DURATION(now, value, ms) ((int) (now) - (int) (value) < (int) (ms)) 31 | // Convert to int is needed to avoid thread switch during execution of this statement which results in negative unsigned 32 | 33 | #ifndef PI 34 | #define PI 3.14159265358979f 35 | #endif 36 | 37 | #endif //META_INFANTRY_COMMON_MACRO_H 38 | -------------------------------------------------------------------------------- /dev/interface/README.md: -------------------------------------------------------------------------------- 1 | # Creating interfaces 2 | 3 | If you want to create new interfaces, please create a folder and then generate files in this folder. 4 | Don't forget adding the new interface folder path to `CMakeLists.txt`, starting from `line 44`. 5 | -------------------------------------------------------------------------------- /dev/interface/ahrs/ahrs_abstract.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by liuzikai on 2019-06-12. 3 | // 4 | 5 | #ifndef META_INFANTRY_AHRS_ABSTRACT_H 6 | #define META_INFANTRY_AHRS_ABSTRACT_H 7 | 8 | #include "ahrs_math.hpp" 9 | 10 | class AbstractAHRS { 11 | public: 12 | 13 | /** 14 | * Get data from gyroscope 15 | * @return Gyro data from gyroscope [deg/s] 16 | */ 17 | virtual Vector3D get_gyro() = 0; 18 | 19 | /** 20 | * Get data from accelerometer 21 | * @return Acceleration data from accelerometer [m/s^2] 22 | */ 23 | virtual Vector3D get_accel() = 0; 24 | 25 | /** 26 | * Get last update time from system start 27 | * @return Last update time from system start [ms] 28 | */ 29 | virtual time_msecs_t get_mpu_update_time() const = 0; 30 | 31 | /** 32 | * Get magnet data from IST 33 | * @return Magnet data [uT] 34 | */ 35 | virtual Vector3D get_magnet() = 0; 36 | 37 | /** 38 | * Get last update time from system start 39 | * @return Last update time from system start [ms] 40 | */ 41 | virtual time_msecs_t get_ist_update_time() const = 0; 42 | 43 | /** 44 | * Get board angle 45 | * @return Board angle [degree] 46 | * @note x - yaw, y - pitch, z - roll 47 | */ 48 | virtual Vector3D get_angle() = 0; 49 | 50 | /** 51 | * Get last update time from system start 52 | * @return Last update time from system start [ms] 53 | */ 54 | virtual time_msecs_t get_ahrs_update_time() const = 0; 55 | 56 | }; 57 | 58 | #endif //META_INFANTRY_AHRS_ABSTRACT_H 59 | -------------------------------------------------------------------------------- /dev/interface/ahrs/ahrs_lib.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Meta-Team/Meta-Embedded/1bf0588cffe7463acc78d59e568265057d118da9/dev/interface/ahrs/ahrs_lib.lib -------------------------------------------------------------------------------- /dev/interface/button/button_monitor.cpp: -------------------------------------------------------------------------------- 1 | #include "button_monitor.h" 2 | 3 | using namespace chibios_rt; 4 | 5 | ButtonMonitorThread::ButtonMonitorThread(ioportid_t ioportid, ioportmask_t ioportmask) 6 | : BaseStaticThread<128>() { 7 | _ioportid = ioportid; 8 | _ioportmask = ioportmask; 9 | } 10 | 11 | void portToString(ioportid_t ioportid, ioportmask_t ioportmask, char* result) { 12 | result[0] = 'P'; 13 | if(ioportid == GPIOA) { 14 | result[1] = 'A'; 15 | } else if(ioportid == GPIOB) { 16 | result[1] = 'B'; 17 | } else if(ioportid == GPIOC) { 18 | result[1] = 'C'; 19 | } else if(ioportid == GPIOD) { 20 | result[1] = 'D'; 21 | } else if(ioportid == GPIOE) { 22 | result[1] = 'E'; 23 | } else if(ioportid == GPIOF) { 24 | result[1] = 'F'; 25 | } else if(ioportid == GPIOG) { 26 | result[1] = 'G'; 27 | } else if(ioportid == GPIOH) { 28 | result[1] = 'H'; 29 | } 30 | result[2] = ioportmask > 9 ? '1' : '0'; 31 | result[3] = '0' + (ioportmask % 10); 32 | } 33 | 34 | void ButtonMonitorThread::main() { 35 | // Enable input on the given port 36 | palSetPadMode(_ioportid, _ioportmask, PAL_MODE_INPUT_PULLUP); 37 | // Set the name of this thread 38 | char name[] = "btn_PXXX"; 39 | portToString(_ioportid, _ioportmask, name + 4); 40 | setName(name); 41 | // Monitor the button 42 | while(!shouldTerminate()) { 43 | while(palReadPad(_ioportid, _ioportmask) != BUTTON_PRESS_PAL_STATUS) { 44 | // Wait for the button to be pressed 45 | sleep(TIME_MS2I(5)); 46 | } 47 | pressed = true; 48 | toggle = !toggle; 49 | counter++; 50 | //if(_function) _function(); 51 | while(palReadPad(_ioportid, _ioportmask) == BUTTON_PRESS_PAL_STATUS) { 52 | // Wait for the button to be released 53 | sleep(TIME_MS2I(5)); 54 | } 55 | pressed = false; 56 | } 57 | } -------------------------------------------------------------------------------- /dev/interface/button/button_monitor.h: -------------------------------------------------------------------------------- 1 | #ifndef META_INFANTRY_BUTTON_MONITOR_H 2 | #define META_INFANTRY_BUTTON_MONITOR_H 3 | 4 | #include "ch.hpp" 5 | #include "hal.h" 6 | 7 | #if defined(BOARD_RM_2017) // press to be low 8 | #define BUTTON_PRESS_PAL_STATUS PAL_LOW 9 | #elif defined(BOARD_RM_2018_A) // press to be high 10 | #define BUTTON_PRESS_PAL_STATUS PAL_HIGH 11 | #endif 12 | 13 | class ButtonMonitorThread : public chibios_rt::BaseStaticThread<128> { 14 | private: 15 | ioportid_t _ioportid; 16 | ioportmask_t _ioportmask; 17 | protected: 18 | void main(void) override; 19 | public: 20 | bool pressed = false; 21 | bool toggle = false; 22 | uint32_t counter = 0; 23 | ButtonMonitorThread(ioportid_t ioportid, ioportmask_t ioportmask); 24 | }; 25 | 26 | #endif -------------------------------------------------------------------------------- /dev/interface/buzzer/README.md: -------------------------------------------------------------------------------- 1 | # Use Buzzer 2 | 3 | ## Initiate 4 | skd_prio is the thread priority for music playing thread. 5 | ```c++ 6 | BuzzerSKD::init(skd_prio); 7 | ``` 8 | 9 | ## Included functions 10 | 11 | 12 | ### BuzzerSKD::play_sound(sound[]) 13 | 14 | ```DOXYGEN 15 | /** 16 | * @param sound An array of note_with_time_t, ending with {Finish(-1), *} 17 | * @param prio Priority of the buzzer thread 18 | */ 19 | ``` 20 | Play the music hard coded in `BuzzerSKD`. For available sounds, just type `BuzzerSKD::sound_***`, a list will show. 21 | 22 | 23 | ### BuzzerSKD::alert_on() 24 | 25 | ```DOXYGEN 26 | /** 27 | * Enable continuous alert 28 | */ 29 | ``` 30 | Stop the playing music (if any) and start alerting. 31 | 32 | ### BuzzerSKD::alert_off() 33 | 34 | ```DOXYGEN 35 | /** 36 | * Disable continuous alert 37 | */ 38 | ``` 39 | Stop alerting and resume music playing (if any). 40 | 41 | ### BuzzerSKD::alerting() 42 | 43 | ```DOXYGEN 44 | /** 45 | * Return the status of continuous alert 46 | * @return The status of continuous alert 47 | */ 48 | ``` 49 | Returns the buzzer status, `true` for alerting. -------------------------------------------------------------------------------- /dev/interface/buzzer/buzzer_interface.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by 钱晨 on 2019/11/16. 3 | // 4 | 5 | #include "buzzer_interface.h" 6 | 7 | 8 | bool BuzzerIF::buzzer_idle = true; 9 | 10 | constexpr PWMConfig BuzzerIF::pwm_config; 11 | 12 | BuzzerIF::note_t BuzzerIF::now_playing_note = Finish; 13 | 14 | 15 | void BuzzerIF::change_playing_note(int note) { 16 | now_playing_note = (note_t) note; 17 | if (now_playing_note > 0) { // A valid playing_note 18 | if (buzzer_idle) { 19 | // Activate PWM driver 20 | pwmStart(&BUZZER_PWM_DRIVER, &pwm_config); 21 | buzzer_idle = false; 22 | } 23 | // See playing_note above for this formula 24 | pwmChangePeriod(&BUZZER_PWM_DRIVER, 1000000 / (unsigned long) now_playing_note); 25 | pwmEnableChannel(&BUZZER_PWM_DRIVER, 0, PWM_PERCENTAGE_TO_WIDTH(&BUZZER_PWM_DRIVER, 5000)); // 50% 26 | } else if (now_playing_note == Silent) { // A silent playing_note 27 | if(!buzzer_idle) { 28 | pwmDisableChannel(&BUZZER_PWM_DRIVER, 0); 29 | } 30 | } else if (now_playing_note == Finish) { // With the sound finished, the buzzer is idled. 31 | if(!buzzer_idle){ // Prevent stop PWM repeatedly. 32 | pwmStop(&BUZZER_PWM_DRIVER); 33 | buzzer_idle = true; 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /dev/interface/lidar/lidar_interface.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Quoke on 3/1/2022. 3 | // 4 | 5 | #include "lidar_interface.h" 6 | 7 | float LidarIF::dist = 0.0f; 8 | 9 | void LidarIF::init(CANInterface *can_interface) { 10 | can_interface->register_callback(0x003, 0x003, process_feedback); 11 | } 12 | 13 | void LidarIF::process_feedback(CANRxFrame const *rxmsg) { 14 | dist = (float) (rxmsg->data8[1] << 8 | rxmsg->data8[0]); 15 | } 16 | -------------------------------------------------------------------------------- /dev/interface/lidar/lidar_interface.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Quoke on 3/1/2022. 3 | // 4 | 5 | #ifndef META_INFANTRY_LIDAR_INTERFACE_H 6 | #define META_INFANTRY_LIDAR_INTERFACE_H 7 | 8 | #include "ch.hpp" 9 | #include "hal.h" 10 | #include "can_interface.h" 11 | 12 | class LidarIF { 13 | public: 14 | /** 15 | * Initialize the lidar interface 16 | */ 17 | static void init(CANInterface *can_interface); 18 | 19 | /** 20 | * [m] Distance received from lidar 21 | */ 22 | static float dist; 23 | 24 | /** 25 | * Process the feedback from super capacitor 26 | * @param rxmsg 27 | */ 28 | static void process_feedback(CANRxFrame const *rxmsg); 29 | }; 30 | 31 | 32 | #endif //META_INFANTRY_LIDAR_INTERFACE_H 33 | -------------------------------------------------------------------------------- /dev/interface/oled/oled_interface.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Quoke on 3/24/2022. 3 | // 4 | 5 | #ifndef META_INFANTRY_OLED_INTERFACE_H 6 | #define META_INFANTRY_OLED_INTERFACE_H 7 | 8 | #include "ch.h" 9 | #include "hal.h" 10 | #include "common_macro.h" 11 | 12 | #if defined(BOARD_RM_2018_A) 13 | #define OLED_SPI_DRIVER SPID1 14 | #define X_WIDTH 128 15 | #define Y_WIDTH 64 16 | 17 | #define OLED_CMD 0x00 18 | #define OLED_DATA 0x01 19 | #else 20 | #error "oledIF is only for RMboard 2018!" 21 | #endif 22 | 23 | class oledIF { 24 | public: 25 | typedef enum 26 | { 27 | Pen_Clear = 0x00, 28 | Pen_Write = 0x01, 29 | Pen_Inversion = 0x02, 30 | }Pen_Typedef; 31 | 32 | typedef enum{ 33 | GPIO_PIN_RESET = 0, 34 | GPIO_PIN_SET 35 | } GPIO_PinState; 36 | 37 | static void init(); 38 | 39 | static void oled_reset_clear(); 40 | static void oled_reset_set(); 41 | static void oled_cmd_clear(); 42 | static void oled_cmd_set(); 43 | static void oled_clear(oledIF::Pen_Typedef pen); 44 | static void oled_refresh_gram(); 45 | 46 | static void oled_write_byte(uint8_t data, uint8_t cmd); 47 | static void oled_set_pos(uint8_t x, uint8_t y); 48 | static void oled_drawpoint(int8_t x, int8_t y, oledIF::Pen_Typedef pen); 49 | static void oled_LOGO(); 50 | static uint8_t OLED_GRAM[130][8]; 51 | 52 | static const unsigned char LOGO_BMP[128][8]; 53 | 54 | private: 55 | static SPIConfig SPI1_cfg; 56 | }; 57 | 58 | 59 | #endif //META_INFANTRY_OLED_INTERFACE_H 60 | -------------------------------------------------------------------------------- /dev/interface/rudder/rudder_interface.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Wu Feiyang on 2023/7/11. 3 | // 4 | 5 | #ifndef EXPLORER_RUDDER_INTERFACE_H 6 | #define EXPLORER_RUDDER_INTERFACE_H 7 | #include "ch.hpp" 8 | #include "hal.h" 9 | #include "hal_pwm.h" 10 | 11 | class Rudder{ 12 | public: 13 | typedef enum{ 14 | MG995, 15 | AFD30T60MG, 16 | RUDDER_TYPE_CNT 17 | }rudderType_t; 18 | 19 | Rudder(PWMDriver *driver,pwmchannel_t channel, rudderType_t rudderType); 20 | ~Rudder(); 21 | static void init(); 22 | static void start(PWMDriver *driver, PWMConfig *config); 23 | void enable(); 24 | void disable(); 25 | static void stop(PWMDriver *driver); 26 | void set_rudder_angle(int angle); 27 | 28 | private: 29 | static constexpr PWMConfig pwm_default_config = { 30 | 10000, // frequency 10000Hz 31 | 100, // 10 ms, 1/10000s * 100 = 0.01s = 10ms 32 | nullptr, 33 | { 34 | {PWM_COMPLEMENTARY_OUTPUT_DISABLED, nullptr}, // it's all CH1 for current support boards 35 | {PWM_COMPLEMENTARY_OUTPUT_DISABLED, nullptr}, 36 | {PWM_COMPLEMENTARY_OUTPUT_DISABLED, nullptr}, 37 | {PWM_COMPLEMENTARY_OUTPUT_DISABLED, nullptr} 38 | }, 39 | 0, 40 | 0, 41 | }; 42 | PWMDriver * driver_; 43 | static PWMConfig config_; 44 | pwmchannel_t channel_; 45 | rudderType_t rudderType_; 46 | }; 47 | 48 | #endif //EXPLORER_RUDDER_INTERFACE_H 49 | -------------------------------------------------------------------------------- /dev/interface/sd_card/sd_card_interface.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by liuzikai on 2019-07-13. 3 | // 4 | 5 | #ifndef META_INFANTRY_SD_CARD_INTERFACE_H 6 | #define META_INFANTRY_SD_CARD_INTERFACE_H 7 | 8 | #include "ch.hpp" 9 | #include "hal.h" 10 | 11 | class SDCard { 12 | 13 | public: 14 | 15 | static constexpr SDCDriver& SDC_DRIVER = SDCD1; 16 | 17 | static constexpr uint8_t PROTOCOL_VERSION = 1; 18 | 19 | static bool init(); 20 | 21 | static bool available(); 22 | 23 | enum result_t { 24 | NOT_AVAILABLE = -1, 25 | OK = 0, 26 | IO_ERROR = 1, 27 | DATA_ERROR = 2, 28 | DATA_UNAVAILABLE = 3 29 | }; 30 | 31 | static int read_all(); 32 | 33 | static int get_data(uint16_t data_id, void *data, size_t n); 34 | 35 | static int write_data(uint16_t data_id, void *data, size_t n); 36 | 37 | static int erase(); 38 | 39 | private: 40 | 41 | static bool available_; 42 | 43 | static constexpr unsigned MAX_BLOCK_COUNT = 64; 44 | 45 | __PACKED_STRUCT sd_info_t { 46 | uint8_t protocal_ver; 47 | uint16_t available_blk; 48 | }; 49 | 50 | static constexpr uint16_t SD_INFO_DATA_ID = 0xCAFE; 51 | static sd_info_t sd_info; 52 | 53 | __PACKED_STRUCT block_header_t { 54 | uint16_t data_id; 55 | uint16_t data_length; 56 | }; 57 | 58 | static __PACKED_STRUCT block_t { 59 | block_header_t header; 60 | uint8_t data[MMCSD_BLOCK_SIZE - sizeof(header)]; // make sure buf has size as a block 61 | } blk[MAX_BLOCK_COUNT]; 62 | 63 | static int find_blk(uint16_t data_id); 64 | 65 | static int update_header(); 66 | 67 | static uint8_t sd_scratchpad_[512]; 68 | 69 | static constexpr SDCConfig SDCCFG = { 70 | sd_scratchpad_, 71 | SDC_MODE_4BIT 72 | }; 73 | 74 | }; 75 | 76 | 77 | #endif //META_INFANTRY_SD_CARD_INTERFACE_H 78 | -------------------------------------------------------------------------------- /dev/interface/shell/printf.h: -------------------------------------------------------------------------------- 1 | /* 2 | ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | /** 18 | * @file chprintf.h 19 | * @brief Revised mini printf-like functionality from ChibiOS Shell. 20 | * 21 | * @addtogroup shell_chibios 22 | * @{ 23 | */ 24 | 25 | #ifndef PRINTF_H 26 | #define PRINTF_H 27 | 28 | #include 29 | 30 | #if defined(SHELL_CONFIG_FILE) 31 | #include "shellconf.h" 32 | #endif 33 | 34 | /** 35 | * @brief Float type support. 36 | */ 37 | #if !defined(CHPRINTF_USE_FLOAT) || defined(__DOXYGEN__) 38 | #define CHPRINTF_USE_FLOAT FALSE 39 | #endif 40 | 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | int chvprintf(BaseSequentialStream *chp, const char *fmt, va_list ap); 45 | int chprintf(BaseSequentialStream *chp, const char *fmt, ...); 46 | int chsnprintf(char *str, size_t size, const char *fmt, ...); 47 | int chvprintfI(BaseSequentialStream *chp, const char *fmt, va_list ap); 48 | int chprintfI(BaseSequentialStream *chp, const char *fmt, ...); 49 | int chsnprintfI(char *str, size_t size, const char *fmt, ...); 50 | #ifdef __cplusplus 51 | } 52 | #endif 53 | 54 | #endif /* PRINTF_H */ 55 | 56 | /** @} */ 57 | -------------------------------------------------------------------------------- /dev/interface/shell/shell_dbg_cmd.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file shell_dbg_cmd.cpp 3 | * @brief Our debug commands for shell. 4 | * 5 | * @addtogroup shell 6 | * @{ 7 | */ 8 | 9 | #ifndef META_INFANTRY_SHELL_COMMANDS_H 10 | #define META_INFANTRY_SHELL_COMMANDS_H 11 | 12 | #include "ch.hpp" 13 | #include "hal.h" 14 | #include "shell.h" 15 | #include "chprintf.h" 16 | 17 | // List of shell debug commands 18 | extern Shell::Command shell_debug_commands[]; 19 | 20 | #endif -------------------------------------------------------------------------------- /dev/logic/sentry_chassis_logic.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Quoke on 8/2/2022. 3 | // 4 | 5 | #ifndef META_EMBEDDED_SENTRY_CHASSIS_LOGIC_H 6 | #define META_EMBEDDED_SENTRY_CHASSIS_LOGIC_H 7 | 8 | #include "sentry_chassis_scheduler.h" 9 | #include "random" 10 | 11 | class SChassisLG { 12 | public: 13 | 14 | enum mode_t { 15 | FORCED_RELAX_MODE, ///< Stop immediately and then cut off power. 16 | AUTO_MODE, ///< Auto move with randomly picked positions. 17 | MANUAL_MODE ///< Controlled by remote controller. 18 | }; 19 | 20 | /** 21 | * @brief Initialize sentry chassis logic. 22 | * @param mtn_ctl_prio 23 | */ 24 | static void init(tprio_t mtn_ctl_prio); 25 | 26 | /** 27 | * @brief Set mode for sentry chassis logic. 28 | * @param mode [in] Mode of sentry chassis. Available options: FORCED_RELAX_MODE, 29 | * AUTO_MODE, MANUAL_MODE. 30 | */ 31 | static void set_mode(mode_t mode); 32 | 33 | /** 34 | * @brief Set velocity for sentry chassis. Only available in MANUAL_MODE. 35 | * @param target_velocity 36 | */ 37 | static void set_velocity(float target_velocity); 38 | 39 | /** 40 | * @brief Set a random destination for sentry 41 | */ 42 | static float set_random_destination(); 43 | 44 | static float set_destination; 45 | 46 | static float positions[]; 47 | 48 | private: 49 | 50 | static mode_t mode; 51 | static float target_velocity; 52 | 53 | class MotionControlThread : public BaseStaticThread<512> { 54 | void main() final; 55 | constexpr static unsigned SCHASSIS_MTN_CTL_INTERVAL = 2; // [ms] 56 | }; 57 | 58 | static MotionControlThread motion_control_thread; 59 | 60 | 61 | static void set_scalar_destination(); 62 | 63 | static int iterator; 64 | }; 65 | 66 | 67 | #endif //META_EMBEDDED_SENTRY_CHASSIS_LOGIC_H 68 | -------------------------------------------------------------------------------- /dev/module/low_pass_filter.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by liuzikai on 7/14/21. 3 | // 4 | 5 | #ifndef META_INFANTRY_LOW_PASS_FILTER_HPP 6 | #define META_INFANTRY_LOW_PASS_FILTER_HPP 7 | 8 | class LowPassFilteredValue { 9 | public: 10 | LowPassFilteredValue() = default; 11 | 12 | explicit LowPassFilteredValue(float alpha) : alpha_(alpha) {} 13 | 14 | /** 15 | * Set alpha value. 16 | * @param alpha Weight for the last data. 17 | */ 18 | void set_alpha(float alpha) { alpha_ = alpha; } 19 | 20 | void update(float val) { 21 | val_ = valValid_ ? (val_ * alpha_ + val * (1 - alpha_)) : val; 22 | valValid_ = true; 23 | } 24 | 25 | float get() const { return val_; } 26 | 27 | void direct_set(float val) { 28 | val_ = val; 29 | valValid_ = true; 30 | } 31 | 32 | void reset() { 33 | val_ = 0; 34 | valValid_ = false; 35 | } 36 | 37 | private: 38 | float alpha_ = 0; 39 | bool valValid_ = false; 40 | float val_ = 0; 41 | }; 42 | 43 | #endif //META_INFANTRY_LOW_PASS_FILTER_HPP 44 | -------------------------------------------------------------------------------- /dev/module/position_kalman_filter.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by liuzikai on 7/22/21. 3 | // 4 | 5 | #ifndef META_INFANTRY_POSITION_KALMAN_FILTER_H 6 | #define META_INFANTRY_POSITION_KALMAN_FILTER_H 7 | 8 | #include "kalman_filter.hpp" 9 | 10 | class PositionKalmanFilter : protected KalmanFilter<2, 1> { 11 | public: 12 | 13 | explicit PositionKalmanFilter(float Q_position = 0, float Q_velocity = 0, float R_position = 0) 14 | : KalmanFilter<2, 1>() { 15 | 16 | reset(); 17 | set_Q_position(Q_position); 18 | set_Q_velocity(Q_velocity); 19 | set_R_position(R_position); 20 | } 21 | 22 | void reset() { 23 | KalmanFilter<2, 1>::reset(); 24 | 25 | F_data[0] = 1; 26 | F_data[3] = 1; 27 | 28 | H_data[0] = H_T_data[0] = 1; 29 | 30 | } 31 | 32 | void set_R_position(float R_position) { R_data[0] = R_position; } 33 | 34 | void set_Q_velocity(float Q_velocity) { Q_data[3] = Q_velocity; } 35 | 36 | void set_Q_position(float Q_position) { Q_data[0] = Q_position; } 37 | 38 | float get_position() const { return x_prime_data[0]; } 39 | 40 | float get_velocity() const { return x_prime_data[1]; } 41 | 42 | void update(float new_position, float time_delta) { 43 | F_data[1] = time_delta; 44 | z_data[0] = new_position; 45 | KalmanFilter<2, 1>::update(); 46 | } 47 | 48 | void reload_position(float new_position) { 49 | x_prime_data[0] = new_position; 50 | // Others not changed 51 | } 52 | }; 53 | 54 | #endif //META_INFANTRY_POSITION_KALMAN_FILTER_H 55 | -------------------------------------------------------------------------------- /dev/module/trajectory_calculator.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by liuzikai on 7/22/21. 3 | // 4 | 5 | #ifndef META_INFANTRY_TRAJECTORY_CALCULATOR_HPP 6 | #define META_INFANTRY_TRAJECTORY_CALCULATOR_HPP 7 | 8 | #include 9 | #include "arm_math.h" 10 | 11 | namespace Trajectory { 12 | 13 | #ifndef GRAV_CONSTANT 14 | #define GRAV_CONSTANT 9.80665f 15 | #endif 16 | 17 | #ifndef PI 18 | #define PI 3.14159265358979f 19 | #endif 20 | 21 | inline float pow2(float v) { return v * v; } 22 | inline float cos(float x) { return arm_cos_f32(x); } 23 | inline float sin(float x) { return arm_sin_f32(x); } 24 | inline float tan(float x) { return arm_sin_f32(x) / arm_cos_f32(x); } 25 | inline float sqrt(float x) { return sqrtf(x); } 26 | inline float atan(float x) { return atanf(x); } 27 | 28 | /** 29 | * Compensate for gravity. 30 | * @param pitch [In] target pitch angle & [Out] compensated pitch angle, + for downward, [deg] 31 | * @param dist [In] Target distance [mm] 32 | * @param bullet_speed [In] Bullet speed [m/s] 33 | * @param flight_time [Out] [ms] 34 | * @return Whether the bullet can hit the target 35 | */ 36 | inline bool compensate_for_gravity(float &pitch, float dist, float bullet_speed, float &flight_time) { 37 | float a = pow2(bullet_speed) / (GRAV_CONSTANT / 1E3f); 38 | float y = dist * -sin(pitch * PI / 180.0f); // + for upward [mm] 39 | float b = pow2(a - y) - pow2(dist); 40 | if (b < 0) return false; 41 | float c = a - sqrt(b); 42 | pitch = -atan(c / (dist * cos(pitch * PI / 180.0f))) * 180.0f / PI; 43 | flight_time = sqrt((c - y) / (0.5f * (GRAV_CONSTANT / 1E3f))); 44 | return true; 45 | } 46 | 47 | inline Vector3D ypdToXYZ(const Vector3D &ypd) { 48 | float x = ypd.z * tan(ypd.x * PI / 180.0f); 49 | float y = ypd.z * tan(ypd.y * PI / 180.0f); 50 | return {x, y, sqrtf(pow2(ypd.z)) - pow2(x) - pow2(y)}; 51 | } 52 | 53 | } 54 | 55 | #endif //META_INFANTRY_TRAJECTORY_CALCULATOR_HPP 56 | -------------------------------------------------------------------------------- /dev/scheduler/scheduler_base.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Quoke on 3/7/2022. 3 | // Modified by Wu Feiyang on 5/8/2023 4 | // 5 | 6 | #ifndef META_INFANTRY_SCHEDULER_BASE_H 7 | #define META_INFANTRY_SCHEDULER_BASE_H 8 | 9 | /** 10 | * @brief Scheduler base for vehicles with gimbal and chassis. 11 | */ 12 | class SKDBase { 13 | public: 14 | enum mode_t { 15 | FORCED_RELAX_MODE, ///< zero force (but still taking control of GimbalIF) 16 | CHASSIS_REF_MODE, ///< Gimbal angle are in chassis frame 17 | #if ENABLE_AHRS 18 | GIMBAL_REF_MODE ///< Gimbal angle are in gimbal frame 19 | #endif 20 | }; 21 | 22 | 23 | 24 | }; 25 | 26 | 27 | #endif //META_INFANTRY_SCHEDULER_BASE_H 28 | -------------------------------------------------------------------------------- /os/common/abstractions/cmsis_os/cmsis_os.mk: -------------------------------------------------------------------------------- 1 | # List of the ChibiOS/RT CMSIS RTOS wrapper. 2 | CMSISRTOSSRC = ${CHIBIOS}/os/common/abstractions/cmsis_os/cmsis_os.c 3 | 4 | CMSISRTOSINC = ${CHIBIOS}/os/common/abstractions/cmsis_os 5 | 6 | # Shared variables 7 | ALLCSRC += $(CMSISRTOSSRC) 8 | ALLINC += $(CMSISRTOSINC) 9 | -------------------------------------------------------------------------------- /os/common/abstractions/nasa_cfe/osal/cfe_osal.mk: -------------------------------------------------------------------------------- 1 | # NASA CFE OSAL files. 2 | CFEOSALSRC = $(CHIBIOS)/os/common/abstractions/nasa_cfe/osal/src/osapi.c 3 | 4 | CFEOSALINC = $(CHIBIOS)/os/common/abstractions/nasa_cfe/osal/include 5 | 6 | # Shared variables 7 | ALLCSRC += $(CFEOSALSRC) 8 | ALLINC += $(CFEOSALINC) 9 | -------------------------------------------------------------------------------- /os/common/abstractions/nasa_cfe/osal/include/osapi-version.h: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | ** File: 3 | ** $Id: osapi-version.h 1.11 2014/05/02 13:53:14GMT-05:00 acudmore Exp $ 4 | ** 5 | ** Copyright (c) 2004-2006, United States government as represented by the 6 | ** administrator of the National Aeronautics Space Administration. 7 | ** All rights reserved. This software was created at NASAs Goddard 8 | ** Space Flight Center pursuant to government contracts. 9 | ** 10 | ** This is governed by the NASA Open Source Agreement and may be used, 11 | ** distributed and modified only pursuant to the terms of that agreement. 12 | ** 13 | ** Purpose: 14 | ** The OSAL version numbers 15 | ** 16 | ** Notes: 17 | ** 18 | ** $Log: osapi-version.h $ 19 | ** Revision 1.11 2014/05/02 13:53:14GMT-05:00 acudmore 20 | ** Updated version to 4.1.1 21 | ** Revision 1.10 2014/01/23 16:33:31GMT-05:00 acudmore 22 | ** Update for 4.1 release 23 | ** Revision 1.9 2013/01/16 14:35:18GMT-05:00 acudmore 24 | ** updated version label 25 | ** Revision 1.8 2012/04/16 14:57:04GMT-05:00 acudmore 26 | ** Updated version label to 3.5.0.0 27 | ** Revision 1.7 2012/01/17 16:04:29EST acudmore 28 | ** Updated version to 3.4.1 29 | ** Revision 1.6 2011/12/05 15:45:16EST acudmore 30 | ** Updated version label to 3.4.0 31 | ** Initial revision 32 | ** Member added to project c:/MKSDATA/MKS-REPOSITORY/MKS-OSAL-REPOSITORY/src/os/inc/project.pj 33 | ** 34 | *************************************************************************/ 35 | #ifndef _osapi_version_h_ 36 | #define _osapi_version_h_ 37 | 38 | #define OS_MAJOR_VERSION (4) 39 | #define OS_MINOR_VERSION (1) 40 | #define OS_REVISION (1) 41 | #define OS_MISSION_REV (0) 42 | 43 | 44 | #endif /* _osapi_version_h_ */ 45 | 46 | /************************/ 47 | /* End of File Comment */ 48 | /************************/ 49 | -------------------------------------------------------------------------------- /os/common/abstractions/nasa_cfe/psp/cfe_psp.mk: -------------------------------------------------------------------------------- 1 | # NASA CFE PSP files. 2 | CFEPSPSRC = $(CHIBIOS)/os/common/abstractions/nasa_cfe/psp/src/cfe_psp_support.c \ 3 | $(CHIBIOS)/os/common/abstractions/nasa_cfe/psp/src/cfe_psp_timer.c \ 4 | $(CHIBIOS)/os/common/abstractions/nasa_cfe/psp/src/cfe_psp_memory.c \ 5 | $(CHIBIOS)/os/common/abstractions/nasa_cfe/psp/src/cfe_psp_exception.c 6 | 7 | CFEPSPINC = $(CHIBIOS)/os/common/abstractions/nasa_cfe/psp/include 8 | 9 | # Shared variables 10 | ALLCSRC += $(CFEPSPSRC) 11 | ALLINC += $(CFEPSPINC) 12 | -------------------------------------------------------------------------------- /os/common/abstractions/nasa_cfe/psp/include/cfe_psp_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** cfe_psp_config.h 3 | ** 4 | ** Copyright (c) 2004-2006, United States government as represented by the 5 | ** administrator of the National Aeronautics Space Administration. 6 | ** All rights reserved. This software(cFE) was created at NASA Goddard 7 | ** Space Flight Center pursuant to government contracts. 8 | ** 9 | ** This software may be used only pursuant to a United States government 10 | ** sponsored project and the United States government may not be charged 11 | ** for use thereof. 12 | ** 13 | ** 14 | */ 15 | 16 | #ifndef _cfe_psp_config_ 17 | #define _cfe_psp_config_ 18 | 19 | #include "common_types.h" 20 | 21 | #endif /* _cfe_psp_config_ */ 22 | -------------------------------------------------------------------------------- /os/common/abstractions/nasa_cfe/psp/include/psp_version.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: psp_version.h 1.2.2.3 2014/10/01 15:41:27GMT-05:00 sstrege Exp $ 3 | ** 4 | ** 5 | ** Copyright (c) 2004-2006, United States government as represented by the 6 | ** administrator of the National Aeronautics Space Administration. 7 | ** All rights reserved. This software(cFE) was created at NASA's Goddard 8 | ** Space Flight Center pursuant to government contracts. 9 | ** 10 | ** This software may be used only pursuant to a United States government 11 | ** sponsored project and the United States government may not be charged 12 | ** for use thereof. 13 | ** 14 | ** 15 | ** 16 | ** Purpose: 17 | ** Provide version identifiers for the cFE Platform Support Packages (PSP). 18 | ** 19 | */ 20 | 21 | #ifndef _psp_version_ 22 | #define _psp_version_ 23 | 24 | 25 | /* 26 | ** Macro Definitions 27 | */ 28 | #define CFE_PSP_MAJOR_VERSION 1 29 | #define CFE_PSP_MINOR_VERSION 2 30 | #define CFE_PSP_REVISION 0 31 | #define CFE_PSP_MISSION_REV 0 32 | 33 | /* For backwards compatibility */ 34 | #define CFE_PSP_SUBMINOR_VERSION CFE_PSP_REVISION 35 | 36 | 37 | #endif /* _psp_version_ */ 38 | 39 | -------------------------------------------------------------------------------- /os/common/ext/ARM/CMSIS/Core/Include/cmsis_version.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************//** 2 | * @file cmsis_version.h 3 | * @brief CMSIS Core(M) Version definitions 4 | * @version V5.0.2 5 | * @date 19. April 2017 6 | ******************************************************************************/ 7 | /* 8 | * Copyright (c) 2009-2017 ARM Limited. All rights reserved. 9 | * 10 | * SPDX-License-Identifier: Apache-2.0 11 | * 12 | * Licensed under the Apache License, Version 2.0 (the License); you may 13 | * not use this file except in compliance with the License. 14 | * You may obtain a copy of the License at 15 | * 16 | * www.apache.org/licenses/LICENSE-2.0 17 | * 18 | * Unless required by applicable law or agreed to in writing, software 19 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 20 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 21 | * See the License for the specific language governing permissions and 22 | * limitations under the License. 23 | */ 24 | 25 | #if defined ( __ICCARM__ ) 26 | #pragma system_include /* treat file as system include file for MISRA check */ 27 | #elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) 28 | #pragma clang system_header /* treat file as system include file */ 29 | #endif 30 | 31 | #ifndef __CMSIS_VERSION_H 32 | #define __CMSIS_VERSION_H 33 | 34 | /* CMSIS Version definitions */ 35 | #define __CM_CMSIS_VERSION_MAIN ( 5U) /*!< [31:16] CMSIS Core(M) main version */ 36 | #define __CM_CMSIS_VERSION_SUB ( 0U) /*!< [15:0] CMSIS Core(M) sub version */ 37 | #define __CM_CMSIS_VERSION ((__CM_CMSIS_VERSION_MAIN << 16U) | \ 38 | __CM_CMSIS_VERSION_SUB ) /*!< CMSIS Core(M) version number */ 39 | #endif 40 | -------------------------------------------------------------------------------- /os/common/ext/ARM/CMSIS/readme.txt: -------------------------------------------------------------------------------- 1 | CMSIS is Copyright (C) 2011-2013 ARM Limited. All rights reserved. 2 | 3 | This directory contains only part of the CMSIS package. If you need the whole 4 | package please download it from: 5 | 6 | http://www.arm.com 7 | -------------------------------------------------------------------------------- /os/common/ext/ST/STM32F4xx/stm32f4xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Meta-Team/Meta-Embedded/1bf0588cffe7463acc78d59e568265057d118da9/os/common/ext/ST/STM32F4xx/stm32f4xx.h -------------------------------------------------------------------------------- /os/common/ext/readme.txt: -------------------------------------------------------------------------------- 1 | All the code contained under ./os/common/ext is not part of the ChibiOS 2 | project and supplied as-is without any additional warranty by ChibiOS. 3 | For ownership and copyright statements see the license details inside the 4 | code. 5 | 6 | Some modules may contain changes from the ChibiOS team in order to increase 7 | compatibility or usability with ChibiOS itself. 8 | -------------------------------------------------------------------------------- /os/common/oslib/readme.txt: -------------------------------------------------------------------------------- 1 | All the code contained under ./os/common/oslib are optional RTOS modules 2 | compatible with both RT and NIL. The code is placed under ./os/common in 3 | order to prevent code duplication and disalignments. 4 | -------------------------------------------------------------------------------- /os/common/ports/ARM/compilers/GCC/mk/port_generic.mk: -------------------------------------------------------------------------------- 1 | # List of the ChibiOS/RT ARM generic port files. 2 | PORTSRC = ${CHIBIOS}/os/common/ports/ARM/chcore.c 3 | 4 | PORTASM = $(CHIBIOS)/os/common/ports/ARM/compilers/GCC/chcoreasm.S 5 | 6 | PORTINC = ${CHIBIOS}/os/common/ports/ARM \ 7 | ${CHIBIOS}/os/common/ports/ARM/compilers/GCC 8 | 9 | # Shared variables 10 | ALLXASMSRC += $(PORTASM) 11 | ALLCSRC += $(PORTSRC) 12 | ALLINC += $(PORTINC) 13 | -------------------------------------------------------------------------------- /os/common/ports/ARMCMx/compilers/GCC/mk/port_v6m.mk: -------------------------------------------------------------------------------- 1 | # List of the ChibiOS/RT Cortex-M0 STM32F0xx port files. 2 | PORTSRC = $(CHIBIOS)/os/common/ports/ARMCMx/chcore.c \ 3 | $(CHIBIOS)/os/common/ports/ARMCMx/chcore_v6m.c 4 | 5 | PORTASM = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/chcoreasm_v6m.S 6 | 7 | PORTINC = $(CHIBIOS)/os/common/ports/ARMCMx \ 8 | $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC 9 | 10 | # Shared variables 11 | ALLXASMSRC += $(PORTASM) 12 | ALLCSRC += $(PORTSRC) 13 | ALLINC += $(PORTINC) 14 | -------------------------------------------------------------------------------- /os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk: -------------------------------------------------------------------------------- 1 | # List of the ChibiOS/RT ARMv7M generic port files. 2 | PORTSRC = $(CHIBIOS)/os/common/ports/ARMCMx/chcore.c \ 3 | $(CHIBIOS)/os/common/ports/ARMCMx/chcore_v7m.c 4 | 5 | PORTASM = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/chcoreasm_v7m.S 6 | 7 | PORTINC = $(CHIBIOS)/os/common/ports/ARMCMx \ 8 | $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC 9 | 10 | # Shared variables 11 | ALLXASMSRC += $(PORTASM) 12 | ALLCSRC += $(PORTSRC) 13 | ALLINC += $(PORTINC) 14 | -------------------------------------------------------------------------------- /os/common/ports/AVR/compilers/GCC/mk/port.mk: -------------------------------------------------------------------------------- 1 | # List of the ChibiOS/RT AVR port files. 2 | PORTSRC = ${CHIBIOS}/os/common/ports/AVR/chcore.c 3 | 4 | PORTASM = 5 | 6 | PORTINC = ${CHIBIOS}/os/common/ports/AVR \ 7 | ${CHIBIOS}/os/common/ports/AVR/compilers/GCC 8 | 9 | # Shared variables 10 | ALLXASMSRC += $(PORTASM) 11 | ALLCSRC += $(PORTSRC) 12 | ALLINC += $(PORTINC) 13 | -------------------------------------------------------------------------------- /os/common/ports/SIMIA32/compilers/GCC/port.mk: -------------------------------------------------------------------------------- 1 | # List of the ChibiOS/RT SIMIA32 port files. 2 | PORTSRC = ${CHIBIOS}/os/common/ports/SIMIA32/chcore.c 3 | 4 | PORTASM = 5 | 6 | PORTINC = ${CHIBIOS}/os/common/ports/SIMIA32/compilers/GCC \ 7 | ${CHIBIOS}/os/common/ports/SIMIA32 8 | 9 | # Shared variables 10 | ALLXASMSRC += $(PORTASM) 11 | ALLCSRC += $(PORTSRC) 12 | ALLINC += $(PORTINC) 13 | -------------------------------------------------------------------------------- /os/common/ports/e200/compilers/GCC/mk/port.mk: -------------------------------------------------------------------------------- 1 | # List of the ChibiOS/RT e200 generic port files. 2 | PORTSRC = $(CHIBIOS)/os/common/ports/e200/chcore.c 3 | 4 | PORTASM = $(CHIBIOS)/os/common/ports/e200/compilers/GCC/ivor.S \ 5 | $(CHIBIOS)/os/common/ports/e200/compilers/GCC/chcoreasm.S 6 | 7 | PORTINC = $(CHIBIOS)/os/common/ports/e200 \ 8 | $(CHIBIOS)/os/common/ports/e200/compilers/GCC 9 | 10 | # Shared variables 11 | ALLXASMSRC += $(PORTASM) 12 | ALLCSRC += $(PORTSRC) 13 | ALLINC += $(PORTINC) 14 | -------------------------------------------------------------------------------- /os/common/ports/e200/compilers/GHS/mk/port.mk: -------------------------------------------------------------------------------- 1 | # List of the ChibiOS/RT e200 generic port files. 2 | PORTSRC = $(CHIBIOS)/os/common/ports/e200/chcore.c 3 | 4 | PORTASM = $(CHIBIOS)/os/common/ports/e200/compilers/GHS/ivor.s \ 5 | $(CHIBIOS)/os/common/ports/e200/compilers/GHS/chcoreasm.s 6 | 7 | PORTINC = $(CHIBIOS)/os/common/ports/e200 \ 8 | $(CHIBIOS)/os/common/ports/e200/compilers/GHS 9 | 10 | # Shared variables 11 | ALLASMSRC += $(PORTASM) 12 | ALLCSRC += $(PORTSRC) 13 | ALLINC += $(PORTINC) 14 | -------------------------------------------------------------------------------- /os/common/ports/readme.txt: -------------------------------------------------------------------------------- 1 | All the code contained under ./os/common/ports are RTOS ports compatible 2 | with both RT and NIL. The code is placed under ./os/common in order to 3 | prevent code duplication and disalignments. 4 | -------------------------------------------------------------------------------- /os/common/startup/ARM/compilers/GCC/ld/LPC2148.ld: -------------------------------------------------------------------------------- 1 | /* 2 | ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | /* 18 | * LPC2148 memory setup. 19 | */ 20 | MEMORY 21 | { 22 | flash : org = 0x00000000, len = 512k - 12k 23 | ram0 : org = 0x40000200, len = 32k - 0x200 - 288 24 | ram1 : org = 0x00000000, len = 0 25 | ram2 : org = 0x00000000, len = 0 26 | ram3 : org = 0x00000000, len = 0 27 | ram4 : org = 0x00000000, len = 0 28 | ram5 : org = 0x00000000, len = 0 29 | ram6 : org = 0x00000000, len = 0 30 | ram7 : org = 0x00000000, len = 0 31 | } 32 | 33 | /* RAM region to be used for stacks. This stack accommodates the processing 34 | of all exceptions and interrupts*/ 35 | REGION_ALIAS("STACKS_RAM", ram0); 36 | 37 | /* RAM region to be used for data segment.*/ 38 | REGION_ALIAS("DATA_RAM", ram0); 39 | 40 | /* RAM region to be used for BSS segment.*/ 41 | REGION_ALIAS("BSS_RAM", ram0); 42 | 43 | INCLUDE rules.ld 44 | -------------------------------------------------------------------------------- /os/common/startup/ARM/compilers/GCC/mk/startup_lpc214x.mk: -------------------------------------------------------------------------------- 1 | # List of the ChibiOS generic LPC214x file. 2 | STARTUPSRC = $(CHIBIOS)/os/common/startup/ARM/compilers/GCC/crt1.c 3 | 4 | STARTUPASM = $(CHIBIOS)/os/common/startup/ARM/compilers/GCC/vectors.S \ 5 | $(CHIBIOS)/os/common/startup/ARM/compilers/GCC/crt0.S 6 | 7 | STARTUPINC = $(CHIBIOS)/os/common/portability/GCC \ 8 | ${CHIBIOS}/os/common/startup/ARM/devices/LPC214x 9 | 10 | STARTUPLD = ${CHIBIOS}/os/common/startup/ARM/compilers/GCC/ld 11 | 12 | # Shared variables 13 | ALLXASMSRC += $(STARTUPASM) 14 | ALLCSRC += $(STARTUPSRC) 15 | ALLINC += $(STARTUPINC) 16 | -------------------------------------------------------------------------------- /os/common/startup/ARM/devices/LPC214x/armparams.h: -------------------------------------------------------------------------------- 1 | /* 2 | ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | /** 18 | * @file LPC214x/armparams.h 19 | * @brief ARM parameters for the LPC214x. 20 | * 21 | * @defgroup ARM_LPC214x LPC214x Specific Parameters 22 | * @ingroup ARM_SPECIFIC 23 | * @details This file contains the ARM specific parameters for the 24 | * LPC214x platform. 25 | * @{ 26 | */ 27 | 28 | #ifndef ARMPARAMS_H 29 | #define ARMPARAMS_H 30 | 31 | /** 32 | * @brief ARM core model. 33 | */ 34 | #define ARM_CORE ARM_CORE_ARM7TDMI 35 | 36 | /** 37 | * @brief Thumb-capable. 38 | */ 39 | #define ARM_SUPPORTS_THUMB 1 40 | 41 | /** 42 | * @brief Thumb2-capable. 43 | */ 44 | #define ARM_SUPPORTS_THUMB2 0 45 | 46 | /** 47 | * @brief Implementation of the wait-for-interrupt state enter. 48 | */ 49 | #define ARM_WFI_IMPL (PCON = 1) 50 | 51 | #if !defined(_FROM_ASM_) || defined(__DOXYGEN__) 52 | /** 53 | * @brief Address of the IRQ vector register in the interrupt controller. 54 | */ 55 | #define ARM_IRQ_VECTOR_REG 0xFFFFF030U 56 | #else 57 | #define ARM_IRQ_VECTOR_REG 0xFFFFF030 58 | #endif 59 | 60 | #endif /* ARMPARAMS_H */ 61 | 62 | /** @} */ 63 | -------------------------------------------------------------------------------- /os/common/startup/ARMCMx/compilers/GCC/ld/rules.ld: -------------------------------------------------------------------------------- 1 | /* Stack rules inclusion.*/ 2 | INCLUDE rules_stacks.ld 3 | 4 | /* Code rules inclusion.*/ 5 | INCLUDE rules_code.ld 6 | 7 | /* Data rules inclusion.*/ 8 | INCLUDE rules_data.ld 9 | -------------------------------------------------------------------------------- /os/common/startup/ARMCMx/compilers/GCC/ld/rules_stacks.ld: -------------------------------------------------------------------------------- 1 | /* 2 | ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | SECTIONS 17 | { 18 | /* Special section for exceptions stack.*/ 19 | .mstack : 20 | { 21 | . = ALIGN(8); 22 | __main_stack_base__ = .; 23 | . += __main_stack_size__; 24 | . = ALIGN(8); 25 | __main_stack_end__ = .; 26 | } > MAIN_STACK_RAM 27 | 28 | /* Special section for process stack.*/ 29 | .pstack : 30 | { 31 | __process_stack_base__ = .; 32 | __main_thread_stack_base__ = .; 33 | . += __process_stack_size__; 34 | . = ALIGN(8); 35 | __process_stack_end__ = .; 36 | __main_thread_stack_end__ = .; 37 | } > PROCESS_STACK_RAM 38 | } 39 | -------------------------------------------------------------------------------- /os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f0xx.mk: -------------------------------------------------------------------------------- 1 | # List of the ChibiOS generic STM32F0xx startup and CMSIS files. 2 | STARTUPSRC = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/crt1.c 3 | 4 | STARTUPASM = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/crt0_v6m.S \ 5 | $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/vectors.S 6 | 7 | STARTUPINC = $(CHIBIOS)/os/common/portability/GCC \ 8 | $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC \ 9 | $(CHIBIOS)/os/common/startup/ARMCMx/devices/STM32F0xx \ 10 | $(CHIBIOS)/os/common/ext/ARM/CMSIS/Core/Include \ 11 | $(CHIBIOS)/os/common/ext/ST/STM32F0xx 12 | 13 | STARTUPLD = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/ld 14 | 15 | # Shared variables 16 | ALLXASMSRC += $(STARTUPASM) 17 | ALLCSRC += $(STARTUPSRC) 18 | ALLINC += $(STARTUPINC) 19 | -------------------------------------------------------------------------------- /os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f1xx.mk: -------------------------------------------------------------------------------- 1 | # List of the ChibiOS generic STM32F1xx startup and CMSIS files. 2 | STARTUPSRC = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/crt1.c 3 | 4 | STARTUPASM = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/crt0_v7m.S \ 5 | $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/vectors.S 6 | 7 | STARTUPINC = $(CHIBIOS)/os/common/portability/GCC \ 8 | $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC \ 9 | $(CHIBIOS)/os/common/startup/ARMCMx/devices/STM32F1xx \ 10 | $(CHIBIOS)/os/common/ext/ARM/CMSIS/Core/Include \ 11 | $(CHIBIOS)/os/common/ext/ST/STM32F1xx 12 | 13 | STARTUPLD = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/ld 14 | 15 | # Shared variables 16 | ALLXASMSRC += $(STARTUPASM) 17 | ALLCSRC += $(STARTUPSRC) 18 | ALLINC += $(STARTUPINC) 19 | -------------------------------------------------------------------------------- /os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f2xx.mk: -------------------------------------------------------------------------------- 1 | # List of the ChibiOS generic STM32F2xx startup and CMSIS files. 2 | STARTUPSRC = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/crt1.c 3 | 4 | STARTUPASM = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/crt0_v7m.S \ 5 | $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/vectors.S 6 | 7 | STARTUPINC = $(CHIBIOS)/os/common/portability/GCC \ 8 | $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC \ 9 | $(CHIBIOS)/os/common/startup/ARMCMx/devices/STM32F2xx \ 10 | $(CHIBIOS)/os/common/ext/ARM/CMSIS/Core/Include \ 11 | $(CHIBIOS)/os/common/ext/ST/STM32F2xx 12 | 13 | STARTUPLD = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/ld 14 | 15 | # Shared variables 16 | ALLXASMSRC += $(STARTUPASM) 17 | ALLCSRC += $(STARTUPSRC) 18 | ALLINC += $(STARTUPINC) 19 | -------------------------------------------------------------------------------- /os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f3xx.mk: -------------------------------------------------------------------------------- 1 | # List of the ChibiOS generic STM32F3xx startup and CMSIS files. 2 | STARTUPSRC = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/crt1.c 3 | 4 | STARTUPASM = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/crt0_v7m.S \ 5 | $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/vectors.S 6 | 7 | STARTUPINC = $(CHIBIOS)/os/common/portability/GCC \ 8 | $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC \ 9 | $(CHIBIOS)/os/common/startup/ARMCMx/devices/STM32F3xx \ 10 | $(CHIBIOS)/os/common/ext/ARM/CMSIS/Core/Include \ 11 | $(CHIBIOS)/os/common/ext/ST/STM32F3xx 12 | 13 | STARTUPLD = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/ld 14 | 15 | # Shared variables 16 | ALLXASMSRC += $(STARTUPASM) 17 | ALLCSRC += $(STARTUPSRC) 18 | ALLINC += $(STARTUPINC) 19 | -------------------------------------------------------------------------------- /os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f4xx.mk: -------------------------------------------------------------------------------- 1 | # List of the ChibiOS generic STM32F4xx startup and CMSIS files. 2 | STARTUPSRC = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/crt1.c 3 | 4 | STARTUPASM = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/crt0_v7m.S \ 5 | $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/vectors.S 6 | 7 | STARTUPINC = $(CHIBIOS)/os/common/portability/GCC \ 8 | $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC \ 9 | $(CHIBIOS)/os/common/startup/ARMCMx/devices/STM32F4xx \ 10 | $(CHIBIOS)/os/common/ext/ARM/CMSIS/Core/Include \ 11 | $(CHIBIOS)/os/common/ext/ST/STM32F4xx 12 | 13 | STARTUPLD = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/ld 14 | 15 | # Shared variables 16 | ALLXASMSRC += $(STARTUPASM) 17 | ALLCSRC += $(STARTUPSRC) 18 | ALLINC += $(STARTUPINC) 19 | -------------------------------------------------------------------------------- /os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f7xx.mk: -------------------------------------------------------------------------------- 1 | # List of the ChibiOS generic STM32F7xx startup and CMSIS files. 2 | STARTUPSRC = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/crt1.c 3 | 4 | STARTUPASM = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/crt0_v7m.S \ 5 | $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/vectors.S 6 | 7 | STARTUPINC = $(CHIBIOS)/os/common/portability/GCC \ 8 | $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC \ 9 | $(CHIBIOS)/os/common/startup/ARMCMx/devices/STM32F7xx \ 10 | $(CHIBIOS)/os/common/ext/ARM/CMSIS/Core/Include \ 11 | $(CHIBIOS)/os/common/ext/ST/STM32F7xx 12 | 13 | STARTUPLD = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/ld 14 | 15 | # Shared variables 16 | ALLXASMSRC += $(STARTUPASM) 17 | ALLCSRC += $(STARTUPSRC) 18 | ALLINC += $(STARTUPINC) 19 | -------------------------------------------------------------------------------- /os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32h7xx.mk: -------------------------------------------------------------------------------- 1 | # List of the ChibiOS generic STM32H7xx startup and CMSIS files. 2 | STARTUPSRC = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/crt1.c 3 | 4 | STARTUPASM = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/crt0_v7m.S \ 5 | $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/vectors.S 6 | 7 | STARTUPINC = $(CHIBIOS)/os/common/portability/GCC \ 8 | $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC \ 9 | $(CHIBIOS)/os/common/startup/ARMCMx/devices/STM32H7xx \ 10 | $(CHIBIOS)/os/common/ext/ARM/CMSIS/Core/Include \ 11 | $(CHIBIOS)/os/common/ext/ST/STM32H7xx 12 | 13 | STARTUPLD = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/ld 14 | 15 | # Shared variables 16 | ALLXASMSRC += $(STARTUPASM) 17 | ALLCSRC += $(STARTUPSRC) 18 | ALLINC += $(STARTUPINC) 19 | -------------------------------------------------------------------------------- /os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32l0xx.mk: -------------------------------------------------------------------------------- 1 | # List of the ChibiOS generic STM32L0xx startup and CMSIS files. 2 | STARTUPSRC = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/crt1.c 3 | 4 | STARTUPASM = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/crt0_v6m.S \ 5 | $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/vectors.S 6 | 7 | STARTUPINC = $(CHIBIOS)/os/common/portability/GCC \ 8 | $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC \ 9 | $(CHIBIOS)/os/common/startup/ARMCMx/devices/STM32L0xx \ 10 | $(CHIBIOS)/os/common/ext/ARM/CMSIS/Core/Include \ 11 | $(CHIBIOS)/os/common/ext/ST/STM32L0xx 12 | 13 | STARTUPLD = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/ld 14 | 15 | # Shared variables 16 | ALLXASMSRC += $(STARTUPASM) 17 | ALLCSRC += $(STARTUPSRC) 18 | ALLINC += $(STARTUPINC) 19 | -------------------------------------------------------------------------------- /os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32l1xx.mk: -------------------------------------------------------------------------------- 1 | # List of the ChibiOS generic STM32L1xx startup and CMSIS files. 2 | STARTUPSRC = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/crt1.c 3 | 4 | STARTUPASM = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/crt0_v7m.S \ 5 | $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/vectors.S 6 | 7 | STARTUPINC = $(CHIBIOS)/os/common/portability/GCC \ 8 | $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC \ 9 | $(CHIBIOS)/os/common/startup/ARMCMx/devices/STM32L1xx \ 10 | $(CHIBIOS)/os/common/ext/ARM/CMSIS/Core/Include \ 11 | $(CHIBIOS)/os/common/ext/ST/STM32L1xx 12 | 13 | STARTUPLD = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/ld 14 | 15 | # Shared variables 16 | ALLXASMSRC += $(STARTUPASM) 17 | ALLCSRC += $(STARTUPSRC) 18 | ALLINC += $(STARTUPINC) 19 | -------------------------------------------------------------------------------- /os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32l4xx.mk: -------------------------------------------------------------------------------- 1 | # List of the ChibiOS generic STM32L4xx startup and CMSIS files. 2 | STARTUPSRC = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/crt1.c 3 | 4 | STARTUPASM = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/crt0_v7m.S \ 5 | $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/vectors.S 6 | 7 | STARTUPINC = $(CHIBIOS)/os/common/portability/GCC \ 8 | $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC \ 9 | $(CHIBIOS)/os/common/startup/ARMCMx/devices/STM32L4xx \ 10 | $(CHIBIOS)/os/common/ext/ARM/CMSIS/Core/Include \ 11 | $(CHIBIOS)/os/common/ext/ST/STM32L4xx 12 | 13 | STARTUPLD = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/ld 14 | 15 | # Shared variables 16 | ALLXASMSRC += $(STARTUPASM) 17 | ALLCSRC += $(STARTUPSRC) 18 | ALLINC += $(STARTUPINC) 19 | -------------------------------------------------------------------------------- /os/common/startup/e200/compilers/GCC/ld/SPC560B50.ld: -------------------------------------------------------------------------------- 1 | /* 2 | ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | /* 18 | * SPC560B50 memory setup. 19 | */ 20 | MEMORY 21 | { 22 | flash : org = 0x00000000, len = 512k 23 | dataflash : org = 0x00800000, len = 64k 24 | ram : org = 0x40000000, len = 32k 25 | } 26 | 27 | INCLUDE rules_z0.ld 28 | -------------------------------------------------------------------------------- /os/common/startup/e200/compilers/GCC/ld/SPC560B60.ld: -------------------------------------------------------------------------------- 1 | /* 2 | ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | /* 18 | * SPC560B60 memory setup. 19 | */ 20 | MEMORY 21 | { 22 | flash : org = 0x00000000, len = 1024k 23 | dataflash : org = 0x00800000, len = 64k 24 | ram : org = 0x40000000, len = 80k 25 | } 26 | 27 | INCLUDE rules_z0.ld 28 | -------------------------------------------------------------------------------- /os/common/startup/e200/compilers/GCC/ld/SPC560B64.ld: -------------------------------------------------------------------------------- 1 | /* 2 | ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | /* 18 | * SPC560B64 memory setup. 19 | */ 20 | MEMORY 21 | { 22 | flash : org = 0x00000000, len = 1536k 23 | dataflash : org = 0x00800000, len = 64k 24 | ram : org = 0x40000000, len = 96k 25 | } 26 | 27 | INCLUDE rules_z0.ld 28 | -------------------------------------------------------------------------------- /os/common/startup/e200/compilers/GCC/ld/SPC560D40.ld: -------------------------------------------------------------------------------- 1 | /* 2 | ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | /* 18 | * SPC560D40 memory setup. 19 | */ 20 | MEMORY 21 | { 22 | flash : org = 0x00000000, len = 256k 23 | dataflash : org = 0x00800000, len = 64k 24 | ram : org = 0x40000000, len = 16k 25 | } 26 | 27 | INCLUDE rules_z0.ld 28 | -------------------------------------------------------------------------------- /os/common/startup/e200/compilers/GCC/ld/SPC560P50.ld: -------------------------------------------------------------------------------- 1 | /* 2 | ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | /* 18 | * SPC560P50 memory setup. 19 | */ 20 | MEMORY 21 | { 22 | flash : org = 0x00000000, len = 512k 23 | dataflash : org = 0x00800000, len = 64k 24 | ram : org = 0x40000000, len = 40k 25 | } 26 | 27 | INCLUDE rules_z0.ld 28 | -------------------------------------------------------------------------------- /os/common/startup/e200/compilers/GCC/ld/SPC563M64.ld: -------------------------------------------------------------------------------- 1 | /* 2 | ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | /* 18 | * SPC563M64 memory setup. 19 | */ 20 | MEMORY 21 | { 22 | flash : org = 0x00000000, len = 1536k 23 | ram : org = 0x40000000, len = 94k 24 | } 25 | 26 | INCLUDE rules_z3.ld 27 | -------------------------------------------------------------------------------- /os/common/startup/e200/compilers/GCC/ld/SPC564A70.ld: -------------------------------------------------------------------------------- 1 | /* 2 | ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | /* 18 | * SPC563A70 memory setup. 19 | */ 20 | MEMORY 21 | { 22 | flash : org = 0x00000000, len = 2M 23 | ram : org = 0x40000000, len = 128k 24 | } 25 | 26 | INCLUDE rules_z4.ld 27 | -------------------------------------------------------------------------------- /os/common/startup/e200/compilers/GCC/ld/SPC564A80.ld: -------------------------------------------------------------------------------- 1 | /* 2 | ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | /* 18 | * SPC563A80 memory setup. 19 | */ 20 | MEMORY 21 | { 22 | flash : org = 0x00000000, len = 4M 23 | ram : org = 0x40000000, len = 192k 24 | } 25 | 26 | INCLUDE rules_z4.ld 27 | -------------------------------------------------------------------------------- /os/common/startup/e200/compilers/GCC/ld/SPC56EC74.ld: -------------------------------------------------------------------------------- 1 | /* 2 | ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | /* 18 | * SPC56EC74 memory setup. 19 | */ 20 | MEMORY 21 | { 22 | flash : org = 0x00000000, len = 3M 23 | dataflash : org = 0x00800000, len = 64k 24 | ram : org = 0x40000000, len = 256k 25 | } 26 | 27 | INCLUDE rules_z4.ld 28 | -------------------------------------------------------------------------------- /os/common/startup/e200/compilers/GCC/ld/SPC56EL54_LSM.ld: -------------------------------------------------------------------------------- 1 | /* 2 | ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | /* 18 | * SPC56EL54 memory setup in LSM mode. 19 | */ 20 | MEMORY 21 | { 22 | flash : org = 0x00000000, len = 768k 23 | ram : org = 0x40000000, len = 128k 24 | } 25 | 26 | INCLUDE rules_z4.ld 27 | -------------------------------------------------------------------------------- /os/common/startup/e200/compilers/GCC/ld/SPC56EL60_LSM.ld: -------------------------------------------------------------------------------- 1 | /* 2 | ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | /* 18 | * SPC56EL60 memory setup in LSM mode. 19 | */ 20 | MEMORY 21 | { 22 | flash : org = 0x00000000, len = 1M 23 | ram : org = 0x40000000, len = 128k 24 | } 25 | 26 | INCLUDE rules_z4.ld 27 | -------------------------------------------------------------------------------- /os/common/startup/e200/compilers/GCC/ld/SPC56EL70_LSM.ld: -------------------------------------------------------------------------------- 1 | /* 2 | ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | /* 18 | * SPC56EL70 memory setup in LSM mode. 19 | */ 20 | MEMORY 21 | { 22 | flash : org = 0x00000000, len = 2M 23 | ram : org = 0x40000000, len = 192k 24 | } 25 | 26 | INCLUDE rules_z4.ld 27 | -------------------------------------------------------------------------------- /os/common/startup/e200/compilers/GCC/ld/SPC57EM80_HSM.ld: -------------------------------------------------------------------------------- 1 | /* 2 | ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | /* 18 | * SPC57EM80-HSM memory setup. 19 | */ 20 | MEMORY 21 | { 22 | flash : org = 0x0060C000, len = 144k 23 | dflash0 : org = 0x00680000, len = 16k 24 | dflash1 : org = 0x00684000, len = 16k 25 | ram : org = 0xA0000000, len = 40k 26 | } 27 | 28 | INCLUDE rules_z0.ld 29 | -------------------------------------------------------------------------------- /os/common/startup/e200/compilers/GCC/mk/startup_spc560bcxx.mk: -------------------------------------------------------------------------------- 1 | # List of the ChibiOS e200z0 SPC560BCxx startup files. 2 | STARTUPSRC = 3 | 4 | STARTUPASM = $(CHIBIOS)/os/common/startup/e200/devices/SPC560BCxx/boot.S \ 5 | $(CHIBIOS)/os/common/startup/e200/compilers/GCC/vectors.S \ 6 | $(CHIBIOS)/os/common/startup/e200/compilers/GCC/crt0.S 7 | 8 | STARTUPINC = $(CHIBIOS)/os/common/portability/GCC \ 9 | ${CHIBIOS}/os/common/startup/e200/compilers/GCC \ 10 | ${CHIBIOS}/os/common/startup/e200/devices/SPC560BCxx 11 | 12 | STARTUPLD = ${CHIBIOS}/os/common/startup/e200/compilers/GCC/ld 13 | 14 | # Shared variables 15 | ALLXASMSRC += $(STARTUPASM) 16 | ALLCSRC += $(STARTUPSRC) 17 | ALLINC += $(STARTUPINC) 18 | -------------------------------------------------------------------------------- /os/common/startup/e200/compilers/GCC/mk/startup_spc560bxx.mk: -------------------------------------------------------------------------------- 1 | # List of the ChibiOS e200z0 SPC560Bxx startup files. 2 | STARTUPSRC = 3 | 4 | STARTUPASM = $(CHIBIOS)/os/common/startup/e200/devices/SPC560Bxx/boot.S \ 5 | $(CHIBIOS)/os/common/startup/e200/compilers/GCC/vectors.S \ 6 | $(CHIBIOS)/os/common/startup/e200/compilers/GCC/crt0.S 7 | 8 | STARTUPINC = $(CHIBIOS)/os/common/portability/GCC \ 9 | ${CHIBIOS}/os/common/startup/e200/compilers/GCC \ 10 | ${CHIBIOS}/os/common/startup/e200/devices/SPC560Bxx 11 | 12 | STARTUPLD = ${CHIBIOS}/os/common/startup/e200/compilers/GCC/ld 13 | 14 | # Shared variables 15 | ALLXASMSRC += $(STARTUPASM) 16 | ALLCSRC += $(STARTUPSRC) 17 | ALLINC += $(STARTUPINC) 18 | -------------------------------------------------------------------------------- /os/common/startup/e200/compilers/GCC/mk/startup_spc560dxx.mk: -------------------------------------------------------------------------------- 1 | # List of the ChibiOS e200z0 SPC560Dxx startup files. 2 | STARTUPSRC = 3 | 4 | STARTUPASM = $(CHIBIOS)/os/common/startup/e200/devices/SPC560Dxx/boot.S \ 5 | $(CHIBIOS)/os/common/startup/e200/compilers/GCC/vectors.S \ 6 | $(CHIBIOS)/os/common/startup/e200/compilers/GCC/crt0.S 7 | 8 | STARTUPINC = $(CHIBIOS)/os/common/portability/GCC \ 9 | ${CHIBIOS}/os/common/startup/e200/compilers/GCC \ 10 | ${CHIBIOS}/os/common/startup/e200/devices/SPC560Dxx 11 | 12 | STARTUPLD = ${CHIBIOS}/os/common/startup/e200/compilers/GCC/ld 13 | 14 | # Shared variables 15 | ALLXASMSRC += $(STARTUPASM) 16 | ALLCSRC += $(STARTUPSRC) 17 | ALLINC += $(STARTUPINC) 18 | -------------------------------------------------------------------------------- /os/common/startup/e200/compilers/GCC/mk/startup_spc560pxx.mk: -------------------------------------------------------------------------------- 1 | # List of the ChibiOS e200z0 SPC560Pxx startup files. 2 | STARTUPSRC = 3 | 4 | STARTUPASM = $(CHIBIOS)/os/common/startup/e200/devices/SPC560Pxx/boot.S \ 5 | $(CHIBIOS)/os/common/startup/e200/compilers/GCC/vectors.S \ 6 | $(CHIBIOS)/os/common/startup/e200/compilers/GCC/crt0.S 7 | 8 | STARTUPINC = $(CHIBIOS)/os/common/portability/GCC \ 9 | ${CHIBIOS}/os/common/startup/e200/compilers/GCC \ 10 | ${CHIBIOS}/os/common/startup/e200/devices/SPC560Pxx 11 | 12 | STARTUPLD = ${CHIBIOS}/os/common/startup/e200/compilers/GCC/ld 13 | 14 | # Shared variables 15 | ALLXASMSRC += $(STARTUPASM) 16 | ALLCSRC += $(STARTUPSRC) 17 | ALLINC += $(STARTUPINC) 18 | -------------------------------------------------------------------------------- /os/common/startup/e200/compilers/GCC/mk/startup_spc563mxx.mk: -------------------------------------------------------------------------------- 1 | # List of the ChibiOS e200z3 SPC563Mxx startup files. 2 | STARTUPSRC = 3 | 4 | STARTUPASM = $(CHIBIOS)/os/common/startup/e200/devices/SPC563Mxx/boot.S \ 5 | $(CHIBIOS)/os/common/startup/e200/compilers/GCC/vectors.S \ 6 | $(CHIBIOS)/os/common/startup/e200/compilers/GCC/crt0.S 7 | 8 | STARTUPINC = $(CHIBIOS)/os/common/portability/GCC \ 9 | ${CHIBIOS}/os/common/startup/e200/compilers/GCC \ 10 | ${CHIBIOS}/os/common/startup/e200/devices/SPC563Mxx 11 | 12 | STARTUPLD = ${CHIBIOS}/os/common/startup/e200/compilers/GCC/ld 13 | 14 | # Shared variables 15 | ALLXASMSRC += $(STARTUPASM) 16 | ALLCSRC += $(STARTUPSRC) 17 | ALLINC += $(STARTUPINC) 18 | -------------------------------------------------------------------------------- /os/common/startup/e200/compilers/GCC/mk/startup_spc564axx.mk: -------------------------------------------------------------------------------- 1 | # List of the ChibiOS e200z4 SPC564Axx startup files. 2 | STARTUPSRC = 3 | 4 | STARTUPASM = $(CHIBIOS)/os/common/startup/e200/devices/SPC564Axx/boot.S \ 5 | $(CHIBIOS)/os/common/startup/e200/compilers/GCC/vectors.S \ 6 | $(CHIBIOS)/os/common/startup/e200/compilers/GCC/crt0.S 7 | 8 | STARTUPINC = $(CHIBIOS)/os/common/portability/GCC \ 9 | ${CHIBIOS}/os/common/startup/e200/compilers/GCC \ 10 | ${CHIBIOS}/os/common/startup/e200/devices/SPC564Axx 11 | 12 | STARTUPLD = ${CHIBIOS}/os/common/startup/e200/compilers/GCC/ld 13 | 14 | # Shared variables 15 | ALLXASMSRC += $(STARTUPASM) 16 | ALLCSRC += $(STARTUPSRC) 17 | ALLINC += $(STARTUPINC) 18 | -------------------------------------------------------------------------------- /os/common/startup/e200/compilers/GCC/mk/startup_spc56ecxx.mk: -------------------------------------------------------------------------------- 1 | # List of the ChibiOS e200z4 SPC56ECxx startup files. 2 | STARTUPSRC = 3 | 4 | STARTUPASM = $(CHIBIOS)/os/common/startup/e200/devices/SPC56ECxx/boot.S \ 5 | $(CHIBIOS)/os/common/startup/e200/compilers/GCC/vectors.S \ 6 | $(CHIBIOS)/os/common/startup/e200/compilers/GCC/crt0.S 7 | 8 | STARTUPINC = $(CHIBIOS)/os/common/portability/GCC \ 9 | ${CHIBIOS}/os/common/startup/e200/compilers/GCC \ 10 | ${CHIBIOS}/os/common/startup/e200/devices/SPC56ECxx 11 | 12 | STARTUPLD = ${CHIBIOS}/os/common/startup/e200/compilers/GCC/ld 13 | 14 | # Shared variables 15 | ALLXASMSRC += $(STARTUPASM) 16 | ALLCSRC += $(STARTUPSRC) 17 | ALLINC += $(STARTUPINC) 18 | -------------------------------------------------------------------------------- /os/common/startup/e200/compilers/GCC/mk/startup_spc56elxx.mk: -------------------------------------------------------------------------------- 1 | # List of the ChibiOS e200z4 SPC56ELxx startup files. 2 | STARTUPSRC = 3 | 4 | STARTUPASM = $(CHIBIOS)/os/common/startup/e200/devices/SPC56ELxx/boot.S \ 5 | $(CHIBIOS)/os/common/startup/e200/compilers/GCC/vectors.S \ 6 | $(CHIBIOS)/os/common/startup/e200/compilers/GCC/crt0.S 7 | 8 | STARTUPINC = $(CHIBIOS)/os/common/portability/GCC \ 9 | ${CHIBIOS}/os/common/startup/e200/compilers/GCC \ 10 | ${CHIBIOS}/os/common/startup/e200/devices/SPC56ELxx 11 | 12 | STARTUPLD = ${CHIBIOS}/os/common/startup/e200/compilers/GCC/ld 13 | 14 | # Shared variables 15 | ALLXASMSRC += $(STARTUPASM) 16 | ALLCSRC += $(STARTUPSRC) 17 | ALLINC += $(STARTUPINC) 18 | -------------------------------------------------------------------------------- /os/common/startup/e200/compilers/GHS/mk/startup_spc560bcxx.mk: -------------------------------------------------------------------------------- 1 | # List of the ChibiOS e200z0 SPC560BCxx startup files. 2 | STARTUPSRC = 3 | 4 | STARTUPASM = $(CHIBIOS)/os/common/startup/e200/devices/SPC560BCxx/boot_ghs.s \ 5 | $(CHIBIOS)/os/common/startup/e200/compilers/GHS/vectors.s \ 6 | $(CHIBIOS)/os/common/startup/e200/compilers/GHS/crt0.s 7 | 8 | STARTUPINC = ${CHIBIOS}/os/common/startup/e200/compilers/GHS \ 9 | ${CHIBIOS}/os/common/startup/e200/devices/SPC560BCxx 10 | 11 | STARTUPLD = ${CHIBIOS}/os/common/startup/e200/compilers/GHS/ld 12 | 13 | # Shared variables 14 | ALLASMSRC += $(STARTUPASM) 15 | ALLCSRC += $(STARTUPSRC) 16 | ALLINC += $(STARTUPINC) 17 | -------------------------------------------------------------------------------- /os/common/startup/e200/compilers/GHS/mk/startup_spc560bxx.mk: -------------------------------------------------------------------------------- 1 | # List of the ChibiOS e200z0 SPC560Bxx startup files. 2 | STARTUPSRC = 3 | 4 | STARTUPASM = $(CHIBIOS)/os/common/startup/e200/devices/SPC560Bxx/boot_ghs.s \ 5 | $(CHIBIOS)/os/common/startup/e200/compilers/GHS/vectors.s \ 6 | $(CHIBIOS)/os/common/startup/e200/compilers/GHS/crt0.s 7 | 8 | STARTUPINC = ${CHIBIOS}/os/common/startup/e200/compilers/GHS \ 9 | ${CHIBIOS}/os/common/startup/e200/devices/SPC560Bxx 10 | 11 | STARTUPLD = ${CHIBIOS}/os/common/startup/e200/compilers/GHS/ld 12 | 13 | # Shared variables 14 | ALLASMSRC += $(STARTUPASM) 15 | ALLCSRC += $(STARTUPSRC) 16 | ALLINC += $(STARTUPINC) 17 | -------------------------------------------------------------------------------- /os/common/startup/e200/compilers/GHS/mk/startup_spc560dxx.mk: -------------------------------------------------------------------------------- 1 | # List of the ChibiOS e200z0 SPC560Dxx startup files. 2 | STARTUPSRC = 3 | 4 | STARTUPASM = $(CHIBIOS)/os/common/startup/e200/devices/SPC560Dxx/boot_ghs.s \ 5 | $(CHIBIOS)/os/common/startup/e200/compilers/GHS/vectors.s \ 6 | $(CHIBIOS)/os/common/startup/e200/compilers/GHS/crt0.s 7 | 8 | STARTUPINC = ${CHIBIOS}/os/common/startup/e200/compilers/GHS \ 9 | ${CHIBIOS}/os/common/startup/e200/devices/SPC560Dxx 10 | 11 | STARTUPLD = ${CHIBIOS}/os/common/startup/e200/compilers/GHS/ld 12 | 13 | # Shared variables 14 | ALLASMSRC += $(STARTUPASM) 15 | ALLCSRC += $(STARTUPSRC) 16 | ALLINC += $(STARTUPINC) 17 | -------------------------------------------------------------------------------- /os/common/startup/e200/compilers/GHS/mk/startup_spc560pxx.mk: -------------------------------------------------------------------------------- 1 | # List of the ChibiOS e200z0 SPC560Pxx startup files. 2 | STARTUPSRC = 3 | 4 | STARTUPASM = $(CHIBIOS)/os/common/startup/e200/devices/SPC560Pxx/boot_ghs.s \ 5 | $(CHIBIOS)/os/common/startup/e200/compilers/GHS/vectors.s \ 6 | $(CHIBIOS)/os/common/startup/e200/compilers/GHS/crt0.s 7 | 8 | STARTUPINC = ${CHIBIOS}/os/common/startup/e200/compilers/GHS \ 9 | ${CHIBIOS}/os/common/startup/e200/devices/SPC560Pxx 10 | 11 | STARTUPLD = ${CHIBIOS}/os/common/startup/e200/compilers/GHS/ld 12 | 13 | # Shared variables 14 | ALLASMSRC += $(STARTUPASM) 15 | ALLCSRC += $(STARTUPSRC) 16 | ALLINC += $(STARTUPINC) 17 | -------------------------------------------------------------------------------- /os/common/startup/e200/compilers/GHS/mk/startup_spc563mxx.mk: -------------------------------------------------------------------------------- 1 | # List of the ChibiOS e200z3 SPC563Mxx startup files. 2 | STARTUPSRC = 3 | 4 | STARTUPASM = $(CHIBIOS)/os/common/startup/e200/devices/SPC563Mxx/boot_ghs.s \ 5 | $(CHIBIOS)/os/common/startup/e200/compilers/GHS/vectors.s \ 6 | $(CHIBIOS)/os/common/startup/e200/compilers/GHS/crt0.s 7 | 8 | STARTUPINC = ${CHIBIOS}/os/common/startup/e200/compilers/GHS \ 9 | ${CHIBIOS}/os/common/startup/e200/devices/SPC563Mxx 10 | 11 | STARTUPLD = ${CHIBIOS}/os/common/startup/e200/compilers/GHS/ld 12 | 13 | # Shared variables 14 | ALLASMSRC += $(STARTUPASM) 15 | ALLCSRC += $(STARTUPSRC) 16 | ALLINC += $(STARTUPINC) 17 | -------------------------------------------------------------------------------- /os/common/startup/e200/compilers/GHS/mk/startup_spc564axx.mk: -------------------------------------------------------------------------------- 1 | # List of the ChibiOS e200z4 SPC564Axx startup files. 2 | STARTUPSRC = 3 | 4 | STARTUPASM = $(CHIBIOS)/os/common/startup/e200/devices/SPC564Axx/boot_ghs.s \ 5 | $(CHIBIOS)/os/common/startup/e200/compilers/GHS/vectors.s \ 6 | $(CHIBIOS)/os/common/startup/e200/compilers/GHS/crt0.s 7 | 8 | STARTUPINC = ${CHIBIOS}/os/common/startup/e200/compilers/GHS \ 9 | ${CHIBIOS}/os/common/startup/e200/devices/SPC564Axx 10 | 11 | STARTUPLD = ${CHIBIOS}/os/common/startup/e200/compilers/GHS/ld 12 | 13 | # Shared variables 14 | ALLASMSRC += $(STARTUPASM) 15 | ALLCSRC += $(STARTUPSRC) 16 | ALLINC += $(STARTUPINC) 17 | -------------------------------------------------------------------------------- /os/common/startup/e200/compilers/GHS/mk/startup_spc56ecxx.mk: -------------------------------------------------------------------------------- 1 | # List of the ChibiOS e200z4 SPC56ECxx startup files. 2 | STARTUPSRC = 3 | 4 | STARTUPASM = $(CHIBIOS)/os/common/startup/e200/devices/SPC56ECxx/boot_ghs.s \ 5 | $(CHIBIOS)/os/common/startup/e200/compilers/GHS/vectors.s \ 6 | $(CHIBIOS)/os/common/startup/e200/compilers/GHS/crt0.s 7 | 8 | STARTUPINC = ${CHIBIOS}/os/common/startup/e200/compilers/GHS \ 9 | ${CHIBIOS}/os/common/startup/e200/devices/SPC56ECxx 10 | 11 | STARTUPLD = ${CHIBIOS}/os/common/startup/e200/compilers/GHS/ld 12 | 13 | # Shared variables 14 | ALLASMSRC += $(STARTUPASM) 15 | ALLCSRC += $(STARTUPSRC) 16 | ALLINC += $(STARTUPINC) 17 | -------------------------------------------------------------------------------- /os/common/startup/e200/compilers/GHS/mk/startup_spc56elxx.mk: -------------------------------------------------------------------------------- 1 | # List of the ChibiOS e200z4 SPC56ELxx startup files. 2 | STARTUPSRC = 3 | 4 | STARTUPASM = $(CHIBIOS)/os/common/startup/e200/devices/SPC56ELxx/boot_ghs.s \ 5 | $(CHIBIOS)/os/common/startup/e200/compilers/GHS/vectors.s \ 6 | $(CHIBIOS)/os/common/startup/e200/compilers/GHS/crt0.s 7 | 8 | STARTUPINC = ${CHIBIOS}/os/common/startup/e200/compilers/GHS \ 9 | ${CHIBIOS}/os/common/startup/e200/devices/SPC56ELxx 10 | 11 | STARTUPLD = ${CHIBIOS}/os/common/startup/e200/compilers/GHS/ld 12 | 13 | # Shared variables 14 | ALLASMSRC += $(STARTUPASM) 15 | ALLCSRC += $(STARTUPSRC) 16 | ALLINC += $(STARTUPINC) 17 | -------------------------------------------------------------------------------- /os/hal/lib/complex/mfs/mfs.mk: -------------------------------------------------------------------------------- 1 | # List of all the MFS subsystem files. 2 | MFSSRC := $(CHIBIOS)/os/hal/lib/complex/mfs/mfs.c 3 | 4 | # Required include directories 5 | MFSINC := $(CHIBIOS)/os/hal/lib/complex/mfs 6 | 7 | # Shared variables 8 | ALLCSRC += $(MFSSRC) 9 | ALLINC += $(MFSINC) 10 | -------------------------------------------------------------------------------- /os/hal/lib/complex/readme.txt: -------------------------------------------------------------------------------- 1 | This directory contains complex drivers subsystems. Complex Drivers must 2 | abide to the following rules: 3 | - Must use HAL and OSAL only. 4 | - Cannot use RTOS functionalities. 5 | - Cannot use HW resources directly. 6 | - Must not use non-standard C language features. 7 | -------------------------------------------------------------------------------- /os/hal/lib/streams/chprintf.h: -------------------------------------------------------------------------------- 1 | /* 2 | ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | /** 18 | * @file chprintf.h 19 | * @brief Mini printf-like functionality. 20 | * 21 | * @addtogroup chprintf 22 | * @{ 23 | */ 24 | 25 | #ifndef CHPRINTF_H 26 | #define CHPRINTF_H 27 | 28 | #include 29 | 30 | /** 31 | * @brief Float type support. 32 | */ 33 | #if !defined(CHPRINTF_USE_FLOAT) || defined(__DOXYGEN__) 34 | #define CHPRINTF_USE_FLOAT FALSE 35 | #endif 36 | 37 | #ifdef __cplusplus 38 | extern "C" { 39 | #endif 40 | int chvprintf(BaseSequentialStream *chp, const char *fmt, va_list ap); 41 | int chprintf(BaseSequentialStream *chp, const char *fmt, ...); 42 | int chsnprintf(char *str, size_t size, const char *fmt, ...); 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | 47 | #endif /* CHPRINTF_H */ 48 | 49 | /** @} */ 50 | -------------------------------------------------------------------------------- /os/hal/lib/streams/streams.mk: -------------------------------------------------------------------------------- 1 | # RT Shell files. 2 | STREAMSSRC = $(CHIBIOS)/os/hal/lib/streams/chprintf.c \ 3 | $(CHIBIOS)/os/hal/lib/streams/memstreams.c \ 4 | $(CHIBIOS)/os/hal/lib/streams/nullstreams.c 5 | 6 | STREAMSINC = $(CHIBIOS)/os/hal/lib/streams 7 | 8 | # Shared variables 9 | ALLCSRC += $(STREAMSSRC) 10 | ALLINC += $(STREAMSINC) 11 | -------------------------------------------------------------------------------- /os/hal/osal/nil/osal.mk: -------------------------------------------------------------------------------- 1 | # OSAL files. 2 | OSALSRC += ${CHIBIOS}/os/hal/osal/nil/osal.c 3 | 4 | # Required include directories 5 | OSALINC += ${CHIBIOS}/os/hal/osal/nil 6 | 7 | # Shared variables 8 | ALLCSRC += $(OSALSRC) 9 | ALLINC += $(OSALINC) 10 | -------------------------------------------------------------------------------- /os/hal/osal/os-less/ARMCMx/osal.mk: -------------------------------------------------------------------------------- 1 | # OSAL files. 2 | OSALSRC += ${CHIBIOS}/os/hal/osal/os-less/ARMCMx/osal.c \ 3 | ${CHIBIOS}/os/hal/osal/lib/osal_vt.c 4 | 5 | # Required include directories 6 | OSALINC += ${CHIBIOS}/os/hal/osal/os-less/ARMCMx \ 7 | ${CHIBIOS}/os/hal/osal/lib 8 | 9 | # Shared variables 10 | ALLCSRC += $(OSALSRC) 11 | ALLINC += $(OSALINC) 12 | -------------------------------------------------------------------------------- /os/hal/osal/rt/osal.mk: -------------------------------------------------------------------------------- 1 | # OSAL files. 2 | OSALSRC += ${CHIBIOS}/os/hal/osal/rt/osal.c 3 | 4 | # Required include directories 5 | OSALINC += ${CHIBIOS}/os/hal/osal/rt 6 | 7 | # Shared variables 8 | ALLCSRC += $(OSALSRC) 9 | ALLINC += $(OSALINC) 10 | -------------------------------------------------------------------------------- /os/hal/ports/STM32/LLD/ADCv1/driver.mk: -------------------------------------------------------------------------------- 1 | ifeq ($(USE_SMART_BUILD),yes) 2 | ifneq ($(findstring HAL_USE_ADC TRUE,$(HALCONF)),) 3 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/ADCv1/hal_adc_lld.c 4 | endif 5 | else 6 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/ADCv1/hal_adc_lld.c 7 | endif 8 | 9 | PLATFORMINC += $(CHIBIOS)/os/hal/ports/STM32/LLD/ADCv1 10 | -------------------------------------------------------------------------------- /os/hal/ports/STM32/LLD/ADCv1/notes.txt: -------------------------------------------------------------------------------- 1 | STM32 ADCv1 driver. 2 | 3 | Driver capability: 4 | 5 | - Supports the STM32 "simple" ADC, the one found on small devices (F0, L0). 6 | 7 | The file registry must export: 8 | 9 | STM32_HAS_ADC1 - ADC1 presence flag. 10 | STM32_ADC_SUPPORTS_PRESCALER - Support of CCR PRESC field. 11 | STM32_ADC_SUPPORTS_OVERSAMPLING - Support of oversampling-related fields. 12 | STM32_ADC1_IRQ_SHARED_WITH_EXTI - TRUE if the IRQ is shared with EXTI. 13 | STM32_ADC1_HANDLER - IRQ vector name. 14 | STM32_ADC1_NUMBER - IRQ vector number. 15 | STM32_ADC1_DMA_MSK - Mask of the compatible DMA channels. 16 | STM32_ADC1_DMA_CHN - Mask of the channels mapping. 17 | -------------------------------------------------------------------------------- /os/hal/ports/STM32/LLD/ADCv2/driver.mk: -------------------------------------------------------------------------------- 1 | ifeq ($(USE_SMART_BUILD),yes) 2 | ifneq ($(findstring HAL_USE_ADC TRUE,$(HALCONF)),) 3 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/ADCv2/hal_adc_lld.c 4 | endif 5 | else 6 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/ADCv2/hal_adc_lld.c 7 | endif 8 | 9 | PLATFORMINC += $(CHIBIOS)/os/hal/ports/STM32/LLD/ADCv2 10 | -------------------------------------------------------------------------------- /os/hal/ports/STM32/LLD/ADCv2/notes.txt: -------------------------------------------------------------------------------- 1 | STM32 ADCv2 driver. 2 | 3 | Driver capability: 4 | 5 | - Supports the STM32 "advanced" ADC found on F2, F4 and F7 sub-families. 6 | 7 | The file registry must export: 8 | 9 | STM32_HAS_ADCx - ADCx presence flag (1..3). 10 | STM32_ADC_HANDLER - IRQ vector name for ADCs (shared). 11 | STM32_ADC_NUMBER - IRQ vector number for ADCs (shared). 12 | STM32_ADCx_DMA_MSK - Mask of the compatible DMA channels. 13 | STM32_ADCx_DMA_CHN - Mask of the channels mapping. 14 | -------------------------------------------------------------------------------- /os/hal/ports/STM32/LLD/ADCv3/driver.mk: -------------------------------------------------------------------------------- 1 | ifeq ($(USE_SMART_BUILD),yes) 2 | ifneq ($(findstring HAL_USE_ADC TRUE,$(HALCONF)),) 3 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/ADCv3/hal_adc_lld.c 4 | endif 5 | else 6 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/ADCv3/hal_adc_lld.c 7 | endif 8 | 9 | PLATFORMINC += $(CHIBIOS)/os/hal/ports/STM32/LLD/ADCv3 10 | -------------------------------------------------------------------------------- /os/hal/ports/STM32/LLD/ADCv3/notes.txt: -------------------------------------------------------------------------------- 1 | STM32 ADCv3 driver. 2 | 3 | Driver capability: 4 | 5 | - Supports the STM32 "fast" ADC found on F3 and L4 sub-families. 6 | 7 | The file registry must export: 8 | 9 | STM32_HAS_ADCx - ADCx presence flag (1..4). 10 | STM32_ADC1_HANDLER - IRQ vector name for ADC1. 11 | STM32_ADC1_NUMBER - IRQ vector number for ADC1. 12 | STM32_ADC2_HANDLER - IRQ vector name for ADC2. 13 | STM32_ADC2_NUMBER - IRQ vector number for ADC2. 14 | STM32_ADC3_HANDLER - IRQ vector name for ADC3. 15 | STM32_ADC3_NUMBER - IRQ vector number for ADC3. 16 | STM32_ADC4_HANDLER - IRQ vector name for ADC4. 17 | STM32_ADC4_NUMBER - IRQ vector number for ADC4. 18 | STM32_ADCx_DMA_MSK - Mask of the compatible DMA channels (1..4). 19 | STM32_ADCx_DMA_CHN - Mask of the channels mapping (1..4). 20 | -------------------------------------------------------------------------------- /os/hal/ports/STM32/LLD/ADCv4/driver.mk: -------------------------------------------------------------------------------- 1 | ifeq ($(USE_SMART_BUILD),yes) 2 | ifneq ($(findstring HAL_USE_ADC TRUE,$(HALCONF)),) 3 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/ADCv4/hal_adc_lld.c 4 | endif 5 | else 6 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/ADCv4/hal_adc_lld.c 7 | endif 8 | 9 | PLATFORMINC += $(CHIBIOS)/os/hal/ports/STM32/LLD/ADCv4 10 | -------------------------------------------------------------------------------- /os/hal/ports/STM32/LLD/ADCv4/notes.txt: -------------------------------------------------------------------------------- 1 | STM32 ADCv4 driver. 2 | 3 | Driver capability: 4 | 5 | - Supports the STM32 "fast" ADC found on H7 sub-family. 6 | 7 | The file registry must export: 8 | 9 | STM32_HAS_ADCx - ADCx presence flag (1..4). 10 | STM32_ADC12_HANDLER - IRQ vector name for ADC1 and ADC2. 11 | STM32_ADC12_NUMBER - IRQ vector number for ADC1 and ADC2. 12 | STM32_ADC34_HANDLER - IRQ vector name for ADC3 and ADC4. 13 | STM32_ADC34_NUMBER - IRQ vector number for ADC3 and ADC4. 14 | -------------------------------------------------------------------------------- /os/hal/ports/STM32/LLD/BDMAv1/driver.mk: -------------------------------------------------------------------------------- 1 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/BDMAv1/stm32_bdma.c 2 | PLATFORMINC += $(CHIBIOS)/os/hal/ports/STM32/LLD/BDMAv1 3 | -------------------------------------------------------------------------------- /os/hal/ports/STM32/LLD/BDMAv1/notes.txt: -------------------------------------------------------------------------------- 1 | STM32 BDMAv1 driver. 2 | 3 | Driver capability: 4 | 5 | - The driver supports the "basic" DMA controller. 6 | 7 | The file registry must export: 8 | 9 | STM32_BDMAn_CHx_HANDLER - Vector name for IRQ "x" (1..7). If the macro 10 | is not exported then the ISR is not declared. 11 | STM32_BDMAn_CHx_NUMBER - Vector number for IRQ "x" (1..7). 12 | -------------------------------------------------------------------------------- /os/hal/ports/STM32/LLD/CANv1/driver.mk: -------------------------------------------------------------------------------- 1 | ifeq ($(USE_SMART_BUILD),yes) 2 | ifneq ($(findstring HAL_USE_CAN TRUE,$(HALCONF)),) 3 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/CANv1/hal_can_lld.c 4 | endif 5 | else 6 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/CANv1/hal_can_lld.c 7 | endif 8 | 9 | PLATFORMINC += $(CHIBIOS)/os/hal/ports/STM32/LLD/CANv1 10 | -------------------------------------------------------------------------------- /os/hal/ports/STM32/LLD/CRYPv1/driver.mk: -------------------------------------------------------------------------------- 1 | ifeq ($(USE_SMART_BUILD),yes) 2 | ifneq ($(findstring HAL_USE_CRY TRUE,$(HALCONF)),) 3 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/CRYPv1/hal_crypto_lld.c 4 | endif 5 | else 6 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/CRYPv1/hal_crypto_lld.c 7 | endif 8 | 9 | PLATFORMINC += $(CHIBIOS)/os/hal/ports/STM32/LLD/CRYPv1 10 | -------------------------------------------------------------------------------- /os/hal/ports/STM32/LLD/DACv1/driver.mk: -------------------------------------------------------------------------------- 1 | ifeq ($(USE_SMART_BUILD),yes) 2 | ifneq ($(findstring HAL_USE_DAC TRUE,$(HALCONF)),) 3 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/DACv1/hal_dac_lld.c 4 | endif 5 | else 6 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/DACv1/hal_dac_lld.c 7 | endif 8 | 9 | PLATFORMINC += $(CHIBIOS)/os/hal/ports/STM32/LLD/DACv1 10 | -------------------------------------------------------------------------------- /os/hal/ports/STM32/LLD/DMAv1/driver.mk: -------------------------------------------------------------------------------- 1 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/DMAv1/stm32_dma.c 2 | PLATFORMINC += $(CHIBIOS)/os/hal/ports/STM32/LLD/DMAv1 3 | -------------------------------------------------------------------------------- /os/hal/ports/STM32/LLD/DMAv1/notes.txt: -------------------------------------------------------------------------------- 1 | STM32 DMAv1 driver. 2 | 3 | Driver capability: 4 | 5 | - The driver supports the STM32 traditional DMA controller in the following 6 | configurations: 5ch, 7ch, 7ch+5ch, 7ch+7ch. 7 | - Support for automatic the channel selection through the CSELR register. 8 | - For devices without CSELR register it is possible to select channels but 9 | the SYSCFG CFGR register is not configured, the user has to configure it 10 | before starting the DMA driver. 11 | - The driver supports shared ISR handlers with a quirk: the IRQ priority is 12 | established by the first allocated channel among the channels sharing the 13 | ISR. 14 | 15 | The file registry must export: 16 | 17 | STM32_ADVANCED_DMA - TRUE not used by the DMA drivers but other 18 | drivers use it to enable checks on DMA 19 | channels. Probably will be removed in the 20 | future. 21 | STM32_DMA_SUPPORTS_CSELR - TRUE if the DMA have a CSELR register. 22 | STM32_DMAn_NUM_CHANNELS - Number of channels in DMAs "n" (1..2). 23 | STM32_DMAn_CHx_HANDLER - Vector name for IRQ "x" (1..7). If the macro 24 | is not exported then the ISR is not declared. 25 | STM32_DMAn_CHx_NUMBER - Vector number for IRQ "x" (1..7). 26 | -------------------------------------------------------------------------------- /os/hal/ports/STM32/LLD/DMAv2/driver.mk: -------------------------------------------------------------------------------- 1 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/DMAv2/stm32_dma.c 2 | PLATFORMINC += $(CHIBIOS)/os/hal/ports/STM32/LLD/DMAv2 3 | -------------------------------------------------------------------------------- /os/hal/ports/STM32/LLD/DMAv2/notes.txt: -------------------------------------------------------------------------------- 1 | STM32 DMAv2 driver. 2 | 3 | Driver capability: 4 | 5 | - The driver supports the STM32 enhanced DMA controller found on F2, F4 and 6 | F7 sub-families. 7 | - Support for automatic the channel selection. 8 | - Support for cache flushing and invalidation. 9 | 10 | The file registry must export: 11 | 12 | STM32_ADVANCED_DMA - TRUE not used by the DMA drivers but other 13 | drivers use it to enable checks on DMA 14 | channels. Probably will be removed in the 15 | future. 16 | STM32_HAS_DMAx - Support for DMA unit "x" (1..2). 17 | STM32_DMAx_CHn_HANDLER - Vector name for channel "n" (0..7). 18 | STM32_DMAn_CHx_NUMBER - Vector number for channel "n" (0..7). 19 | -------------------------------------------------------------------------------- /os/hal/ports/STM32/LLD/DMAv3/driver.mk: -------------------------------------------------------------------------------- 1 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/DMAv3/stm32_dma.c 2 | PLATFORMINC += $(CHIBIOS)/os/hal/ports/STM32/LLD/DMAv3 3 | -------------------------------------------------------------------------------- /os/hal/ports/STM32/LLD/DMAv3/notes.txt: -------------------------------------------------------------------------------- 1 | STM32 DMAv3 driver. 2 | 3 | Driver capability: 4 | 5 | - The driver supports the STM32 enhanced DMA controller found on H7 sub-family. 6 | - Support for cache flushing and invalidation. 7 | 8 | The file registry must export: 9 | 10 | STM32_HAS_DMAx - Support for DMA unit "x" (1..2). 11 | STM32_DMAx_CHn_HANDLER - Vector name for channel "n" (0..7). 12 | STM32_DMAx_CHn_NUMBER - Vector number for channel "n" (0..7). 13 | -------------------------------------------------------------------------------- /os/hal/ports/STM32/LLD/EXTIv1/driver.mk: -------------------------------------------------------------------------------- 1 | ifeq ($(USE_SMART_BUILD),yes) 2 | ifneq ($(findstring HAL_USE_EXT TRUE,$(HALCONF)),) 3 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/EXTIv1/hal_ext_lld.c 4 | endif 5 | else 6 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/EXTIv1/hal_ext_lld.c 7 | endif 8 | 9 | PLATFORMINC += $(CHIBIOS)/os/hal/ports/STM32/LLD/EXTIv1 10 | -------------------------------------------------------------------------------- /os/hal/ports/STM32/LLD/EXTIv1/notes.txt: -------------------------------------------------------------------------------- 1 | STM32 EXT driver implementation through EXTI unit. 2 | 3 | There are several kind of EXTI lines: 4 | 5 | 1) GPIO lines. Always in range 0..15, always handled by the EXT driver. 6 | 2) Configurable peripheral events not shared, always handled by the EXT driver. 7 | 3) Configurable peripheral events shared with other, non EXTI, interrupts. 8 | The EXTI driver declares the ISR and has to call the IRQ handler of the 9 | other driver. 10 | 4) Direct lines (1 in IMR register after reset). The EXTI driver never touches 11 | the default configuration for direct lines and does not declare ISRs. 12 | 5) Unused lines. The EXTI driver does not declare ISRs. 13 | 14 | The file registry must export: 15 | STM32_EXTI_NUM_LINES - Range of configurable lines, it can have holes of 16 | unused or direct lines. Configurable line numbers go 17 | from 0 to STM32_EXTI_NUM_LINES-1. 18 | STM32_EXTI_IMR_MASK - Direct lines and unused lines marked as 1 in this 19 | mask, configurable lines marked as 0. 20 | STM32_EXTI_IMR2_MASK - Optional, for lines 32...63. 21 | 22 | ISRs are not declared inside the driver, each sub-family must have its own 23 | ext_lld_isr.h and ext_lld_isr.c files. 24 | -------------------------------------------------------------------------------- /os/hal/ports/STM32/LLD/GPIOv1/driver.mk: -------------------------------------------------------------------------------- 1 | ifeq ($(USE_SMART_BUILD),yes) 2 | ifneq ($(findstring HAL_USE_PAL TRUE,$(HALCONF)),) 3 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/GPIOv1/hal_pal_lld.c 4 | endif 5 | else 6 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/GPIOv1/hal_pal_lld.c 7 | endif 8 | 9 | PLATFORMINC += $(CHIBIOS)/os/hal/ports/STM32/LLD/GPIOv1 10 | -------------------------------------------------------------------------------- /os/hal/ports/STM32/LLD/GPIOv2/driver.mk: -------------------------------------------------------------------------------- 1 | ifeq ($(USE_SMART_BUILD),yes) 2 | ifneq ($(findstring HAL_USE_PAL TRUE,$(HALCONF)),) 3 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/GPIOv2/hal_pal_lld.c 4 | endif 5 | else 6 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/GPIOv2/hal_pal_lld.c 7 | endif 8 | 9 | PLATFORMINC += $(CHIBIOS)/os/hal/ports/STM32/LLD/GPIOv2 10 | -------------------------------------------------------------------------------- /os/hal/ports/STM32/LLD/GPIOv3/driver.mk: -------------------------------------------------------------------------------- 1 | ifeq ($(USE_SMART_BUILD),yes) 2 | ifneq ($(findstring HAL_USE_PAL TRUE,$(HALCONF)),) 3 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/GPIOv3/hal_pal_lld.c 4 | endif 5 | else 6 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/GPIOv3/hal_pal_lld.c 7 | endif 8 | 9 | PLATFORMINC += $(CHIBIOS)/os/hal/ports/STM32/LLD/GPIOv3 10 | -------------------------------------------------------------------------------- /os/hal/ports/STM32/LLD/I2Cv1/driver.mk: -------------------------------------------------------------------------------- 1 | ifeq ($(USE_HAL_I2C_FALLBACK),yes) 2 | # Fallback SW driver. 3 | ifeq ($(USE_SMART_BUILD),yes) 4 | ifneq ($(findstring HAL_USE_I2C TRUE,$(HALCONF)),) 5 | PLATFORMSRC += $(CHIBIOS)/os/hal/lib/fallback/I2C/hal_i2c_lld.c 6 | endif 7 | else 8 | PLATFORMSRC += $(CHIBIOS)/os/hal/lib/fallback/I2C/hal_i2c_lld.c 9 | endif 10 | PLATFORMINC += $(CHIBIOS)/os/hal/lib/fallback/I2C 11 | else 12 | # Default HW driver. 13 | ifeq ($(USE_SMART_BUILD),yes) 14 | ifneq ($(findstring HAL_USE_I2C TRUE,$(HALCONF)),) 15 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/I2Cv1/hal_i2c_lld.c 16 | endif 17 | else 18 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/I2Cv1/hal_i2c_lld.c 19 | endif 20 | PLATFORMINC += $(CHIBIOS)/os/hal/ports/STM32/LLD/I2Cv1 21 | endif 22 | -------------------------------------------------------------------------------- /os/hal/ports/STM32/LLD/I2Cv2/driver.mk: -------------------------------------------------------------------------------- 1 | ifeq ($(USE_HAL_I2C_FALLBACK),yes) 2 | # Fallback SW driver. 3 | ifeq ($(USE_SMART_BUILD),yes) 4 | ifneq ($(findstring HAL_USE_I2C TRUE,$(HALCONF)),) 5 | PLATFORMSRC += $(CHIBIOS)/os/hal/lib/fallback/I2C/hal_i2c_lld.c 6 | endif 7 | else 8 | PLATFORMSRC += $(CHIBIOS)/os/hal/lib/fallback/I2C/hal_i2c_lld.c 9 | endif 10 | PLATFORMINC += $(CHIBIOS)/os/hal/lib/fallback/I2C 11 | else 12 | # Default HW driver. 13 | ifeq ($(USE_SMART_BUILD),yes) 14 | ifneq ($(findstring HAL_USE_I2C TRUE,$(HALCONF)),) 15 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/I2Cv2/hal_i2c_lld.c 16 | endif 17 | else 18 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/I2Cv2/hal_i2c_lld.c 19 | endif 20 | PLATFORMINC += $(CHIBIOS)/os/hal/ports/STM32/LLD/I2Cv2 21 | endif 22 | -------------------------------------------------------------------------------- /os/hal/ports/STM32/LLD/I2Cv3/driver.mk: -------------------------------------------------------------------------------- 1 | ifeq ($(USE_HAL_I2C_FALLBACK),yes) 2 | # Fallback SW driver. 3 | ifeq ($(USE_SMART_BUILD),yes) 4 | ifneq ($(findstring HAL_USE_I2C TRUE,$(HALCONF)),) 5 | PLATFORMSRC += $(CHIBIOS)/os/hal/lib/fallback/I2C/hal_i2c_lld.c 6 | endif 7 | else 8 | PLATFORMSRC += $(CHIBIOS)/os/hal/lib/fallback/I2C/hal_i2c_lld.c 9 | endif 10 | PLATFORMINC += $(CHIBIOS)/os/hal/lib/fallback/I2C 11 | else 12 | # Default HW driver. 13 | ifeq ($(USE_SMART_BUILD),yes) 14 | ifneq ($(findstring HAL_USE_I2C TRUE,$(HALCONF)),) 15 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/I2Cv3/hal_i2c_lld.c 16 | endif 17 | else 18 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/I2Cv3/hal_i2c_lld.c 19 | endif 20 | PLATFORMINC += $(CHIBIOS)/os/hal/ports/STM32/LLD/I2Cv3 21 | endif 22 | -------------------------------------------------------------------------------- /os/hal/ports/STM32/LLD/MACv1/driver.mk: -------------------------------------------------------------------------------- 1 | ifeq ($(USE_SMART_BUILD),yes) 2 | ifneq ($(findstring HAL_USE_MAC TRUE,$(HALCONF)),) 3 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/MACv1/hal_mac_lld.c 4 | endif 5 | else 6 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/MACv1/hal_mac_lld.c 7 | endif 8 | 9 | PLATFORMINC += $(CHIBIOS)/os/hal/ports/STM32/LLD/MACv1 10 | -------------------------------------------------------------------------------- /os/hal/ports/STM32/LLD/OTGv1/driver.mk: -------------------------------------------------------------------------------- 1 | ifeq ($(USE_SMART_BUILD),yes) 2 | ifneq ($(findstring HAL_USE_USB TRUE,$(HALCONF)),) 3 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.c 4 | endif 5 | else 6 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.c 7 | endif 8 | 9 | PLATFORMINC += $(CHIBIOS)/os/hal/ports/STM32/LLD/OTGv1 10 | -------------------------------------------------------------------------------- /os/hal/ports/STM32/LLD/QUADSPIv1/driver.mk: -------------------------------------------------------------------------------- 1 | ifeq ($(USE_SMART_BUILD),yes) 2 | ifneq ($(findstring HAL_USE_QSPI TRUE,$(HALCONF)),) 3 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/QUADSPIv1/hal_qspi_lld.c 4 | endif 5 | else 6 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/QUADSPIv1/hal_qspi_lld.c 7 | endif 8 | 9 | PLATFORMINC += $(CHIBIOS)/os/hal/ports/STM32/LLD/QUADSPIv1 10 | -------------------------------------------------------------------------------- /os/hal/ports/STM32/LLD/RTCv1/driver.mk: -------------------------------------------------------------------------------- 1 | ifeq ($(USE_SMART_BUILD),yes) 2 | ifneq ($(findstring HAL_USE_RTC TRUE,$(HALCONF)),) 3 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/RTCv1/hal_rtc_lld.c 4 | endif 5 | else 6 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/RTCv1/hal_rtc_lld.c 7 | endif 8 | 9 | PLATFORMINC += $(CHIBIOS)/os/hal/ports/STM32/LLD/RTCv1 10 | -------------------------------------------------------------------------------- /os/hal/ports/STM32/LLD/RTCv2/driver.mk: -------------------------------------------------------------------------------- 1 | ifeq ($(USE_SMART_BUILD),yes) 2 | ifneq ($(findstring HAL_USE_RTC TRUE,$(HALCONF)),) 3 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/RTCv2/hal_rtc_lld.c 4 | endif 5 | else 6 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/RTCv2/hal_rtc_lld.c 7 | endif 8 | 9 | PLATFORMINC += $(CHIBIOS)/os/hal/ports/STM32/LLD/RTCv2 10 | -------------------------------------------------------------------------------- /os/hal/ports/STM32/LLD/SDIOv1/driver.mk: -------------------------------------------------------------------------------- 1 | ifeq ($(USE_SMART_BUILD),yes) 2 | ifneq ($(findstring HAL_USE_SDC TRUE,$(HALCONF)),) 3 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/SDIOv1/hal_sdc_lld.c 4 | endif 5 | else 6 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/SDIOv1/hal_sdc_lld.c 7 | endif 8 | 9 | PLATFORMINC += $(CHIBIOS)/os/hal/ports/STM32/LLD/SDIOv1 10 | -------------------------------------------------------------------------------- /os/hal/ports/STM32/LLD/SDMMCv1/driver.mk: -------------------------------------------------------------------------------- 1 | ifeq ($(USE_SMART_BUILD),yes) 2 | ifneq ($(findstring HAL_USE_SDC TRUE,$(HALCONF)),) 3 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/SDMMCv1/hal_sdc_lld.c 4 | endif 5 | else 6 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/SDMMCv1/hal_sdc_lld.c 7 | endif 8 | 9 | PLATFORMINC += $(CHIBIOS)/os/hal/ports/STM32/LLD/SDMMCv1 10 | -------------------------------------------------------------------------------- /os/hal/ports/STM32/LLD/SPIv1/driver.mk: -------------------------------------------------------------------------------- 1 | ifeq ($(USE_SMART_BUILD),yes) 2 | ifneq ($(findstring HAL_USE_I2S TRUE,$(HALCONF)),) 3 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/SPIv1/hal_i2s_lld.c 4 | endif 5 | ifneq ($(findstring HAL_USE_SPI TRUE,$(HALCONF)),) 6 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/SPIv1/hal_spi_lld.c 7 | endif 8 | else 9 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/SPIv1/hal_i2s_lld.c 10 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/SPIv1/hal_spi_lld.c 11 | endif 12 | 13 | PLATFORMINC += $(CHIBIOS)/os/hal/ports/STM32/LLD/SPIv1 14 | -------------------------------------------------------------------------------- /os/hal/ports/STM32/LLD/SPIv2/driver.mk: -------------------------------------------------------------------------------- 1 | ifeq ($(USE_SMART_BUILD),yes) 2 | ifneq ($(findstring HAL_USE_I2S TRUE,$(HALCONF)),) 3 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/SPIv2/hal_i2s_lld.c 4 | endif 5 | ifneq ($(findstring HAL_USE_SPI TRUE,$(HALCONF)),) 6 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/SPIv2/hal_spi_lld.c 7 | endif 8 | else 9 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/SPIv2/hal_i2s_lld.c 10 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/SPIv2/hal_spi_lld.c 11 | endif 12 | 13 | PLATFORMINC += $(CHIBIOS)/os/hal/ports/STM32/LLD/SPIv2 14 | -------------------------------------------------------------------------------- /os/hal/ports/STM32/LLD/SPIv3/driver.mk: -------------------------------------------------------------------------------- 1 | ifeq ($(USE_SMART_BUILD),yes) 2 | ifneq ($(findstring HAL_USE_I2S TRUE,$(HALCONF)),) 3 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/SPIv3/hal_i2s_lld.c 4 | endif 5 | ifneq ($(findstring HAL_USE_SPI TRUE,$(HALCONF)),) 6 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/SPIv3/hal_spi_lld.c 7 | endif 8 | else 9 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/SPIv3/hal_i2s_lld.c 10 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/SPIv3/hal_spi_lld.c 11 | endif 12 | 13 | PLATFORMINC += $(CHIBIOS)/os/hal/ports/STM32/LLD/SPIv3 14 | -------------------------------------------------------------------------------- /os/hal/ports/STM32/LLD/TIMv1/driver.mk: -------------------------------------------------------------------------------- 1 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/TIMv1/hal_st_lld.c 2 | 3 | ifeq ($(USE_SMART_BUILD),yes) 4 | ifneq ($(findstring HAL_USE_GPT TRUE,$(HALCONF)),) 5 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/TIMv1/hal_gpt_lld.c 6 | endif 7 | ifneq ($(findstring HAL_USE_ICU TRUE,$(HALCONF)),) 8 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/TIMv1/hal_icu_lld.c 9 | endif 10 | ifneq ($(findstring HAL_USE_PWM TRUE,$(HALCONF)),) 11 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/TIMv1/hal_pwm_lld.c 12 | endif 13 | else 14 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/TIMv1/hal_gpt_lld.c 15 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/TIMv1/hal_icu_lld.c 16 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/TIMv1/hal_pwm_lld.c 17 | endif 18 | 19 | PLATFORMINC += $(CHIBIOS)/os/hal/ports/STM32/LLD/TIMv1 20 | -------------------------------------------------------------------------------- /os/hal/ports/STM32/LLD/TIMv1/tim_irq_mapping.txt: -------------------------------------------------------------------------------- 1 | TIM units IRQ collisions mapping. 2 | 3 | 1B 1UP 1TC 1CC 2 3 4 5 6 7 8B 8UP 8TC 8CC 9 10 11 12 13 14 15 16 17 18 19 20 21 22 LP1 LP2 4 | F0xx 1---1 2---2 * * * * * * * * 5 | F030 1---1 2---2 * * * * * 6 | F1xx 1 2 3 * * * * * * * 1 2 3 7 | F100 1 2 3 * * * * * * * 1 2 3 8 | F3xx 1 2 3 * * * * * * * * * * 1 2 3 9 | F37x * * * * * * * * * * * * * * 10 | F4xx 1 2 3 * * * * * * * 4 5 6 * 1 2 3 4 5 6 11 | F7xx 1 2 3 * * * * * * * 4 5 6 * 1 2 3 4 5 6 * 12 | L0xx * * * * * 13 | L1xx * * * * * * * * * 14 | L4xx 1 2 3 * * * * * * * * * * * 1 2 3 * * 15 | -------------------------------------------------------------------------------- /os/hal/ports/STM32/LLD/USARTv1/driver.mk: -------------------------------------------------------------------------------- 1 | ifeq ($(USE_SMART_BUILD),yes) 2 | ifneq ($(findstring HAL_USE_SERIAL TRUE,$(HALCONF)),) 3 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/USARTv1/hal_serial_lld.c 4 | endif 5 | ifneq ($(findstring HAL_USE_UART TRUE,$(HALCONF)),) 6 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/USARTv1/hal_uart_lld.c 7 | endif 8 | else 9 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/USARTv1/hal_serial_lld.c 10 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/USARTv1/hal_uart_lld.c 11 | endif 12 | 13 | PLATFORMINC += $(CHIBIOS)/os/hal/ports/STM32/LLD/USARTv1 14 | -------------------------------------------------------------------------------- /os/hal/ports/STM32/LLD/USARTv2/driver.mk: -------------------------------------------------------------------------------- 1 | ifeq ($(USE_SMART_BUILD),yes) 2 | ifneq ($(findstring HAL_USE_SERIAL TRUE,$(HALCONF)),) 3 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/USARTv2/hal_serial_lld.c 4 | endif 5 | ifneq ($(findstring HAL_USE_UART TRUE,$(HALCONF)),) 6 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/USARTv2/hal_uart_lld.c 7 | endif 8 | else 9 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/USARTv2/hal_serial_lld.c 10 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/USARTv2/hal_uart_lld.c 11 | endif 12 | 13 | PLATFORMINC += $(CHIBIOS)/os/hal/ports/STM32/LLD/USARTv2 14 | -------------------------------------------------------------------------------- /os/hal/ports/STM32/LLD/USBv1/driver.mk: -------------------------------------------------------------------------------- 1 | ifeq ($(USE_SMART_BUILD),yes) 2 | ifneq ($(findstring HAL_USE_USB TRUE,$(HALCONF)),) 3 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/USBv1/hal_usb_lld.c 4 | endif 5 | else 6 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/USBv1/hal_usb_lld.c 7 | endif 8 | 9 | PLATFORMINC += $(CHIBIOS)/os/hal/ports/STM32/LLD/USBv1 10 | -------------------------------------------------------------------------------- /os/hal/ports/STM32/LLD/xWDGv1/driver.mk: -------------------------------------------------------------------------------- 1 | ifeq ($(USE_SMART_BUILD),yes) 2 | ifneq ($(findstring HAL_USE_WDG TRUE,$(HALCONF)),) 3 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/xWDGv1/hal_wdg_lld.c 4 | endif 5 | else 6 | PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/LLD/xWDGv1/hal_wdg_lld.c 7 | endif 8 | 9 | PLATFORMINC += $(CHIBIOS)/os/hal/ports/STM32/LLD/xWDGv1 10 | -------------------------------------------------------------------------------- /os/hal/ports/STM32/STM32F4xx/platform.mk: -------------------------------------------------------------------------------- 1 | # Required platform files. 2 | PLATFORMSRC := $(CHIBIOS)/os/hal/ports/common/ARMCMx/nvic.c \ 3 | $(CHIBIOS)/os/hal/ports/STM32/STM32F4xx/stm32_isr.c \ 4 | $(CHIBIOS)/os/hal/ports/STM32/STM32F4xx/hal_lld.c 5 | 6 | # Required include directories. 7 | PLATFORMINC := $(CHIBIOS)/os/hal/ports/common/ARMCMx \ 8 | $(CHIBIOS)/os/hal/ports/STM32/STM32F4xx 9 | 10 | # Optional platform files. 11 | ifeq ($(USE_SMART_BUILD),yes) 12 | 13 | # Configuration files directory 14 | ifeq ($(CONFDIR),) 15 | CONFDIR = . 16 | endif 17 | 18 | HALCONF := $(strip $(shell cat $(CONFDIR)/halconf.h | egrep -e "\#define")) 19 | 20 | else 21 | endif 22 | 23 | # Drivers compatible with the platform. 24 | include $(CHIBIOS)/os/hal/ports/STM32/LLD/ADCv2/driver.mk 25 | include $(CHIBIOS)/os/hal/ports/STM32/LLD/CANv1/driver.mk 26 | include $(CHIBIOS)/os/hal/ports/STM32/LLD/DACv1/driver.mk 27 | include $(CHIBIOS)/os/hal/ports/STM32/LLD/DMAv2/driver.mk 28 | include $(CHIBIOS)/os/hal/ports/STM32/LLD/EXTIv1/driver.mk 29 | include $(CHIBIOS)/os/hal/ports/STM32/LLD/GPIOv2/driver.mk 30 | include $(CHIBIOS)/os/hal/ports/STM32/LLD/I2Cv1/driver.mk 31 | include $(CHIBIOS)/os/hal/ports/STM32/LLD/MACv1/driver.mk 32 | include $(CHIBIOS)/os/hal/ports/STM32/LLD/OTGv1/driver.mk 33 | include $(CHIBIOS)/os/hal/ports/STM32/LLD/QUADSPIv1/driver.mk 34 | include $(CHIBIOS)/os/hal/ports/STM32/LLD/RTCv2/driver.mk 35 | include $(CHIBIOS)/os/hal/ports/STM32/LLD/SPIv1/driver.mk 36 | include $(CHIBIOS)/os/hal/ports/STM32/LLD/SDIOv1/driver.mk 37 | include $(CHIBIOS)/os/hal/ports/STM32/LLD/TIMv1/driver.mk 38 | include $(CHIBIOS)/os/hal/ports/STM32/LLD/USARTv1/driver.mk 39 | include $(CHIBIOS)/os/hal/ports/STM32/LLD/xWDGv1/driver.mk 40 | 41 | # Shared variables 42 | ALLCSRC += $(PLATFORMSRC) 43 | ALLINC += $(PLATFORMINC) 44 | -------------------------------------------------------------------------------- /os/hal/templates/board/board.c: -------------------------------------------------------------------------------- 1 | /* 2 | ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #include "hal.h" 18 | 19 | /** 20 | * @brief Board-specific initialization code. 21 | * @todo Add your board-specific code, if any. 22 | */ 23 | void boardInit(void) { 24 | } 25 | -------------------------------------------------------------------------------- /os/hal/templates/board/board.h: -------------------------------------------------------------------------------- 1 | /* 2 | ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #ifndef BOARD_H 18 | #define BOARD_H 19 | 20 | /* 21 | * Setup for a generic board. 22 | */ 23 | 24 | /* 25 | * Board identifier. 26 | */ 27 | #define BOARD_GENERIC 28 | #define BOARD_NAME "Generic Board" 29 | 30 | #if !defined(_FROM_ASM_) 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | void boardInit(void); 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | #endif /* _FROM_ASM_ */ 39 | 40 | #endif /* BOARD_H */ 41 | -------------------------------------------------------------------------------- /os/hal/templates/board/board.mk: -------------------------------------------------------------------------------- 1 | # List of all the board related files. 2 | BOARDSRC = $(CHIBIOS)/os/hal/templates/board/board.c 3 | 4 | # Required include directories 5 | BOARDINC = $(CHIBIOS)/os/hal/templates/board 6 | -------------------------------------------------------------------------------- /os/hal/templates/mcuconf.h: -------------------------------------------------------------------------------- 1 | /* 2 | ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #ifndef MCUCONF_H 18 | #define MCUCONF_H 19 | 20 | /* 21 | * Platform drivers configuration. 22 | * The following settings override the default settings present in 23 | * the various device driver implementation headers. 24 | * Note that the settings for each driver only have effect if the whole 25 | * driver is enabled in halconf.h. 26 | */ 27 | 28 | #define PLATFORM_MCUCONF 29 | 30 | #endif /* MCUCONF_H */ 31 | -------------------------------------------------------------------------------- /os/hal/templates/osal/osal.mk: -------------------------------------------------------------------------------- 1 | # OSAL files. 2 | OSALSRC += ${CHIBIOS}/os/hal/templates/osal/osal.c 3 | 4 | # Required include directories 5 | OSALINC += ${CHIBIOS}/os/hal/templates/osal 6 | 7 | # Shared variables 8 | ALLCSRC += $(OSALSRC) 9 | ALLINC += $(OSALINC) 10 | -------------------------------------------------------------------------------- /os/license/license.mk: -------------------------------------------------------------------------------- 1 | # List of all the licensing subsystem files. 2 | LICSRC := 3 | 4 | # Required include directories 5 | LICINC := $(CHIBIOS)/os/license 6 | 7 | # Shared variables 8 | ALLCSRC += $(LICSRC) 9 | ALLINC += $(LICINC) 10 | -------------------------------------------------------------------------------- /os/nil/nil.mk: -------------------------------------------------------------------------------- 1 | # List of all the ChibiOS/NIL kernel files, there is no need to remove the files 2 | # from this list, you can disable parts of the kernel by editing chconf.h. 3 | ifeq ($(USE_SMART_BUILD),yes) 4 | CHCONF := $(strip $(shell cat chconf.h | egrep -e "\#define")) 5 | KERNSRC := ${CHIBIOS}/os/nil/src/ch.c 6 | ifneq ($(findstring CH_CFG_USE_MAILBOXES TRUE,$(CHCONF)),) 7 | KERNSRC += $(CHIBIOS)/os/common/oslib/src/chmboxes.c 8 | endif 9 | ifneq ($(findstring CH_CFG_USE_MEMCORE TRUE,$(CHCONF)),) 10 | KERNSRC += $(CHIBIOS)/os/common/oslib/src/chmemcore.c 11 | endif 12 | ifneq ($(findstring CH_CFG_USE_HEAP TRUE,$(CHCONF)),) 13 | KERNSRC += $(CHIBIOS)/os/common/oslib/src/chheap.c 14 | endif 15 | ifneq ($(findstring CH_CFG_USE_MEMPOOLS TRUE,$(CHCONF)),) 16 | KERNSRC += $(CHIBIOS)/os/common/oslib/src/chmempools.c 17 | endif 18 | ifneq ($(findstring CH_CFG_USE_FACTORY TRUE,$(CHCONF)),) 19 | KERNSRC += $(CHIBIOS)/os/common/oslib/src/chfactory.c 20 | endif 21 | else 22 | KERNSRC := ${CHIBIOS}/os/nil/src/ch.c \ 23 | $(CHIBIOS)/os/common/oslib/src/chmboxes.c \ 24 | $(CHIBIOS)/os/common/oslib/src/chmemcore.c \ 25 | $(CHIBIOS)/os/common/oslib/src/chheap.c \ 26 | $(CHIBIOS)/os/common/oslib/src/chmempools.c \ 27 | $(CHIBIOS)/os/common/oslib/src/chfactory.c 28 | endif 29 | 30 | # Required include directories 31 | KERNINC := ${CHIBIOS}/os/nil/include \ 32 | ${CHIBIOS}/os/common/oslib/include 33 | 34 | # Shared variables 35 | ALLCSRC += $(KERNSRC) 36 | ALLINC += $(KERNINC) 37 | -------------------------------------------------------------------------------- /os/readme.txt: -------------------------------------------------------------------------------- 1 | ***************************************************************************** 2 | *** ChibiOS products directory organization *** 3 | ***************************************************************************** 4 | 5 | --{root} - Distribution directory. 6 | +--os/ - ChibiOS products, this directory. 7 | | +--rt/ - ChibiOS/RT product. 8 | | | +--include/ - RT kernel headers. 9 | | | +--src/ - RT kernel sources. 10 | | | +--templates/ - RT kernel port template files. 11 | | | +--ports/ - RT kernel port files. 12 | | | +--osal/ - RT kernel OSAL module for HAL interface. 13 | | +--nil/ - ChibiOS/NIL product. 14 | | | +--include/ - Nil kernel headers. 15 | | | +--src/ - Nil kernel sources. 16 | | | +--templates/ - Nil kernel port template files. 17 | | | +--ports/ - Nil kernel port files. 18 | | | +--osal/ - Nil kernel OSAL module for HAL interface. 19 | | +--hal/ - ChibiOS/HAL product. 20 | | | +--include/ - HAL high level headers. 21 | | | +--src/ - HAL high level sources. 22 | | | +--templates/ - HAL port template files. 23 | | | +--ports/ - HAL port files (low level drivers implementations). 24 | | | +--boards/ - HAL board files. 25 | | +--common/ - Files used by multiple ChibiOS products. 26 | | | +--ports - Common port files for various architectures and 27 | | | compilers. 28 | | +--various/ - Various portable support files. 29 | | +--ext/ - Vendor files used by ChibiOS products. 30 | -------------------------------------------------------------------------------- /os/various/cpp_wrappers/ch.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | /** 17 | * @file ch.cpp 18 | * @brief C++ wrapper code. 19 | * 20 | * @addtogroup cpp_library 21 | * @{ 22 | */ 23 | 24 | #include "ch.hpp" 25 | 26 | namespace chibios_rt { 27 | 28 | #if (CH_CFG_NO_IDLE_THREAD == FALSE) || defined(__DOXYGEN__) 29 | ThreadReference System::getIdleThreadX(void) { 30 | 31 | return ThreadReference(chSysGetIdleThreadX()); 32 | } 33 | #endif /* CH_CFG_NO_IDLE_THREAD == FALSE */ 34 | 35 | /*------------------------------------------------------------------------* 36 | * chibios_rt::BaseStaticThread * 37 | *------------------------------------------------------------------------*/ 38 | 39 | void _thd_start(void *arg) { 40 | 41 | ((BaseThread *)arg)->main(); 42 | } 43 | } 44 | 45 | /** @} */ 46 | -------------------------------------------------------------------------------- /os/various/cpp_wrappers/chcpp.mk: -------------------------------------------------------------------------------- 1 | # C++ wrapper files. 2 | CHCPPSRC = $(CHIBIOS)/os/various/cpp_wrappers/ch.cpp \ 3 | $(CHIBIOS)/os/various/cpp_wrappers/syscalls_cpp.cpp 4 | 5 | CHCPPINC = $(CHIBIOS)/os/various/cpp_wrappers 6 | 7 | # Shared variables 8 | ALLCPPSRC += $(CHCPPSRC) 9 | ALLINC += $(CHCPPINC) 10 | -------------------------------------------------------------------------------- /os/various/cpp_wrappers/syscalls_cpp.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "osal.h" 5 | 6 | #include "syscalls_cpp.hpp" 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | void _exit(int status){ 13 | (void) status; 14 | osalSysHalt("Unrealized"); 15 | while(TRUE){} 16 | } 17 | 18 | pid_t _getpid(void){ 19 | return 1; 20 | } 21 | 22 | #undef errno 23 | extern int errno; 24 | int _kill(int pid, int sig) { 25 | (void)pid; 26 | (void)sig; 27 | errno = EINVAL; 28 | return -1; 29 | } 30 | 31 | void _open_r(void){ 32 | return; 33 | } 34 | 35 | void __cxa_pure_virtual() { 36 | osalSysHalt("Pure virtual function call."); 37 | } 38 | 39 | #ifdef __cplusplus 40 | } 41 | #endif 42 | -------------------------------------------------------------------------------- /os/various/cpp_wrappers/syscalls_cpp.hpp: -------------------------------------------------------------------------------- 1 | #ifndef SYSCALLS_CPP_HPP_ 2 | #define SYSCALLS_CPP_HPP_ 3 | 4 | /* The ABI requires a 32-bit type.*/ 5 | typedef int __guard; 6 | 7 | int __cxa_guard_acquire(__guard *); 8 | void __cxa_guard_release (__guard *); 9 | void __cxa_guard_abort (__guard *); 10 | 11 | void *__dso_handle = NULL; 12 | 13 | #endif /* SYSCALLS_CPP_HPP_ */ 14 | -------------------------------------------------------------------------------- /os/various/fatfs_bindings/fatfs.mk: -------------------------------------------------------------------------------- 1 | # FATFS files. 2 | FATFSSRC = $(CHIBIOS)/os/various/fatfs_bindings/fatfs_diskio.c \ 3 | $(CHIBIOS)/os/various/fatfs_bindings/fatfs_syscall.c \ 4 | $(CHIBIOS)/ext/fatfs/src/ff.c \ 5 | $(CHIBIOS)/ext/fatfs/src/ffunicode.c 6 | 7 | FATFSINC = $(CHIBIOS)/ext/fatfs/src 8 | 9 | # Shared variables 10 | ALLCSRC += $(FATFSSRC) 11 | ALLINC += $(FATFSINC) 12 | -------------------------------------------------------------------------------- /os/various/fatfs_bindings/readme.txt: -------------------------------------------------------------------------------- 1 | This directory contains the ChibiOS/RT "official" bindings with the FatFS 2 | library by ChaN: http://elm-chan.org 3 | 4 | In order to use FatFS within ChibiOS/RT project: 5 | 1. unzip FatFS under ./ext/fatfs [See Note 2] 6 | 2. include $(CHIBIOS)/os/various/fatfs_bindings/fatfs.mk in your makefile. 7 | 3. Add $(FATFSSRC) to $(CSRC) 8 | 4. Add $(FATFSINC) to $(INCDIR) 9 | 10 | Note: 11 | 1. These files modified for use with version 0.13 of fatfs. 12 | 2. In the original distribution, the source directory is called 'source' rather than 'src' 13 | -------------------------------------------------------------------------------- /os/various/lwip_bindings/lwip.mk: -------------------------------------------------------------------------------- 1 | # List of the required lwIP files. 2 | LWIPDIR = $(CHIBIOS)/ext/lwip/src 3 | 4 | # The various blocks of files are outlined in Filelists.mk. 5 | include $(LWIPDIR)/Filelists.mk 6 | 7 | LWBINDSRC = \ 8 | $(CHIBIOS)/os/various/lwip_bindings/lwipthread.c \ 9 | $(CHIBIOS)/os/various/lwip_bindings/arch/sys_arch.c 10 | 11 | 12 | # Add blocks of files from Filelists.mk as required for enabled options 13 | LWSRC = $(COREFILES) $(CORE4FILES) $(APIFILES) $(LWBINDSRC) $(NETIFFILES) $(HTTPDFILES) 14 | 15 | LWINC = \ 16 | $(CHIBIOS)/os/various/lwip_bindings \ 17 | $(LWIPDIR)/include 18 | 19 | # Shared variables 20 | ALLCSRC += $(LWSRC) 21 | ALLINC += $(LWINC) \ 22 | $(CHIBIOS)/os/various 23 | -------------------------------------------------------------------------------- /os/various/lwip_bindings/readme.txt: -------------------------------------------------------------------------------- 1 | This directory contains the ChibiOS "official" bindings with the lwIP 2 | TCP/IP stack: http://savannah.nongnu.org/projects/lwip 3 | 4 | In order to use lwIP within ChibiOS/RT project, unzip lwIP under 5 | ./ext/lwip then include $(CHIBIOS)/os/various/lwip_bindings/lwip.mk 6 | in your makefile. 7 | -------------------------------------------------------------------------------- /os/various/lwip_bindings/static_lwipopts.h: -------------------------------------------------------------------------------- 1 | /* 2 | ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | /** 18 | * @file static_lwipopts.h 19 | * 20 | * @addtogroup static_lwipopts 21 | * @{ 22 | */ 23 | 24 | #ifndef STATIC_LWIPOPTS_H 25 | #define STATIC_LWIPOPTS_H 26 | 27 | #define NO_SYS 0 28 | 29 | #define LWIP_TIMERS 1 30 | #define LWIP_TIMERS_CUSTOM 0 31 | 32 | #define LWIP_TCPIP_CORE_LOCKING 1 33 | #define LWIP_TCPIP_CORE_LOCKING_INPUT 0 34 | #define LWIP_COMPAT_MUTEX_ALLOWED 1 35 | 36 | #define SYS_LIGHTWEIGHT_PROT 0 37 | 38 | #define MEM_ALIGNMENT 4 39 | 40 | #endif /* STATIC_LWIPOPTS_H */ 41 | 42 | /** @} */ 43 | -------------------------------------------------------------------------------- /os/various/shell/shell.mk: -------------------------------------------------------------------------------- 1 | # RT Shell files. 2 | SHELLSRC = $(CHIBIOS)/os/various/shell/shell.c \ 3 | $(CHIBIOS)/os/various/shell/shell_cmd.c 4 | 5 | SHELLINC = $(CHIBIOS)/os/various/shell 6 | 7 | # Shared variables 8 | ALLCSRC += $(SHELLSRC) 9 | ALLINC += $(SHELLINC) 10 | --------------------------------------------------------------------------------