├── code ├── keilkill.bat ├── Board_BSP │ ├── Control.c │ ├── Control.h │ ├── Pwm_in.c │ ├── Pwm_in.h │ ├── Pwm_out.c │ ├── Board_I2C.c │ ├── Board_I2C.h │ ├── Board_MPU.C │ ├── Board_MPU.H │ ├── Board_SPI.C │ ├── Board_SPI.H │ ├── Data_IMU.c │ ├── Data_IMU.h │ ├── Board_Usart.c │ ├── Board_Usart.h │ ├── Board_filter.c │ ├── Board_filter.h │ ├── Data_Sensor.c │ ├── Telecontrol.c │ ├── Telecontrol.h │ ├── configParam.c │ ├── configParam.h │ ├── Board_MPU9250.c │ ├── Board_MPU9250.h │ ├── Pwm_out.h │ └── Data_Sensor.h ├── SL_RTE │ ├── RTE_APP │ │ ├── RTE_Vec.c │ │ ├── RTE_BGet.c │ │ ├── RTE_Core.c │ │ ├── RTE_KVDB.c │ │ ├── RTE_KVDB.h │ │ ├── RTE_Shell.c │ │ ├── RTE_Stdio.c │ │ ├── RTE_Include.h │ │ ├── RTE_Stdlib.c │ │ ├── RTE_RetargetIO.c │ │ ├── RTE_RingQuene.c │ │ ├── RTE_RoundRobin.c │ │ ├── RTE_StateMachine.c │ │ ├── RTE_StateMachine.h │ │ ├── RTE_Stdio.h │ │ ├── RTE_Shell.h │ │ ├── RTE_BGet.h │ │ ├── RTE_RoundRobin.h │ │ ├── RTE_Stdlib.h │ │ └── RTE_List.h │ ├── RTE_Docs │ │ ├── 版本历史记录.txt │ │ └── 用户手册.docx │ ├── RTE_GUI │ │ ├── GUI_Config.h │ │ ├── GUI_Core │ │ │ ├── GUI_Obj.c │ │ │ ├── GUI_Obj.h │ │ │ ├── GUI_VDB.c │ │ │ ├── GUI_Color.c │ │ │ ├── GUI_Indev.c │ │ │ ├── GUI_Refresh.c │ │ │ ├── GUI_Refresh.h │ │ │ ├── GUI_Trigo.h │ │ │ ├── GUI_VDB.h │ │ │ ├── GUI_Trigo.c │ │ │ ├── GUI_Anim.h │ │ │ └── GUI_Indev.h │ │ ├── GUI_Themes │ │ │ ├── GUI_Theme_Zen.h │ │ │ ├── GUI_Theme_Mono.h │ │ │ ├── GUI_Theme_Alien.h │ │ │ ├── GUI_Theme_Night.h │ │ │ ├── GUI_Theme_Default.h │ │ │ ├── GUI_Theme_Material.h │ │ │ └── GUI_Theme.c │ │ ├── GUI_Draw │ │ │ ├── GUI_Circ.h │ │ │ ├── GUI_Circ.c │ │ │ └── GUI_BufferDraw.h │ │ ├── GUI_Objx │ │ │ ├── GUI_Led.h │ │ │ ├── GUI_Bar.h │ │ │ ├── GUI_SW.h │ │ │ └── GUI_Cont.h │ │ └── GUI_HAL │ │ │ └── GUI_Hal_Indev.c │ ├── RTE_Config │ │ └── RTE_Config.h │ ├── RTE_Board │ │ ├── General_F4 │ │ │ ├── common.h │ │ │ ├── BSP_ADC.c │ │ │ ├── BSP_ADC.h │ │ │ ├── BSP_Com.c │ │ │ ├── BSP_Com.h │ │ │ ├── BSP_E32.c │ │ │ ├── BSP_Key.c │ │ │ ├── BSP_Key.h │ │ │ ├── Board_I2C.c │ │ │ ├── Board_RTC.c │ │ │ ├── Board_RTC.h │ │ │ ├── Board_DHT11.c │ │ │ ├── Board_Font.h │ │ │ ├── Board_Touch.c │ │ │ ├── Board_Touch.h │ │ │ ├── BSP_2WaySwitch.c │ │ │ ├── Board_E2PROM.c │ │ │ ├── Board_E2PROM.h │ │ │ ├── Board_LCDFSMC.c │ │ │ ├── Board_LCDFSMC.h │ │ │ ├── R_Touch_Adjust.h │ │ │ ├── R_Touch_Adjust.lib │ │ │ ├── BSP_Systick.h │ │ │ ├── BSP_Systick.c │ │ │ ├── Board_DHT11.h │ │ │ ├── BSP_E32.h │ │ │ ├── Board_I2C.h │ │ │ ├── BSP_2WaySwitch.h │ │ │ ├── BSP_Led.h │ │ │ ├── BSP_Led.c │ │ │ └── BSP_Flash.h │ │ ├── General_F0 │ │ │ ├── BSP_Com.c │ │ │ ├── BSP_Com.h │ │ │ ├── BSP_Systick.h │ │ │ ├── BSP_Systick.c │ │ │ ├── BSP_Key.c │ │ │ ├── BSP_Key.h │ │ │ ├── BSP_Led.h │ │ │ └── BSP_Led.c │ │ ├── General_TM4C │ │ │ ├── BSP_CAN.c │ │ │ ├── BSP_CAN.h │ │ │ ├── BSP_Com.c │ │ │ ├── BSP_Com.h │ │ │ ├── BSP_ETH.c │ │ │ ├── BSP_ETH.h │ │ │ ├── BSP_Time.c │ │ │ ├── BSP_WatchDog.c │ │ │ ├── BSP_Systick.h │ │ │ ├── BSP_WatchDog.h │ │ │ ├── BSP_Flash.h │ │ │ ├── BSP_Systick.c │ │ │ ├── BSP_Time.h │ │ │ ├── BSP_Led.h │ │ │ ├── BSP_Led.c │ │ │ ├── BSP_Flash.c │ │ │ └── BSP_Interrupt.c │ │ ├── General_H7 │ │ │ ├── BSP_Systick.c │ │ │ ├── BSP_Systick.h │ │ │ ├── BSP_Led.h │ │ │ └── BSP_Led.c │ │ └── General_MSP432 │ │ │ ├── BSP_Systick.h │ │ │ ├── BSP_Systick.c │ │ │ ├── BSP_Led.h │ │ │ └── BSP_Led.c │ └── RTE_Utils │ │ ├── stm32f10x_DSP_lib.chm │ │ ├── FatFs │ │ ├── option │ │ │ └── unicode.c │ │ ├── integer.h │ │ ├── diskio.h │ │ └── drivers │ │ │ ├── sd_diskio_template.h │ │ │ ├── sd_diskio_dma_template.h │ │ │ ├── usbh_diskio_template.h │ │ │ ├── sdram_diskio_template.h │ │ │ ├── sram_diskio_template.h │ │ │ ├── ppp_diskio_template.h │ │ │ ├── usbh_diskio_dma_template.h │ │ │ └── sd_diskio_dma_rtos_template.h │ │ └── STM32F10x_DSP_Lib │ │ ├── src │ │ ├── asm │ │ │ ├── gcc │ │ │ │ ├── PID_stm32.s │ │ │ │ └── iirarma_stm32.s │ │ │ ├── iar │ │ │ │ ├── PID_stm32.s │ │ │ │ └── iirarma_stm32.s │ │ │ └── arm │ │ │ │ └── PID_stm32.s │ │ ├── PID_C_stm32.c │ │ └── iir_stm32.c │ │ └── inc │ │ └── stm32_dsp.h ├── Thread_APP │ ├── Thread_System.c │ ├── Thread_Datasensor.c │ ├── Thread_Stabilizer.c │ ├── Thread_Datasensor.h │ ├── Thread_Stabilizer.h │ └── Thread_System.h ├── MDKPro │ ├── EventRecorderStub.scvd │ ├── RTE │ │ ├── _Target_1 │ │ │ └── RTE_Components.h │ │ ├── _MSP432 │ │ │ └── RTE_Components.h │ │ └── CMSIS │ │ │ └── RTX_Config.c │ ├── Objects │ │ └── MSP432Pro.sct │ └── JLinkSettings.ini ├── Main │ └── main.c └── MSP432P4xx_DriverLib │ ├── eusci.h │ ├── driverlib.h │ ├── pmap.c │ ├── cpu.h │ ├── reset.c │ ├── debug.h │ ├── systick.c │ └── ref_a.c └── README.md /code/keilkill.bat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/keilkill.bat -------------------------------------------------------------------------------- /code/Board_BSP/Control.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/Board_BSP/Control.c -------------------------------------------------------------------------------- /code/Board_BSP/Control.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/Board_BSP/Control.h -------------------------------------------------------------------------------- /code/Board_BSP/Pwm_in.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/Board_BSP/Pwm_in.c -------------------------------------------------------------------------------- /code/Board_BSP/Pwm_in.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/Board_BSP/Pwm_in.h -------------------------------------------------------------------------------- /code/Board_BSP/Pwm_out.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/Board_BSP/Pwm_out.c -------------------------------------------------------------------------------- /code/Board_BSP/Board_I2C.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/Board_BSP/Board_I2C.c -------------------------------------------------------------------------------- /code/Board_BSP/Board_I2C.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/Board_BSP/Board_I2C.h -------------------------------------------------------------------------------- /code/Board_BSP/Board_MPU.C: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/Board_BSP/Board_MPU.C -------------------------------------------------------------------------------- /code/Board_BSP/Board_MPU.H: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/Board_BSP/Board_MPU.H -------------------------------------------------------------------------------- /code/Board_BSP/Board_SPI.C: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/Board_BSP/Board_SPI.C -------------------------------------------------------------------------------- /code/Board_BSP/Board_SPI.H: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/Board_BSP/Board_SPI.H -------------------------------------------------------------------------------- /code/Board_BSP/Data_IMU.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/Board_BSP/Data_IMU.c -------------------------------------------------------------------------------- /code/Board_BSP/Data_IMU.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/Board_BSP/Data_IMU.h -------------------------------------------------------------------------------- /code/Board_BSP/Board_Usart.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/Board_BSP/Board_Usart.c -------------------------------------------------------------------------------- /code/Board_BSP/Board_Usart.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/Board_BSP/Board_Usart.h -------------------------------------------------------------------------------- /code/Board_BSP/Board_filter.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/Board_BSP/Board_filter.c -------------------------------------------------------------------------------- /code/Board_BSP/Board_filter.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/Board_BSP/Board_filter.h -------------------------------------------------------------------------------- /code/Board_BSP/Data_Sensor.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/Board_BSP/Data_Sensor.c -------------------------------------------------------------------------------- /code/Board_BSP/Telecontrol.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/Board_BSP/Telecontrol.c -------------------------------------------------------------------------------- /code/Board_BSP/Telecontrol.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/Board_BSP/Telecontrol.h -------------------------------------------------------------------------------- /code/Board_BSP/configParam.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/Board_BSP/configParam.c -------------------------------------------------------------------------------- /code/Board_BSP/configParam.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/Board_BSP/configParam.h -------------------------------------------------------------------------------- /code/SL_RTE/RTE_APP/RTE_Vec.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_APP/RTE_Vec.c -------------------------------------------------------------------------------- /code/Board_BSP/Board_MPU9250.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/Board_BSP/Board_MPU9250.c -------------------------------------------------------------------------------- /code/Board_BSP/Board_MPU9250.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/Board_BSP/Board_MPU9250.h -------------------------------------------------------------------------------- /code/SL_RTE/RTE_APP/RTE_BGet.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_APP/RTE_BGet.c -------------------------------------------------------------------------------- /code/SL_RTE/RTE_APP/RTE_Core.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_APP/RTE_Core.c -------------------------------------------------------------------------------- /code/SL_RTE/RTE_APP/RTE_KVDB.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_APP/RTE_KVDB.c -------------------------------------------------------------------------------- /code/SL_RTE/RTE_APP/RTE_KVDB.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_APP/RTE_KVDB.h -------------------------------------------------------------------------------- /code/SL_RTE/RTE_APP/RTE_Shell.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_APP/RTE_Shell.c -------------------------------------------------------------------------------- /code/SL_RTE/RTE_APP/RTE_Stdio.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_APP/RTE_Stdio.c -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Docs/版本历史记录.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_Docs/版本历史记录.txt -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Docs/用户手册.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_Docs/用户手册.docx -------------------------------------------------------------------------------- /code/Thread_APP/Thread_System.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/Thread_APP/Thread_System.c -------------------------------------------------------------------------------- /code/SL_RTE/RTE_APP/RTE_Include.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_APP/RTE_Include.h -------------------------------------------------------------------------------- /code/SL_RTE/RTE_APP/RTE_Stdlib.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_APP/RTE_Stdlib.c -------------------------------------------------------------------------------- /code/SL_RTE/RTE_GUI/GUI_Config.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_GUI/GUI_Config.h -------------------------------------------------------------------------------- /code/SL_RTE/RTE_APP/RTE_RetargetIO.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_APP/RTE_RetargetIO.c -------------------------------------------------------------------------------- /code/SL_RTE/RTE_APP/RTE_RingQuene.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_APP/RTE_RingQuene.c -------------------------------------------------------------------------------- /code/SL_RTE/RTE_APP/RTE_RoundRobin.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_APP/RTE_RoundRobin.c -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Config/RTE_Config.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_Config/RTE_Config.h -------------------------------------------------------------------------------- /code/Thread_APP/Thread_Datasensor.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/Thread_APP/Thread_Datasensor.c -------------------------------------------------------------------------------- /code/Thread_APP/Thread_Stabilizer.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/Thread_APP/Thread_Stabilizer.c -------------------------------------------------------------------------------- /code/SL_RTE/RTE_APP/RTE_StateMachine.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_APP/RTE_StateMachine.c -------------------------------------------------------------------------------- /code/SL_RTE/RTE_GUI/GUI_Core/GUI_Obj.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_GUI/GUI_Core/GUI_Obj.c -------------------------------------------------------------------------------- /code/SL_RTE/RTE_GUI/GUI_Core/GUI_Obj.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_GUI/GUI_Core/GUI_Obj.h -------------------------------------------------------------------------------- /code/SL_RTE/RTE_GUI/GUI_Core/GUI_VDB.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_GUI/GUI_Core/GUI_VDB.c -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_F4/common.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_Board/General_F4/common.h -------------------------------------------------------------------------------- /code/SL_RTE/RTE_GUI/GUI_Core/GUI_Color.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_GUI/GUI_Core/GUI_Color.c -------------------------------------------------------------------------------- /code/SL_RTE/RTE_GUI/GUI_Core/GUI_Indev.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_GUI/GUI_Core/GUI_Indev.c -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_F0/BSP_Com.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_Board/General_F0/BSP_Com.c -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_F0/BSP_Com.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_Board/General_F0/BSP_Com.h -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_F4/BSP_ADC.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_Board/General_F4/BSP_ADC.c -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_F4/BSP_ADC.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_Board/General_F4/BSP_ADC.h -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_F4/BSP_Com.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_Board/General_F4/BSP_Com.c -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_F4/BSP_Com.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_Board/General_F4/BSP_Com.h -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_F4/BSP_E32.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_Board/General_F4/BSP_E32.c -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_F4/BSP_Key.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_Board/General_F4/BSP_Key.c -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_F4/BSP_Key.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_Board/General_F4/BSP_Key.h -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_F4/Board_I2C.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_Board/General_F4/Board_I2C.c -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_F4/Board_RTC.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_Board/General_F4/Board_RTC.c -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_F4/Board_RTC.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_Board/General_F4/Board_RTC.h -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_TM4C/BSP_CAN.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_Board/General_TM4C/BSP_CAN.c -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_TM4C/BSP_CAN.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_Board/General_TM4C/BSP_CAN.h -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_TM4C/BSP_Com.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_Board/General_TM4C/BSP_Com.c -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_TM4C/BSP_Com.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_Board/General_TM4C/BSP_Com.h -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_TM4C/BSP_ETH.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_Board/General_TM4C/BSP_ETH.c -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_TM4C/BSP_ETH.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_Board/General_TM4C/BSP_ETH.h -------------------------------------------------------------------------------- /code/SL_RTE/RTE_GUI/GUI_Core/GUI_Refresh.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_GUI/GUI_Core/GUI_Refresh.c -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Utils/stm32f10x_DSP_lib.chm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_Utils/stm32f10x_DSP_lib.chm -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_F4/Board_DHT11.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_Board/General_F4/Board_DHT11.c -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_F4/Board_Font.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_Board/General_F4/Board_Font.h -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_F4/Board_Touch.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_Board/General_F4/Board_Touch.c -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_F4/Board_Touch.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_Board/General_F4/Board_Touch.h -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_H7/BSP_Systick.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_Board/General_H7/BSP_Systick.c -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_TM4C/BSP_Time.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_Board/General_TM4C/BSP_Time.c -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_F4/BSP_2WaySwitch.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_Board/General_F4/BSP_2WaySwitch.c -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_F4/Board_E2PROM.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_Board/General_F4/Board_E2PROM.c -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_F4/Board_E2PROM.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_Board/General_F4/Board_E2PROM.h -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_F4/Board_LCDFSMC.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_Board/General_F4/Board_LCDFSMC.c -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_F4/Board_LCDFSMC.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_Board/General_F4/Board_LCDFSMC.h -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_F4/R_Touch_Adjust.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_Board/General_F4/R_Touch_Adjust.h -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_TM4C/BSP_WatchDog.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_Board/General_TM4C/BSP_WatchDog.c -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_F4/R_Touch_Adjust.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvring/Msp432-Four-rotor/HEAD/code/SL_RTE/RTE_Board/General_F4/R_Touch_Adjust.lib -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_F0/BSP_Systick.h: -------------------------------------------------------------------------------- 1 | #ifndef __BSP_SYSTICK_H 2 | #define __BSP_SYSTICK_H 3 | #include "stm32f0xx.h" 4 | #include "RTE_Include.h" 5 | extern void BSP_Systick_Init(void); 6 | #endif 7 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_F4/BSP_Systick.h: -------------------------------------------------------------------------------- 1 | #ifndef __BSP_SYSTICK_H 2 | #define __BSP_SYSTICK_H 3 | #include "stm32f4xx.h" 4 | #include "RTE_Include.h" 5 | extern void BSP_Systick_Init(void); 6 | #endif 7 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_H7/BSP_Systick.h: -------------------------------------------------------------------------------- 1 | #ifndef __BSP_SYSTICK_H 2 | #define __BSP_SYSTICK_H 3 | #include "stm32h7xx.h" 4 | #include "RTE_Include.h" 5 | extern void BSP_Systick_Init(void); 6 | #endif 7 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_MSP432/BSP_Systick.h: -------------------------------------------------------------------------------- 1 | #ifndef __BSP_SYSTICK_H 2 | #define __BSP_SYSTICK_H 3 | #include 4 | #include "RTE_Include.h" 5 | extern void BSP_Systick_Init(void); 6 | #endif 7 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_TM4C/BSP_Systick.h: -------------------------------------------------------------------------------- 1 | #ifndef __BSP_SYSTICK_H 2 | #define __BSP_SYSTICK_H 3 | #include "tm4c1294ncpdt.h" 4 | #include "RTE_Include.h" 5 | #include "systick.h" 6 | extern void BSP_Systick_Init(void); 7 | #endif 8 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_F4/BSP_Systick.c: -------------------------------------------------------------------------------- 1 | #include "BSP_Systick.h" 2 | void BSP_Systick_Init(void) 3 | { 4 | SysTick_Config(SystemCoreClock / 1000); //Set SysTick Timer for 1ms interrupts 5 | } 6 | #if RTE_USE_OS == 0 7 | void SysTick_Handler(void) 8 | { 9 | RTE_RoundRobin_TickHandler(); 10 | } 11 | #endif 12 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_MSP432/BSP_Systick.c: -------------------------------------------------------------------------------- 1 | #include "BSP_Systick.h" 2 | void BSP_Systick_Init(void) 3 | { 4 | SysTick_Config(SystemCoreClock / 1000); //Set SysTick Timer for 1ms interrupts 5 | } 6 | #if RTE_USE_OS == 0 7 | void SysTick_Handler(void) 8 | { 9 | RTE_RoundRobin_TickHandler(); 10 | } 11 | #endif 12 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_TM4C/BSP_WatchDog.h: -------------------------------------------------------------------------------- 1 | #ifndef __BSP_WATCHDOG_H 2 | #define __BSP_WATCHDOG_H 3 | #include "tm4c1294ncpdt.h" 4 | #include "RTE_Include.h" 5 | #include "watchdog.h" 6 | #include "sysctl.h" 7 | #include "interrupt.h" 8 | #include "hw_ints.h" 9 | extern void BSP_WatchDog_Init(void); 10 | #endif 11 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_F0/BSP_Systick.c: -------------------------------------------------------------------------------- 1 | #include "BSP_Systick.h" 2 | #include "BSP_LED.h" 3 | void BSP_Systick_Init(void) 4 | { 5 | SysTick_Config(SystemCoreClock / 1000); //Set SysTick Timer for 1ms interrupts 6 | } 7 | #if RTE_USE_OS == 0 8 | void SysTick_Handler(void) 9 | { 10 | RTE_RoundRobin_TickHandler(); 11 | } 12 | #endif 13 | -------------------------------------------------------------------------------- /code/Thread_APP/Thread_Datasensor.h: -------------------------------------------------------------------------------- 1 | #ifndef __THREAD_Datasensor_H 2 | #define __THREAD_Datasensor_H 3 | #include "RTE_Include.h" 4 | #if RTE_USE_OS == 1 5 | 6 | extern osThreadId_t ThreadIDDataSensor; 7 | extern const osThreadAttr_t DataSensorTask; 8 | extern __NO_RETURN void ThreadTaskDatasensor(void *argument); 9 | 10 | #endif 11 | #endif 12 | -------------------------------------------------------------------------------- /code/Thread_APP/Thread_Stabilizer.h: -------------------------------------------------------------------------------- 1 | #ifndef __THREAD_stabilizer_H 2 | #define __THREAD_stabilizer_H 3 | #include "RTE_Include.h" 4 | #if RTE_USE_OS == 1 5 | 6 | extern osThreadId_t ThreadIDStabilizer; 7 | extern const osThreadAttr_t stabilizerTask; 8 | extern __NO_RETURN void ThreadTaskStabilizer(void *argument); 9 | 10 | 11 | #endif 12 | #endif 13 | -------------------------------------------------------------------------------- /code/Board_BSP/Pwm_out.h: -------------------------------------------------------------------------------- 1 | #ifndef __PWM_OUT_H 2 | #define __PWM_OUT_H 3 | 4 | #include 5 | 6 | 7 | #define MOTOR_PWM_MAX 3500//3500 8 | 9 | void PWM_Out_Init(uint16_t arr,uint16_t CCR1,uint16_t CCR2,uint16_t CCR3,uint16_t CCR4); 10 | void Motor_PWM_Update(int16_t motor1_pwm,int16_t motor2_pwm,int16_t motor3_pwm,int16_t motor4_pwm); 11 | 12 | #endif 13 | 14 | 15 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_TM4C/BSP_Flash.h: -------------------------------------------------------------------------------- 1 | #ifndef __BSP_FLASH_H 2 | #define __BSP_FLASH_H 3 | /* Includes ------------------------------------------------------------------*/ 4 | #include "tm4c1294ncpdt.h" 5 | #include "RTE_Include.h" 6 | #include "flash.h" 7 | #endif /* __EEPROM_H */ 8 | 9 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ 10 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_TM4C/BSP_Systick.c: -------------------------------------------------------------------------------- 1 | #include "BSP_Systick.h" 2 | void BSP_Systick_Init(void) 3 | { 4 | SysTickPeriodSet(SystemCoreClock/1000); 5 | // Enable the SysTick Interrupt. 6 | SysTickIntEnable(); 7 | // Enable SysTick. 8 | SysTickEnable(); 9 | } 10 | #if RTE_USE_OS == 0 11 | void SysTick_Handler(void) 12 | { 13 | RTE_RoundRobin_TickHandler(); 14 | } 15 | #endif 16 | -------------------------------------------------------------------------------- /code/MDKPro/EventRecorderStub.scvd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Utils/FatFs/option/unicode.c: -------------------------------------------------------------------------------- 1 | #include "../ff.h" 2 | 3 | #if _USE_LFN != 0 4 | 5 | #if _CODE_PAGE == 932 /* Japanese Shift_JIS */ 6 | #include "cc932.c" 7 | #elif _CODE_PAGE == 936 /* Simplified Chinese GBK */ 8 | #include "cc936.c" 9 | #elif _CODE_PAGE == 949 /* Korean */ 10 | #include "cc949.c" 11 | #elif _CODE_PAGE == 950 /* Traditional Chinese Big5 */ 12 | #include "cc950.c" 13 | #else /* Single Byte Character-Set */ 14 | #include "ccsbcs.c" 15 | #endif 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_F4/Board_DHT11.h: -------------------------------------------------------------------------------- 1 | #ifndef __BOARD_DHT11_H 2 | #define __BOARD_DHT11_H 3 | #include "stm32f4xx.h" 4 | #include "RTE_Include.h" 5 | #define DHT11_DataPin GPIO_Pin_15 6 | #define DHT11_GPIO GPIOA 7 | #define DHT11_GPIOCLK RCC_AHB1Periph_GPIOA 8 | typedef struct 9 | { 10 | uint8_t TemperHigh8; 11 | uint8_t TemperLow8; 12 | uint8_t HumdityHigh8; 13 | uint8_t HumdityLow8; 14 | uint8_t CheckData; 15 | }DHT11Result_t; 16 | void DHT11_GetData(void); 17 | extern DHT11Result_t DHT11Result; 18 | #endif 19 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_F4/BSP_E32.h: -------------------------------------------------------------------------------- 1 | #ifndef __BSP_E32_H 2 | #define __BSP_E32_H 3 | #include "stm32f4xx.h" 4 | #include "RTE_Include.h" 5 | #include "BSP_Com.h" 6 | typedef enum 7 | { 8 | MODE_NORMAL = 0x00, 9 | MODE_LOWPWR = 0x01, 10 | MODE_WAKEUP = 0x02, 11 | MODE_SLEEP = 0x03, 12 | }BSP_E32_WorkMode_e; 13 | extern void BSP_E32_Init(void); 14 | extern void BSP_E32_ModeSet(BSP_E32_WorkMode_e Mode); 15 | extern void BSP_E32_ArgsSet(uint16_t DeviceAdd); 16 | extern void BSP_E32_Send(uint8_t *Data,uint16_t Length); 17 | #endif 18 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_TM4C/BSP_Time.h: -------------------------------------------------------------------------------- 1 | #ifndef __BSP_TIME_H 2 | #define __BSP_TIME_H 3 | #include "tm4c1294ncpdt.h" 4 | #include "RTE_Include.h" 5 | #include 6 | #include "sysctl.h" 7 | #include "hibernate.h" 8 | #include "hw_hibernate.h" 9 | extern void BSP_Time_Init(void); 10 | extern void BSP_Time_Set(uint32_t g_ui32HourIdx,uint32_t g_ui32MinIdx,uint32_t g_ui32MonthIdx,uint32_t g_ui32DayIdx 11 | ,uint32_t g_ui32YearIdx); 12 | extern bool BSP_Time_Display(void); 13 | extern bool BSP_Time_Get(struct tm *sTime); 14 | #endif 15 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_F0/BSP_Key.c: -------------------------------------------------------------------------------- 1 | #include "BSP_Key.h" 2 | static Key_Handle_t KeyHandle[KEY_N] = 3 | { 4 | {.KeyName = KEY_0, .KeyPort = GPIOA, .KeyPin = GPIO_Pin_0, .KeyClk = RCC_AHBPeriph_GPIOA,.KeyPressValue = 0}, 5 | }; 6 | static StateMachine_t KeySM = 7 | { 8 | .StateNum = 0, 9 | .RunningState = 0, 10 | .FunctionListTable = (void *)0, 11 | }; 12 | void Board_Key_Init(Key_Name_e KeyName) 13 | { 14 | memset(KeyHandle[KeyName].KeyFIFO.Key_Buffer,0,KEY_FIFO_SIZE); 15 | KeyHandle[KeyName].KeyFIFO.WritePointer = 0; 16 | KeyHandle[KeyName].KeyFIFO.ReadPointer = 0; 17 | } 18 | -------------------------------------------------------------------------------- /code/MDKPro/RTE/_Target_1/RTE_Components.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Auto generated Run-Time-Environment Component Configuration File 4 | * *** Do not modify ! *** 5 | * 6 | * Project: 'MSP432Pro' 7 | * Target: 'Target 1' 8 | */ 9 | 10 | #ifndef RTE_COMPONENTS_H 11 | #define RTE_COMPONENTS_H 12 | 13 | 14 | /* 15 | * Define the Device Header File: 16 | */ 17 | #define CMSIS_device_header "msp.h" 18 | 19 | #define RTE_CMSIS_RTOS2 /* CMSIS-RTOS2 */ 20 | #define RTE_CMSIS_RTOS2_RTX5 /* CMSIS-RTOS2 Keil RTX5 */ 21 | 22 | #endif /* RTE_COMPONENTS_H */ 23 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_GUI/GUI_Core/GUI_Refresh.h: -------------------------------------------------------------------------------- 1 | #ifndef __GUI_REFRESH_H 2 | #define __GUI_REFRESH_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | #include "RTE_Include.h" 7 | extern void GUI_Refresh(void); 8 | extern void refr_init(void); 9 | extern void inv_area(const area_t * area_p,bool reverse); 10 | extern void refr_set_monitor_cb(void (*cb)(uint32_t, uint32_t)); 11 | extern void refr_set_round_cb(void(*cb)(area_t*)); 12 | extern uint16_t refr_get_buf_size(void); 13 | extern void refr_pop_from_buf(uint16_t num); 14 | #ifdef __cplusplus 15 | } /* extern "C" */ 16 | #endif 17 | #endif 18 | -------------------------------------------------------------------------------- /code/MDKPro/RTE/_MSP432/RTE_Components.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Auto generated Run-Time-Environment Configuration File 4 | * *** Do not modify ! *** 5 | * 6 | * Project: 'MSP432Pro' 7 | * Target: 'MSP432' 8 | */ 9 | 10 | #ifndef RTE_COMPONENTS_H 11 | #define RTE_COMPONENTS_H 12 | 13 | 14 | /* 15 | * Define the Device Header File: 16 | */ 17 | #define CMSIS_device_header "msp.h" 18 | 19 | /* ARM::CMSIS:RTOS2:Keil RTX5:Library:5.5.0 */ 20 | #define RTE_CMSIS_RTOS2 /* CMSIS-RTOS2 */ 21 | #define RTE_CMSIS_RTOS2_RTX5 /* CMSIS-RTOS2 Keil RTX5 */ 22 | 23 | 24 | #endif /* RTE_COMPONENTS_H */ 25 | -------------------------------------------------------------------------------- /code/Thread_APP/Thread_System.h: -------------------------------------------------------------------------------- 1 | #ifndef __THREAD_SYSTEM_H 2 | #define __THREAD_SYSTEM_H 3 | #include "RTE_Include.h" 4 | #if RTE_USE_OS == 1 5 | extern osThreadId_t ThreadIDSYS; 6 | extern const osThreadAttr_t SystemThreadControl; 7 | extern __NO_RETURN void ThreadTaskSYS(void *argument); 8 | 9 | extern osThreadId_t ThreadIDStabilizer; 10 | extern const osThreadAttr_t stabilizerTask; 11 | extern __NO_RETURN void ThreadTaskStabilizer(void *argument); 12 | 13 | extern osThreadId_t ThreadIDDataSensor; 14 | extern const osThreadAttr_t DataSensorTask; 15 | extern __NO_RETURN void ThreadTaskDatasensor(void *argument); 16 | #endif 17 | #endif 18 | -------------------------------------------------------------------------------- /code/MDKPro/Objects/MSP432Pro.sct: -------------------------------------------------------------------------------- 1 | ; ************************************************************* 2 | ; *** Scatter-Loading Description File generated by uVision *** 3 | ; ************************************************************* 4 | 5 | LR_IROM1 0x00000000 0x00040000 { ; load region size_region 6 | ER_IROM1 0x00000000 0x00040000 { ; load address = execution address 7 | *.o (RESET, +First) 8 | *(InRoot$$Sections) 9 | .ANY (+RO) 10 | .ANY (+XO) 11 | } 12 | RW_IRAM1 0x20000000 0x00010000 { ; RW data 13 | .ANY (+RW +ZI) 14 | } 15 | } 16 | 17 | LR_IROM2 0x00200000 0x00004000 { 18 | ER_IROM2 0x00200000 0x00004000 { ; load address = execution address 19 | .ANY (+RO) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Msp432-Four-rotor 2 | Four-rotor based on Msp432(TI ' MCU) 3 | 4 | # TI主控的四轴飞行器 5 | 基于MSP432(TI主控)制作的一款四轴飞行器飞控板,目前可以实现遥控飞行。 6 | 7 | # 使用说明 8 | 1、使用的陀螺仪使用的型号是MPU6500(和MPU9250同一封装),留有气压计5611焊盘位置 9 | 10 | 2、接收机使用6路PWM输入,飞控采集读取占空比进行数值调节 11 | 12 | 3、内部姿态调节使用双环PID进行控制,使用二阶低通进行滤波操作(卡尔曼滤波效果应该好,可是自己的懒) 13 | 14 | # 功能实现 15 | 2019.7.1 实现遥控飞行控制 16 | 17 | 18 | # 备注 19 | 2019.7.1 20 | 21 | 这个飞控我没有太多时间搞了,目前先这样(毕业先)。 22 | 23 | 如果有时间我还是会继续花时间进去的,不过有点烧钱(穷学生)。 24 | 25 | 如果有问题或者想要原理图,可以发邮件给我(a767196057@163.com)(星星超过20个,我就上传了)。 26 | 27 | 28 | 29 | # TI MCU's quadcopter 30 | Based on the MSP432 (TI MCU), a four-axis aircraft flight control board can now realize remote flight. 31 | 32 | # Funcation 33 | 2019.7.1 Remote control flight control 34 | 35 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_F0/BSP_Key.h: -------------------------------------------------------------------------------- 1 | #ifndef __BSP_KEY_H 2 | #define __BSP_KEY_H 3 | #include "stm32f0xx.h" 4 | #include "RTE_Include.h" 5 | typedef enum 6 | { 7 | KEY_NONE = 0, 8 | KEY_PRESS = 1, 9 | KEY_RELEASE = 2, 10 | KEY_LONG = 3, 11 | }Key_State_e; 12 | typedef enum 13 | { 14 | KEY_0 = 0, 15 | KEY_1 = 1, 16 | KEY_N, 17 | }Key_Name_e; 18 | #define KEY_FIFO_SIZE 10 19 | typedef struct 20 | { 21 | Key_State_e Key_Buffer[KEY_FIFO_SIZE]; 22 | uint8_t WritePointer; 23 | uint8_t ReadPointer; 24 | }Key_FIFO_t; 25 | typedef struct 26 | { 27 | Key_Name_e KeyName; 28 | Key_FIFO_t KeyFIFO; 29 | uint8_t KeyPressValue; 30 | GPIO_TypeDef* KeyPort; 31 | uint16_t KeyPin; 32 | uint32_t KeyClk; // Clock 33 | uint32_t KeyStartTick; 34 | uint32_t KeyLongTick; 35 | }Key_Handle_t; 36 | 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_F4/Board_I2C.h: -------------------------------------------------------------------------------- 1 | #ifndef __BOARD_I2C_H 2 | #define __BOARD_I2C_H 3 | #include "RTE_Include.h" 4 | #include "stm32f4xx.h" 5 | #define I2C_SCLPin GPIO_Pin_8 6 | #define I2C_SDAPin GPIO_Pin_9 7 | #define I2C_GPIO GPIOB 8 | #define I2C_GPIOCLK RCC_AHB1Periph_GPIOB 9 | #define SoftI2C_SDARead() GPIO_ReadInputDataBit(I2C_GPIO,I2C_SDAPin) 10 | #define SoftI2C_SDASetHigh() GPIO_SetBits(I2C_GPIO, I2C_SDAPin) 11 | #define SoftI2C_SDASetLow() GPIO_ResetBits(I2C_GPIO, I2C_SDAPin) 12 | #define SoftI2C_SCLSetHigh() GPIO_SetBits(I2C_GPIO, I2C_SCLPin) 13 | #define SoftI2C_SCLSetLow() GPIO_ResetBits(I2C_GPIO, I2C_SCLPin) 14 | void SoftI2C_Init(void); 15 | void SoftI2C_StartSignal(void); 16 | void SoftI2C_StopSignal(void); 17 | uint8_t SoftI2C_WaitAck(void); 18 | uint8_t SoftI2C_ReadByte(uint8_t ack); 19 | void SoftI2C_SendByte(uint8_t txd); 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /code/MDKPro/JLinkSettings.ini: -------------------------------------------------------------------------------- 1 | [BREAKPOINTS] 2 | ForceImpTypeAny = 0 3 | ShowInfoWin = 1 4 | EnableFlashBP = 2 5 | BPDuringExecution = 0 6 | [CFI] 7 | CFISize = 0x00 8 | CFIAddr = 0x00 9 | [CPU] 10 | MonModeVTableAddr = 0xFFFFFFFF 11 | MonModeDebug = 0 12 | MaxNumAPs = 0 13 | LowPowerHandlingMode = 0 14 | OverrideMemMap = 0 15 | AllowSimulation = 1 16 | ScriptFile="" 17 | [FLASH] 18 | CacheExcludeSize = 0x00 19 | CacheExcludeAddr = 0x00 20 | MinNumBytesFlashDL = 0 21 | SkipProgOnCRCMatch = 1 22 | VerifyDownload = 1 23 | AllowCaching = 1 24 | EnableFlashDL = 2 25 | Override = 0 26 | Device="ARM7" 27 | [GENERAL] 28 | WorkRAMSize = 0x00 29 | WorkRAMAddr = 0x00 30 | RAMUsageLimit = 0x00 31 | [SWO] 32 | SWOLogFile="" 33 | [MEM] 34 | RdOverrideOrMask = 0x00 35 | RdOverrideAndMask = 0xFFFFFFFF 36 | RdOverrideAddr = 0xFFFFFFFF 37 | WrOverrideOrMask = 0x00 38 | WrOverrideAndMask = 0xFFFFFFFF 39 | WrOverrideAddr = 0xFFFFFFFF 40 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_F4/BSP_2WaySwitch.h: -------------------------------------------------------------------------------- 1 | #ifndef __BSP_2WAYSWITCH_H 2 | #define __BSP_2WAYSWITCH_H 3 | #include "stm32f4xx.h" 4 | #include "RTE_Include.h" 5 | typedef enum 6 | { 7 | SWITCH_01 = 0 , 8 | SWITCH_02 , 9 | SWITCH_03 , 10 | SWITCH_04 , 11 | SWITCH_05 , 12 | SWITCH_06 , 13 | SWITCH_07 , 14 | SWITCH_08 , 15 | SWITCH_09 , 16 | SWITCH_10 , 17 | SWITCH_11 , 18 | SWITCH_12 , 19 | SWITCH_13 , 20 | SWITCH_14 , 21 | SWITCH_15 , 22 | SWITCH_N , 23 | }BSP_2WaySwtch_Name_e; 24 | typedef enum 25 | { 26 | STATUS_NONE = 0x00, 27 | STATUS_NC = 0x01, 28 | STATUS_NO = 0x02, 29 | }BSP_2WaySwtch_Status_e; 30 | typedef struct 31 | { 32 | BSP_2WaySwtch_Name_e SwitchName; 33 | GPIO_TypeDef* SwitchPort; // Port 34 | uint16_t NCPin; 35 | uint16_t NOPin; 36 | uint32_t SwitchClk; // Clock 37 | BSP_2WaySwtch_Status_e SwitchStatus; 38 | }BSP_2WaySwitch_t; 39 | extern void BSP_2WaySwitch_Init(void); 40 | extern BSP_2WaySwtch_Status_e BSP_2WaySwitch_ReadStatus(BSP_2WaySwtch_Name_e i); 41 | #endif 42 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Utils/FatFs/integer.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------*/ 2 | /* Integer type definitions for FatFs module */ 3 | /*-------------------------------------------*/ 4 | 5 | #ifndef _FF_INTEGER 6 | #define _FF_INTEGER 7 | 8 | #ifdef _WIN32 /* FatFs development platform */ 9 | 10 | #include 11 | #include 12 | typedef unsigned __int64 QWORD; 13 | 14 | 15 | #else /* Embedded platform */ 16 | 17 | /* These types MUST be 16-bit or 32-bit */ 18 | typedef int INT; 19 | typedef unsigned int UINT; 20 | 21 | /* This type MUST be 8-bit */ 22 | typedef unsigned char BYTE; 23 | 24 | /* These types MUST be 16-bit */ 25 | typedef short SHORT; 26 | typedef unsigned short WORD; 27 | typedef unsigned short WCHAR; 28 | 29 | /* These types MUST be 32-bit */ 30 | typedef long LONG; 31 | typedef unsigned long DWORD; 32 | 33 | /* This type MUST be 64-bit (Remove this for ANSI C (C89) compatibility) */ 34 | typedef unsigned long long QWORD; 35 | 36 | #endif 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_APP/RTE_StateMachine.h: -------------------------------------------------------------------------------- 1 | #ifndef __RTE_STATEMACHINE_H 2 | #define __RTE_STATEMACHINE_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | #include "RTE_Include.h" 7 | typedef enum 8 | { 9 | SM_NOERR = 0, 10 | SM_HANDLEUNINIT = 1, 11 | SM_NOSPACEFORNEW = 2, 12 | SM_ALREADYEXIST = 3, 13 | SM_NOSUCHSM = 4, 14 | }RTE_SM_Err_e; 15 | typedef struct 16 | { 17 | uint8_t StateName; 18 | uint8_t (*StateFunction)(void *); 19 | }RTE_State_t; 20 | typedef vec_t(RTE_State_t) sm_vec_t; 21 | typedef struct { 22 | uint8_t RunningState; 23 | sm_vec_t SMTable; 24 | }RTE_StateMachine_t; 25 | extern void StateMachine_Init(RTE_StateMachine_t *thisStateMachine); 26 | extern RTE_SM_Err_e StateMachine_Add(RTE_StateMachine_t *thisStateMachine,uint8_t State, uint8_t(*StateFunction)(void *)); 27 | extern void StateMachine_Run(RTE_StateMachine_t *thisStateMachine,void * InputArgs); 28 | extern RTE_SM_Err_e StateMachine_Remove(RTE_StateMachine_t *thisStateMachine,uint8_t State); 29 | #ifdef __cplusplus 30 | } 31 | #endif 32 | #endif 33 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_APP/RTE_Stdio.h: -------------------------------------------------------------------------------- 1 | #ifndef __UARTSTDIO_H__ 2 | #define __UARTSTDIO_H__ 3 | #include "RTE_Include.h" 4 | #include 5 | //***************************************************************************** 6 | // 7 | // If building with a C++ compiler, make all of the definitions in this header 8 | // have a C binding. 9 | // 10 | //***************************************************************************** 11 | #ifdef __cplusplus 12 | extern "C" 13 | { 14 | #endif 15 | extern void RTE_Puts (const char *pcString,uint16_t length); 16 | extern void RTE_Printf(const char *pcString, ...); 17 | extern void RTE_Vprintf(const char *pcString, va_list vaArgP); 18 | #if RTE_USE_OS == 1 19 | extern osMutexId_t MutexIDStdio; 20 | #endif 21 | //***************************************************************************** 22 | // 23 | // Mark the end of the C bindings section for C++ compilers. 24 | // 25 | //***************************************************************************** 26 | #ifdef __cplusplus 27 | } 28 | #endif 29 | 30 | #endif // __UARTSTDIO_H__ 31 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_GUI/GUI_Core/GUI_Trigo.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file trig.h 3 | * Basic trigonometric integer functions 4 | */ 5 | 6 | #ifndef GUI_TRIGO_H 7 | #define GUI_TRIGO_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | 14 | /********************* 15 | * INCLUDES 16 | *********************/ 17 | #include 18 | 19 | /********************* 20 | * DEFINES 21 | *********************/ 22 | #define GUI_TRIGO_SIN_MAX 32767 23 | #define GUI_TRIGO_SHIFT 15 /* >> GUI_TRIGO_SHIFT to normalize*/ 24 | 25 | /********************** 26 | * TYPEDEFS 27 | **********************/ 28 | 29 | /********************** 30 | * GLOBAL PROTOTYPES 31 | **********************/ 32 | 33 | /** 34 | * Return with sinus of an angle 35 | * @param angle 36 | * @return sinus of 'angle'. sin(-90) = -32767, sin(90) = 32767 37 | */ 38 | int16_t trigo_sin(int16_t angle); 39 | 40 | /********************** 41 | * MACROS 42 | **********************/ 43 | 44 | #ifdef __cplusplus 45 | } /* extern "C" */ 46 | #endif 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_GUI/GUI_Core/GUI_VDB.h: -------------------------------------------------------------------------------- 1 | #ifndef __GUI_VDB_H 2 | #define __GUI_VDB_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | #include "RTE_Include.h" 7 | /********************* 8 | * DEFINES 9 | *********************/ 10 | #if GUI_VDB_SIZE != 0 11 | /********************** 12 | * TYPEDEFS 13 | **********************/ 14 | 15 | typedef struct 16 | { 17 | color_t *buf; 18 | area_t area; 19 | }vdb_t; 20 | 21 | /********************** 22 | * GLOBAL PROTOTYPES 23 | **********************/ 24 | void vdb_init(void); 25 | /** 26 | * Get the 'vdb' variable or allocate one in GUI_VDB_DOUBLE mode 27 | * @return pointer to a 'vdb' variable 28 | */ 29 | vdb_t * vdb_get(void); 30 | 31 | /** 32 | * Flush the content of the vdb 33 | */ 34 | void vdb_flush(bool reverse); 35 | 36 | 37 | /** 38 | * In 'GUI_VDB_DOUBLE' mode has to be called when 'disp_map()' 39 | * is ready with copying the map to a frame buffer. 40 | */ 41 | void flush_ready(void); 42 | 43 | /********************** 44 | * MACROS 45 | **********************/ 46 | 47 | #else /*GUI_VDB_SIZE != 0*/ 48 | 49 | /*Just for compatibility*/ 50 | void flush_ready(void); 51 | #endif 52 | #ifdef __cplusplus 53 | } /* extern "C" */ 54 | #endif 55 | #endif 56 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_GUI/GUI_Themes/GUI_Theme_Zen.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file theme_zen.h 3 | * 4 | */ 5 | 6 | #ifndef GUI_THEME_ZEN_H 7 | #define GUI_THEME_ZEN_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "RTE_Include.h" 17 | 18 | #if GUI_USE_THEME_ZEN 19 | 20 | /********************* 21 | * DEFINES 22 | *********************/ 23 | 24 | /********************** 25 | * TYPEDEFS 26 | **********************/ 27 | 28 | /********************** 29 | * GLOBAL PROTOTYPES 30 | **********************/ 31 | 32 | /** 33 | * Initialize the zen theme 34 | * @param hue [0..360] hue value from HSV color space to define the theme's base color 35 | * @param font pointer to a font (NULL to use the default) 36 | * @return pointer to the initialized theme 37 | */ 38 | theme_t * theme_zen_init(uint16_t hue, font_t *font); 39 | 40 | /** 41 | * Get a pointer to the theme 42 | * @return pointer to the theme 43 | */ 44 | theme_t * theme_get_zen(void); 45 | 46 | /********************** 47 | * MACROS 48 | **********************/ 49 | 50 | #endif 51 | 52 | #ifdef __cplusplus 53 | } /* extern "C" */ 54 | #endif 55 | 56 | #endif /*GUI_THEME_ZEN_H*/ 57 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_GUI/GUI_Themes/GUI_Theme_Mono.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file theme_mono.h 3 | * 4 | */ 5 | 6 | #ifndef GUI_THEME_MONO_H 7 | #define GUI_THEME_MONO_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "RTE_Include.h" 17 | 18 | #if GUI_USE_THEME_MONO 19 | 20 | /********************* 21 | * DEFINES 22 | *********************/ 23 | 24 | /********************** 25 | * TYPEDEFS 26 | **********************/ 27 | 28 | /********************** 29 | * GLOBAL PROTOTYPES 30 | **********************/ 31 | 32 | /** 33 | * Initialize the mono theme 34 | * @param hue [0..360] hue value from HSV color space to define the theme's base color 35 | * @param font pointer to a font (NULL to use the default) 36 | * @return pointer to the initialized theme 37 | */ 38 | theme_t * theme_mono_init(uint16_t hue, font_t *font); 39 | 40 | /** 41 | * Get a pointer to the theme 42 | * @return pointer to the theme 43 | */ 44 | theme_t * theme_get_mono(void); 45 | 46 | /********************** 47 | * MACROS 48 | **********************/ 49 | 50 | #endif 51 | 52 | #ifdef __cplusplus 53 | } /* extern "C" */ 54 | #endif 55 | 56 | #endif /*GUI_THEME_MONO_H*/ 57 | -------------------------------------------------------------------------------- /code/Board_BSP/Data_Sensor.h: -------------------------------------------------------------------------------- 1 | #ifndef __DATA_MPU6500_H 2 | #define __DATA_MPU6500_H 3 | 4 | #include "RTE_Include.h" 5 | 6 | #include "Board_MPU9250.h" 7 | 8 | 9 | #define Byte16(Type, ByteH, ByteL) ((Type)((((uint16_t)(ByteH))<<8) | ((uint16_t)(ByteL)))) 10 | #define Byte16(Type, ByteH, ByteL) ((Type)((((uint16_t)(ByteH))<<8) | ((uint16_t)(ByteL)))) 11 | 12 | #if defined(__CC_ARM) 13 | #pragma anon_unions 14 | #endif 15 | 16 | typedef struct 17 | { 18 | int16_t X; 19 | int16_t Y; 20 | int16_t Z; 21 | }S_INT16_XYZ; 22 | 23 | typedef struct 24 | { 25 | int32_t X; 26 | int32_t Y; 27 | int32_t Z; 28 | }S_INT32_XYZ; 29 | 30 | typedef union 31 | { 32 | struct 33 | { 34 | float x; 35 | float y; 36 | float z; 37 | }; 38 | float axis[3]; 39 | } Axis3f; 40 | 41 | extern S_INT16_XYZ MPU6500_Acc; 42 | extern S_INT16_XYZ MPU6500_Gyro; 43 | extern S_INT16_XYZ AK8963_Mag; 44 | extern Axis3f gyroRaw; 45 | extern Axis3f accRaw; 46 | extern Axis3f magRaw; 47 | 48 | 49 | 50 | bool MPU6500DataInit(void); 51 | void MPU6500_newValues(int16_t ax,int16_t ay,int16_t az,int16_t gx,int16_t gy,int16_t gz); 52 | void MPU6500_Date_Offset(uint16_t cnt); 53 | void Deal_value(void); 54 | 55 | 56 | 57 | static void applyAxis3fLpf(lpf2pData *data, Axis3f* in); 58 | #endif 59 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_GUI/GUI_Themes/GUI_Theme_Alien.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file theme_alien.h 3 | * 4 | */ 5 | 6 | #ifndef GUI_THEME_ALIEN_H 7 | #define GUI_THEME_ALIEN_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "RTE_Include.h" 17 | 18 | #if GUI_USE_THEME_ALIEN 19 | 20 | /********************* 21 | * DEFINES 22 | *********************/ 23 | 24 | /********************** 25 | * TYPEDEFS 26 | **********************/ 27 | 28 | /********************** 29 | * GLOBAL PROTOTYPES 30 | **********************/ 31 | 32 | /** 33 | * Initialize the alien theme 34 | * @param hue [0..360] hue value from HSV color space to define the theme's base color 35 | * @param font pointer to a font (NULL to use the default) 36 | * @return pointer to the initialized theme 37 | */ 38 | theme_t * theme_alien_init(uint16_t hue, font_t *font); 39 | /** 40 | * Get a pointer to the theme 41 | * @return pointer to the theme 42 | */ 43 | theme_t * theme_get_alien(void); 44 | 45 | /********************** 46 | * MACROS 47 | **********************/ 48 | 49 | #endif 50 | 51 | #ifdef __cplusplus 52 | } /* extern "C" */ 53 | #endif 54 | 55 | #endif /*GUI_THEME_ALIEN_H*/ 56 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_GUI/GUI_Themes/GUI_Theme_Night.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file theme_night.h 3 | * 4 | */ 5 | 6 | #ifndef GUI_THEME_NIGHT_H 7 | #define GUI_THEME_NIGHT_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "RTE_Include.h" 17 | 18 | #if GUI_USE_THEME_NIGHT 19 | 20 | /********************* 21 | * DEFINES 22 | *********************/ 23 | 24 | /********************** 25 | * TYPEDEFS 26 | **********************/ 27 | 28 | /********************** 29 | * GLOBAL PROTOTYPES 30 | **********************/ 31 | 32 | /** 33 | * Initialize the night theme 34 | * @param hue [0..360] hue value from HSV color space to define the theme's base color 35 | * @param font pointer to a font (NULL to use the default) 36 | * @return pointer to the initialized theme 37 | */ 38 | theme_t * theme_night_init(uint16_t hue, font_t *font); 39 | 40 | /** 41 | * Get a pointer to the theme 42 | * @return pointer to the theme 43 | */ 44 | theme_t * theme_get_night(void); 45 | 46 | /********************** 47 | * MACROS 48 | **********************/ 49 | 50 | #endif 51 | 52 | #ifdef __cplusplus 53 | } /* extern "C" */ 54 | #endif 55 | 56 | #endif /*GUI_THEME_NIGHT_H*/ 57 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_GUI/GUI_Themes/GUI_Theme_Default.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file theme_default.h 3 | * 4 | */ 5 | 6 | #ifndef GUI_THEME_DEFAULT_H 7 | #define GUI_THEME_DEFAULT_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "RTE_Include.h" 17 | 18 | #if GUI_USE_THEME_DEFAULT 19 | 20 | /********************* 21 | * DEFINES 22 | *********************/ 23 | 24 | /********************** 25 | * TYPEDEFS 26 | **********************/ 27 | 28 | /********************** 29 | * GLOBAL PROTOTYPES 30 | **********************/ 31 | 32 | /** 33 | * Initialize the default theme 34 | * @param hue [0..360] hue value from HSV color space to define the theme's base color 35 | * @param font pointer to a font (NULL to use the default) 36 | * @return pointer to the initialized theme 37 | */ 38 | theme_t * theme_default_init(uint16_t hue, font_t *font); 39 | 40 | /** 41 | * Get a pointer to the theme 42 | * @return pointer to the theme 43 | */ 44 | theme_t * theme_get_default(void); 45 | 46 | /********************** 47 | * MACROS 48 | **********************/ 49 | 50 | #endif 51 | 52 | #ifdef __cplusplus 53 | } /* extern "C" */ 54 | #endif 55 | 56 | #endif /*GUI_THEME_TEMPL_H*/ 57 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_GUI/GUI_Themes/GUI_Theme_Material.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file theme_material.h 3 | * 4 | */ 5 | 6 | #ifndef GUI_THEME_MATERIAL_H 7 | #define GUI_THEME_MATERIAL_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "RTE_Include.h" 17 | 18 | #if GUI_USE_THEME_MATERIAL 19 | 20 | /********************* 21 | * DEFINES 22 | *********************/ 23 | 24 | /********************** 25 | * TYPEDEFS 26 | **********************/ 27 | 28 | /********************** 29 | * GLOBAL PROTOTYPES 30 | **********************/ 31 | 32 | /** 33 | * Initialize the material theme 34 | * @param hue [0..360] hue value from HSV color space to define the theme's base color 35 | * @param font pointer to a font (NULL to use the default) 36 | * @return pointer to the initialized theme 37 | */ 38 | theme_t * theme_material_init(uint16_t hue, font_t *font); 39 | 40 | /** 41 | * Get a pointer to the theme 42 | * @return pointer to the theme 43 | */ 44 | theme_t * theme_get_material(void); 45 | 46 | /********************** 47 | * MACROS 48 | **********************/ 49 | 50 | #endif 51 | 52 | #ifdef __cplusplus 53 | } /* extern "C" */ 54 | #endif 55 | 56 | #endif /*GUI_THEME_MATERIAL_H*/ 57 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_APP/RTE_Shell.h: -------------------------------------------------------------------------------- 1 | #ifndef __RTE_SHELL_H 2 | #define __RTE_SHELL_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | #include "RTE_Include.h" 7 | typedef enum 8 | { 9 | SHELL_NOERR = 0, 10 | SHELL_UNINITHANDLE = 1, 11 | SHELL_NOSPACEFORNEW = 2, 12 | SHELL_ALREADYEXIST = 3, 13 | SHELL_NOSUCHCMD = 4, 14 | SHELL_TOOMANYARGS = 5, 15 | SHELL_NOVALIDCMD = 6, 16 | }RTE_Shell_Err_e; 17 | typedef struct 18 | { 19 | //! A pointer to a string containing the name of the command. 20 | const char *pcCmd; 21 | //! A function pointer to the implementation of the command. 22 | RTE_Shell_Err_e (*pfnCmdLine)(int argc, char *argv[]); 23 | //! A pointer to a string of brief help text for the command. 24 | const char *pcHelp; 25 | }RTE_Shell_t; 26 | 27 | typedef vec_t(RTE_Shell_t) sh_vec_t; 28 | 29 | typedef struct 30 | { 31 | char *g_ppcArgv[HI_SHELL_MAX_ARGS + 1]; 32 | sh_vec_t g_psCmdTable; 33 | }RTE_Shell_Control_t; 34 | 35 | extern RTE_Shell_Err_e RTE_Shell_AddCommand(const char *cmd,RTE_Shell_Err_e (*func)(int argc, char *argv[]),const char *help); 36 | extern RTE_Shell_Err_e RTE_Shell_DeleteCommand(const char *cmd); 37 | extern void RTE_Shell_Init(void); 38 | extern void RTE_Shell_Poll(char *ShellBuffer); 39 | #ifdef __cplusplus 40 | } 41 | #endif 42 | #endif 43 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_GUI/GUI_Themes/GUI_Theme.c: -------------------------------------------------------------------------------- 1 | /********************* 2 | * INCLUDES 3 | *********************/ 4 | #include "RTE_Include.h" 5 | #if RTE_USE_GUI == 1 6 | /********************* 7 | * DEFINES 8 | *********************/ 9 | 10 | /********************** 11 | * TYPEDEFS 12 | **********************/ 13 | 14 | /********************** 15 | * STATIC PROTOTYPES 16 | **********************/ 17 | 18 | /********************** 19 | * STATIC VARIABLES 20 | **********************/ 21 | static theme_t *current_theme; 22 | 23 | /********************** 24 | * MACROS 25 | **********************/ 26 | 27 | /********************** 28 | * GLOBAL FUNCTIONS 29 | **********************/ 30 | 31 | /** 32 | * Set a theme for the system. 33 | * From now, all the created objects will use styles from this theme by default 34 | * @param th pointer to theme (return value of: 'theme_init_xxx()') 35 | */ 36 | void theme_set_current(theme_t *th) 37 | { 38 | current_theme = th; 39 | } 40 | 41 | /** 42 | * Get the current system theme. 43 | * @return pointer to the current system theme. NULL if not set. 44 | */ 45 | theme_t * theme_get_current(void) 46 | { 47 | return current_theme; 48 | } 49 | #endif 50 | /********************** 51 | * STATIC FUNCTIONS 52 | **********************/ 53 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_F0/BSP_Led.h: -------------------------------------------------------------------------------- 1 | #ifndef __BSP_LED_H 2 | #define __BSP_LED_H 3 | #include "stm32f0xx.h" 4 | #include "RTE_Include.h" 5 | /* Exported types ------------------------------------------------------------*/ 6 | //-------------------------------------------------------------- 7 | // Liste aller LEDs 8 | // (keine Nummer doppelt und von 0 beginnend) 9 | //-------------------------------------------------------------- 10 | typedef enum 11 | { 12 | LED_0=0, // LED0 13 | LED_N, 14 | }BSP_LED_Name_t; 15 | //-------------------------------------------------------------- 16 | // Status einer LED 17 | //-------------------------------------------------------------- 18 | typedef enum { 19 | LED_OFF = 0, // LED AUS 20 | LED_ON // LED EIN 21 | }BSP_LED_Status_e; 22 | //-------------------------------------------------------------- 23 | // Struktur einer LED 24 | //-------------------------------------------------------------- 25 | typedef struct { 26 | BSP_LED_Name_t LedName; // Name 27 | GPIO_TypeDef* LedPort; // Port 28 | uint16_t LedPin; // Pin 29 | uint32_t LedClk; // Clock 30 | BSP_LED_Status_e LedInitStatus; // Init 31 | }BSP_LED_Handle_t; 32 | void BSP_LED_Init(void); 33 | void BSP_LED_Toggle(BSP_LED_Name_t led_name); 34 | void BSP_LED_On(BSP_LED_Name_t led_name); 35 | void BSP_LED_Off(BSP_LED_Name_t led_name); 36 | #endif 37 | 38 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_TM4C/BSP_Led.h: -------------------------------------------------------------------------------- 1 | /* Define to prevent recursive inclusion -------------------------------------*/ 2 | #ifndef __BSP_LED_H 3 | #define __BSP_LED_H 4 | /* Includes ------------------------------------------------------------------*/ 5 | #include "RTE_Include.h" 6 | #include "tm4c1294ncpdt.h" 7 | #include "gpio.h" 8 | #include "sysctl.h" 9 | /* Exported types ------------------------------------------------------------*/ 10 | //-------------------------------------------------------------- 11 | // Liste aller LEDs 12 | // (keine Nummer doppelt und von 0 beginnend) 13 | //-------------------------------------------------------------- 14 | typedef enum 15 | { 16 | LED_0=0, // LED0 17 | LED_N, 18 | }BSP_LED_Name_t; 19 | //-------------------------------------------------------------- 20 | // Status einer LED 21 | //-------------------------------------------------------------- 22 | typedef enum { 23 | LED_OFF = 0, // LED AUS 24 | LED_ON // LED EIN 25 | }BSP_LED_Status_e; 26 | //-------------------------------------------------------------- 27 | // Struktur einer LED 28 | //-------------------------------------------------------------- 29 | typedef struct { 30 | BSP_LED_Name_t LedName; // Name 31 | uint32_t LedPort; // Port 32 | uint16_t LedPin; // Pin 33 | uint32_t LedClk; // Clock 34 | BSP_LED_Status_e LedInitStatus; // Init 35 | }BSP_LED_Handle_t; 36 | void BSP_LED_Init(void); 37 | void BSP_LED_Toggle(BSP_LED_Name_t led_name); 38 | void BSP_LED_On(BSP_LED_Name_t led_name); 39 | void BSP_LED_Off(BSP_LED_Name_t led_name); 40 | #endif 41 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_F4/BSP_Led.h: -------------------------------------------------------------------------------- 1 | /* Define to prevent recursive inclusion -------------------------------------*/ 2 | #ifndef __BSP_LED_H 3 | #define __BSP_LED_H 4 | /* Includes ------------------------------------------------------------------*/ 5 | #include "stm32f4xx.h" 6 | #include "RTE_Include.h" 7 | /* Exported types ------------------------------------------------------------*/ 8 | //-------------------------------------------------------------- 9 | // Liste aller LEDs 10 | // (keine Nummer doppelt und von 0 beginnend) 11 | //-------------------------------------------------------------- 12 | typedef enum 13 | { 14 | LED_BAT = 0, // LED0 15 | LED_SIGNAL = 1, // LED0 16 | LED_STATUS =2, // LED0 17 | LED_N, 18 | }BSP_LED_Name_t; 19 | //-------------------------------------------------------------- 20 | // Status einer LED 21 | //-------------------------------------------------------------- 22 | typedef enum { 23 | LED_OFF = 0, // LED AUS 24 | LED_ON // LED EIN 25 | }BSP_LED_Status_e; 26 | //-------------------------------------------------------------- 27 | // Struktur einer LED 28 | //-------------------------------------------------------------- 29 | typedef struct { 30 | BSP_LED_Name_t LedName; // Name 31 | GPIO_TypeDef* LedPort; // Port 32 | uint16_t LedPin; // Pin 33 | uint32_t LedClk; // Clock 34 | BSP_LED_Status_e LedInitStatus; // Init 35 | }BSP_LED_Handle_t; 36 | void BSP_LED_Init(void); 37 | void BSP_LED_Toggle(BSP_LED_Name_t led_name); 38 | void BSP_LED_On(BSP_LED_Name_t led_name); 39 | void BSP_LED_Off(BSP_LED_Name_t led_name); 40 | #endif 41 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_MSP432/BSP_Led.h: -------------------------------------------------------------------------------- 1 | /* Define to prevent recursive inclusion -------------------------------------*/ 2 | #ifndef __BSP_LED_H 3 | #define __BSP_LED_H 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | /* Includes ------------------------------------------------------------------*/ 8 | #include 9 | #include "RTE_Include.h" 10 | /* Exported types ------------------------------------------------------------*/ 11 | //-------------------------------------------------------------- 12 | // Liste aller LEDs 13 | // (keine Nummer doppelt und von 0 beginnend) 14 | //-------------------------------------------------------------- 15 | typedef enum 16 | { 17 | LED_A = 0, 18 | LED_B = 1, // LED0 19 | LED_C = 2, // LED0 20 | LED_N, 21 | }BSP_LED_Name_t; 22 | //-------------------------------------------------------------- 23 | // Status einer LED 24 | //-------------------------------------------------------------- 25 | typedef enum { 26 | LED_OFF = 0, // LED AUS 27 | LED_ON // LED EIN 28 | }BSP_LED_Status_e; 29 | //-------------------------------------------------------------- 30 | // Struktur einer LED 31 | //-------------------------------------------------------------- 32 | typedef struct { 33 | BSP_LED_Name_t LedName; // Name 34 | uint_fast8_t LedPort ; // Port 35 | uint16_t LedPin; // Pin 36 | BSP_LED_Status_e LedInitStatus; // Init 37 | }BSP_LED_Handle_t; 38 | void BSP_LED_Init(void); 39 | void BSP_LED_Toggle(BSP_LED_Name_t led_name); 40 | void BSP_LED_On(BSP_LED_Name_t led_name); 41 | void BSP_LED_Off(BSP_LED_Name_t led_name); 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | #endif 46 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_H7/BSP_Led.h: -------------------------------------------------------------------------------- 1 | /* Define to prevent recursive inclusion -------------------------------------*/ 2 | #ifndef __BSP_LED_H 3 | #define __BSP_LED_H 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | /* Includes ------------------------------------------------------------------*/ 8 | #include "stm32h7xx.h" 9 | #include "RTE_Include.h" 10 | /* Exported types ------------------------------------------------------------*/ 11 | //-------------------------------------------------------------- 12 | // Liste aller LEDs 13 | // (keine Nummer doppelt und von 0 beginnend) 14 | //-------------------------------------------------------------- 15 | typedef enum 16 | { 17 | LED_B = 0, // LED0 18 | LED_N, 19 | }BSP_LED_Name_t; 20 | //-------------------------------------------------------------- 21 | // Status einer LED 22 | //-------------------------------------------------------------- 23 | typedef enum { 24 | LED_OFF = 0, // LED AUS 25 | LED_ON // LED EIN 26 | }BSP_LED_Status_e; 27 | //-------------------------------------------------------------- 28 | // Struktur einer LED 29 | //-------------------------------------------------------------- 30 | typedef struct { 31 | BSP_LED_Name_t LedName; // Name 32 | GPIO_TypeDef* LedPort; // Port 33 | uint16_t LedPin; // Pin 34 | #ifdef USE_STDPERIPH_DRIVER 35 | uint32_t LedClk; // Clock 36 | #endif 37 | BSP_LED_Status_e LedInitStatus; // Init 38 | }BSP_LED_Handle_t; 39 | void BSP_LED_Init(void); 40 | void BSP_LED_Toggle(BSP_LED_Name_t led_name); 41 | void BSP_LED_On(BSP_LED_Name_t led_name); 42 | void BSP_LED_Off(BSP_LED_Name_t led_name); 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | #endif 47 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_GUI/GUI_Draw/GUI_Circ.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file circ.h 3 | * 4 | */ 5 | 6 | #ifndef GUI_CIRC_H 7 | #define GUI_CIRC_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | /********************* 13 | * INCLUDES 14 | *********************/ 15 | #include "RTE_Include.h" 16 | /********************* 17 | * DEFINES 18 | *********************/ 19 | #define GUI_CIRC_OCT1_X(p) (p.x) 20 | #define GUI_CIRC_OCT1_Y(p) (p.y) 21 | #define GUI_CIRC_OCT2_X(p) (p.y) 22 | #define GUI_CIRC_OCT2_Y(p) (p.x) 23 | #define GUI_CIRC_OCT3_X(p) (-p.y) 24 | #define GUI_CIRC_OCT3_Y(p) (p.x) 25 | #define GUI_CIRC_OCT4_X(p) (-p.x) 26 | #define GUI_CIRC_OCT4_Y(p) (p.y) 27 | #define GUI_CIRC_OCT5_X(p) (-p.x) 28 | #define GUI_CIRC_OCT5_Y(p) (-p.y) 29 | #define GUI_CIRC_OCT6_X(p) (-p.y) 30 | #define GUI_CIRC_OCT6_Y(p) (-p.x) 31 | #define GUI_CIRC_OCT7_X(p) (p.y) 32 | #define GUI_CIRC_OCT7_Y(p) (-p.x) 33 | #define GUI_CIRC_OCT8_X(p) (p.x) 34 | #define GUI_CIRC_OCT8_Y(p) (-p.y) 35 | 36 | /********************** 37 | * TYPEDEFS 38 | **********************/ 39 | 40 | /********************** 41 | * GLOBAL PROTOTYPES 42 | **********************/ 43 | 44 | /** 45 | * Initialize the circle drawing 46 | * @param c pointer to a point. The coordinates will be calculated here 47 | * @param tmp point to a variable. It will store temporary data 48 | * @param radius radius of the circle 49 | */ 50 | void circ_init(point_t * c, coord_t * tmp, coord_t radius); 51 | 52 | /** 53 | * Test the circle drawing is ready or not 54 | * @param c same as in circ_init 55 | * @return true if the circle is not ready yet 56 | */ 57 | bool circ_cont(point_t * c); 58 | 59 | /** 60 | * Get the next point from the circle 61 | * @param c same as in circ_init. The next point stored here. 62 | * @param tmp same as in circ_init. 63 | */ 64 | void circ_next(point_t * c, coord_t * tmp); 65 | 66 | /********************** 67 | * MACROS 68 | **********************/ 69 | 70 | #ifdef __cplusplus 71 | } /* extern "C" */ 72 | #endif 73 | 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_MSP432/BSP_Led.c: -------------------------------------------------------------------------------- 1 | #include "BSP_Led.h" 2 | //-------------------------------------------------------------- 3 | // Definition aller LEDs 4 | // Reihenfolge wie bei LED_NAME_t 5 | // 6 | // Init : [LED_OFF,LED_ON] 7 | //-------------------------------------------------------------- 8 | static BSP_LED_Handle_t LedControlArray[LED_N]= 9 | { 10 | // Name ,PORT , PIN , Init 11 | {LED_A ,GPIO_PORT_P5,GPIO_PIN0 ,LED_OFF}, 12 | {LED_B ,GPIO_PORT_P5,GPIO_PIN1 ,LED_OFF}, // PD2,LED0 13 | {LED_C ,GPIO_PORT_P5,GPIO_PIN2 ,LED_OFF}, // PD2,LED0 14 | }; 15 | 16 | 17 | //-------------------------------------------------------------- 18 | // LED ausschalten 19 | //-------------------------------------------------------------- 20 | void BSP_LED_Off(BSP_LED_Name_t led_name) 21 | { 22 | GPIO_setOutputLowOnPin(LedControlArray[led_name].LedPort, LedControlArray[led_name].LedPin); 23 | } 24 | 25 | //-------------------------------------------------------------- 26 | // LED einschalten 27 | //-------------------------------------------------------------- 28 | void BSP_LED_On(BSP_LED_Name_t led_name) 29 | { 30 | GPIO_setOutputHighOnPin(LedControlArray[led_name].LedPort, LedControlArray[led_name].LedPin); 31 | } 32 | //-------------------------------------------------------------- 33 | // LED toggeln 34 | //-------------------------------------------------------------- 35 | void BSP_LED_Toggle(BSP_LED_Name_t led_name) 36 | { 37 | GPIO_toggleOutputOnPin(LedControlArray[led_name].LedPort,LedControlArray[led_name].LedPin); 38 | } 39 | void BSP_LED_Init(void) 40 | { 41 | for(BSP_LED_Name_t led_name=(BSP_LED_Name_t)0;led_namex = radius; 46 | c->y = 0; 47 | *tmp = 1 - radius; 48 | } 49 | 50 | /** 51 | * Test the circle drawing is ready or not 52 | * @param c same as in circ_init 53 | * @return true if the circle is not ready yet 54 | */ 55 | bool circ_cont(point_t * c) 56 | { 57 | return c->y <= c->x ? true : false; 58 | } 59 | 60 | /** 61 | * Get the next point from the circle 62 | * @param c same as in circ_init. The next point stored here. 63 | * @param tmp same as in circ_init. 64 | */ 65 | void circ_next(point_t * c, coord_t * tmp) 66 | { 67 | c->y++; 68 | 69 | if (*tmp <= 0) { 70 | (*tmp) += 2 * c->y + 1; // Change in decision criterion for y -> y+1 71 | } else { 72 | c->x--; 73 | (*tmp) += 2 * (c->y - c->x) + 1; // Change for y -> y+1, x -> x-1 74 | } 75 | } 76 | 77 | /********************** 78 | * STATIC FUNCTIONS 79 | **********************/ 80 | #endif 81 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_APP/RTE_BGet.h: -------------------------------------------------------------------------------- 1 | #ifndef __RTE_BGET_H 2 | #define __RTE_BGET_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | #include "RTE_Include.h" 7 | #if RTE_USE_BGET == 1 8 | #define DM_MEM_ATTR /*Complier prefix for big array declaration*/ 9 | #define MEM_MIN(a,b) (ab?a:b) 11 | #define MEM_ABS(x) ((x)>0?(x):(-(x))) 12 | /*The size of this union must be 4 bytes (uint32_t)*/ 13 | typedef union 14 | { 15 | struct 16 | { 17 | uint32_t used:1; //1: if the entry is used 18 | uint32_t d_size:31; //Size off the data (1 means 4 bytes) 19 | }; 20 | uint32_t header; //The header (used + d_size) 21 | }RTE_BGet_Header_t; 22 | typedef struct 23 | { 24 | RTE_BGet_Header_t header; 25 | uint8_t first_data; //First data in entry data 26 | }RTE_BGet_Ent_t; 27 | typedef struct 28 | { 29 | uint32_t cnt_free; 30 | uint32_t cnt_used; 31 | uint32_t size_free; 32 | uint32_t size_free_big; 33 | uint32_t size_total; 34 | uint8_t pct_frag; 35 | uint8_t pct_used; 36 | }RTE_BGet_Monitor_t; 37 | typedef enum 38 | { 39 | MEM_RTE = 0, 40 | MEM_N, 41 | }RTE_BGet_Name_e; 42 | typedef struct 43 | { 44 | RTE_BGet_Name_e MemName; 45 | DM_MEM_ATTR uint8_t *work_mem; //Work memory for allocation 46 | uint32_t totalsize; 47 | }RTE_BGet_t; 48 | 49 | extern void RTE_BPool(RTE_BGet_Name_e mem_name,void *buf,uint32_t len); 50 | extern void *RTE_BGet(RTE_BGet_Name_e mem_name,uint32_t size); 51 | extern void *RTE_BGetz(RTE_BGet_Name_e mem_name,uint32_t size); 52 | extern void RTE_BRel(RTE_BGet_Name_e mem_name,void *data); 53 | extern void *RTE_BGetr(RTE_BGet_Name_e mem_name,void *data_p,uint32_t new_size); 54 | extern void RTE_BGet_Defrag(RTE_BGet_Name_e mem_name); 55 | extern void RET_BGet_Monitor(RTE_BGet_Name_e mem_name,RTE_BGet_Monitor_t *mon_infor); 56 | extern uint32_t RTE_BGet_BufSize(void *data); 57 | extern void RTE_BGet_Demon(void); 58 | #endif 59 | #ifdef __cplusplus 60 | } 61 | #endif 62 | #endif 63 | /****************** (C) COPYRIGHT SuChow University Shannon********************/ 64 | -------------------------------------------------------------------------------- /code/MSP432P4xx_DriverLib/eusci.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ------------------------------------------- 3 | * MSP432 DriverLib - v3_21_00_05 4 | * ------------------------------------------- 5 | * 6 | * --COPYRIGHT--,BSD,BSD 7 | * Copyright (c) 2016, Texas Instruments Incorporated 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions 12 | * are met: 13 | * 14 | * * Redistributions of source code must retain the above copyright 15 | * notice, this list of conditions and the following disclaimer. 16 | * 17 | * * Redistributions in binary form must reproduce the above copyright 18 | * notice, this list of conditions and the following disclaimer in the 19 | * documentation and/or other materials provided with the distribution. 20 | * 21 | * * Neither the name of Texas Instruments Incorporated nor the names of 22 | * its contributors may be used to endorse or promote products derived 23 | * from this software without specific prior written permission. 24 | * 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 27 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 28 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 29 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 30 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 31 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 32 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 33 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 34 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 35 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | * --/COPYRIGHT--*/ 37 | #ifndef EUSCI_H_ 38 | #define EUSCI_H_ 39 | 40 | #include 41 | 42 | #define EUSCI_A_CMSIS(x) ((EUSCI_A_Type *) x) 43 | #define EUSCI_B_CMSIS(x) ((EUSCI_B_Type *) x) 44 | 45 | #endif /* EUSCI_H_ */ 46 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_TM4C/BSP_Led.c: -------------------------------------------------------------------------------- 1 | #include "BSP_Led.h" 2 | //-------------------------------------------------------------- 3 | // Definition aller LEDs 4 | // Reihenfolge wie bei LED_NAME_t 5 | // 6 | // Init : [LED_OFF,LED_ON] 7 | //-------------------------------------------------------------- 8 | static BSP_LED_Handle_t LedControlArray[LED_N]= 9 | { 10 | // Name ,PORT , PIN , Init 11 | {LED_0 ,GPION_BASE,GPIO_PIN_0,SYSCTL_PERIPH_GPION,LED_OFF}, // PD2,LED0 12 | }; 13 | //-------------------------------------------------------------- 14 | // LED ausschalten 15 | //-------------------------------------------------------------- 16 | void BSP_LED_Off(BSP_LED_Name_t led_name) 17 | { 18 | GPIOPinWrite(LedControlArray[led_name].LedPort, LedControlArray[led_name].LedPin, 0x00); 19 | } 20 | 21 | //-------------------------------------------------------------- 22 | // LED einschalten 23 | //-------------------------------------------------------------- 24 | void BSP_LED_On(BSP_LED_Name_t led_name) 25 | { 26 | GPIOPinWrite(LedControlArray[led_name].LedPort, LedControlArray[led_name].LedPin, 0x01); 27 | } 28 | //-------------------------------------------------------------- 29 | // LED toggeln 30 | //-------------------------------------------------------------- 31 | void BSP_LED_Toggle(BSP_LED_Name_t led_name) 32 | { 33 | GPIOPinWrite(LedControlArray[led_name].LedPort, LedControlArray[led_name].LedPin, 34 | (!GPIOPinRead(LedControlArray[led_name].LedPort, LedControlArray[led_name].LedPin))&&LedControlArray[led_name].LedPin); 35 | } 36 | void BSP_LED_Init(void) 37 | { 38 | for(BSP_LED_Name_t led_name=(BSP_LED_Name_t)0;led_nameODR ^= LedControlArray[led_name].LedPin; 34 | } 35 | void BSP_LED_Init(void) 36 | { 37 | for(BSP_LED_Name_t led_name=(BSP_LED_Name_t)0;led_name 0; size -= 4, addr += 4, buf++) { 17 | *buf = *(uint32_t *) addr; 18 | } 19 | return result; 20 | } 21 | /** 22 | * Erase data on flash. 23 | * @note This operation is irreversible. 24 | * @note This operation's units is different which on many chips. 25 | * 26 | * @param addr flash address 27 | * @param size erase bytes size 28 | * 29 | * @return result 30 | */ 31 | EfErrCode ef_port_erase(uint32_t addr, size_t size) { 32 | EfErrCode result = EF_NO_ERR; 33 | size_t erased_size = 0; 34 | uint32_t cur_erase_addr; 35 | /* make sure the start address is a multiple of EF_ERASE_MIN_SIZE */ 36 | RTE_AssertParam(addr % KVDB_ERASE_MIN_SIZE == 0); 37 | /* it will stop when erased size is greater than setting size */ 38 | while(erased_size < size) { 39 | cur_erase_addr = addr + erased_size; 40 | // Erase this block of the flash. 41 | if(FlashErase(cur_erase_addr)==0) 42 | erased_size += 16 * 1024; 43 | else 44 | return EF_ERASE_ERR; 45 | } 46 | 47 | return result; 48 | } 49 | /** 50 | * Write data to flash. 51 | * @note This operation's units is word. 52 | * @note This operation must after erase. @see flash_erase. 53 | * 54 | * @param addr flash address 55 | * @param buf the write data buffer 56 | * @param size write bytes size 57 | * 58 | * @return result 59 | */ 60 | EfErrCode ef_port_write(uint32_t addr, const uint32_t *buf, size_t size) { 61 | EfErrCode result = EF_NO_ERR; 62 | RTE_AssertParam(size % 4 == 0); 63 | if(FlashProgram((uint32_t *)buf,addr,size)!=0) 64 | result = EF_WRITE_ERR; 65 | return result; 66 | } 67 | /** 68 | * lock the ENV ram cache 69 | */ 70 | void ef_port_env_lock(void) { 71 | //rt_sem_take(&env_cache_lock, RT_WAITING_FOREVER); 72 | } 73 | 74 | /** 75 | * unlock the ENV ram cache 76 | */ 77 | void ef_port_env_unlock(void) { 78 | //rt_sem_release(&env_cache_lock); 79 | } 80 | 81 | 82 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_GUI/GUI_Core/GUI_Trigo.c: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * @file trigo.c 4 | * Basic trigonometric integer functions 5 | */ 6 | 7 | /********************* 8 | * INCLUDES 9 | *********************/ 10 | #include "RTE_Include.h" 11 | 12 | /********************* 13 | * DEFINES 14 | *********************/ 15 | 16 | /********************** 17 | * TYPEDEFS 18 | **********************/ 19 | 20 | /********************** 21 | * STATIC PROTOTYPES 22 | **********************/ 23 | 24 | /********************** 25 | * STATIC VARIABLES 26 | **********************/ 27 | static int16_t sin0_90_table[] = 28 | { 29 | 0, 572, 1144, 1715, 2286, 2856, 3425, 3993, 4560, 5126, 30 | 5690, 6252, 6813, 7371, 7927, 8481, 9032, 9580, 10126, 10668, 31 | 11207, 11743, 12275, 12803, 13328, 13848, 14364, 14876, 15383, 15886, 32 | 16383, 16876, 17364, 17846, 18323, 18794, 19260, 19720, 20173, 20621, 33 | 21062, 21497, 21925, 22347, 22762, 23170, 23571, 23964, 24351, 24730, 34 | 25101, 25465, 25821, 26169, 26509, 26841, 27165, 27481, 27788, 28087, 35 | 28377, 28659, 28932, 29196, 29451, 29697, 29934, 30162, 30381, 30591, 36 | 30791, 30982, 31163, 31335, 31498, 31650, 31794, 31927, 32051, 32165, 37 | 32269, 32364, 32448, 32523, 32587, 32642, 32687, 32722, 32747, 32762 38 | }; 39 | 40 | 41 | /********************** 42 | * MACROS 43 | **********************/ 44 | 45 | /********************** 46 | * GLOBAL FUNCTIONS 47 | **********************/ 48 | 49 | /** 50 | * Return with sinus of an angle 51 | * @param angle 52 | * @return sinus of 'angle'. sin(-90) = -32767, sin(90) = 32767 53 | */ 54 | int16_t trigo_sin(int16_t angle) 55 | { 56 | int16_t ret = 0; 57 | angle = angle % 360; 58 | 59 | if(angle < 0) angle = 360 + angle; 60 | 61 | if(angle < 90){ 62 | ret = sin0_90_table[angle]; 63 | } else if(angle >= 90 && angle < 180) 64 | { 65 | angle = 179 - angle; 66 | ret = sin0_90_table[angle]; 67 | } else if(angle >= 180 && angle < 270) 68 | { 69 | angle = angle - 180; 70 | ret = - sin0_90_table[angle]; 71 | } else { /*angle >=270*/ 72 | angle = 359 - angle; 73 | ret = - sin0_90_table[angle]; 74 | } 75 | 76 | return ret; 77 | } 78 | 79 | 80 | /********************** 81 | * STATIC FUNCTIONS 82 | **********************/ 83 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_F4/BSP_Led.c: -------------------------------------------------------------------------------- 1 | #include "BSP_Led.h" 2 | //-------------------------------------------------------------- 3 | // Definition aller LEDs 4 | // Reihenfolge wie bei LED_NAME_t 5 | // 6 | // Init : [LED_OFF,LED_ON] 7 | //-------------------------------------------------------------- 8 | static BSP_LED_Handle_t LedControlArray[LED_N]= 9 | { 10 | // Name ,PORT , PIN , Init 11 | {LED_BAT ,GPIOE,GPIO_Pin_1,RCC_AHB1Periph_GPIOE,LED_OFF}, // PD2,LED0 12 | {LED_SIGNAL ,GPIOE,GPIO_Pin_4,RCC_AHB1Periph_GPIOE,LED_OFF}, // PD2,LED0 13 | {LED_STATUS ,GPIOE,GPIO_Pin_3,RCC_AHB1Periph_GPIOE,LED_OFF}, // PD2,LED0 14 | }; 15 | //-------------------------------------------------------------- 16 | // LED ausschalten 17 | //-------------------------------------------------------------- 18 | void BSP_LED_Off(BSP_LED_Name_t led_name) 19 | { 20 | GPIO_SetBits(LedControlArray[led_name].LedPort, LedControlArray[led_name].LedPin); 21 | } 22 | 23 | //-------------------------------------------------------------- 24 | // LED einschalten 25 | //-------------------------------------------------------------- 26 | void BSP_LED_On(BSP_LED_Name_t led_name) 27 | { 28 | GPIO_ResetBits(LedControlArray[led_name].LedPort, LedControlArray[led_name].LedPin); 29 | } 30 | //-------------------------------------------------------------- 31 | // LED toggeln 32 | //-------------------------------------------------------------- 33 | void BSP_LED_Toggle(BSP_LED_Name_t led_name) 34 | { 35 | LedControlArray[led_name].LedPort->ODR ^= LedControlArray[led_name].LedPin; 36 | } 37 | void BSP_LED_Init(void) 38 | { 39 | for(BSP_LED_Name_t led_name=(BSP_LED_Name_t)0;led_name 38 | #include 39 | #include 40 | 41 | void PMAP_configurePorts(const uint8_t *portMapping, uint8_t pxMAPy, 42 | uint8_t numberOfPorts, uint8_t portMapReconfigure) 43 | { 44 | uint_fast16_t i; 45 | 46 | ASSERT( 47 | (portMapReconfigure == PMAP_ENABLE_RECONFIGURATION) 48 | || (portMapReconfigure == PMAP_DISABLE_RECONFIGURATION)); 49 | 50 | //Get write-access to port mapping registers: 51 | PMAP->KEYID = PMAP_KEYID_VAL; 52 | 53 | //Enable/Disable reconfiguration during runtime 54 | PMAP->CTL = (PMAP->CTL & ~PMAP_CTL_PRECFG) | portMapReconfigure; 55 | 56 | //Configure Port Mapping: 57 | 58 | for (i = 0; i < numberOfPorts * 8; i++) 59 | { 60 | HWREG8(PMAP_BASE + i + pxMAPy) = portMapping[i]; 61 | } 62 | 63 | //Disable write-access to port mapping registers: 64 | PMAP->KEYID = 0; 65 | } 66 | 67 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Utils/FatFs/diskio.h: -------------------------------------------------------------------------------- 1 | /*-----------------------------------------------------------------------/ 2 | / Low level disk interface modlue include file (C)ChaN, 2014 / 3 | /-----------------------------------------------------------------------*/ 4 | 5 | #ifndef _DISKIO_DEFINED 6 | #define _DISKIO_DEFINED 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | #define _USE_WRITE 1 /* 1: Enable disk_write function */ 13 | #define _USE_IOCTL 1 /* 1: Enable disk_ioctl function */ 14 | 15 | #include "integer.h" 16 | 17 | 18 | /* Status of Disk Functions */ 19 | typedef BYTE DSTATUS; 20 | 21 | /* Results of Disk Functions */ 22 | typedef enum { 23 | RES_OK = 0, /* 0: Successful */ 24 | RES_ERROR, /* 1: R/W Error */ 25 | RES_WRPRT, /* 2: Write Protected */ 26 | RES_NOTRDY, /* 3: Not Ready */ 27 | RES_PARERR /* 4: Invalid Parameter */ 28 | } DRESULT; 29 | 30 | 31 | /*---------------------------------------*/ 32 | /* Prototypes for disk control functions */ 33 | 34 | 35 | DSTATUS disk_initialize (BYTE pdrv); 36 | DSTATUS disk_status (BYTE pdrv); 37 | DRESULT disk_read (BYTE pdrv, BYTE* buff, DWORD sector, UINT count); 38 | DRESULT disk_write (BYTE pdrv, const BYTE* buff, DWORD sector, UINT count); 39 | DRESULT disk_ioctl (BYTE pdrv, BYTE cmd, void* buff); 40 | DWORD get_fattime (void); 41 | 42 | /* Disk Status Bits (DSTATUS) */ 43 | 44 | #define STA_NOINIT 0x01 /* Drive not initialized */ 45 | #define STA_NODISK 0x02 /* No medium in the drive */ 46 | #define STA_PROTECT 0x04 /* Write protected */ 47 | 48 | 49 | /* Command code for disk_ioctrl fucntion */ 50 | 51 | /* Generic command (Used by FatFs) */ 52 | #define CTRL_SYNC 0 /* Complete pending write process (needed at _FS_READONLY == 0) */ 53 | #define GET_SECTOR_COUNT 1 /* Get media size (needed at _USE_MKFS == 1) */ 54 | #define GET_SECTOR_SIZE 2 /* Get sector size (needed at _MAX_SS != _MIN_SS) */ 55 | #define GET_BLOCK_SIZE 3 /* Get erase block size (needed at _USE_MKFS == 1) */ 56 | #define CTRL_TRIM 4 /* Inform device that the data on the block of sectors is no longer used (needed at _USE_TRIM == 1) */ 57 | 58 | /* Generic command (Not used by FatFs) */ 59 | #define CTRL_POWER 5 /* Get/Set power status */ 60 | #define CTRL_LOCK 6 /* Lock/Unlock media removal */ 61 | #define CTRL_EJECT 7 /* Eject media */ 62 | #define CTRL_FORMAT 8 /* Create physical format on the media */ 63 | 64 | /* MMC/SDC specific ioctl command */ 65 | #define MMC_GET_TYPE 10 /* Get card type */ 66 | #define MMC_GET_CSD 11 /* Get CSD */ 67 | #define MMC_GET_CID 12 /* Get CID */ 68 | #define MMC_GET_OCR 13 /* Get OCR */ 69 | #define MMC_GET_SDSTAT 14 /* Get SD status */ 70 | 71 | /* ATA/CF specific ioctl command */ 72 | #define ATA_GET_REV 20 /* Get F/W revision */ 73 | #define ATA_GET_MODEL 21 /* Get model name */ 74 | #define ATA_GET_SN 22 /* Get serial number */ 75 | 76 | #ifdef __cplusplus 77 | } 78 | #endif 79 | 80 | #endif 81 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Utils/STM32F10x_DSP_Lib/src/asm/iar/PID_stm32.s: -------------------------------------------------------------------------------- 1 | /******************** (C) COPYRIGHT 2009 STMicroelectronics ******************** 2 | * File Name : PID_stm32.s 3 | * Author : MCD Application Team 4 | ;* Version : V2.0.0 5 | ;* Date : 04/27/2009 6 | * Description : This source file contains assembly optimized source code 7 | * of a PID controller. 8 | ******************************************************************************** 9 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 10 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. 11 | * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, 12 | * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE 13 | * CONTENT OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING 14 | * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 15 | *******************************************************************************/ 16 | 17 | SECTION .text:CODE(2) 18 | 19 | PUBLIC PID_stm32 20 | IMPORT IntTerm 21 | IMPORT PrevError 22 | 23 | #define Err R0 /* 1st function input: Error */ 24 | #define Coeff R1 /* 2nd fct input: Address of coefficient table */ 25 | #define Kd R1 26 | #define Ki R2 27 | #define Kp R3 28 | 29 | #define Out R4 30 | #define Result R2 31 | #define Integ R5 32 | #define PrevErr R12 33 | 34 | 35 | /******************************************************************************* 36 | * Function Name : DoPID 37 | * Description : PID in ASM, Error computed outside the routine 38 | * Input : Error: difference between reference and measured value 39 | * Coeff: pointer to the coefficient table 40 | * Output : None 41 | * Return : PID output (command) 42 | *******************************************************************************/ 43 | PID_stm32: 44 | 45 | PUSH {R4, R5, R9} 46 | 47 | LDR R12, =IntTerm 48 | LDR R9, =PrevError 49 | 50 | LDRH Kp, [Coeff, #0] /* Load Kp */ 51 | LDRH Ki, [Coeff, #2] /* Load Ki */ 52 | LDRH Kd, [Coeff, #4] /* Load Kd and destroy Coeff*/ 53 | LDRH Integ, [R12, #0] /* Last Integral Term */ 54 | LDRH PrevErr, [R9, #0] /* Previous Error */ 55 | 56 | MLA Integ, Ki, Err, Integ /* IntTerm += Ki*error */ 57 | MLA Out, Kp, Err, Integ /* Output = (Kp * error) + InTerm */ 58 | SUBS PrevErr, Err, PrevErr /* PrevErr now holds DeltaError = Error - PrevError */ 59 | MLA Result, Kd, PrevErr, Out /* Output += Kd * DeltaError */ 60 | 61 | LDR R12, =IntTerm 62 | STRH Integ, [R12, #0] /* Write back InTerm */ 63 | STRH Err, [R9, #0] /* Write back PrevError */ 64 | 65 | MOV R0, Result 66 | UXTH R0, R0 67 | POP {R4, R5, R9} 68 | BX LR 69 | 70 | END 71 | 72 | /******************* (C) COPYRIGHT 2009 STMicroelectronics *****END OF FILE****/ 73 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Utils/STM32F10x_DSP_Lib/inc/stm32_dsp.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file STM32F10x_DSP_Lib/inc/stm32_dsp.h 4 | * @author MCD Application Team 5 | * @version V2.0.0 6 | * @date 04/27/2009 7 | * @brief This source file contains prototypes of DSP functions 8 | ****************************************************************************** 9 | * @copy 10 | * 11 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 12 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 13 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 14 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 15 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 16 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 17 | * 18 | *

© COPYRIGHT 2009 STMicroelectronics

19 | */ 20 | 21 | 22 | /* Define to prevent recursive inclusion -------------------------------------*/ 23 | #ifndef __STM32F10x_DSP_H 24 | #define __STM32F10x_DSP_H 25 | 26 | /* Includes ------------------------------------------------------------------*/ 27 | #include "stm32f10x.h" 28 | 29 | 30 | /* Exported types ------------------------------------------------------------*/ 31 | /* for block FIR module */ 32 | typedef struct { 33 | uint16_t *h; 34 | uint32_t nh; 35 | } COEFS; 36 | 37 | /* Exported constants --------------------------------------------------------*/ 38 | /* Exported macro ------------------------------------------------------------*/ 39 | /* Exported functions ------------------------------------------------------- */ 40 | 41 | /* FIR 16-bit filter in assembly */ 42 | void fir_16by16_stm32(void *y, void *x, COEFS *c, uint32_t N); 43 | 44 | /* PID controller in C, error computed outside the function */ 45 | uint16_t DoPID(uint16_t Error, uint16_t *Coeff); 46 | 47 | /* Full PID in C, error computed inside the function */ 48 | uint16_t DoFullPID(uint16_t In, uint16_t Ref, uint16_t *Coeff); 49 | 50 | /* PID controller in assembly, error computed outside the function */ 51 | uint16_t PID_stm32(uint16_t Error, uint16_t *Coeff); 52 | 53 | /* Radix-4 complex FFT for STM32, in assembly */ 54 | /* 64 points*/ 55 | void cr4_fft_64_stm32(void *pssOUT, void *pssIN, uint16_t Nbin); 56 | /* 256 points */ 57 | void cr4_fft_256_stm32(void *pssOUT, void *pssIN, uint16_t Nbin); 58 | /* 1024 points */ 59 | void cr4_fft_1024_stm32(void *pssOUT, void *pssIN, uint16_t Nbin); 60 | 61 | /* IIR filter in assembly */ 62 | void iirarma_stm32(void *y, void *x, uint16_t *h2, uint16_t *h1, uint32_t ny ); 63 | 64 | /* IIR filter in C */ 65 | void iir_biquad_stm32(uint16_t *y, uint16_t *x, int16_t *IIRCoeff, uint16_t ny); 66 | 67 | #endif /* __STM32F10x_DSP_H */ 68 | 69 | /******************* (C) COPYRIGHT 2009 STMicroelectronics *****END OF FILE****/ 70 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_APP/RTE_RoundRobin.h: -------------------------------------------------------------------------------- 1 | #ifndef __RTE_ROUNDROBIN_H 2 | #define __RTE_ROUNDROBIN_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | #include "RTE_Include.h" 7 | typedef enum 8 | { 9 | RR_NOERR = 0, 10 | RR_HANDLEUNINIT = 1, 11 | RR_NOSPACEFORNEW = 2, 12 | RR_ALREADYEXIST = 3, 13 | RR_NOSUCHTIMER = 4, 14 | RR_NOSUCHGROUP = 5, 15 | }RTE_RoundRobin_Err_e; 16 | typedef struct 17 | { 18 | union { 19 | struct { 20 | uint8_t AREN:1; /*!< Auto-reload enabled */ 21 | uint8_t CNTEN:1; /*!< Count enabled */ 22 | } F; 23 | uint8_t FlagsVal; 24 | } Flags; 25 | uint8_t TimerID;/*!< Timer ID */ 26 | volatile uint32_t ARR; /*!< Auto reload value */ 27 | volatile uint32_t CNT; /*!< Counter value, counter counts down */ 28 | const char *TimerName; 29 | void (*Callback)(void *); /*!< Callback which will be called when timer reaches zero */ 30 | void* UserParameters; /*!< Pointer to user parameters used for callback function */ 31 | }RTE_SoftTimer_t; 32 | typedef vec_t(RTE_SoftTimer_t) rrtimer_vec_t; 33 | typedef struct 34 | { 35 | uint8_t TimerGroupID; 36 | const char *TimerGroupName; 37 | rrtimer_vec_t SoftTimerTable; 38 | }RTE_RoundRobin_TimerGroup_t; 39 | typedef struct 40 | { 41 | uint8_t TimerGroupCnt; 42 | #if RTE_USE_OS == 0 43 | volatile uint32_t RoundRobinRunTick; 44 | #endif 45 | RTE_RoundRobin_TimerGroup_t *TimerGroup; 46 | }RTE_RoundRobin_t; 47 | extern void RTE_RoundRobin_Init(void); 48 | extern RTE_RoundRobin_Err_e RTE_RoundRobin_CreateGroup(const char *GroupName); 49 | extern int8_t RTE_RoundRobin_GetGroupID(const char *GroupName); 50 | 51 | 52 | extern RTE_RoundRobin_Err_e RTE_RoundRobin_CreateTimer( 53 | uint8_t GroupID, 54 | const char *TimerName, 55 | uint32_t ReloadValue, 56 | uint8_t ReloadEnable, 57 | uint8_t RunEnable, 58 | void (*TimerCallback)(void *), 59 | void* UserParameters); 60 | extern int8_t RTE_RoundRobin_GetTimerID(uint8_t GroupID,const char *TimerName); 61 | extern RTE_RoundRobin_Err_e RTE_RoundRobin_RemoveTimer(uint8_t GroupID,uint8_t TimerID); 62 | extern void RTE_RoundRobin_TickHandler(void); 63 | extern void RTE_RoundRobin_Run(uint8_t GroupID); 64 | 65 | extern RTE_RoundRobin_Err_e RTE_RoundRobin_ReadyTimer(uint8_t GroupID,uint8_t TimerID); 66 | extern RTE_RoundRobin_Err_e RTE_RoundRobin_ResetTimer(uint8_t GroupID,uint8_t TimerID); 67 | extern RTE_RoundRobin_Err_e RTE_RoundRobin_PauseTimer(uint8_t GroupID,uint8_t TimerID); 68 | extern RTE_RoundRobin_Err_e RTE_RoundRobin_ResumeTimer(uint8_t GroupID,uint8_t TimerID); 69 | 70 | extern void RTE_RoundRobin_Demon(void); 71 | 72 | extern uint32_t RTE_RoundRobin_GetTick(void); 73 | extern uint32_t RTE_RoundRobin_TickElaps(uint32_t prev_tick); 74 | extern void RTE_RoundRobin_DelayMS(uint32_t Delay); 75 | extern __inline void RTE_RoundRobin_DelayUS(volatile uint32_t micros); 76 | #ifdef __cplusplus 77 | } 78 | #endif 79 | #endif 80 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Utils/STM32F10x_DSP_Lib/src/asm/arm/PID_stm32.s: -------------------------------------------------------------------------------- 1 | ;/******************** (C) COPYRIGHT 2009 STMicroelectronics ******************** 2 | ;* File Name : PID_stm32.s 3 | ;* Author : MCD Application Team 4 | ;* Version : V2.0.0 5 | ;* Date : 04/27/2009 6 | ;* Description : This source file contains assembly optimized source code 7 | ;* of a PID controller. 8 | ;******************************************************************************** 9 | ;* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 10 | ;* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. 11 | ;* AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, 12 | ;* INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE 13 | ;* CONTENT OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING 14 | ;* INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 15 | ;*******************************************************************************/ 16 | 17 | THUMB 18 | REQUIRE8 19 | PRESERVE8 20 | 21 | AREA |.text|, CODE, READONLY, ALIGN=2 22 | 23 | EXPORT PID_stm32 24 | IMPORT IntTerm 25 | IMPORT PrevError 26 | 27 | Err RN R0 ; 1st function input: Error 28 | Coeff RN R1 ; 2nd fct input: Address of coefficient table 29 | Kd RN R1 30 | Ki RN R2 31 | Kp RN R3 32 | 33 | Out RN R4 34 | Result RN R2 35 | Integ RN R5 36 | PrevErr RN R12 37 | 38 | ;/******************************************************************************* 39 | ;* Function Name : DoPID 40 | ;* Description : PID in ASM, Error computed outside the routine 41 | ;* Input : Error: difference between reference and measured value 42 | ;* Coeff: pointer to the coefficient table 43 | ;* Output : None 44 | ;* Return : PID output (command) 45 | ;*******************************************************************************/ 46 | PID_stm32 47 | 48 | PUSH {R4, R5, R9} 49 | 50 | LDR R12, =IntTerm 51 | LDR R9, =PrevError 52 | 53 | LDRH Kp, [Coeff, #0] ; Load Kp 54 | LDRH Ki, [Coeff, #2] ; Load Ki 55 | LDRH Kd, [Coeff, #4] ; Load Kd and destroy Coeff 56 | LDRH Integ, [R12, #0] ; Last Integral Term 57 | LDRH PrevErr, [R9, #0] ; Previous Error 58 | 59 | MLA Integ, Ki, Err, Integ ; IntTerm += Ki*error 60 | MLA Out, Kp, Err, Integ ; Output = (Kp * error) + InTerm 61 | SUBS PrevErr, Err, PrevErr ; PrevErr now holds DeltaError = Error - PrevError 62 | MLA Result, Kd, PrevErr, Out ; Output += Kd * DeltaError 63 | 64 | LDR R12, =IntTerm 65 | STRH Integ, [R12, #0] ; Write back InTerm 66 | STRH Err, [R9, #0] ; Write back PrevError 67 | 68 | MOV R0, Result 69 | UXTH R0, R0 70 | POP {R4, R5, R9} 71 | BX LR 72 | 73 | END 74 | 75 | ;/******************* (C) COPYRIGHT 2009 STMicroelectronics *****END OF FILE****/ 76 | -------------------------------------------------------------------------------- /code/MSP432P4xx_DriverLib/cpu.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ------------------------------------------- 3 | * MSP432 DriverLib - v3_21_00_05 4 | * ------------------------------------------- 5 | * 6 | * --COPYRIGHT--,BSD,BSD 7 | * Copyright (c) 2016, Texas Instruments Incorporated 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions 12 | * are met: 13 | * 14 | * * Redistributions of source code must retain the above copyright 15 | * notice, this list of conditions and the following disclaimer. 16 | * 17 | * * Redistributions in binary form must reproduce the above copyright 18 | * notice, this list of conditions and the following disclaimer in the 19 | * documentation and/or other materials provided with the distribution. 20 | * 21 | * * Neither the name of Texas Instruments Incorporated nor the names of 22 | * its contributors may be used to endorse or promote products derived 23 | * from this software without specific prior written permission. 24 | * 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 27 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 28 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 29 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 30 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 31 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 32 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 33 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 34 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 35 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | * --/COPYRIGHT--*/ 37 | #ifndef __CPU_H__ 38 | #define __CPU_H__ 39 | 40 | #include 41 | 42 | //***************************************************************************** 43 | // 44 | // If building with a C++ compiler, make all of the definitions in this header 45 | // have a C binding. 46 | // 47 | //***************************************************************************** 48 | #ifdef __cplusplus 49 | extern "C" 50 | { 51 | #endif 52 | 53 | //***************************************************************************** 54 | // 55 | // Prototypes. 56 | // 57 | //***************************************************************************** 58 | extern uint32_t CPU_cpsid(void); 59 | extern uint32_t CPU_cpsie(void); 60 | extern uint32_t CPU_primask(void); 61 | extern void CPU_wfi(void); 62 | extern uint32_t CPU_basepriGet(void); 63 | extern void CPU_basepriSet(uint32_t newBasepri); 64 | 65 | 66 | //***************************************************************************** 67 | // 68 | // Mark the end of the C bindings section for C++ compilers. 69 | // 70 | //***************************************************************************** 71 | #ifdef __cplusplus 72 | } 73 | #endif 74 | 75 | #endif // __CPU_H__ 76 | 77 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_GUI/GUI_HAL/GUI_Hal_Indev.c: -------------------------------------------------------------------------------- 1 | #include "RTE_Include.h" 2 | #if RTE_USE_GUI == 1 3 | /********************* 4 | * DEFINES 5 | *********************/ 6 | 7 | /********************** 8 | * TYPEDEFS 9 | **********************/ 10 | 11 | /********************** 12 | * STATIC PROTOTYPES 13 | **********************/ 14 | static indev_t *indev_list = NULL; 15 | 16 | /********************** 17 | * STATIC VARIABLES 18 | **********************/ 19 | 20 | /********************** 21 | * MACROS 22 | **********************/ 23 | 24 | /********************** 25 | * GLOBAL FUNCTIONS 26 | **********************/ 27 | 28 | /** 29 | * Initialize an input device driver with default values. 30 | * It is used to surly have known values in the fields ant not memory junk. 31 | * After it you can set the fields. 32 | * @param driver pointer to driver variable to initialize 33 | */ 34 | void indev_drv_init(indev_drv_t *driver) 35 | { 36 | driver->read = NULL; 37 | driver->type = GUI_INDEV_TYPE_NONE; 38 | driver->user_data = NULL; 39 | } 40 | 41 | /** 42 | * Register an initialized input device driver. 43 | * @param driver pointer to an initialized 'indev_drv_t' variable (can be local variable) 44 | * @return pointer to the new input device or NULL on error 45 | */ 46 | indev_t * indev_drv_register(indev_drv_t *driver) 47 | { 48 | indev_t *node; 49 | 50 | node = RTE_BGet(MEM_RTE,sizeof(indev_t)); 51 | if (!node) return NULL; 52 | 53 | memset(node, 0, sizeof(indev_t)); 54 | memcpy(&node->driver, driver, sizeof(indev_drv_t)); 55 | 56 | node->next = NULL; 57 | node->proc.reset_query = 1; 58 | node->cursor = NULL; 59 | node->group = NULL; 60 | node->btn_points = NULL; 61 | 62 | if (indev_list == NULL) { 63 | indev_list = node; 64 | } else { 65 | indev_t *last = indev_list; 66 | while (last->next) 67 | last = last->next; 68 | 69 | last->next = node; 70 | } 71 | 72 | return node; 73 | } 74 | 75 | /** 76 | * Get the next input device. 77 | * @param indev pointer to the current input device. NULL to initialize. 78 | * @return the next input devise or NULL if no more. Give the first input device when the parameter is NULL 79 | */ 80 | indev_t * indev_next(indev_t * indev) 81 | { 82 | 83 | if(indev == NULL) { 84 | return indev_list; 85 | } else { 86 | if(indev->next == NULL) return NULL; 87 | else return indev->next; 88 | } 89 | } 90 | 91 | /** 92 | * Read data from an input device. 93 | * @param indev pointer to an input device 94 | * @param data input device will write its data here 95 | * @return false: no more data; true: there more data to read (buffered) 96 | */ 97 | bool indev_read(indev_t * indev, indev_data_t *data) 98 | { 99 | bool cont = false; 100 | 101 | if(indev->driver.read) { 102 | data->user_data = indev->driver.user_data; 103 | cont = indev->driver.read(data); 104 | } else { 105 | memset(data, 0, sizeof(indev_data_t)); 106 | } 107 | 108 | return cont; 109 | } 110 | #endif 111 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Utils/STM32F10x_DSP_Lib/src/PID_C_stm32.c: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file STM32F10x_DSP_Lib/src/PID_C_stm32.c 4 | * @author MCD Application Team 5 | * @version V2.0.0 6 | * @date 04/27/2009 7 | * @brief This source file contains code PID controller 8 | ****************************************************************************** 9 | * @copy 10 | * 11 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 12 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 13 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 14 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 15 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 16 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 17 | * 18 | *

© COPYRIGHT 2009 STMicroelectronics

19 | */ 20 | 21 | 22 | /* Includes ------------------------------------------------------------------*/ 23 | #include "stm32f10x.h" 24 | #include "stm32_dsp.h" 25 | 26 | 27 | /** @addtogroup STM32F10x_DSP_Lib 28 | * @{ 29 | */ 30 | 31 | 32 | /* Private typedef -----------------------------------------------------------*/ 33 | /* Private define ------------------------------------------------------------*/ 34 | /* Private macro -------------------------------------------------------------*/ 35 | /* Private variables ---------------------------------------------------------*/ 36 | uint16_t PrevError = 0, IntTerm = 0; 37 | uint16_t PrevError_C = 0, IntTerm_C = 0; 38 | 39 | /* Private function prototypes -----------------------------------------------*/ 40 | /* Private functions ---------------------------------------------------------*/ 41 | 42 | 43 | 44 | /** 45 | * @brief PID in C, Error computed outside the routine 46 | * @param ror: difference between reference and measured value 47 | * Coeff: pointer to the coefficient table 48 | * @retval : PID output (command) 49 | */ 50 | uint16_t DoPID(uint16_t Error, uint16_t *Coeff) 51 | { 52 | uint16_t Kp, Ki, Kd, Output; 53 | 54 | Kp = Coeff[0]; 55 | Ki = Coeff[1]; 56 | Kd = Coeff[2]; 57 | 58 | IntTerm_C += Ki*Error; 59 | Output = Kp * Error; 60 | Output += IntTerm_C; 61 | Output += Kd * (Error - PrevError_C); 62 | 63 | PrevError_C = Error; 64 | 65 | return (Output); 66 | } 67 | 68 | 69 | 70 | /** 71 | * @brief PID in C, Error computed inside the routine 72 | * @param : Input (measured value) 73 | * Ref: reference (target value) 74 | * Coeff: pointer to the coefficient table 75 | * @retval : PID output (command) 76 | */ 77 | uint16_t DoFullPID(uint16_t In, uint16_t Ref, uint16_t *Coeff) 78 | { 79 | uint16_t Kp, Ki, Kd, Output, Error; 80 | 81 | Error = Ref - In; 82 | Kp = Coeff[0]; 83 | Ki = Coeff[1]; 84 | Kd = Coeff[2]; 85 | 86 | IntTerm_C += Ki*Error; 87 | Output = Kp * Error; 88 | Output += IntTerm_C; 89 | Output += Kd * (Error - PrevError_C); 90 | 91 | PrevError_C = Error; 92 | 93 | return (Output); 94 | } 95 | 96 | /** 97 | * @} 98 | */ 99 | 100 | 101 | 102 | 103 | /******************* (C) COPYRIGHT 2009 STMicroelectronics *****END OF FILE****/ 104 | -------------------------------------------------------------------------------- /code/MSP432P4xx_DriverLib/reset.c: -------------------------------------------------------------------------------- 1 | /* 2 | * ------------------------------------------- 3 | * MSP432 DriverLib - v3_21_00_05 4 | * ------------------------------------------- 5 | * 6 | * --COPYRIGHT--,BSD,BSD 7 | * Copyright (c) 2016, Texas Instruments Incorporated 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions 12 | * are met: 13 | * 14 | * * Redistributions of source code must retain the above copyright 15 | * notice, this list of conditions and the following disclaimer. 16 | * 17 | * * Redistributions in binary form must reproduce the above copyright 18 | * notice, this list of conditions and the following disclaimer in the 19 | * documentation and/or other materials provided with the distribution. 20 | * 21 | * * Neither the name of Texas Instruments Incorporated nor the names of 22 | * its contributors may be used to endorse or promote products derived 23 | * from this software without specific prior written permission. 24 | * 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 27 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 28 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 29 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 30 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 31 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 32 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 33 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 34 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 35 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | * --/COPYRIGHT--*/ 37 | #include 38 | #include 39 | 40 | void ResetCtl_initiateSoftReset(void) 41 | { 42 | RSTCTL->RESET_REQ |= (RESET_KEY | RESET_SOFT_RESET); 43 | } 44 | 45 | void ResetCtl_initiateSoftResetWithSource(uint32_t source) 46 | { 47 | RSTCTL->SOFTRESET_SET |= (source); 48 | } 49 | 50 | uint32_t ResetCtl_getSoftResetSource(void) 51 | { 52 | return RSTCTL->SOFTRESET_STAT; 53 | } 54 | 55 | void ResetCtl_clearSoftResetSource(uint32_t mask) 56 | { 57 | RSTCTL->SOFTRESET_CLR |= mask; 58 | } 59 | 60 | void ResetCtl_initiateHardReset(void) 61 | { 62 | RSTCTL->RESET_REQ |= (RESET_KEY | RESET_HARD_RESET); 63 | } 64 | 65 | void ResetCtl_initiateHardResetWithSource(uint32_t source) 66 | { 67 | RSTCTL->HARDRESET_SET |= (source); 68 | } 69 | 70 | uint32_t ResetCtl_getHardResetSource(void) 71 | { 72 | return RSTCTL->HARDRESET_STAT; 73 | } 74 | 75 | void ResetCtl_clearHardResetSource(uint32_t mask) 76 | { 77 | RSTCTL->HARDRESET_CLR |= mask; 78 | } 79 | 80 | uint32_t ResetCtl_getPSSSource(void) 81 | { 82 | return RSTCTL->PSSRESET_STAT; 83 | } 84 | 85 | void ResetCtl_clearPSSFlags(void) 86 | { 87 | RSTCTL->PSSRESET_CLR |= RSTCTL_PSSRESET_CLR_CLR; 88 | } 89 | 90 | uint32_t ResetCtl_getPCMSource(void) 91 | { 92 | return RSTCTL->PCMRESET_STAT; 93 | } 94 | 95 | void ResetCtl_clearPCMFlags(void) 96 | { 97 | RSTCTL->PCMRESET_CLR |= RSTCTL_PCMRESET_CLR_CLR; 98 | } 99 | 100 | -------------------------------------------------------------------------------- /code/MSP432P4xx_DriverLib/debug.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ------------------------------------------- 3 | * MSP432 DriverLib - v3_21_00_05 4 | * ------------------------------------------- 5 | * 6 | * --COPYRIGHT--,BSD,BSD 7 | * Copyright (c) 2016, Texas Instruments Incorporated 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions 12 | * are met: 13 | * 14 | * * Redistributions of source code must retain the above copyright 15 | * notice, this list of conditions and the following disclaimer. 16 | * 17 | * * Redistributions in binary form must reproduce the above copyright 18 | * notice, this list of conditions and the following disclaimer in the 19 | * documentation and/or other materials provided with the distribution. 20 | * 21 | * * Neither the name of Texas Instruments Incorporated nor the names of 22 | * its contributors may be used to endorse or promote products derived 23 | * from this software without specific prior written permission. 24 | * 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 27 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 28 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 29 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 30 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 31 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 32 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 33 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 34 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 35 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | * --/COPYRIGHT--*/ 37 | #ifndef __DEBUG_H__ 38 | #define __DEBUG_H__ 39 | 40 | //***************************************************************************** 41 | // 42 | // Prototype for the function that is called when an invalid argument is passed 43 | // to an API. This is only used when doing a DEBUG build. 44 | // 45 | //***************************************************************************** 46 | extern void __error__(char *pcFilename, unsigned long line); 47 | 48 | //***************************************************************************** 49 | // 50 | // The ASSERT macro, which does the actual assertion checking. Typically, this 51 | // will be for procedure arguments. 52 | // 53 | //***************************************************************************** 54 | #ifdef DEBUG 55 | #define ASSERT(expr) { \ 56 | if(!(expr)) \ 57 | { \ 58 | __error__(__FILE__, __LINE__); \ 59 | } \ 60 | } 61 | #else 62 | #define ASSERT(expr) 63 | #endif 64 | 65 | #ifdef DEBUG 66 | #define assert(expr) { \ 67 | if(!(expr)) \ 68 | { \ 69 | __error__(__FILE__, __LINE__); \ 70 | } \ 71 | } 72 | #else 73 | #define assert(expr) 74 | #endif 75 | 76 | #endif // __DEBUG_H__ 77 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Board/General_H7/BSP_Led.c: -------------------------------------------------------------------------------- 1 | #include "BSP_Led.h" 2 | //-------------------------------------------------------------- 3 | // Definition aller LEDs 4 | // Reihenfolge wie bei LED_NAME_t 5 | // 6 | // Init : [LED_OFF,LED_ON] 7 | //-------------------------------------------------------------- 8 | static BSP_LED_Handle_t LedControlArray[LED_N]= 9 | { 10 | // Name ,PORT , PIN , Init 11 | {LED_B ,GPIOC,GPIO_PIN_0 ,LED_OFF}, // PD2,LED0 12 | }; 13 | 14 | //-------------------------------------------------------------- 15 | // LED ausschalten 16 | //-------------------------------------------------------------- 17 | void BSP_LED_Off(BSP_LED_Name_t led_name) 18 | { 19 | #ifdef USE_STDPERIPH_DRIVER 20 | GPIO_SetBits(LedControlArray[led_name].LedPort, LedControlArray[led_name].LedPin); 21 | #endif 22 | #ifdef USE_HAL_DRIVER 23 | HAL_GPIO_WritePin(LedControlArray[led_name].LedPort, LedControlArray[led_name].LedPin, GPIO_PIN_RESET); 24 | #endif 25 | } 26 | 27 | //-------------------------------------------------------------- 28 | // LED einschalten 29 | //-------------------------------------------------------------- 30 | void BSP_LED_On(BSP_LED_Name_t led_name) 31 | { 32 | #ifdef USE_STDPERIPH_DRIVER 33 | GPIO_ResetBits(LedControlArray[led_name].LedPort, LedControlArray[led_name].LedPin); 34 | #endif 35 | #ifdef USE_HAL_DRIVER 36 | HAL_GPIO_WritePin(LedControlArray[led_name].LedPort, LedControlArray[led_name].LedPin, GPIO_PIN_SET); 37 | #endif 38 | } 39 | //-------------------------------------------------------------- 40 | // LED toggeln 41 | //-------------------------------------------------------------- 42 | void BSP_LED_Toggle(BSP_LED_Name_t led_name) 43 | { 44 | LedControlArray[led_name].LedPort->ODR ^= LedControlArray[led_name].LedPin; 45 | } 46 | void BSP_LED_Init(void) 47 | { 48 | for(BSP_LED_Name_t led_name=(BSP_LED_Name_t)0;led_name
© Copyright (c) 2017 STMicroelectronics International N.V. 13 | * All rights reserved.
14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted, provided that the following conditions are met: 17 | * 18 | * 1. Redistribution of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright notice, 21 | * this list of conditions and the following disclaimer in the documentation 22 | * and/or other materials provided with the distribution. 23 | * 3. Neither the name of STMicroelectronics nor the names of other 24 | * contributors to this software may be used to endorse or promote products 25 | * derived from this software without specific written permission. 26 | * 4. This software, including modifications and/or derivative works of this 27 | * software, must execute solely and exclusively on microcontroller or 28 | * microprocessor devices manufactured by or for STMicroelectronics. 29 | * 5. Redistribution and use of this software other than as permitted under 30 | * this license is void and will automatically terminate your rights under 31 | * this license. 32 | * 33 | * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" 34 | * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT 35 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 36 | * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY 37 | * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT 38 | * SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 39 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 40 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 41 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 42 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 43 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 44 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 45 | * 46 | ****************************************************************************** 47 | */ 48 | 49 | /* Define to prevent recursive inclusion -------------------------------------*/ 50 | #ifndef __SD_DISKIO_H 51 | #define __SD_DISKIO_H 52 | 53 | /* Includes ------------------------------------------------------------------*/ 54 | #include "stm32xxxxx_{eval}{discovery}_sd.h" 55 | /* Exported types ------------------------------------------------------------*/ 56 | /* Exported constants --------------------------------------------------------*/ 57 | /* Exported functions ------------------------------------------------------- */ 58 | extern const Diskio_drvTypeDef SD_Driver; 59 | 60 | #endif /* __SD_DISKIO_H */ 61 | 62 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 63 | 64 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Utils/STM32F10x_DSP_Lib/src/iir_stm32.c: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file STM32F10x_DSP_Lib/src/iir_stm32.c 4 | * @author MCD Application Team 5 | * @version V2.0.0 6 | * @date 04/27/2009 7 | * @brief This source file contains IIR functions in C 8 | ****************************************************************************** 9 | * @copy 10 | * 11 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 12 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 13 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 14 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 15 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 16 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 17 | * 18 | *

© COPYRIGHT 2009 STMicroelectronics

19 | */ 20 | 21 | 22 | /* Includes ------------------------------------------------------------------*/ 23 | #include "stm32_dsp.h" 24 | #include "stm32f10x.h" 25 | 26 | 27 | /** @addtogroup STM32F10x_DSP_Lib 28 | * @{ 29 | */ 30 | 31 | 32 | /* Private typedef -----------------------------------------------------------*/ 33 | /* Private define ------------------------------------------------------------*/ 34 | /* Private macro -------------------------------------------------------------*/ 35 | /* Private variables ---------------------------------------------------------*/ 36 | /* Private function prototypes -----------------------------------------------*/ 37 | /* Private functions ---------------------------------------------------------*/ 38 | 39 | 40 | /** 41 | * @brief Canonique Form of 8th order IIR filter, factorized in 42 | * 4 biquads sections in series. 43 | * @param y: Output array . 44 | * @param x: Input array 45 | * @param IIRCoeff: IIR Filter Coefficients, an array of 20 shorts 46 | * @param ny: the number of output samples 47 | * @retval : None 48 | */ 49 | void iir_biquad_stm32(uint16_t *y, uint16_t *x, int16_t *IIRCoeff, uint16_t ny) 50 | { 51 | uint32_t i; 52 | uint32_t w1_2 = 0, w1_1 = 0, w1; 53 | uint32_t w2_2 = 0, w2_1 = 0, w2; 54 | uint32_t w3_2 = 0, w3_1 = 0, w3; 55 | uint32_t w4_2 = 0, w4_1 = 0, w4; 56 | 57 | /** Canonic form **/ 58 | /* 1st section */ 59 | for (i=0; i
© Copyright (c) 2017 STMicroelectronics International N.V. 13 | * All rights reserved.
14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted, provided that the following conditions are met: 17 | * 18 | * 1. Redistribution of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright notice, 21 | * this list of conditions and the following disclaimer in the documentation 22 | * and/or other materials provided with the distribution. 23 | * 3. Neither the name of STMicroelectronics nor the names of other 24 | * contributors to this software may be used to endorse or promote products 25 | * derived from this software without specific written permission. 26 | * 4. This software, including modifications and/or derivative works of this 27 | * software, must execute solely and exclusively on microcontroller or 28 | * microprocessor devices manufactured by or for STMicroelectronics. 29 | * 5. Redistribution and use of this software other than as permitted under 30 | * this license is void and will automatically terminate your rights under 31 | * this license. 32 | * 33 | * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" 34 | * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT 35 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 36 | * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY 37 | * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT 38 | * SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 39 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 40 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 41 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 42 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 43 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 44 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 45 | * 46 | ****************************************************************************** 47 | */ 48 | 49 | /* Define to prevent recursive inclusion -------------------------------------*/ 50 | #ifndef __SD_DISKIO_H 51 | #define __SD_DISKIO_H 52 | 53 | /* Includes ------------------------------------------------------------------*/ 54 | #include "stm32xxxxx_{eval}{discovery}_sd.h" 55 | /* Exported types ------------------------------------------------------------*/ 56 | /* Exported constants --------------------------------------------------------*/ 57 | /* Exported functions ------------------------------------------------------- */ 58 | extern const Diskio_drvTypeDef SD_Driver; 59 | 60 | #endif /* __SD_DISKIO_H */ 61 | 62 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 63 | 64 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Utils/FatFs/drivers/usbh_diskio_template.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file usbh_diskio.h 4 | * @author MCD Application Team 5 | * @version V2.0.1 6 | * @date 10-July-2017 7 | * @brief Header for usbh_diskio_template.c module. This file needs to be 8 | customized and copied under the application project tree. 9 | ****************************************************************************** 10 | * @attention 11 | * 12 | *

© Copyright (c) 2017 STMicroelectronics International N.V. 13 | * All rights reserved.

14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted, provided that the following conditions are met: 17 | * 18 | * 1. Redistribution of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright notice, 21 | * this list of conditions and the following disclaimer in the documentation 22 | * and/or other materials provided with the distribution. 23 | * 3. Neither the name of STMicroelectronics nor the names of other 24 | * contributors to this software may be used to endorse or promote products 25 | * derived from this software without specific written permission. 26 | * 4. This software, including modifications and/or derivative works of this 27 | * software, must execute solely and exclusively on microcontroller or 28 | * microprocessor devices manufactured by or for STMicroelectronics. 29 | * 5. Redistribution and use of this software other than as permitted under 30 | * this license is void and will automatically terminate your rights under 31 | * this license. 32 | * 33 | * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" 34 | * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT 35 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 36 | * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY 37 | * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT 38 | * SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 39 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 40 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 41 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 42 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 43 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 44 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 45 | * 46 | ****************************************************************************** 47 | */ 48 | 49 | /* Define to prevent recursive inclusion -------------------------------------*/ 50 | #ifndef __USBH_DISKIO_H 51 | #define __USBH_DISKIO_H 52 | 53 | /* Includes ------------------------------------------------------------------*/ 54 | #include "usbh_core.h" 55 | #include "usbh_msc.h" 56 | /* Exported types ------------------------------------------------------------*/ 57 | /* Exported constants --------------------------------------------------------*/ 58 | /* Exported functions ------------------------------------------------------- */ 59 | extern const Diskio_drvTypeDef USBH_Driver; 60 | 61 | #endif /* __USBH_DISKIO_H */ 62 | 63 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 64 | 65 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Utils/FatFs/drivers/sdram_diskio_template.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file sdram_diskio_template.h 4 | * @author MCD Application Team 5 | * @version V2.0.1 6 | * @date 10-July-2017 7 | * @brief Header for sdram_diskio.c module.This filed needs to be customized 8 | and copied under the application project. 9 | ****************************************************************************** 10 | * @attention 11 | * 12 | *

© Copyright (c) 2017 STMicroelectronics International N.V. 13 | * All rights reserved.

14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted, provided that the following conditions are met: 17 | * 18 | * 1. Redistribution of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright notice, 21 | * this list of conditions and the following disclaimer in the documentation 22 | * and/or other materials provided with the distribution. 23 | * 3. Neither the name of STMicroelectronics nor the names of other 24 | * contributors to this software may be used to endorse or promote products 25 | * derived from this software without specific written permission. 26 | * 4. This software, including modifications and/or derivative works of this 27 | * software, must execute solely and exclusively on microcontroller or 28 | * microprocessor devices manufactured by or for STMicroelectronics. 29 | * 5. Redistribution and use of this software other than as permitted under 30 | * this license is void and will automatically terminate your rights under 31 | * this license. 32 | * 33 | * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" 34 | * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT 35 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 36 | * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY 37 | * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT 38 | * SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 39 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 40 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 41 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 42 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 43 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 44 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 45 | * 46 | ****************************************************************************** 47 | */ 48 | 49 | /* Define to prevent recursive inclusion -------------------------------------*/ 50 | #ifndef __SDRAM_DISKIO_H 51 | #define __SDRAM_DISKIO_H 52 | 53 | /* Includes ------------------------------------------------------------------*/ 54 | #include "stm32xxxx_{discovery}{eval}_sdram.h" 55 | /* Exported types ------------------------------------------------------------*/ 56 | /* Exported constants --------------------------------------------------------*/ 57 | /* Exported functions ------------------------------------------------------- */ 58 | extern const Diskio_drvTypeDef SDRAMDISK_Driver; 59 | 60 | #endif /* __SDRAM_DISKIO_H */ 61 | 62 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 63 | 64 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Utils/FatFs/drivers/sram_diskio_template.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file sram_diskio_template.h 4 | * @author MCD Application Team 5 | * @version V2.0.1 6 | * @date 10-July-2017 7 | * @brief Header for sram_diskio_template.c module.This file has to be 8 | customized and copied under the application project 9 | ****************************************************************************** 10 | * @attention 11 | * 12 | *

© Copyright (c) 2017 STMicroelectronics International N.V. 13 | * All rights reserved.

14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted, provided that the following conditions are met: 17 | * 18 | * 1. Redistribution of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright notice, 21 | * this list of conditions and the following disclaimer in the documentation 22 | * and/or other materials provided with the distribution. 23 | * 3. Neither the name of STMicroelectronics nor the names of other 24 | * contributors to this software may be used to endorse or promote products 25 | * derived from this software without specific written permission. 26 | * 4. This software, including modifications and/or derivative works of this 27 | * software, must execute solely and exclusively on microcontroller or 28 | * microprocessor devices manufactured by or for STMicroelectronics. 29 | * 5. Redistribution and use of this software other than as permitted under 30 | * this license is void and will automatically terminate your rights under 31 | * this license. 32 | * 33 | * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" 34 | * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT 35 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 36 | * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY 37 | * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT 38 | * SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 39 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 40 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 41 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 42 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 43 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 44 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 45 | * 46 | ****************************************************************************** 47 | */ 48 | 49 | /* Define to prevent recursive inclusion -------------------------------------*/ 50 | #ifndef __SRAM_DISKIO_H 51 | #define __SRAM_DISKIO_H 52 | 53 | /* Includes ------------------------------------------------------------------*/ 54 | #include "stm32xxxxx_{eval}{discovery}_sram.h" 55 | /* Exported types ------------------------------------------------------------*/ 56 | /* Exported constants --------------------------------------------------------*/ 57 | /* Exported functions ------------------------------------------------------- */ 58 | extern const Diskio_drvTypeDef SRAMDISK_Driver; 59 | 60 | #endif /* __SRAM_DISKIO_H */ 61 | 62 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 63 | 64 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Utils/FatFs/drivers/ppp_diskio_template.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file ppp_diskio.h 4 | * @author MCD Application Team 5 | * @version V2.0.1 6 | * @date 10-July-2017 7 | * @brief Header for ppp_diskio.c module. the PPP diskio driver is not 8 | functional and is intended to show how to implement 9 | a FatFS diskio driver. 10 | ****************************************************************************** 11 | * @attention 12 | * 13 | *

© Copyright (c) 2017 STMicroelectronics International N.V. 14 | * All rights reserved.

15 | * 16 | * Redistribution and use in source and binary forms, with or without 17 | * modification, are permitted, provided that the following conditions are met: 18 | * 19 | * 1. Redistribution of source code must retain the above copyright notice, 20 | * this list of conditions and the following disclaimer. 21 | * 2. Redistributions in binary form must reproduce the above copyright notice, 22 | * this list of conditions and the following disclaimer in the documentation 23 | * and/or other materials provided with the distribution. 24 | * 3. Neither the name of STMicroelectronics nor the names of other 25 | * contributors to this software may be used to endorse or promote products 26 | * derived from this software without specific written permission. 27 | * 4. This software, including modifications and/or derivative works of this 28 | * software, must execute solely and exclusively on microcontroller or 29 | * microprocessor devices manufactured by or for STMicroelectronics. 30 | * 5. Redistribution and use of this software other than as permitted under 31 | * this license is void and will automatically terminate your rights under 32 | * this license. 33 | * 34 | * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" 35 | * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT 36 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 37 | * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY 38 | * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT 39 | * SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 40 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 41 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 42 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 43 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 44 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 45 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 46 | * 47 | ****************************************************************************** 48 | */ 49 | 50 | /* Define to prevent recursive inclusion -------------------------------------*/ 51 | #ifndef __PPP_DISKIO_H 52 | #define __PPP_DISKIO_H 53 | 54 | /* Includes ------------------------------------------------------------------*/ 55 | #include "stm32xxxxx_{eval}{discovery}_ppp.h" 56 | /* Exported types ------------------------------------------------------------*/ 57 | /* Exported constants --------------------------------------------------------*/ 58 | /* Exported functions ------------------------------------------------------- */ 59 | extern const Diskio_drvTypeDef PPP_Driver; 60 | 61 | #endif /* __SD_DISKIO_H */ 62 | 63 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 64 | 65 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Utils/FatFs/drivers/usbh_diskio_dma_template.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file usbh_diskio_dma_template.h 4 | * @author MCD Application Team 5 | * @version V2.0.1 6 | * @date 10-July-2017 7 | * @brief Header for usbh_diskio_dma_template.c module.This file needs to be 8 | customized and copied under the application project 9 | ****************************************************************************** 10 | * @attention 11 | * 12 | *

© Copyright (c) 2017 STMicroelectronics International N.V. 13 | * All rights reserved.

14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted, provided that the following conditions are met: 17 | * 18 | * 1. Redistribution of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright notice, 21 | * this list of conditions and the following disclaimer in the documentation 22 | * and/or other materials provided with the distribution. 23 | * 3. Neither the name of STMicroelectronics nor the names of other 24 | * contributors to this software may be used to endorse or promote products 25 | * derived from this software without specific written permission. 26 | * 4. This software, including modifications and/or derivative works of this 27 | * software, must execute solely and exclusively on microcontroller or 28 | * microprocessor devices manufactured by or for STMicroelectronics. 29 | * 5. Redistribution and use of this software other than as permitted under 30 | * this license is void and will automatically terminate your rights under 31 | * this license. 32 | * 33 | * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" 34 | * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT 35 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 36 | * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY 37 | * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT 38 | * SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 39 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 40 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 41 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 42 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 43 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 44 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 45 | * 46 | ****************************************************************************** 47 | */ 48 | 49 | /* Define to prevent recursive inclusion -------------------------------------*/ 50 | #ifndef __USBH_DISKIO_H 51 | #define __USBH_DISKIO_H 52 | 53 | /* Includes ------------------------------------------------------------------*/ 54 | #include "usbh_core.h" 55 | #include "usbh_msc.h" 56 | /* Exported types ------------------------------------------------------------*/ 57 | /* Exported constants --------------------------------------------------------*/ 58 | /* Exported functions ------------------------------------------------------- */ 59 | extern const Diskio_drvTypeDef USBH_Driver; 60 | 61 | #endif /* __USBH_DISKIO_H */ 62 | 63 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 64 | 65 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Utils/FatFs/drivers/sd_diskio_dma_rtos_template.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file sd_diskio_dma_rtos_template.h 4 | * @author MCD Application Team 5 | * @version V2.0.1 6 | * @date 10-July-2017 7 | * @brief Header for sd_diskio_dma_rtos.c module. This is template file that 8 | needs to be adjusted and copied into the application project. 9 | ****************************************************************************** 10 | * @attention 11 | * 12 | *

© Copyright (c) 2017 STMicroelectronics International N.V. 13 | * All rights reserved.

14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted, provided that the following conditions are met: 17 | * 18 | * 1. Redistribution of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright notice, 21 | * this list of conditions and the following disclaimer in the documentation 22 | * and/or other materials provided with the distribution. 23 | * 3. Neither the name of STMicroelectronics nor the names of other 24 | * contributors to this software may be used to endorse or promote products 25 | * derived from this software without specific written permission. 26 | * 4. This software, including modifications and/or derivative works of this 27 | * software, must execute solely and exclusively on microcontroller or 28 | * microprocessor devices manufactured by or for STMicroelectronics. 29 | * 5. Redistribution and use of this software other than as permitted under 30 | * this license is void and will automatically terminate your rights under 31 | * this license. 32 | * 33 | * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" 34 | * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT 35 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 36 | * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY 37 | * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT 38 | * SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 39 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 40 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 41 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 42 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 43 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 44 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 45 | * 46 | ****************************************************************************** 47 | */ 48 | 49 | /* Define to prevent recursive inclusion -------------------------------------*/ 50 | #ifndef __SD_DISKIO_H 51 | #define __SD_DISKIO_H 52 | 53 | /* Includes ------------------------------------------------------------------*/ 54 | #include "stm32xxxxx_{eval}{discovery}_sd.h" 55 | /* Exported types ------------------------------------------------------------*/ 56 | /* Exported constants --------------------------------------------------------*/ 57 | /* Exported functions ------------------------------------------------------- */ 58 | extern const Diskio_drvTypeDef SD_Driver; 59 | 60 | #endif /* __SD_DISKIO_H */ 61 | 62 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 63 | 64 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_GUI/GUI_Objx/GUI_Bar.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file bar.h 3 | * 4 | */ 5 | 6 | #ifndef GUI_BAR_H 7 | #define GUI_BAR_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "RTE_Include.h" 17 | #if GUI_USE_BAR != 0 18 | 19 | /********************* 20 | * DEFINES 21 | *********************/ 22 | 23 | /********************** 24 | * TYPEDEFS 25 | **********************/ 26 | 27 | /*Data of bar*/ 28 | typedef struct 29 | { 30 | /*No inherited ext*/ /*Ext. of ancestor*/ 31 | /*New data for this type */ 32 | int16_t cur_value; /*Current value of the bar*/ 33 | int16_t min_value; /*Minimum value of the bar*/ 34 | int16_t max_value; /*Maximum value of the bar*/ 35 | style_t *style_indic; /*Style of the indicator*/ 36 | }bar_ext_t; 37 | 38 | typedef enum { 39 | GUI_BAR_STYLE_BG, 40 | GUI_BAR_STYLE_INDIC, 41 | }bar_style_t; 42 | 43 | /********************** 44 | * GLOBAL PROTOTYPES 45 | **********************/ 46 | 47 | /** 48 | * Create a bar objects 49 | * @param par pointer to an object, it will be the parent of the new bar 50 | * @param copy pointer to a bar object, if not NULL then the new object will be copied from it 51 | * @return pointer to the created bar 52 | */ 53 | obj_t * bar_create(obj_t * par, obj_t * copy); 54 | 55 | /*===================== 56 | * Setter functions 57 | *====================*/ 58 | 59 | /** 60 | * Set a new value on the bar 61 | * @param bar pointer to a bar object 62 | * @param value new value 63 | */ 64 | void bar_set_value(obj_t * bar, int16_t value); 65 | 66 | /** 67 | * Set a new value with animation on the bar 68 | * @param bar pointer to a bar object 69 | * @param value new value 70 | * @param anim_time animation time in milliseconds 71 | */ 72 | void bar_set_value_anim(obj_t * bar, int16_t value, uint16_t anim_time); 73 | 74 | 75 | /** 76 | * Set minimum and the maximum values of a bar 77 | * @param bar pointer to the bar object 78 | * @param min minimum value 79 | * @param max maximum value 80 | */ 81 | void bar_set_range(obj_t * bar, int16_t min, int16_t max); 82 | 83 | /** 84 | * Set a style of a bar 85 | * @param bar pointer to a bar object 86 | * @param type which style should be set 87 | * @param style pointer to a style 88 | */ 89 | void bar_set_style(obj_t *bar, bar_style_t type, style_t *style); 90 | 91 | /*===================== 92 | * Getter functions 93 | *====================*/ 94 | 95 | /** 96 | * Get the value of a bar 97 | * @param bar pointer to a bar object 98 | * @return the value of the bar 99 | */ 100 | int16_t bar_get_value(obj_t * bar); 101 | 102 | /** 103 | * Get the minimum value of a bar 104 | * @param bar pointer to a bar object 105 | * @return the minimum value of the bar 106 | */ 107 | int16_t bar_get_min_value(obj_t * bar); 108 | 109 | /** 110 | * Get the maximum value of a bar 111 | * @param bar pointer to a bar object 112 | * @return the maximum value of the bar 113 | */ 114 | int16_t bar_get_max_value(obj_t * bar); 115 | 116 | 117 | /** 118 | * Get a style of a bar 119 | * @param bar pointer to a bar object 120 | * @param type which style should be get 121 | * @return style pointer to a style 122 | */ 123 | style_t * bar_get_style(obj_t *bar, bar_style_t type); 124 | 125 | /********************** 126 | * MACROS 127 | **********************/ 128 | 129 | #endif /*GUI_USE_BAR*/ 130 | 131 | #ifdef __cplusplus 132 | } /* extern "C" */ 133 | #endif 134 | 135 | #endif /*GUI_BAR_H*/ 136 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_GUI/GUI_Core/GUI_Anim.h: -------------------------------------------------------------------------------- 1 | #ifndef __GUI_ANIM_H 2 | #define __GUI_ANIM_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | #include "RTE_Include.h" 7 | #if GUI_USE_ANIMATION == 1 8 | /********************* 9 | * DEFINES 10 | *********************/ 11 | 12 | /********************** 13 | * TYPEDEFS 14 | **********************/ 15 | 16 | struct _anim_t; 17 | 18 | typedef int32_t(*anim_path_t)(const struct _anim_t*); 19 | 20 | typedef void (*anim_fp_t)(void *, int32_t); 21 | typedef void (*anim_cb_t)(void *); 22 | 23 | typedef struct _anim_t 24 | { 25 | uint8_t playback :1; /*When the animation is ready play it back*/ 26 | uint8_t repeat :1; /*Repeat the animation infinitely*/ 27 | /*Animation system use these - user shouldn't set*/ 28 | uint8_t playback_now :1; /*Play back is in progress*/ 29 | uint8_t back:1; 30 | uint16_t playback_pause; /*Wait before play back*/ 31 | uint16_t repeat_pause; /*Wait before repeat*/ 32 | uint16_t time; /*Animation time in ms*/ 33 | int32_t start; /*Start value*/ 34 | int32_t end; /*End value*/ 35 | int16_t act_time; /*Current time in animation. Set to negative to make delay.*/ 36 | anim_path_t path; /*An array with the steps of animations*/ 37 | anim_cb_t end_cb; /*Call it when the animation is ready*/ 38 | anim_fp_t fp; /*Animator function*/ 39 | void * var; /*Variable to animate*/ 40 | }anim_t; 41 | 42 | /*Example initialization 43 | anim_t a; 44 | a.var = obj; 45 | a.start = obj_get_height(obj); 46 | a.end = new_height; 47 | a.fp = (anim_fp_t)obj_set_height; 48 | a.path = anim_path_linear; 49 | a.end_cb = NULL; 50 | a.act_time = 0; 51 | a.time = 200; 52 | a.playback = 0; 53 | a.playback_pause = 0; 54 | a.repeat = 0; 55 | a.repeat_pause = 0; 56 | */ 57 | /********************** 58 | * GLOBAL PROTOTYPES 59 | **********************/ 60 | 61 | /** 62 | * Init. the animation module 63 | */ 64 | void anim_init(void); 65 | 66 | /** 67 | * Create an animation 68 | * @param anim_p an initialized 'anim_t' variable. Not required after call. 69 | */ 70 | void anim_create(anim_t * anim_p); 71 | 72 | /** 73 | * Delete an animation for a variable with a given animatior function 74 | * @param var pointer to variable 75 | * @param fp a function pointer which is animating 'var', 76 | * or NULL to ignore it and delete all animation with 'var 77 | * @return true: at least 1 animation is deleted, false: no animation is deleted 78 | */ 79 | bool anim_del(void * var, anim_fp_t fp); 80 | 81 | /** 82 | * Calculate the time of an animation with a given speed and the start and end values 83 | * @param speed speed of animation in unit/sec 84 | * @param start start value of the animation 85 | * @param end end value of the animation 86 | * @return the required time [ms] for the animation with the given parameters 87 | */ 88 | uint16_t anim_speed_to_time(uint16_t speed, int32_t start, int32_t end); 89 | 90 | /** 91 | * Calculate the current value of an animation applying linear characteristic 92 | * @param a pointer to an animation 93 | * @return the current value to set 94 | */ 95 | int32_t anim_path_linear(const anim_t *a); 96 | 97 | /** 98 | * Calculate the current value of an animation applying step characteristic. 99 | * (Set end value on the end of the animation) 100 | * @param a pointer to an animation 101 | * @return the current value to set 102 | */ 103 | int32_t anim_path_step(const anim_t *a); 104 | /********************** 105 | * MACROS 106 | **********************/ 107 | 108 | #endif 109 | #ifdef __cplusplus 110 | } /* extern "C" */ 111 | #endif 112 | 113 | #endif 114 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Utils/STM32F10x_DSP_Lib/src/asm/gcc/iirarma_stm32.s: -------------------------------------------------------------------------------- 1 | /*;******************* (C) COPYRIGHT 2009 STMicroelectronics ******************** 2 | ;* File Name : iirarma_stm32.s 3 | ;* Author : MCD Application Team 4 | ;* Version : V2.0.0 5 | ;* Date : 04/27/2009 6 | ;* Description : This source file contains IIR ARMA filter source code 7 | ;******************************************************************************** 8 | ;* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 9 | ;* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. 10 | ;* AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, 11 | ;* INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE 12 | ;* CONTENT OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING 13 | ;* INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 14 | ;*******************************************************************************/ 15 | 16 | .cpu cortex-m3 17 | .fpu softvfp 18 | .syntax unified 19 | .thumb 20 | .text 21 | 22 | .global iirarma_stm32 23 | 24 | 25 | /*;****************************************************************************** 26 | ;* Function Name : iirarma_stm32 27 | ;* Description : IIR order ARMA 16-bit filter 28 | ;* Input : - y: Output array . 29 | ;* - x: Input array 30 | ;* - h2: AutoRegressive part Filter Coefficients 31 | ;* - h1: Moving Average part Filter Coefficients 32 | ;* - ny: the number of output samples 33 | ;* Output : None 34 | ;* Return : None 35 | ;*******************************************************************************/ 36 | /* void iirarma_stm32(void *y, void *x, short *h2, short *h1, int ny) */ 37 | .thumb_func 38 | iirarma_stm32: 39 | STMDB SP!, {R4-R7} 40 | LDR R12, [SP, #+16] 41 | 42 | CMP r12, #+1 /*if val_ny==1*/ 43 | BEQ done_for_now /*go to done_for_now*/ 44 | 45 | acc_five_data: 46 | LDRSH r4, [r2, #+0] 47 | LDRSH r5, [r1, #+8] 48 | LDRSH r6, [r2, #+2] 49 | LDRSH r7, [r1, #+6] 50 | 51 | SUBS r12, r12, #+1 /*decrement val_ny*/ 52 | MUL r6, r7, r6 53 | MLA r4, r5, r4, r6 54 | LDRSH r5, [r3, #+2] 55 | LDRSH r6, [r0, #+6] 56 | MUL r5, r6,r5 57 | LDRSH r6, [r1, #+4] 58 | SUB r4, r4, r5 59 | LDRSH r5, [r2, #+4] 60 | MLA r4, r6, r5, r4 61 | LDRSH r5, [r3, #+4] 62 | LDRSH r6, [r0, #+4] 63 | MUL r5, r6, r5 64 | LDRSH r6, [r1, #+2] 65 | SUB r4, r4, r5 66 | LDRSH r5, [r2, #+6] 67 | MLA r4, r6, r5, r4 68 | LDRSH r5, [r3, #+6] 69 | LDRSH r6, [r0, #+2] 70 | MUL r5, r6, r5 71 | LDRSH r6, [r1], #+2 72 | SUB r4, r4, r5 73 | LDRSH r5, [r2, #+8] 74 | MLA r4, r6, r5, r4 75 | LDRSH r5, [r3, #+8] 76 | LDRSH r6, [r0, #+0] 77 | MUL r5, r6, r5 78 | SUB r4, r4, r5 79 | ASR r4, r4, #+15 80 | STRH r4, [r0, #+8] 81 | ADD r0, r0, #+2 82 | BNE acc_five_data 83 | 84 | done_for_now: 85 | LDMIA SP!, {R4-R7} 86 | BX LR /* return */ 87 | .end 88 | 89 | /;******************* (C) COPYRIGHT 2009 STMicroelectronics *****END OF FILE****/ 90 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_GUI/GUI_Objx/GUI_SW.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file sw.h 3 | * 4 | */ 5 | 6 | #ifndef GUI_SW_H 7 | #define GUI_SW_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "RTE_Include.h" 17 | #if GUI_USE_SW != 0 18 | 19 | /*Testing of dependencies*/ 20 | #if GUI_USE_SLIDER == 0 21 | #error "sw: slider is required. Enable it in conf.h (GUI_USE_SLIDER 1)" 22 | #endif 23 | 24 | 25 | /********************* 26 | * DEFINES 27 | *********************/ 28 | 29 | /********************** 30 | * TYPEDEFS 31 | **********************/ 32 | /*Data of switch*/ 33 | typedef struct 34 | { 35 | slider_ext_t slider; /*Ext. of ancestor*/ 36 | /*New data for this type */ 37 | style_t *style_knob_off; /*Style of the knob when the switch is OFF*/ 38 | style_t *style_knob_on; /*Style of the knob when the switch is ON (NULL to use the same as OFF)*/ 39 | uint8_t changed :1; /*Indicates the switch explicitly changed by drag*/ 40 | }sw_ext_t; 41 | 42 | typedef enum { 43 | GUI_SW_STYLE_BG, 44 | GUI_SW_STYLE_INDIC, 45 | GUI_SW_STYLE_KNOB_OFF, 46 | GUI_SW_STYLE_KNOB_ON, 47 | }sw_style_t; 48 | 49 | /********************** 50 | * GLOBAL PROTOTYPES 51 | **********************/ 52 | 53 | /** 54 | * Create a switch objects 55 | * @param par pointer to an object, it will be the parent of the new switch 56 | * @param copy pointer to a switch object, if not NULL then the new object will be copied from it 57 | * @return pointer to the created switch 58 | */ 59 | obj_t * sw_create(obj_t * par, obj_t * copy); 60 | 61 | /*===================== 62 | * Setter functions 63 | *====================*/ 64 | 65 | /** 66 | * Turn ON the switch 67 | * @param sw pointer to a switch object 68 | */ 69 | void sw_on(obj_t *sw); 70 | 71 | /** 72 | * Turn OFF the switch 73 | * @param sw pointer to a switch object 74 | */ 75 | void sw_off(obj_t *sw); 76 | 77 | /** 78 | * Set a function which will be called when the switch is toggled by the user 79 | * @param sw pointer to switch object 80 | * @param action a callback function 81 | */ 82 | static inline void sw_set_action(obj_t * sw, action_t action) 83 | { 84 | slider_set_action(sw, action); 85 | } 86 | 87 | /** 88 | * Set a style of a switch 89 | * @param sw pointer to a switch object 90 | * @param type which style should be set 91 | * @param style pointer to a style 92 | */ 93 | void sw_set_style(obj_t *sw, sw_style_t type, style_t *style); 94 | 95 | /*===================== 96 | * Getter functions 97 | *====================*/ 98 | 99 | /** 100 | * Get the state of a switch 101 | * @param sw pointer to a switch object 102 | * @return false: OFF; true: ON 103 | */ 104 | static inline bool sw_get_state(obj_t *sw) 105 | { 106 | return bar_get_value(sw) == 0 ? false : true; 107 | } 108 | 109 | /** 110 | * Get the switch action function 111 | * @param slider pointer to a switch object 112 | * @return the callback function 113 | */ 114 | static inline action_t sw_get_action(obj_t * slider) 115 | { 116 | return slider_get_action(slider); 117 | } 118 | 119 | /** 120 | * Get a style of a switch 121 | * @param sw pointer to a switch object 122 | * @param type which style should be get 123 | * @return style pointer to a style 124 | */ 125 | style_t * sw_get_style(obj_t *sw, sw_style_t type); 126 | 127 | /********************** 128 | * MACROS 129 | **********************/ 130 | 131 | #endif /*GUI_USE_SW*/ 132 | 133 | #ifdef __cplusplus 134 | } /* extern "C" */ 135 | #endif 136 | 137 | #endif /*GUI_SW_H*/ 138 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_APP/RTE_Stdlib.h: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // 3 | // ustdlib.h - Prototypes for simple standard library functions. 4 | // 5 | // Copyright (c) 2007-2017 Texas Instruments Incorporated. All rights reserved. 6 | // Software License Agreement 7 | // 8 | // Texas Instruments (TI) is supplying this software for use solely and 9 | // exclusively on TI's microcontroller products. The software is owned by 10 | // TI and/or its suppliers, and is protected under applicable copyright 11 | // laws. You may not combine this software with "viral" open-source 12 | // software in order to form a larger program. 13 | // 14 | // THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS. 15 | // NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT 16 | // NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 17 | // A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY 18 | // CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL 19 | // DAMAGES, FOR ANY REASON WHATSOEVER. 20 | // 21 | // This is part of revision 2.1.4.178 of the Tiva Utility Library. 22 | // 23 | //***************************************************************************** 24 | 25 | #ifndef __USTDLIB_H__ 26 | #define __USTDLIB_H__ 27 | //***************************************************************************** 28 | // 29 | // Include the standard C headers upon which these replacements are based. 30 | // 31 | //***************************************************************************** 32 | #include "RTE_Include.h" 33 | #include 34 | #include 35 | //***************************************************************************** 36 | // 37 | // If building with a C++ compiler, make all of the definitions in this header 38 | // have a C binding. 39 | // 40 | //***************************************************************************** 41 | #ifdef __cplusplus 42 | extern "C" 43 | { 44 | #endif 45 | 46 | //***************************************************************************** 47 | // 48 | // Prototypes for the APIs. 49 | // 50 | //***************************************************************************** 51 | extern void ulocaltime(time_t timer, struct tm *tm); 52 | extern time_t umktime(struct tm *timeptr); 53 | extern int urand(void); 54 | extern int usnprintf(char * restrict s, size_t n, const char * restrict format, 55 | ...); 56 | extern int usprintf(char * restrict s, const char * restrict format, ...); 57 | extern void usrand(unsigned int seed); 58 | extern int ustrcasecmp(const char *s1, const char *s2); 59 | extern int ustrcmp(const char *s1, const char *s2); 60 | extern size_t ustrlen(const char *s); 61 | extern int ustrncasecmp(const char *s1, const char *s2, size_t n); 62 | extern int ustrncmp(const char *s1, const char *s2, size_t n); 63 | extern char *ustrncpy(char * restrict s1, const char * restrict s2, size_t n); 64 | extern char *ustrstr(const char *s1, const char *s2); 65 | extern float ustrtof(const char * restrict nptr, 66 | const char ** restrict endptr); 67 | extern unsigned long int ustrtoul(const char * restrict nptr, 68 | const char ** restrict endptr, int base); 69 | extern int uvsnprintf(char * restrict s, size_t n, 70 | const char * restrict format, va_list arg); 71 | extern char * unum2str(int32_t num, char * buf); 72 | //***************************************************************************** 73 | // 74 | // Mark the end of the C bindings section for C++ compilers. 75 | // 76 | //***************************************************************************** 77 | #ifdef __cplusplus 78 | } 79 | #endif 80 | 81 | #endif // __USTDLIB_H__ 82 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_GUI/GUI_Core/GUI_Indev.h: -------------------------------------------------------------------------------- 1 | #ifndef __GUI_INDEV_H 2 | #define __GUI_INDEV_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | #include "RTE_Include.h" 7 | /********************* 8 | * DEFINES 9 | *********************/ 10 | 11 | /********************** 12 | * TYPEDEFS 13 | **********************/ 14 | 15 | /********************** 16 | * GLOBAL PROTOTYPES 17 | **********************/ 18 | 19 | /** 20 | * Initialize the display input device subsystem 21 | */ 22 | void indev_init(void); 23 | 24 | /** 25 | * Get the currently processed input device. Can be used in action functions too. 26 | * @return pointer to the currently processed input device or NULL if no input device processing right now 27 | */ 28 | indev_t * indev_get_act(void); 29 | 30 | /** 31 | * Reset one or all input devices 32 | * @param indev pointer to an input device to reset or NULL to reset all of them 33 | */ 34 | void indev_reset(indev_t * indev); 35 | 36 | /** 37 | * Reset the long press state of an input device 38 | * @param indev_proc pointer to an input device 39 | */ 40 | void indev_reset_lpr(indev_t * indev); 41 | 42 | /** 43 | * Enable input devices device by type 44 | * @param type Input device type 45 | * @param enable true: enable this type; false: disable this type 46 | */ 47 | void indev_enable(hal_indev_type_t type, bool enable); 48 | 49 | /** 50 | * Set a cursor for a pointer input device (for GUI_INPUT_TYPE_POINTER and GUI_INPUT_TYPE_BUTTON) 51 | * @param indev pointer to an input device 52 | * @param cur_obj pointer to an object to be used as cursor 53 | */ 54 | void indev_set_cursor(indev_t *indev, obj_t *cur_obj); 55 | 56 | #if GUI_USE_GROUP 57 | /** 58 | * Set a destination group for a keypad input device (for GUI_INDEV_TYPE_KEYPAD) 59 | * @param indev pointer to an input device 60 | * @param group point to a group 61 | */ 62 | void indev_set_group(indev_t *indev, group_t *group); 63 | #endif 64 | 65 | /** 66 | * Set the an array of points for GUI_INDEV_TYPE_BUTTON. 67 | * These points will be assigned to the buttons to press a specific point on the screen 68 | * @param indev pointer to an input device 69 | * @param group point to a group 70 | */ 71 | void indev_set_button_points(indev_t *indev, point_t *points); 72 | 73 | /** 74 | * Get the last point of an input device (for GUI_INDEV_TYPE_POINTER and GUI_INDEV_TYPE_BUTTON) 75 | * @param indev pointer to an input device 76 | * @param point pointer to a point to store the result 77 | */ 78 | void indev_get_point(indev_t * indev, point_t * point); 79 | 80 | /** 81 | * Check if there is dragging with an input device or not (for GUI_INDEV_TYPE_POINTER and GUI_INDEV_TYPE_BUTTON) 82 | * @param indev pointer to an input device 83 | * @return true: drag is in progress 84 | */ 85 | bool indev_is_dragging(indev_t * indev); 86 | 87 | /** 88 | * Get the vector of dragging of an input device (for GUI_INDEV_TYPE_POINTER and GUI_INDEV_TYPE_BUTTON) 89 | * @param indev pointer to an input device 90 | * @param point pointer to a point to store the vector 91 | */ 92 | void indev_get_vect(indev_t * indev, point_t * point); 93 | /** 94 | * Get elapsed time since last press 95 | * @param indev pointer to an input device (NULL to get the overall smallest inactivity) 96 | * @return Elapsed ticks (milliseconds) since last press 97 | */ 98 | uint32_t indev_get_inactive_time(indev_t * indev); 99 | 100 | /** 101 | * Do nothing until the next release 102 | * @param indev pointer to an input device 103 | */ 104 | void indev_wait_release(indev_t * indev); 105 | 106 | /********************** 107 | * MACROS 108 | **********************/ 109 | #ifdef __cplusplus 110 | } /* extern "C" */ 111 | #endif 112 | #endif 113 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_APP/RTE_List.h: -------------------------------------------------------------------------------- 1 | #ifndef __RTE_LIST_H 2 | #define __RTE_LIST_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | #include "RTE_Include.h" 7 | /********************** 8 | * TYPEDEFS 9 | **********************/ 10 | 11 | /*Dummy type to make handling easier*/ 12 | typedef uint8_t ll_node_t; 13 | 14 | /*Description of a linked list*/ 15 | typedef struct 16 | { 17 | uint32_t n_size; 18 | ll_node_t* head; 19 | ll_node_t* tail; 20 | }ll_t; 21 | 22 | /********************** 23 | * GLOBAL PROTOTYPES 24 | **********************/ 25 | 26 | /** 27 | * Initialize linked list 28 | * @param ll_dsc pointer to ll_dsc variable 29 | * @param node_size the size of 1 node in bytes 30 | */ 31 | void ll_init(ll_t * ll_p, uint32_t node_size); 32 | 33 | /** 34 | * Add a new head to a linked list 35 | * @param ll_p pointer to linked list 36 | * @return pointer to the new head 37 | */ 38 | void * ll_ins_head(ll_t * ll_p); 39 | 40 | /** 41 | * Insert a new node in front of the n_act node 42 | * @param ll_p pointer to linked list 43 | * @param n_act pointer a node 44 | * @return pointer to the new head 45 | */ 46 | void * ll_ins_prev(ll_t * ll_p, void * n_act); 47 | 48 | /** 49 | * Add a new tail to a linked list 50 | * @param ll_p pointer to linked list 51 | * @return pointer to the new tail 52 | */ 53 | void * ll_ins_tail(ll_t * ll_p); 54 | 55 | /** 56 | * Remove the node 'node_p' from 'll_p' linked list. 57 | * It Dose not free the the memory of node. 58 | * @param ll_p pointer to the linked list of 'node_p' 59 | * @param node_p pointer to node in 'll_p' linked list 60 | */ 61 | void ll_rem(ll_t * ll_p, void * node_p); 62 | 63 | /** 64 | * Remove and free all elements from a linked list. The list remain valid but become empty. 65 | * @param ll_p pointer to linked list 66 | */ 67 | void ll_clear(ll_t * ll_p); 68 | 69 | /** 70 | * Move a node to a new linked list 71 | * @param ll_ori_p pointer to the original (old) linked list 72 | * @param ll_new_p pointer to the new linked list 73 | * @param node pointer to a node 74 | */ 75 | void ll_chg_list(ll_t * ll_ori_p, ll_t * ll_new_p, void * node); 76 | 77 | /** 78 | * Return with head node of the linked list 79 | * @param ll_p pointer to linked list 80 | * @return pointer to the head of 'll_p' 81 | */ 82 | void * ll_get_head(ll_t * ll_p); 83 | 84 | /** 85 | * Return with tail node of the linked list 86 | * @param ll_p pointer to linked list 87 | * @return pointer to the head of 'll_p' 88 | */ 89 | void * ll_get_tail(ll_t * ll_p); 90 | 91 | /** 92 | * Return with the pointer of the next node after 'n_act' 93 | * @param ll_p pointer to linked list 94 | * @param n_act pointer a node 95 | * @return pointer to the next node 96 | */ 97 | void * ll_get_next(ll_t * ll_p, void * n_act); 98 | 99 | /** 100 | * Return with the pointer of the previous node after 'n_act' 101 | * @param ll_p pointer to linked list 102 | * @param n_act pointer a node 103 | * @return pointer to the previous node 104 | */ 105 | void * ll_get_prev(ll_t * ll_p, void * n_act); 106 | 107 | /** 108 | * Move a nodw before an other node in the same linked list 109 | * @param ll_p pointer to a linked list 110 | * @param n_act pointer to node to move 111 | * @param n_after pointer to a node which should be after `n_act` 112 | */ 113 | void ll_move_before(ll_t * ll_p, void * n_act, void * n_after); 114 | 115 | /********************** 116 | * MACROS 117 | **********************/ 118 | 119 | #define LL_READ(list, i) for(i = ll_get_head(&list); i != NULL; i = ll_get_next(&list, i)) 120 | 121 | #define LL_READ_BACK(list, i) for(i = ll_get_tail(&list); i != NULL; i = ll_get_prev(&list, i)) 122 | 123 | #ifdef __cplusplus 124 | } /* extern "C" */ 125 | #endif 126 | 127 | #endif 128 | -------------------------------------------------------------------------------- /code/MSP432P4xx_DriverLib/systick.c: -------------------------------------------------------------------------------- 1 | /* 2 | * ------------------------------------------- 3 | * MSP432 DriverLib - v3_21_00_05 4 | * ------------------------------------------- 5 | * 6 | * --COPYRIGHT--,BSD,BSD 7 | * Copyright (c) 2016, Texas Instruments Incorporated 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions 12 | * are met: 13 | * 14 | * * Redistributions of source code must retain the above copyright 15 | * notice, this list of conditions and the following disclaimer. 16 | * 17 | * * Redistributions in binary form must reproduce the above copyright 18 | * notice, this list of conditions and the following disclaimer in the 19 | * documentation and/or other materials provided with the distribution. 20 | * 21 | * * Neither the name of Texas Instruments Incorporated nor the names of 22 | * its contributors may be used to endorse or promote products derived 23 | * from this software without specific prior written permission. 24 | * 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 27 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 28 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 29 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 30 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 31 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 32 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 33 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 34 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 35 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | * --/COPYRIGHT--*/ 37 | #include 38 | #include 39 | #include 40 | 41 | void SysTick_enableModule(void) 42 | { 43 | // 44 | // Enable SysTick. 45 | // 46 | SysTick->CTRL |= SysTick_CTRL_CLKSOURCE_Msk | SysTick_CTRL_ENABLE_Msk; 47 | } 48 | 49 | void SysTick_disableModule(void) 50 | { 51 | // 52 | // Disable SysTick. 53 | // 54 | SysTick->CTRL &= ~(SysTick_CTRL_ENABLE_Msk); 55 | } 56 | 57 | void SysTick_registerInterrupt(void (*intHandler)(void)) 58 | { 59 | // 60 | // Register the interrupt handler, returning an error if an error occurs. 61 | // 62 | Interrupt_registerInterrupt(FAULT_SYSTICK, intHandler); 63 | 64 | } 65 | 66 | void SysTick_unregisterInterrupt(void) 67 | { 68 | 69 | // 70 | // Unregister the interrupt handler. 71 | // 72 | Interrupt_unregisterInterrupt(FAULT_SYSTICK); 73 | } 74 | 75 | void SysTick_enableInterrupt(void) 76 | { 77 | // 78 | // Enable the SysTick interrupt. 79 | // 80 | SysTick->CTRL |= SysTick_CTRL_TICKINT_Msk; 81 | } 82 | 83 | void SysTick_disableInterrupt(void) 84 | { 85 | // 86 | // Disable the SysTick interrupt. 87 | // 88 | SysTick->CTRL &= ~(SysTick_CTRL_TICKINT_Msk); 89 | } 90 | 91 | void SysTick_setPeriod(uint32_t period) 92 | { 93 | // 94 | // Check the arguments. 95 | // 96 | ASSERT((period > 0) && (period <= 16777216)); 97 | 98 | // 99 | // Set the period of the SysTick counter. 100 | // 101 | SysTick->LOAD = period - 1; 102 | } 103 | 104 | uint32_t SysTick_getPeriod(void) 105 | { 106 | // 107 | // Return the period of the SysTick counter. 108 | // 109 | return (SysTick->LOAD + 1); 110 | } 111 | 112 | uint32_t SysTick_getValue(void) 113 | { 114 | // 115 | // Return the current value of the SysTick counter. 116 | // 117 | return (SysTick->VAL); 118 | } 119 | -------------------------------------------------------------------------------- /code/MSP432P4xx_DriverLib/ref_a.c: -------------------------------------------------------------------------------- 1 | /* 2 | * ------------------------------------------- 3 | * MSP432 DriverLib - v3_21_00_05 4 | * ------------------------------------------- 5 | * 6 | * --COPYRIGHT--,BSD,BSD 7 | * Copyright (c) 2016, Texas Instruments Incorporated 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions 12 | * are met: 13 | * 14 | * * Redistributions of source code must retain the above copyright 15 | * notice, this list of conditions and the following disclaimer. 16 | * 17 | * * Redistributions in binary form must reproduce the above copyright 18 | * notice, this list of conditions and the following disclaimer in the 19 | * documentation and/or other materials provided with the distribution. 20 | * 21 | * * Neither the name of Texas Instruments Incorporated nor the names of 22 | * its contributors may be used to endorse or promote products derived 23 | * from this software without specific prior written permission. 24 | * 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 27 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 28 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 29 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 30 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 31 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 32 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 33 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 34 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 35 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | * --/COPYRIGHT--*/ 37 | #include 38 | #include 39 | 40 | void REF_A_setReferenceVoltage(uint_fast8_t referenceVoltageSelect) 41 | { 42 | ASSERT(referenceVoltageSelect <= REF_A_VREF2_5V); 43 | 44 | REF_A->CTL0 = (REF_A->CTL0 & ~REF_A_CTL0_VSEL_3) | referenceVoltageSelect; 45 | } 46 | 47 | void REF_A_disableTempSensor(void) 48 | { 49 | BITBAND_PERI(REF_A->CTL0,REF_A_CTL0_TCOFF_OFS) = 1; 50 | } 51 | 52 | void REF_A_enableTempSensor(void) 53 | { 54 | BITBAND_PERI(REF_A->CTL0,REF_A_CTL0_TCOFF_OFS) = 0; 55 | } 56 | 57 | void REF_A_enableReferenceVoltageOutput(void) 58 | { 59 | BITBAND_PERI(REF_A->CTL0,REF_A_CTL0_OUT_OFS) = 1; 60 | } 61 | 62 | void REF_A_disableReferenceVoltageOutput(void) 63 | { 64 | BITBAND_PERI(REF_A->CTL0,REF_A_CTL0_OUT_OFS) = 0; 65 | } 66 | 67 | void REF_A_enableReferenceVoltage(void) 68 | { 69 | BITBAND_PERI(REF_A->CTL0,REF_A_CTL0_ON_OFS) = 1; 70 | } 71 | 72 | void REF_A_disableReferenceVoltage(void) 73 | { 74 | BITBAND_PERI(REF_A->CTL0,REF_A_CTL0_ON_OFS) = 0; 75 | } 76 | 77 | uint_fast8_t REF_A_getBandgapMode(void) 78 | { 79 | return (REF_A->CTL0 & REF_A_CTL0_BGMODE); 80 | } 81 | 82 | bool REF_A_isBandgapActive(void) 83 | { 84 | return BITBAND_PERI(REF_A->CTL0,REF_A_CTL0_BGACT_OFS); 85 | } 86 | 87 | bool REF_A_isRefGenBusy(void) 88 | { 89 | return BITBAND_PERI(REF_A->CTL0,REF_A_CTL0_GENBUSY_OFS); 90 | } 91 | 92 | bool REF_A_isRefGenActive(void) 93 | { 94 | return BITBAND_PERI(REF_A->CTL0,REF_A_CTL0_GENACT_OFS); 95 | } 96 | 97 | bool REF_A_getBufferedBandgapVoltageStatus(void) 98 | { 99 | return BITBAND_PERI(REF_A->CTL0,REF_A_CTL0_BGRDY_OFS); 100 | } 101 | 102 | bool REF_A_getVariableReferenceVoltageStatus(void) 103 | { 104 | return BITBAND_PERI(REF_A->CTL0,REF_A_CTL0_GENRDY_OFS); 105 | } 106 | 107 | void REF_A_setReferenceVoltageOneTimeTrigger(void) 108 | { 109 | BITBAND_PERI(REF_A->CTL0,REF_A_CTL0_GENOT_OFS) = 1; 110 | } 111 | 112 | void REF_A_setBufferedBandgapVoltageOneTimeTrigger(void) 113 | { 114 | BITBAND_PERI(REF_A->CTL0,REF_A_CTL0_BGOT_OFS) = 1; 115 | } 116 | 117 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_Utils/STM32F10x_DSP_Lib/src/asm/iar/iirarma_stm32.s: -------------------------------------------------------------------------------- 1 | /******************** (C) COPYRIGHT 2009 STMicroelectronics ******************** 2 | * File Name : iirarma_stm32.s 3 | * Author : MCD Application Team 4 | ;* Version : V2.0.0 5 | ;* Date : 04/27/2009 6 | * Description : This source file contains IIR ARMA filter source code 7 | ******************************************************************************** 8 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 9 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. 10 | * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, 11 | * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE 12 | * CONTENT OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING 13 | * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 14 | *******************************************************************************/ 15 | 16 | SECTION .text:CODE(2) 17 | 18 | PUBLIC iirarma_stm32 19 | 20 | #define y R0 /* Assigned to output array y[] */ 21 | #define x R1 /* Assigned to input array x[] */ 22 | #define h2 R2 /* Assigned to coefficients h2[] */ 23 | #define h1 R3 /* Assigned to coefficients h1[] */ 24 | 25 | #define ar_a R4 26 | #define ar_b R5 27 | #define ar_c R6 28 | #define ar_d R7 29 | 30 | #define val_ny R12 /* number of output samples */ 31 | 32 | 33 | /******************************************************************************* 34 | * Function Name : iirarma_stm32 35 | * Description : IIR order ARMA 16-bit filter 36 | * Input : - y: Output array . 37 | * - x: Input array 38 | * - h2: AutoRegressive part Filter Coefficients 39 | * - h1: Moving Average part Filter Coefficients 40 | * - ny: the number of output samples 41 | * Output : None 42 | * Return : None 43 | *******************************************************************************/ 44 | /* void iirarma_stm32(void *y, void *x, short *h2, short *h1, int ny); */ 45 | iirarma_stm32: 46 | STMDB SP!, {R4-R7} 47 | LDR R12, [SP, #+16] 48 | ; 49 | CMP val_ny, #+1 ;if val_ny==1 50 | BEQ done_for_now ;go to done_for_now 51 | ; 52 | acc_five_data: 53 | LDRSH ar_a, [h2, #+0] 54 | LDRSH ar_b, [x, #+8] 55 | LDRSH ar_c, [h2, #+2] 56 | LDRSH ar_d, [x, #+6] 57 | ; 58 | SUBS val_ny, val_ny, #+1 ;decrement val_ny 59 | MUL ar_c, ar_d, ar_c 60 | MLA ar_a, ar_b, ar_a, ar_c 61 | LDRSH ar_b, [h1, #+2] 62 | LDRSH ar_c, [y, #+6] 63 | MUL ar_b, ar_c,ar_b 64 | LDRSH ar_c, [x, #+4] 65 | SUB ar_a, ar_a, ar_b 66 | LDRSH ar_b, [h2, #+4] 67 | MLA ar_a, ar_c, ar_b, ar_a 68 | LDRSH ar_b, [h1, #+4] 69 | LDRSH ar_c, [y, #+4] 70 | MUL ar_b, ar_c, ar_b 71 | LDRSH ar_c, [x, #+2] 72 | SUB ar_a, ar_a, ar_b 73 | LDRSH ar_b, [h2, #+6] 74 | MLA ar_a, ar_c, ar_b, ar_a 75 | LDRSH ar_b, [h1, #+6] 76 | LDRSH ar_c, [y, #+2] 77 | MUL ar_b, ar_c, ar_b 78 | LDRSH ar_c, [x], #+2 79 | SUB ar_a, ar_a, ar_b 80 | LDRSH ar_b, [h2, #+8] 81 | MLA ar_a, ar_c, ar_b, ar_a 82 | LDRSH ar_b, [h1, #+8] 83 | LDRSH ar_c, [y, #+0] 84 | MUL ar_b, ar_c, ar_b 85 | SUB ar_a, ar_a, ar_b 86 | ASR ar_a, ar_a, #+15 87 | STRH ar_a, [y, #+8] 88 | ADD y, y, #+2 89 | BNE acc_five_data 90 | ; 91 | done_for_now: 92 | LDMIA SP!, {R4-R7} 93 | BX LR ;; return 94 | END 95 | 96 | /******************* (C) COPYRIGHT 2009 STMicroelectronics *****END OF FILE****/ 97 | -------------------------------------------------------------------------------- /code/SL_RTE/RTE_GUI/GUI_Objx/GUI_Cont.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file cont.h 3 | * 4 | */ 5 | 6 | #ifndef GUI_CONT_H 7 | #define GUI_CONT_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "RTE_Include.h" 17 | #if GUI_USE_CONT != 0 18 | 19 | 20 | /********************* 21 | * DEFINES 22 | *********************/ 23 | 24 | /********************** 25 | * TYPEDEFS 26 | **********************/ 27 | 28 | /*Layout options*/ 29 | typedef enum 30 | { 31 | GUI_LAYOUT_OFF = 0, 32 | GUI_LAYOUT_CENTER, 33 | GUI_LAYOUT_COL_L, /*Column left align*/ 34 | GUI_LAYOUT_COL_M, /*Column middle align*/ 35 | GUI_LAYOUT_COL_R, /*Column right align*/ 36 | GUI_LAYOUT_ROW_T, /*Row top align*/ 37 | GUI_LAYOUT_ROW_M, /*Row middle align*/ 38 | GUI_LAYOUT_ROW_B, /*Row bottom align*/ 39 | GUI_LAYOUT_PRETTY, /*Put as many object as possible in row and begin a new row*/ 40 | GUI_LAYOUT_GRID, /*Align same-sized object into a grid*/ 41 | }layout_t; 42 | 43 | typedef struct 44 | { 45 | /*Inherited from 'base_obj' so no inherited ext. */ /*Ext. of ancestor*/ 46 | /*New data for this type */ 47 | uint8_t layout :4; /*A layout from 'cont_layout_t' enum*/ 48 | uint8_t hor_fit :1; /*1: Enable horizontal fit to involve all children*/ 49 | uint8_t ver_fit :1; /*1: Enable horizontal fir to involve all children*/ 50 | }cont_ext_t; 51 | 52 | /********************** 53 | * GLOBAL PROTOTYPES 54 | **********************/ 55 | 56 | /** 57 | * Create a container objects 58 | * @param par pointer to an object, it will be the parent of the new container 59 | * @param copy pointer to a container object, if not NULL then the new object will be copied from it 60 | * @return pointer to the created container 61 | */ 62 | obj_t * cont_create(obj_t * par, obj_t * copy); 63 | 64 | /*===================== 65 | * Setter functions 66 | *====================*/ 67 | 68 | /** 69 | * Set a layout on a container 70 | * @param cont pointer to a container object 71 | * @param layout a layout from 'cont_layout_t' 72 | */ 73 | void cont_set_layout(obj_t * cont, layout_t layout); 74 | 75 | 76 | /** 77 | * Enable the horizontal or vertical fit. 78 | * The container size will be set to involve the children horizontally or vertically. 79 | * @param cont pointer to a container object 80 | * @param hor_en true: enable the horizontal fit 81 | * @param ver_en true: enable the vertical fit 82 | */ 83 | void cont_set_fit(obj_t * cont, bool hor_en, bool ver_en); 84 | 85 | /** 86 | * Set the style of a container 87 | * @param cont pointer to a container object 88 | * @param style pointer to the new style 89 | */ 90 | static inline void cont_set_style(obj_t *cont, style_t * style) 91 | { 92 | obj_set_style(cont, style); 93 | } 94 | 95 | /*===================== 96 | * Getter functions 97 | *====================*/ 98 | 99 | /** 100 | * Get the layout of a container 101 | * @param cont pointer to container object 102 | * @return the layout from 'cont_layout_t' 103 | */ 104 | layout_t cont_get_layout(obj_t * cont); 105 | 106 | /** 107 | * Get horizontal fit enable attribute of a container 108 | * @param cont pointer to a container object 109 | * @return true: horizontal fit is enabled; false: disabled 110 | */ 111 | bool cont_get_hor_fit(obj_t * cont); 112 | 113 | /** 114 | * Get vertical fit enable attribute of a container 115 | * @param cont pointer to a container object 116 | * @return true: vertical fit is enabled; false: disabled 117 | */ 118 | bool cont_get_ver_fit(obj_t * cont); 119 | 120 | /** 121 | * Get the style of a container 122 | * @param cont pointer to a container object 123 | * @return pointer to the container's style 124 | */ 125 | static inline style_t * cont_get_style(obj_t *cont) 126 | { 127 | return obj_get_style(cont); 128 | } 129 | 130 | /********************** 131 | * MACROS 132 | **********************/ 133 | 134 | #endif /*GUI_USE_CONT*/ 135 | 136 | #ifdef __cplusplus 137 | } /* extern "C" */ 138 | #endif 139 | 140 | #endif /*GUI_CONT_H*/ 141 | --------------------------------------------------------------------------------