Compare commits

...

6 commits
MB ... master

Author SHA1 Message Date
Yohan Simard
64ea0cbd78 accelerometer and display fix 2020-12-03 12:16:07 +01:00
Yohan Simard
c8ea3f3a91 clean project 2020-11-16 19:45:46 +01:00
Yohan Simard
542722584d Merge branch 'reel'
# Conflicts:
#	MyDrivers/Timer.c
#	MyDrivers/Timer.h
#	Services/RFReceiver.c
2020-11-16 18:55:44 +01:00
Yohan Simard
599b7f7c6b fix many bugs (work done during lab session) 2020-11-16 18:42:10 +01:00
Arnaud Vergnet
4e69b9b112 improve doc 2020-11-15 16:53:55 +01:00
Yohan Simard
e1773afbbe fix bugs and more... 2020-11-14 18:00:25 +01:00
62 changed files with 748 additions and 4661 deletions

18
.gitignore vendored
View file

@ -1,12 +1,6 @@
/
*.o
*.d
*.crf
!/README.md
!/Src/
!/Services/
!/MyDrivers/
!/LLDrivers/
/MDK-ARM/
!/Inc
!/.gitignore
/MDK-ARM/DebugConfig
/MDK-ARM/RTE
/MDK-ARM/NUCLEO-F103RB
/MDK-ARM/Project.uvguix.*
/MDK-ARM/EventRecorderStub.scvd
/MDK-ARM/startup_stm32f103xb.lst

View file

@ -1,97 +0,0 @@
// <<< Use Configuration Wizard in Context Menu >>>
// <h> Debug MCU Configuration
// <o0.0> DBG_SLEEP
// <i> Debug Sleep Mode
// <i> 0: (FCLK=On, HCLK=Off) FCLK is clocked by the system clock as previously configured by the software while HCLK is disabled
// <i> 1: (FCLK=On, HCLK=On) HCLK is fed by the same clock that is provided to FCLK
// <o0.1> DBG_STOP
// <i> Debug Stop Mode
// <i> 0: (FCLK=Off, HCLK=Off) Clock controller disables all clocks
// <i> 1: (FCLK=On, HCLK=On) FCLK and HCLK are provided by the internal RC oscillator which remains active
// <o0.2> DBG_STANDBY
// <i> Debug Standby Mode
// <i> 0: (FCLK=Off, HCLK=Off) The whole digital part is unpowered.
// <i> 1: (FCLK=On, HCLK=On) Digital part is powered and FCLK and HCLK are provided by the internal RC oscillator which remains active
// <o0.8> DBG_IWDG_STOP
// <i> Debug independent watchdog stopped when core is halted
// <i> 0: The watchdog counter clock continues even if the core is halted
// <i> 1: The watchdog counter clock is stopped when the core is halted
// <o0.9> DBG_WWDG_STOP
// <i> Debug window watchdog stopped when core is halted
// <i> 0: The window watchdog counter clock continues even if the core is halted
// <i> 1: The window watchdog counter clock is stopped when the core is halted
// <o0.10> DBG_TIM1_STOP
// <i> Timer 1 counter stopped when core is halted
// <i> 0: The clock of the involved Timer Counter is fed even if the core is halted
// <i> 1: The clock of the involved Timer counter is stopped when the core is halted
// <o0.11> DBG_TIM2_STOP
// <i> Timer 2 counter stopped when core is halted
// <i> 0: The clock of the involved Timer Counter is fed even if the core is halted
// <i> 1: The clock of the involved Timer counter is stopped when the core is halted
// <o0.12> DBG_TIM3_STOP
// <i> Timer 3 counter stopped when core is halted
// <i> 0: The clock of the involved Timer Counter is fed even if the core is halted
// <i> 1: The clock of the involved Timer counter is stopped when the core is halted
// <o0.13> DBG_TIM4_STOP
// <i> Timer 4 counter stopped when core is halted
// <i> 0: The clock of the involved Timer Counter is fed even if the core is halted
// <i> 1: The clock of the involved Timer counter is stopped when the core is halted
// <o0.14> DBG_CAN1_STOP
// <i> Debug CAN1 stopped when Core is halted
// <i> 0: Same behavior as in normal mode
// <i> 1: CAN1 receive registers are frozen
// <o0.15> DBG_I2C1_SMBUS_TIMEOUT
// <i> I2C1 SMBUS timeout mode stopped when Core is halted
// <i> 0: Same behavior as in normal mode
// <i> 1: The SMBUS timeout is frozen
// <o0.16> DBG_I2C2_SMBUS_TIMEOUT
// <i> I2C2 SMBUS timeout mode stopped when Core is halted
// <i> 0: Same behavior as in normal mode
// <i> 1: The SMBUS timeout is frozen
// <o0.17> DBG_TIM8_STOP
// <i> Timer 8 counter stopped when core is halted
// <i> 0: The clock of the involved timer counter is fed even if the core is halted, and the outputs behave normally.
// <i> 1: The clock of the involved timer counter is stopped when the core is halted, and the outputs are disabled (as if there were an emergency stop in response to a break event).
// <o0.18> DBG_TIM5_STOP
// <i> Timer 5 counter stopped when core is halted
// <i> 0: The clock of the involved timer counter is fed even if the core is halted, and the outputs behave normally.
// <i> 1: The clock of the involved timer counter is stopped when the core is halted, and the outputs are disabled (as if there were an emergency stop in response to a break event).
// <o0.19> DBG_TIM6_STOP
// <i> Timer 6 counter stopped when core is halted
// <i> 0: The clock of the involved timer counter is fed even if the core is halted, and the outputs behave normally.
// <i> 1: The clock of the involved timer counter is stopped when the core is halted, and the outputs are disabled (as if there were an emergency stop in response to a break event).
// <o0.20> DBG_TIM7_STOP
// <i> Timer 7 counter stopped when core is halted
// <i> 0: The clock of the involved timer counter is fed even if the core is halted, and the outputs behave normally.
// <i> 1: The clock of the involved timer counter is stopped when the core is halted, and the outputs are disabled (as if there were an emergency stop in response to a break event).
// <o0.21> DBG_CAN2_STOP
// <i> Debug CAN2 stopped when Core is halted
// <i> 0: Same behavior as in normal mode
// <i> 1: CAN2 receive registers are frozen
// <o0.25> DBG_TIM12_STOP
// <i> Timer 12 counter stopped when core is halted
// <i> 0: The clock of the involved timer counter is fed even if the core is halted, and the outputs behave normally.
// <i> 1: The clock of the involved timer counter is stopped when the core is halted, and the outputs are disabled (as if there were an emergency stop in response to a break event).
// <o0.26> DBG_TIM13_STOP
// <i> Timer 13 counter stopped when core is halted
// <i> 0: The clock of the involved timer counter is fed even if the core is halted, and the outputs behave normally.
// <i> 1: The clock of the involved timer counter is stopped when the core is halted, and the outputs are disabled (as if there were an emergency stop in response to a break event).
// <o0.27> DBG_TIM14_STOP
// <i> Timer 14 counter stopped when core is halted
// <i> 0: The clock of the involved timer counter is fed even if the core is halted, and the outputs behave normally.
// <i> 1: The clock of the involved timer counter is stopped when the core is halted, and the outputs are disabled (as if there were an emergency stop in response to a break event).
// <o0.28> DBG_TIM9_STOP
// <i> Timer 9 counter stopped when core is halted
// <i> 0: The clock of the involved timer counter is fed even if the core is halted, and the outputs behave normally.
// <i> 1: The clock of the involved timer counter is stopped when the core is halted, and the outputs are disabled (as if there were an emergency stop in response to a break event).
// <o0.29> DBG_TIM10_STOP
// <i> Timer 10 counter stopped when core is halted
// <i> 0: The clock of the involved timer counter is fed even if the core is halted, and the outputs behave normally.
// <i> 1: The clock of the involved timer counter is stopped when the core is halted, and the outputs are disabled (as if there were an emergency stop in response to a break event).
// <o0.30> DBG_TIM11_STOP
// <i> Timer 11 counter stopped when core is halted
// <i> 0: The clock of the involved timer counter is fed even if the core is halted, and the outputs behave normally.
// <i> 1: The clock of the involved timer counter is stopped when the core is halted, and the outputs are disabled (as if there were an emergency stop in response to a break event).
// </h>
DbgMCU_CR = 0x00000007;
// <<< end of configuration section >>>

View file

@ -1,97 +0,0 @@
// <<< Use Configuration Wizard in Context Menu >>>
// <h> Debug MCU Configuration
// <o0.0> DBG_SLEEP
// <i> Debug Sleep Mode
// <i> 0: (FCLK=On, HCLK=Off) FCLK is clocked by the system clock as previously configured by the software while HCLK is disabled
// <i> 1: (FCLK=On, HCLK=On) HCLK is fed by the same clock that is provided to FCLK
// <o0.1> DBG_STOP
// <i> Debug Stop Mode
// <i> 0: (FCLK=Off, HCLK=Off) Clock controller disables all clocks
// <i> 1: (FCLK=On, HCLK=On) FCLK and HCLK are provided by the internal RC oscillator which remains active
// <o0.2> DBG_STANDBY
// <i> Debug Standby Mode
// <i> 0: (FCLK=Off, HCLK=Off) The whole digital part is unpowered.
// <i> 1: (FCLK=On, HCLK=On) Digital part is powered and FCLK and HCLK are provided by the internal RC oscillator which remains active
// <o0.8> DBG_IWDG_STOP
// <i> Debug independent watchdog stopped when core is halted
// <i> 0: The watchdog counter clock continues even if the core is halted
// <i> 1: The watchdog counter clock is stopped when the core is halted
// <o0.9> DBG_WWDG_STOP
// <i> Debug window watchdog stopped when core is halted
// <i> 0: The window watchdog counter clock continues even if the core is halted
// <i> 1: The window watchdog counter clock is stopped when the core is halted
// <o0.10> DBG_TIM1_STOP
// <i> Timer 1 counter stopped when core is halted
// <i> 0: The clock of the involved Timer Counter is fed even if the core is halted
// <i> 1: The clock of the involved Timer counter is stopped when the core is halted
// <o0.11> DBG_TIM2_STOP
// <i> Timer 2 counter stopped when core is halted
// <i> 0: The clock of the involved Timer Counter is fed even if the core is halted
// <i> 1: The clock of the involved Timer counter is stopped when the core is halted
// <o0.12> DBG_TIM3_STOP
// <i> Timer 3 counter stopped when core is halted
// <i> 0: The clock of the involved Timer Counter is fed even if the core is halted
// <i> 1: The clock of the involved Timer counter is stopped when the core is halted
// <o0.13> DBG_TIM4_STOP
// <i> Timer 4 counter stopped when core is halted
// <i> 0: The clock of the involved Timer Counter is fed even if the core is halted
// <i> 1: The clock of the involved Timer counter is stopped when the core is halted
// <o0.14> DBG_CAN1_STOP
// <i> Debug CAN1 stopped when Core is halted
// <i> 0: Same behavior as in normal mode
// <i> 1: CAN1 receive registers are frozen
// <o0.15> DBG_I2C1_SMBUS_TIMEOUT
// <i> I2C1 SMBUS timeout mode stopped when Core is halted
// <i> 0: Same behavior as in normal mode
// <i> 1: The SMBUS timeout is frozen
// <o0.16> DBG_I2C2_SMBUS_TIMEOUT
// <i> I2C2 SMBUS timeout mode stopped when Core is halted
// <i> 0: Same behavior as in normal mode
// <i> 1: The SMBUS timeout is frozen
// <o0.17> DBG_TIM8_STOP
// <i> Timer 8 counter stopped when core is halted
// <i> 0: The clock of the involved timer counter is fed even if the core is halted, and the outputs behave normally.
// <i> 1: The clock of the involved timer counter is stopped when the core is halted, and the outputs are disabled (as if there were an emergency stop in response to a break event).
// <o0.18> DBG_TIM5_STOP
// <i> Timer 5 counter stopped when core is halted
// <i> 0: The clock of the involved timer counter is fed even if the core is halted, and the outputs behave normally.
// <i> 1: The clock of the involved timer counter is stopped when the core is halted, and the outputs are disabled (as if there were an emergency stop in response to a break event).
// <o0.19> DBG_TIM6_STOP
// <i> Timer 6 counter stopped when core is halted
// <i> 0: The clock of the involved timer counter is fed even if the core is halted, and the outputs behave normally.
// <i> 1: The clock of the involved timer counter is stopped when the core is halted, and the outputs are disabled (as if there were an emergency stop in response to a break event).
// <o0.20> DBG_TIM7_STOP
// <i> Timer 7 counter stopped when core is halted
// <i> 0: The clock of the involved timer counter is fed even if the core is halted, and the outputs behave normally.
// <i> 1: The clock of the involved timer counter is stopped when the core is halted, and the outputs are disabled (as if there were an emergency stop in response to a break event).
// <o0.21> DBG_CAN2_STOP
// <i> Debug CAN2 stopped when Core is halted
// <i> 0: Same behavior as in normal mode
// <i> 1: CAN2 receive registers are frozen
// <o0.25> DBG_TIM12_STOP
// <i> Timer 12 counter stopped when core is halted
// <i> 0: The clock of the involved timer counter is fed even if the core is halted, and the outputs behave normally.
// <i> 1: The clock of the involved timer counter is stopped when the core is halted, and the outputs are disabled (as if there were an emergency stop in response to a break event).
// <o0.26> DBG_TIM13_STOP
// <i> Timer 13 counter stopped when core is halted
// <i> 0: The clock of the involved timer counter is fed even if the core is halted, and the outputs behave normally.
// <i> 1: The clock of the involved timer counter is stopped when the core is halted, and the outputs are disabled (as if there were an emergency stop in response to a break event).
// <o0.27> DBG_TIM14_STOP
// <i> Timer 14 counter stopped when core is halted
// <i> 0: The clock of the involved timer counter is fed even if the core is halted, and the outputs behave normally.
// <i> 1: The clock of the involved timer counter is stopped when the core is halted, and the outputs are disabled (as if there were an emergency stop in response to a break event).
// <o0.28> DBG_TIM9_STOP
// <i> Timer 9 counter stopped when core is halted
// <i> 0: The clock of the involved timer counter is fed even if the core is halted, and the outputs behave normally.
// <i> 1: The clock of the involved timer counter is stopped when the core is halted, and the outputs are disabled (as if there were an emergency stop in response to a break event).
// <o0.29> DBG_TIM10_STOP
// <i> Timer 10 counter stopped when core is halted
// <i> 0: The clock of the involved timer counter is fed even if the core is halted, and the outputs behave normally.
// <i> 1: The clock of the involved timer counter is stopped when the core is halted, and the outputs are disabled (as if there were an emergency stop in response to a break event).
// <o0.30> DBG_TIM11_STOP
// <i> Timer 11 counter stopped when core is halted
// <i> 0: The clock of the involved timer counter is fed even if the core is halted, and the outputs behave normally.
// <i> 1: The clock of the involved timer counter is stopped when the core is halted, and the outputs are disabled (as if there were an emergency stop in response to a break event).
// </h>
DbgMCU_CR = 0x00000007;
// <<< end of configuration section >>>

View file

@ -1,2 +0,0 @@
[EXTDLL]
Count=0

View file

@ -1,58 +0,0 @@
<html>
<body>
<pre>
<h1>µVision Build Log</h1>
<h2>Tool Versions:</h2>
IDE-Version: µVision V5.31.0.0
Copyright (C) 2020 ARM Ltd and ARM Germany GmbH. All rights reserved.
License Information: Toyoste Biencuit, a, LIC=----
Tool Versions:
Toolchain: MDK-Lite Version: 5.31.0.0
Toolchain Path: C:\Keil_v5\ARM\ARMCC\Bin
C Compiler: Armcc.exe V5.06 update 6 (build 750)
Assembler: Armasm.exe V5.06 update 6 (build 750)
Linker/Locator: ArmLink.exe V5.06 update 6 (build 750)
Library Manager: ArmAr.exe V5.06 update 6 (build 750)
Hex Converter: FromElf.exe V5.06 update 6 (build 750)
CPU DLL: SARMCM3.DLL V5.31.0.0
Dialog DLL: DARMSTM.DLL V1.68.0.0
Target DLL: STLink\ST-LINKIII-KEIL_SWO.dll V3.0.7.0
Dialog DLL: TARMSTM.DLL V1.66.0.0
<h2>Project:</h2>
C:\users\vergnet\My Documents\INSA\4A\Info Mat\projet_voilier\MDK-ARM\Project.uvprojx
Project File Date: 10/19/2020
<h2>Output:</h2>
*** Using Compiler 'V5.06 update 6 (build 750)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin'
Build target 'Simulateur'
linking...
Program Size: Code=1464 RO-data=268 RW-data=28 ZI-data=1028
"NUCLEO-F103RB\NUCLEO-F103RB.axf" - 0 Error(s), 0 Warning(s).
<h2>Software Packages used:</h2>
Package Vendor: ARM
http://www.keil.com/pack/ARM.CMSIS.5.7.0.pack
ARM.CMSIS.5.7.0
CMSIS (Cortex Microcontroller Software Interface Standard)
* Component: CORE Version: 5.4.0
Package Vendor: Keil
http://www.keil.com/pack/Keil.STM32F1xx_DFP.2.3.0.pack
Keil.STM32F1xx_DFP.2.3.0
STMicroelectronics STM32F1 Series Device Support, Drivers and Examples
<h2>Collection of Component include folders:</h2>
.\RTE\_Simulateur
C:\ARM\Packs\ARM\CMSIS\5.7.0\CMSIS\Core\Include
C:\ARM\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include
<h2>Collection of Component Files used:</h2>
* Component: ARM::CMSIS:CORE:5.4.0
Build Time Elapsed: 00:00:01
</pre>
</body>
</html>

View file

@ -1,549 +0,0 @@
Component: ARM Compiler 5.06 update 6 (build 750) Tool: armlink [4d35ed]
==============================================================================
Section Cross References
main.o(i.SystemClock_Config) refers to stm32f1xx_ll_utils.o(i.LL_Init1msTick) for LL_Init1msTick
main.o(i.SystemClock_Config) refers to stm32f1xx_ll_utils.o(i.LL_SetSystemCoreClock) for LL_SetSystemCoreClock
main.o(i.main) refers to main.o(i.SystemClock_Config) for SystemClock_Config
main.o(i.main) refers to chrono.o(i.Chrono_Conf) for Chrono_Conf
main.o(i.main) refers to chrono.o(i.Chrono_Start) for Chrono_Start
chrono.o(i.Chrono_Conf) refers to timer.o(i.MyTimer_Conf) for MyTimer_Conf
chrono.o(i.Chrono_Conf) refers to timer.o(i.MyTimer_IT_Conf) for MyTimer_IT_Conf
chrono.o(i.Chrono_Conf) refers to timer.o(i.MyTimer_IT_Enable) for MyTimer_IT_Enable
chrono.o(i.Chrono_Conf) refers to chrono.o(.data) for Chrono_Time
chrono.o(i.Chrono_Conf) refers to chrono.o(i.Chrono_Task_10ms) for Chrono_Task_10ms
chrono.o(i.Chrono_Read) refers to chrono.o(.data) for Chrono_Time
chrono.o(i.Chrono_Reset) refers to timer.o(i.MyTimer_Stop) for MyTimer_Stop
chrono.o(i.Chrono_Reset) refers to chrono.o(.data) for Chrono_Timer
chrono.o(i.Chrono_Start) refers to timer.o(i.MyTimer_Start) for MyTimer_Start
chrono.o(i.Chrono_Start) refers to chrono.o(.data) for Chrono_Timer
chrono.o(i.Chrono_Stop) refers to timer.o(i.MyTimer_Stop) for MyTimer_Stop
chrono.o(i.Chrono_Stop) refers to chrono.o(.data) for Chrono_Timer
chrono.o(i.Chrono_Task_10ms) refers to chrono.o(.data) for Chrono_Time
timer.o(i.MyTimer_Conf) refers to timer.o(i.LL_APB1_GRP1_EnableClock) for LL_APB1_GRP1_EnableClock
timer.o(i.MyTimer_Conf) refers to stm32f1xx_ll_tim.o(i.LL_TIM_Init) for LL_TIM_Init
timer.o(i.MyTimer_Conf) refers to timer.o(i.LL_TIM_DisableIT_UPDATE) for LL_TIM_DisableIT_UPDATE
timer.o(i.MyTimer_Conf) refers to timer.o(i.LL_TIM_DisableCounter) for LL_TIM_DisableCounter
timer.o(i.MyTimer_IT_Conf) refers to timer.o(i.LL_TIM_DisableIT_UPDATE) for LL_TIM_DisableIT_UPDATE
timer.o(i.MyTimer_IT_Conf) refers to timer.o(.data) for Ptr_ItFct_TIM1
timer.o(i.MyTimer_IT_Disable) refers to timer.o(i.LL_TIM_DisableIT_UPDATE) for LL_TIM_DisableIT_UPDATE
timer.o(i.MyTimer_Stop) refers to timer.o(i.LL_TIM_DisableCounter) for LL_TIM_DisableCounter
timer.o(i.TIM1_UP_IRQHandler) refers to timer.o(i.LL_TIM_ClearFlag_UPDATE) for LL_TIM_ClearFlag_UPDATE
timer.o(i.TIM1_UP_IRQHandler) refers to timer.o(.data) for Ptr_ItFct_TIM1
timer.o(i.TIM2_IRQHandler) refers to timer.o(i.LL_TIM_ClearFlag_UPDATE) for LL_TIM_ClearFlag_UPDATE
timer.o(i.TIM2_IRQHandler) refers to timer.o(.data) for Ptr_ItFct_TIM2
timer.o(i.TIM3_IRQHandler) refers to timer.o(i.LL_TIM_ClearFlag_UPDATE) for LL_TIM_ClearFlag_UPDATE
timer.o(i.TIM3_IRQHandler) refers to timer.o(.data) for Ptr_ItFct_TIM3
timer.o(i.TIM4_IRQHandler) refers to timer.o(i.LL_TIM_ClearFlag_UPDATE) for LL_TIM_ClearFlag_UPDATE
timer.o(i.TIM4_IRQHandler) refers to timer.o(.data) for Ptr_ItFct_TIM4
stm32f1xx_ll_rcc.o(i.LL_RCC_DeInit) refers to stm32f1xx_ll_rcc.o(i.LL_RCC_PLL_IsReady) for LL_RCC_PLL_IsReady
stm32f1xx_ll_rcc.o(i.LL_RCC_GetADCClockFreq) refers to main.o(i.assert_failed) for assert_failed
stm32f1xx_ll_rcc.o(i.LL_RCC_GetADCClockFreq) refers to stm32f1xx_ll_rcc.o(i.RCC_GetSystemClockFreq) for RCC_GetSystemClockFreq
stm32f1xx_ll_rcc.o(i.LL_RCC_GetADCClockFreq) refers to stm32f1xx_ll_rcc.o(i.RCC_GetHCLKClockFreq) for RCC_GetHCLKClockFreq
stm32f1xx_ll_rcc.o(i.LL_RCC_GetADCClockFreq) refers to stm32f1xx_ll_rcc.o(i.RCC_GetPCLK2ClockFreq) for RCC_GetPCLK2ClockFreq
stm32f1xx_ll_rcc.o(i.LL_RCC_GetSystemClocksFreq) refers to stm32f1xx_ll_rcc.o(i.RCC_GetSystemClockFreq) for RCC_GetSystemClockFreq
stm32f1xx_ll_rcc.o(i.LL_RCC_GetSystemClocksFreq) refers to stm32f1xx_ll_rcc.o(i.RCC_GetHCLKClockFreq) for RCC_GetHCLKClockFreq
stm32f1xx_ll_rcc.o(i.LL_RCC_GetSystemClocksFreq) refers to stm32f1xx_ll_rcc.o(i.RCC_GetPCLK1ClockFreq) for RCC_GetPCLK1ClockFreq
stm32f1xx_ll_rcc.o(i.LL_RCC_GetSystemClocksFreq) refers to stm32f1xx_ll_rcc.o(i.RCC_GetPCLK2ClockFreq) for RCC_GetPCLK2ClockFreq
stm32f1xx_ll_rcc.o(i.LL_RCC_GetUSBClockFreq) refers to main.o(i.assert_failed) for assert_failed
stm32f1xx_ll_rcc.o(i.LL_RCC_GetUSBClockFreq) refers to stm32f1xx_ll_rcc.o(i.LL_RCC_PLL_IsReady) for LL_RCC_PLL_IsReady
stm32f1xx_ll_rcc.o(i.LL_RCC_GetUSBClockFreq) refers to stm32f1xx_ll_rcc.o(i.RCC_PLL_GetFreqDomain_SYS) for RCC_PLL_GetFreqDomain_SYS
stm32f1xx_ll_rcc.o(i.RCC_GetHCLKClockFreq) refers to system_stm32f1xx.o(.constdata) for AHBPrescTable
stm32f1xx_ll_rcc.o(i.RCC_GetPCLK1ClockFreq) refers to system_stm32f1xx.o(.constdata) for APBPrescTable
stm32f1xx_ll_rcc.o(i.RCC_GetPCLK2ClockFreq) refers to system_stm32f1xx.o(.constdata) for APBPrescTable
stm32f1xx_ll_rcc.o(i.RCC_GetSystemClockFreq) refers to stm32f1xx_ll_rcc.o(i.RCC_PLL_GetFreqDomain_SYS) for RCC_PLL_GetFreqDomain_SYS
stm32f1xx_ll_utils.o(i.LL_PLL_ConfigSystemClock_HSE) refers to main.o(i.assert_failed) for assert_failed
stm32f1xx_ll_utils.o(i.LL_PLL_ConfigSystemClock_HSE) refers to stm32f1xx_ll_utils.o(i.UTILS_PLL_IsBusy) for UTILS_PLL_IsBusy
stm32f1xx_ll_utils.o(i.LL_PLL_ConfigSystemClock_HSE) refers to stm32f1xx_ll_utils.o(i.UTILS_GetPLLOutputFrequency) for UTILS_GetPLLOutputFrequency
stm32f1xx_ll_utils.o(i.LL_PLL_ConfigSystemClock_HSE) refers to stm32f1xx_ll_utils.o(i.LL_RCC_HSE_IsReady) for LL_RCC_HSE_IsReady
stm32f1xx_ll_utils.o(i.LL_PLL_ConfigSystemClock_HSE) refers to stm32f1xx_ll_utils.o(i.LL_RCC_PLL_ConfigDomain_SYS) for LL_RCC_PLL_ConfigDomain_SYS
stm32f1xx_ll_utils.o(i.LL_PLL_ConfigSystemClock_HSE) refers to stm32f1xx_ll_utils.o(i.UTILS_EnablePLLAndSwitchSystem) for UTILS_EnablePLLAndSwitchSystem
stm32f1xx_ll_utils.o(i.LL_PLL_ConfigSystemClock_HSI) refers to stm32f1xx_ll_utils.o(i.UTILS_PLL_IsBusy) for UTILS_PLL_IsBusy
stm32f1xx_ll_utils.o(i.LL_PLL_ConfigSystemClock_HSI) refers to stm32f1xx_ll_utils.o(i.UTILS_GetPLLOutputFrequency) for UTILS_GetPLLOutputFrequency
stm32f1xx_ll_utils.o(i.LL_PLL_ConfigSystemClock_HSI) refers to stm32f1xx_ll_utils.o(i.LL_RCC_HSI_IsReady) for LL_RCC_HSI_IsReady
stm32f1xx_ll_utils.o(i.LL_PLL_ConfigSystemClock_HSI) refers to stm32f1xx_ll_utils.o(i.LL_RCC_PLL_ConfigDomain_SYS) for LL_RCC_PLL_ConfigDomain_SYS
stm32f1xx_ll_utils.o(i.LL_PLL_ConfigSystemClock_HSI) refers to stm32f1xx_ll_utils.o(i.UTILS_EnablePLLAndSwitchSystem) for UTILS_EnablePLLAndSwitchSystem
stm32f1xx_ll_utils.o(i.LL_SetSystemCoreClock) refers to system_stm32f1xx.o(.data) for SystemCoreClock
stm32f1xx_ll_utils.o(i.UTILS_EnablePLLAndSwitchSystem) refers to main.o(i.assert_failed) for assert_failed
stm32f1xx_ll_utils.o(i.UTILS_EnablePLLAndSwitchSystem) refers to stm32f1xx_ll_utils.o(i.UTILS_SetFlashLatency) for UTILS_SetFlashLatency
stm32f1xx_ll_utils.o(i.UTILS_EnablePLLAndSwitchSystem) refers to stm32f1xx_ll_utils.o(i.LL_RCC_PLL_IsReady) for LL_RCC_PLL_IsReady
stm32f1xx_ll_utils.o(i.UTILS_EnablePLLAndSwitchSystem) refers to stm32f1xx_ll_utils.o(i.LL_SetSystemCoreClock) for LL_SetSystemCoreClock
stm32f1xx_ll_utils.o(i.UTILS_EnablePLLAndSwitchSystem) refers to system_stm32f1xx.o(.constdata) for AHBPrescTable
stm32f1xx_ll_utils.o(i.UTILS_EnablePLLAndSwitchSystem) refers to system_stm32f1xx.o(.data) for SystemCoreClock
stm32f1xx_ll_utils.o(i.UTILS_GetPLLOutputFrequency) refers to main.o(i.assert_failed) for assert_failed
stm32f1xx_ll_utils.o(i.UTILS_PLL_IsBusy) refers to stm32f1xx_ll_utils.o(i.LL_RCC_PLL_IsReady) for LL_RCC_PLL_IsReady
stm32f1xx_ll_tim.o(i.IC1Config) refers to main.o(i.assert_failed) for assert_failed
stm32f1xx_ll_tim.o(i.IC2Config) refers to main.o(i.assert_failed) for assert_failed
stm32f1xx_ll_tim.o(i.IC3Config) refers to main.o(i.assert_failed) for assert_failed
stm32f1xx_ll_tim.o(i.IC4Config) refers to main.o(i.assert_failed) for assert_failed
stm32f1xx_ll_tim.o(i.LL_TIM_BDTR_Init) refers to main.o(i.assert_failed) for assert_failed
stm32f1xx_ll_tim.o(i.LL_TIM_DeInit) refers to main.o(i.assert_failed) for assert_failed
stm32f1xx_ll_tim.o(i.LL_TIM_DeInit) refers to stm32f1xx_ll_tim.o(i.LL_APB1_GRP1_ForceReset) for LL_APB1_GRP1_ForceReset
stm32f1xx_ll_tim.o(i.LL_TIM_DeInit) refers to stm32f1xx_ll_tim.o(i.LL_APB1_GRP1_ReleaseReset) for LL_APB1_GRP1_ReleaseReset
stm32f1xx_ll_tim.o(i.LL_TIM_ENCODER_Init) refers to main.o(i.assert_failed) for assert_failed
stm32f1xx_ll_tim.o(i.LL_TIM_HALLSENSOR_Init) refers to main.o(i.assert_failed) for assert_failed
stm32f1xx_ll_tim.o(i.LL_TIM_HALLSENSOR_Init) refers to stm32f1xx_ll_tim.o(i.LL_TIM_OC_SetCompareCH2) for LL_TIM_OC_SetCompareCH2
stm32f1xx_ll_tim.o(i.LL_TIM_IC_Init) refers to stm32f1xx_ll_tim.o(i.IC1Config) for IC1Config
stm32f1xx_ll_tim.o(i.LL_TIM_IC_Init) refers to stm32f1xx_ll_tim.o(i.IC2Config) for IC2Config
stm32f1xx_ll_tim.o(i.LL_TIM_IC_Init) refers to stm32f1xx_ll_tim.o(i.IC3Config) for IC3Config
stm32f1xx_ll_tim.o(i.LL_TIM_IC_Init) refers to stm32f1xx_ll_tim.o(i.IC4Config) for IC4Config
stm32f1xx_ll_tim.o(i.LL_TIM_Init) refers to main.o(i.assert_failed) for assert_failed
stm32f1xx_ll_tim.o(i.LL_TIM_OC_Init) refers to stm32f1xx_ll_tim.o(i.OC1Config) for OC1Config
stm32f1xx_ll_tim.o(i.LL_TIM_OC_Init) refers to stm32f1xx_ll_tim.o(i.OC2Config) for OC2Config
stm32f1xx_ll_tim.o(i.LL_TIM_OC_Init) refers to stm32f1xx_ll_tim.o(i.OC3Config) for OC3Config
stm32f1xx_ll_tim.o(i.LL_TIM_OC_Init) refers to stm32f1xx_ll_tim.o(i.OC4Config) for OC4Config
stm32f1xx_ll_tim.o(i.OC1Config) refers to main.o(i.assert_failed) for assert_failed
stm32f1xx_ll_tim.o(i.OC2Config) refers to main.o(i.assert_failed) for assert_failed
stm32f1xx_ll_tim.o(i.OC2Config) refers to stm32f1xx_ll_tim.o(i.LL_TIM_OC_SetCompareCH2) for LL_TIM_OC_SetCompareCH2
stm32f1xx_ll_tim.o(i.OC3Config) refers to main.o(i.assert_failed) for assert_failed
stm32f1xx_ll_tim.o(i.OC4Config) refers to main.o(i.assert_failed) for assert_failed
system_stm32f1xx.o(i.SystemCoreClockUpdate) refers to system_stm32f1xx.o(.data) for SystemCoreClock
system_stm32f1xx.o(i.SystemCoreClockUpdate) refers to system_stm32f1xx.o(.constdata) for AHBPrescTable
startup_stm32f103xb.o(RESET) refers to startup_stm32f103xb.o(STACK) for __initial_sp
startup_stm32f103xb.o(RESET) refers to startup_stm32f103xb.o(.text) for Reset_Handler
startup_stm32f103xb.o(RESET) refers to timer.o(i.TIM1_UP_IRQHandler) for TIM1_UP_IRQHandler
startup_stm32f103xb.o(RESET) refers to timer.o(i.TIM2_IRQHandler) for TIM2_IRQHandler
startup_stm32f103xb.o(RESET) refers to timer.o(i.TIM3_IRQHandler) for TIM3_IRQHandler
startup_stm32f103xb.o(RESET) refers to timer.o(i.TIM4_IRQHandler) for TIM4_IRQHandler
startup_stm32f103xb.o(.text) refers to system_stm32f1xx.o(i.SystemInit) for SystemInit
startup_stm32f103xb.o(.text) refers to entry.o(.ARM.Collect$$$$00000000) for __main
entry.o(.ARM.Collect$$$$00000000) refers (Special) to entry10a.o(.ARM.Collect$$$$0000000D) for __rt_final_cpp
entry.o(.ARM.Collect$$$$00000000) refers (Special) to entry11a.o(.ARM.Collect$$$$0000000F) for __rt_final_exit
entry.o(.ARM.Collect$$$$00000000) refers (Special) to entry7b.o(.ARM.Collect$$$$00000008) for _main_clock
entry.o(.ARM.Collect$$$$00000000) refers (Special) to entry8b.o(.ARM.Collect$$$$0000000A) for _main_cpp_init
entry.o(.ARM.Collect$$$$00000000) refers (Special) to entry9a.o(.ARM.Collect$$$$0000000B) for _main_init
entry.o(.ARM.Collect$$$$00000000) refers (Special) to entry5.o(.ARM.Collect$$$$00000004) for _main_scatterload
entry.o(.ARM.Collect$$$$00000000) refers (Special) to entry2.o(.ARM.Collect$$$$00000001) for _main_stk
entry2.o(.ARM.Collect$$$$00000001) refers to entry2.o(.ARM.Collect$$$$00002712) for __lit__00000000
entry2.o(.ARM.Collect$$$$00002712) refers to startup_stm32f103xb.o(STACK) for __initial_sp
entry2.o(__vectab_stack_and_reset_area) refers to startup_stm32f103xb.o(STACK) for __initial_sp
entry2.o(__vectab_stack_and_reset_area) refers to entry.o(.ARM.Collect$$$$00000000) for __main
entry5.o(.ARM.Collect$$$$00000004) refers to init.o(.text) for __scatterload
entry9a.o(.ARM.Collect$$$$0000000B) refers to main.o(i.main) for main
entry9b.o(.ARM.Collect$$$$0000000C) refers to main.o(i.main) for main
init.o(.text) refers to entry5.o(.ARM.Collect$$$$00000004) for __main_after_scatterload
==============================================================================
Removing Unused input sections from the image.
Removing main.o(.rev16_text), (4 bytes).
Removing main.o(.revsh_text), (4 bytes).
Removing main.o(.rrx_text), (6 bytes).
Removing chrono.o(.rev16_text), (4 bytes).
Removing chrono.o(.revsh_text), (4 bytes).
Removing chrono.o(.rrx_text), (6 bytes).
Removing chrono.o(i.Chrono_Read), (8 bytes).
Removing chrono.o(i.Chrono_Reset), (32 bytes).
Removing chrono.o(i.Chrono_Stop), (16 bytes).
Removing timer.o(.rev16_text), (4 bytes).
Removing timer.o(.revsh_text), (4 bytes).
Removing timer.o(.rrx_text), (6 bytes).
Removing timer.o(i.MyTimer_IT_Disable), (12 bytes).
Removing timer.o(i.MyTimer_Stop), (12 bytes).
Removing timer.o(.constdata), (35 bytes).
Removing stm32f1xx_ll_rcc.o(.rev16_text), (4 bytes).
Removing stm32f1xx_ll_rcc.o(.revsh_text), (4 bytes).
Removing stm32f1xx_ll_rcc.o(.rrx_text), (6 bytes).
Removing stm32f1xx_ll_rcc.o(i.LL_RCC_DeInit), (152 bytes).
Removing stm32f1xx_ll_rcc.o(i.LL_RCC_GetADCClockFreq), (124 bytes).
Removing stm32f1xx_ll_rcc.o(i.LL_RCC_GetSystemClocksFreq), (36 bytes).
Removing stm32f1xx_ll_rcc.o(i.LL_RCC_GetUSBClockFreq), (120 bytes).
Removing stm32f1xx_ll_rcc.o(i.LL_RCC_PLL_IsReady), (16 bytes).
Removing stm32f1xx_ll_rcc.o(i.RCC_GetHCLKClockFreq), (32 bytes).
Removing stm32f1xx_ll_rcc.o(i.RCC_GetPCLK1ClockFreq), (36 bytes).
Removing stm32f1xx_ll_rcc.o(i.RCC_GetPCLK2ClockFreq), (36 bytes).
Removing stm32f1xx_ll_rcc.o(i.RCC_GetSystemClockFreq), (60 bytes).
Removing stm32f1xx_ll_rcc.o(i.RCC_PLL_GetFreqDomain_SYS), (88 bytes).
Removing stm32f1xx_ll_utils.o(.rev16_text), (4 bytes).
Removing stm32f1xx_ll_utils.o(.revsh_text), (4 bytes).
Removing stm32f1xx_ll_utils.o(.rrx_text), (6 bytes).
Removing stm32f1xx_ll_utils.o(i.LL_PLL_ConfigSystemClock_HSE), (260 bytes).
Removing stm32f1xx_ll_utils.o(i.LL_PLL_ConfigSystemClock_HSI), (104 bytes).
Removing stm32f1xx_ll_utils.o(i.LL_RCC_HSE_IsReady), (16 bytes).
Removing stm32f1xx_ll_utils.o(i.LL_RCC_HSI_IsReady), (16 bytes).
Removing stm32f1xx_ll_utils.o(i.LL_RCC_PLL_ConfigDomain_SYS), (28 bytes).
Removing stm32f1xx_ll_utils.o(i.LL_RCC_PLL_IsReady), (16 bytes).
Removing stm32f1xx_ll_utils.o(i.LL_mDelay), (40 bytes).
Removing stm32f1xx_ll_utils.o(i.UTILS_EnablePLLAndSwitchSystem), (416 bytes).
Removing stm32f1xx_ll_utils.o(i.UTILS_GetPLLOutputFrequency), (228 bytes).
Removing stm32f1xx_ll_utils.o(i.UTILS_PLL_IsBusy), (16 bytes).
Removing stm32f1xx_ll_utils.o(i.UTILS_SetFlashLatency), (80 bytes).
Removing stm32f1xx_ll_tim.o(.rev16_text), (4 bytes).
Removing stm32f1xx_ll_tim.o(.revsh_text), (4 bytes).
Removing stm32f1xx_ll_tim.o(.rrx_text), (6 bytes).
Removing stm32f1xx_ll_tim.o(i.IC1Config), (376 bytes).
Removing stm32f1xx_ll_tim.o(i.IC2Config), (376 bytes).
Removing stm32f1xx_ll_tim.o(i.IC3Config), (380 bytes).
Removing stm32f1xx_ll_tim.o(i.IC4Config), (380 bytes).
Removing stm32f1xx_ll_tim.o(i.LL_APB1_GRP1_ForceReset), (16 bytes).
Removing stm32f1xx_ll_tim.o(i.LL_APB1_GRP1_ReleaseReset), (16 bytes).
Removing stm32f1xx_ll_tim.o(i.LL_TIM_BDTR_Init), (312 bytes).
Removing stm32f1xx_ll_tim.o(i.LL_TIM_BDTR_StructInit), (18 bytes).
Removing stm32f1xx_ll_tim.o(i.LL_TIM_DeInit), (192 bytes).
Removing stm32f1xx_ll_tim.o(i.LL_TIM_ENCODER_Init), (688 bytes).
Removing stm32f1xx_ll_tim.o(i.LL_TIM_ENCODER_StructInit), (36 bytes).
Removing stm32f1xx_ll_tim.o(i.LL_TIM_HALLSENSOR_Init), (396 bytes).
Removing stm32f1xx_ll_tim.o(i.LL_TIM_HALLSENSOR_StructInit), (12 bytes).
Removing stm32f1xx_ll_tim.o(i.LL_TIM_IC_Init), (92 bytes).
Removing stm32f1xx_ll_tim.o(i.LL_TIM_IC_StructInit), (18 bytes).
Removing stm32f1xx_ll_tim.o(i.LL_TIM_OC_Init), (92 bytes).
Removing stm32f1xx_ll_tim.o(i.LL_TIM_OC_SetCompareCH2), (4 bytes).
Removing stm32f1xx_ll_tim.o(i.LL_TIM_OC_StructInit), (20 bytes).
Removing stm32f1xx_ll_tim.o(i.LL_TIM_StructInit), (18 bytes).
Removing stm32f1xx_ll_tim.o(i.OC1Config), (404 bytes).
Removing stm32f1xx_ll_tim.o(i.OC2Config), (404 bytes).
Removing stm32f1xx_ll_tim.o(i.OC3Config), (404 bytes).
Removing stm32f1xx_ll_tim.o(i.OC4Config), (372 bytes).
Removing stm32f1xx_ll_tim.o(.constdata), (35 bytes).
Removing system_stm32f1xx.o(.rev16_text), (4 bytes).
Removing system_stm32f1xx.o(.revsh_text), (4 bytes).
Removing system_stm32f1xx.o(.rrx_text), (6 bytes).
Removing system_stm32f1xx.o(i.SystemCoreClockUpdate), (164 bytes).
Removing system_stm32f1xx.o(.constdata), (24 bytes).
Removing startup_stm32f103xb.o(HEAP), (512 bytes).
75 unused section(s) (total 7894 bytes) removed from the image.
==============================================================================
Image Symbol Table
Local Symbols
Symbol Name Value Ov Type Size Object(Section)
../Src/main.c 0x00000000 Number 0 main.o ABSOLUTE
../Src/system_stm32f1xx.c 0x00000000 Number 0 system_stm32f1xx.o ABSOLUTE
../clib/microlib/init/entry.s 0x00000000 Number 0 entry8a.o ABSOLUTE
../clib/microlib/init/entry.s 0x00000000 Number 0 entry7b.o ABSOLUTE
../clib/microlib/init/entry.s 0x00000000 Number 0 entry7a.o ABSOLUTE
../clib/microlib/init/entry.s 0x00000000 Number 0 entry5.o ABSOLUTE
../clib/microlib/init/entry.s 0x00000000 Number 0 entry11b.o ABSOLUTE
../clib/microlib/init/entry.s 0x00000000 Number 0 entry2.o ABSOLUTE
../clib/microlib/init/entry.s 0x00000000 Number 0 entry10a.o ABSOLUTE
../clib/microlib/init/entry.s 0x00000000 Number 0 entry.o ABSOLUTE
../clib/microlib/init/entry.s 0x00000000 Number 0 entry11a.o ABSOLUTE
../clib/microlib/init/entry.s 0x00000000 Number 0 entry10b.o ABSOLUTE
../clib/microlib/init/entry.s 0x00000000 Number 0 entry9b.o ABSOLUTE
../clib/microlib/init/entry.s 0x00000000 Number 0 entry9a.o ABSOLUTE
../clib/microlib/init/entry.s 0x00000000 Number 0 entry8b.o ABSOLUTE
..\LLDrivers\src\stm32f1xx_ll_rcc.c 0x00000000 Number 0 stm32f1xx_ll_rcc.o ABSOLUTE
..\LLDrivers\src\stm32f1xx_ll_tim.c 0x00000000 Number 0 stm32f1xx_ll_tim.o ABSOLUTE
..\LLDrivers\src\stm32f1xx_ll_utils.c 0x00000000 Number 0 stm32f1xx_ll_utils.o ABSOLUTE
..\MyDrivers\ADC.c 0x00000000 Number 0 adc.o ABSOLUTE
..\MyDrivers\GPIO.c 0x00000000 Number 0 gpio.o ABSOLUTE
..\MyDrivers\Timer.c 0x00000000 Number 0 timer.o ABSOLUTE
..\MyDrivers\USART.c 0x00000000 Number 0 usart.o ABSOLUTE
..\Services\Accelerometer.c 0x00000000 Number 0 accelerometer.o ABSOLUTE
..\Services\Chrono.c 0x00000000 Number 0 chrono.o ABSOLUTE
..\Services\DCMotor.c 0x00000000 Number 0 dcmotor.o ABSOLUTE
..\Services\IncrementalEncoder.c 0x00000000 Number 0 incrementalencoder.o ABSOLUTE
..\Services\RFEmitter.c 0x00000000 Number 0 rfemitter.o ABSOLUTE
..\Services\RFReceiver.c 0x00000000 Number 0 rfreceiver.o ABSOLUTE
..\Services\ServoMotor.c 0x00000000 Number 0 servomotor.o ABSOLUTE
..\Services\Voltage.c 0x00000000 Number 0 voltage.o ABSOLUTE
..\Src\Display.c 0x00000000 Number 0 display.o ABSOLUTE
..\Src\Orientation.c 0x00000000 Number 0 orientation.o ABSOLUTE
..\Src\Roll.c 0x00000000 Number 0 roll.o ABSOLUTE
..\Src\Sail.c 0x00000000 Number 0 sail.o ABSOLUTE
..\Src\main.c 0x00000000 Number 0 main.o ABSOLUTE
..\Src\system_stm32f1xx.c 0x00000000 Number 0 system_stm32f1xx.o ABSOLUTE
..\\LLDrivers\\src\\stm32f1xx_ll_rcc.c 0x00000000 Number 0 stm32f1xx_ll_rcc.o ABSOLUTE
..\\LLDrivers\\src\\stm32f1xx_ll_tim.c 0x00000000 Number 0 stm32f1xx_ll_tim.o ABSOLUTE
..\\LLDrivers\\src\\stm32f1xx_ll_utils.c 0x00000000 Number 0 stm32f1xx_ll_utils.o ABSOLUTE
..\\MyDrivers\\Timer.c 0x00000000 Number 0 timer.o ABSOLUTE
..\\Services\\Chrono.c 0x00000000 Number 0 chrono.o ABSOLUTE
dc.s 0x00000000 Number 0 dc.o ABSOLUTE
handlers.s 0x00000000 Number 0 handlers.o ABSOLUTE
init.s 0x00000000 Number 0 init.o ABSOLUTE
startup_stm32f103xb.s 0x00000000 Number 0 startup_stm32f103xb.o ABSOLUTE
RESET 0x08000000 Section 236 startup_stm32f103xb.o(RESET)
.ARM.Collect$$$$00000000 0x080000ec Section 0 entry.o(.ARM.Collect$$$$00000000)
.ARM.Collect$$$$00000001 0x080000ec Section 4 entry2.o(.ARM.Collect$$$$00000001)
.ARM.Collect$$$$00000004 0x080000f0 Section 4 entry5.o(.ARM.Collect$$$$00000004)
.ARM.Collect$$$$00000008 0x080000f4 Section 0 entry7b.o(.ARM.Collect$$$$00000008)
.ARM.Collect$$$$0000000A 0x080000f4 Section 0 entry8b.o(.ARM.Collect$$$$0000000A)
.ARM.Collect$$$$0000000B 0x080000f4 Section 8 entry9a.o(.ARM.Collect$$$$0000000B)
.ARM.Collect$$$$0000000D 0x080000fc Section 0 entry10a.o(.ARM.Collect$$$$0000000D)
.ARM.Collect$$$$0000000F 0x080000fc Section 0 entry11a.o(.ARM.Collect$$$$0000000F)
.ARM.Collect$$$$00002712 0x080000fc Section 4 entry2.o(.ARM.Collect$$$$00002712)
__lit__00000000 0x080000fc Data 4 entry2.o(.ARM.Collect$$$$00002712)
.text 0x08000100 Section 36 startup_stm32f103xb.o(.text)
.text 0x08000124 Section 36 init.o(.text)
i.Chrono_Conf 0x08000148 Section 0 chrono.o(i.Chrono_Conf)
i.Chrono_Start 0x0800018c Section 0 chrono.o(i.Chrono_Start)
i.Chrono_Task_10ms 0x0800019c Section 0 chrono.o(i.Chrono_Task_10ms)
i.LL_APB1_GRP1_EnableClock 0x080001e4 Section 0 timer.o(i.LL_APB1_GRP1_EnableClock)
LL_APB1_GRP1_EnableClock 0x080001e5 Thumb Code 24 timer.o(i.LL_APB1_GRP1_EnableClock)
i.LL_Init1msTick 0x08000200 Section 0 stm32f1xx_ll_utils.o(i.LL_Init1msTick)
i.LL_SetSystemCoreClock 0x0800021c Section 0 stm32f1xx_ll_utils.o(i.LL_SetSystemCoreClock)
i.LL_TIM_ClearFlag_UPDATE 0x08000228 Section 0 timer.o(i.LL_TIM_ClearFlag_UPDATE)
LL_TIM_ClearFlag_UPDATE 0x08000229 Thumb Code 8 timer.o(i.LL_TIM_ClearFlag_UPDATE)
i.LL_TIM_DisableCounter 0x08000230 Section 0 timer.o(i.LL_TIM_DisableCounter)
LL_TIM_DisableCounter 0x08000231 Thumb Code 10 timer.o(i.LL_TIM_DisableCounter)
i.LL_TIM_DisableIT_UPDATE 0x0800023a Section 0 timer.o(i.LL_TIM_DisableIT_UPDATE)
LL_TIM_DisableIT_UPDATE 0x0800023b Thumb Code 10 timer.o(i.LL_TIM_DisableIT_UPDATE)
i.LL_TIM_Init 0x08000244 Section 0 stm32f1xx_ll_tim.o(i.LL_TIM_Init)
i.MyTimer_Conf 0x08000358 Section 0 timer.o(i.MyTimer_Conf)
i.MyTimer_IT_Conf 0x080003dc Section 0 timer.o(i.MyTimer_IT_Conf)
i.MyTimer_IT_Enable 0x080004a4 Section 0 timer.o(i.MyTimer_IT_Enable)
i.MyTimer_Start 0x080004b2 Section 0 timer.o(i.MyTimer_Start)
i.SystemClock_Config 0x080004c0 Section 0 main.o(i.SystemClock_Config)
i.SystemInit 0x080005b0 Section 0 system_stm32f1xx.o(i.SystemInit)
i.TIM1_UP_IRQHandler 0x08000608 Section 0 timer.o(i.TIM1_UP_IRQHandler)
i.TIM2_IRQHandler 0x08000620 Section 0 timer.o(i.TIM2_IRQHandler)
i.TIM3_IRQHandler 0x08000638 Section 0 timer.o(i.TIM3_IRQHandler)
i.TIM4_IRQHandler 0x08000650 Section 0 timer.o(i.TIM4_IRQHandler)
i.__scatterload_copy 0x08000668 Section 14 handlers.o(i.__scatterload_copy)
i.__scatterload_null 0x08000676 Section 2 handlers.o(i.__scatterload_null)
i.__scatterload_zeroinit 0x08000678 Section 14 handlers.o(i.__scatterload_zeroinit)
i.assert_failed 0x08000686 Section 0 main.o(i.assert_failed)
i.main 0x0800068c Section 0 main.o(i.main)
.data 0x20000000 Section 8 chrono.o(.data)
Chrono_Time 0x20000000 Data 3 chrono.o(.data)
Chrono_Timer 0x20000004 Data 4 chrono.o(.data)
.data 0x20000008 Section 16 timer.o(.data)
.data 0x20000018 Section 4 system_stm32f1xx.o(.data)
STACK 0x20000020 Section 1024 startup_stm32f103xb.o(STACK)
Global Symbols
Symbol Name Value Ov Type Size Object(Section)
BuildAttributes$$THM_ISAv4$P$D$K$B$S$PE$A:L22UL41UL21$X:L11$S22US41US21$IEEE1$IW$USESV6$~STKCKD$USESV7$~SHL$OSPACE$EBA8$MICROLIB$REQ8$PRES8$EABIv2 0x00000000 Number 0 anon$$obj.o ABSOLUTE
__ARM_use_no_argv 0x00000000 Number 0 main.o ABSOLUTE
__cpp_initialize__aeabi_ - Undefined Weak Reference
__cxa_finalize - Undefined Weak Reference
__decompress - Undefined Weak Reference
_clock_init - Undefined Weak Reference
_microlib_exit - Undefined Weak Reference
__Vectors_Size 0x000000ec Number 0 startup_stm32f103xb.o ABSOLUTE
__Vectors 0x08000000 Data 4 startup_stm32f103xb.o(RESET)
__Vectors_End 0x080000ec Data 0 startup_stm32f103xb.o(RESET)
__main 0x080000ed Thumb Code 0 entry.o(.ARM.Collect$$$$00000000)
_main_stk 0x080000ed Thumb Code 0 entry2.o(.ARM.Collect$$$$00000001)
_main_scatterload 0x080000f1 Thumb Code 0 entry5.o(.ARM.Collect$$$$00000004)
__main_after_scatterload 0x080000f5 Thumb Code 0 entry5.o(.ARM.Collect$$$$00000004)
_main_clock 0x080000f5 Thumb Code 0 entry7b.o(.ARM.Collect$$$$00000008)
_main_cpp_init 0x080000f5 Thumb Code 0 entry8b.o(.ARM.Collect$$$$0000000A)
_main_init 0x080000f5 Thumb Code 0 entry9a.o(.ARM.Collect$$$$0000000B)
__rt_final_cpp 0x080000fd Thumb Code 0 entry10a.o(.ARM.Collect$$$$0000000D)
__rt_final_exit 0x080000fd Thumb Code 0 entry11a.o(.ARM.Collect$$$$0000000F)
Reset_Handler 0x08000101 Thumb Code 8 startup_stm32f103xb.o(.text)
NMI_Handler 0x08000109 Thumb Code 2 startup_stm32f103xb.o(.text)
HardFault_Handler 0x0800010b Thumb Code 2 startup_stm32f103xb.o(.text)
MemManage_Handler 0x0800010d Thumb Code 2 startup_stm32f103xb.o(.text)
BusFault_Handler 0x0800010f Thumb Code 2 startup_stm32f103xb.o(.text)
UsageFault_Handler 0x08000111 Thumb Code 2 startup_stm32f103xb.o(.text)
SVC_Handler 0x08000113 Thumb Code 2 startup_stm32f103xb.o(.text)
DebugMon_Handler 0x08000115 Thumb Code 2 startup_stm32f103xb.o(.text)
PendSV_Handler 0x08000117 Thumb Code 2 startup_stm32f103xb.o(.text)
SysTick_Handler 0x08000119 Thumb Code 2 startup_stm32f103xb.o(.text)
ADC1_2_IRQHandler 0x0800011b Thumb Code 0 startup_stm32f103xb.o(.text)
CAN1_RX1_IRQHandler 0x0800011b Thumb Code 0 startup_stm32f103xb.o(.text)
CAN1_SCE_IRQHandler 0x0800011b Thumb Code 0 startup_stm32f103xb.o(.text)
DMA1_Channel1_IRQHandler 0x0800011b Thumb Code 0 startup_stm32f103xb.o(.text)
DMA1_Channel2_IRQHandler 0x0800011b Thumb Code 0 startup_stm32f103xb.o(.text)
DMA1_Channel3_IRQHandler 0x0800011b Thumb Code 0 startup_stm32f103xb.o(.text)
DMA1_Channel4_IRQHandler 0x0800011b Thumb Code 0 startup_stm32f103xb.o(.text)
DMA1_Channel5_IRQHandler 0x0800011b Thumb Code 0 startup_stm32f103xb.o(.text)
DMA1_Channel6_IRQHandler 0x0800011b Thumb Code 0 startup_stm32f103xb.o(.text)
DMA1_Channel7_IRQHandler 0x0800011b Thumb Code 0 startup_stm32f103xb.o(.text)
EXTI0_IRQHandler 0x0800011b Thumb Code 0 startup_stm32f103xb.o(.text)
EXTI15_10_IRQHandler 0x0800011b Thumb Code 0 startup_stm32f103xb.o(.text)
EXTI1_IRQHandler 0x0800011b Thumb Code 0 startup_stm32f103xb.o(.text)
EXTI2_IRQHandler 0x0800011b Thumb Code 0 startup_stm32f103xb.o(.text)
EXTI3_IRQHandler 0x0800011b Thumb Code 0 startup_stm32f103xb.o(.text)
EXTI4_IRQHandler 0x0800011b Thumb Code 0 startup_stm32f103xb.o(.text)
EXTI9_5_IRQHandler 0x0800011b Thumb Code 0 startup_stm32f103xb.o(.text)
FLASH_IRQHandler 0x0800011b Thumb Code 0 startup_stm32f103xb.o(.text)
I2C1_ER_IRQHandler 0x0800011b Thumb Code 0 startup_stm32f103xb.o(.text)
I2C1_EV_IRQHandler 0x0800011b Thumb Code 0 startup_stm32f103xb.o(.text)
I2C2_ER_IRQHandler 0x0800011b Thumb Code 0 startup_stm32f103xb.o(.text)
I2C2_EV_IRQHandler 0x0800011b Thumb Code 0 startup_stm32f103xb.o(.text)
PVD_IRQHandler 0x0800011b Thumb Code 0 startup_stm32f103xb.o(.text)
RCC_IRQHandler 0x0800011b Thumb Code 0 startup_stm32f103xb.o(.text)
RTC_Alarm_IRQHandler 0x0800011b Thumb Code 0 startup_stm32f103xb.o(.text)
RTC_IRQHandler 0x0800011b Thumb Code 0 startup_stm32f103xb.o(.text)
SPI1_IRQHandler 0x0800011b Thumb Code 0 startup_stm32f103xb.o(.text)
SPI2_IRQHandler 0x0800011b Thumb Code 0 startup_stm32f103xb.o(.text)
TAMPER_IRQHandler 0x0800011b Thumb Code 0 startup_stm32f103xb.o(.text)
TIM1_BRK_IRQHandler 0x0800011b Thumb Code 0 startup_stm32f103xb.o(.text)
TIM1_CC_IRQHandler 0x0800011b Thumb Code 0 startup_stm32f103xb.o(.text)
TIM1_TRG_COM_IRQHandler 0x0800011b Thumb Code 0 startup_stm32f103xb.o(.text)
USART1_IRQHandler 0x0800011b Thumb Code 0 startup_stm32f103xb.o(.text)
USART2_IRQHandler 0x0800011b Thumb Code 0 startup_stm32f103xb.o(.text)
USART3_IRQHandler 0x0800011b Thumb Code 0 startup_stm32f103xb.o(.text)
USBWakeUp_IRQHandler 0x0800011b Thumb Code 0 startup_stm32f103xb.o(.text)
USB_HP_CAN1_TX_IRQHandler 0x0800011b Thumb Code 0 startup_stm32f103xb.o(.text)
USB_LP_CAN1_RX0_IRQHandler 0x0800011b Thumb Code 0 startup_stm32f103xb.o(.text)
WWDG_IRQHandler 0x0800011b Thumb Code 0 startup_stm32f103xb.o(.text)
__scatterload 0x08000125 Thumb Code 28 init.o(.text)
__scatterload_rt2 0x08000125 Thumb Code 0 init.o(.text)
Chrono_Conf 0x08000149 Thumb Code 54 chrono.o(i.Chrono_Conf)
Chrono_Start 0x0800018d Thumb Code 12 chrono.o(i.Chrono_Start)
Chrono_Task_10ms 0x0800019d Thumb Code 68 chrono.o(i.Chrono_Task_10ms)
LL_Init1msTick 0x08000201 Thumb Code 28 stm32f1xx_ll_utils.o(i.LL_Init1msTick)
LL_SetSystemCoreClock 0x0800021d Thumb Code 6 stm32f1xx_ll_utils.o(i.LL_SetSystemCoreClock)
LL_TIM_Init 0x08000245 Thumb Code 228 stm32f1xx_ll_tim.o(i.LL_TIM_Init)
MyTimer_Conf 0x08000359 Thumb Code 118 timer.o(i.MyTimer_Conf)
MyTimer_IT_Conf 0x080003dd Thumb Code 166 timer.o(i.MyTimer_IT_Conf)
MyTimer_IT_Enable 0x080004a5 Thumb Code 14 timer.o(i.MyTimer_IT_Enable)
MyTimer_Start 0x080004b3 Thumb Code 14 timer.o(i.MyTimer_Start)
SystemClock_Config 0x080004c1 Thumb Code 226 main.o(i.SystemClock_Config)
SystemInit 0x080005b1 Thumb Code 70 system_stm32f1xx.o(i.SystemInit)
TIM1_UP_IRQHandler 0x08000609 Thumb Code 16 timer.o(i.TIM1_UP_IRQHandler)
TIM2_IRQHandler 0x08000621 Thumb Code 18 timer.o(i.TIM2_IRQHandler)
TIM3_IRQHandler 0x08000639 Thumb Code 16 timer.o(i.TIM3_IRQHandler)
TIM4_IRQHandler 0x08000651 Thumb Code 16 timer.o(i.TIM4_IRQHandler)
__scatterload_copy 0x08000669 Thumb Code 14 handlers.o(i.__scatterload_copy)
__scatterload_null 0x08000677 Thumb Code 2 handlers.o(i.__scatterload_null)
__scatterload_zeroinit 0x08000679 Thumb Code 14 handlers.o(i.__scatterload_zeroinit)
assert_failed 0x08000687 Thumb Code 4 main.o(i.assert_failed)
main 0x0800068d Thumb Code 18 main.o(i.main)
Region$$Table$$Base 0x080006a4 Number 0 anon$$obj.o(Region$$Table)
Region$$Table$$Limit 0x080006c4 Number 0 anon$$obj.o(Region$$Table)
Ptr_ItFct_TIM1 0x20000008 Data 4 timer.o(.data)
Ptr_ItFct_TIM2 0x2000000c Data 4 timer.o(.data)
Ptr_ItFct_TIM3 0x20000010 Data 4 timer.o(.data)
Ptr_ItFct_TIM4 0x20000014 Data 4 timer.o(.data)
SystemCoreClock 0x20000018 Data 4 system_stm32f1xx.o(.data)
__initial_sp 0x20000420 Data 0 startup_stm32f103xb.o(STACK)
==============================================================================
Memory Map of the image
Image Entry point : 0x080000ed
Load Region LR_IROM1 (Base: 0x08000000, Size: 0x000006e0, Max: 0x00020000, ABSOLUTE)
Execution Region ER_IROM1 (Exec base: 0x08000000, Load base: 0x08000000, Size: 0x000006c4, Max: 0x00020000, ABSOLUTE)
Exec Addr Load Addr Size Type Attr Idx E Section Name Object
0x08000000 0x08000000 0x000000ec Data RO 753 RESET startup_stm32f103xb.o
0x080000ec 0x080000ec 0x00000000 Code RO 758 * .ARM.Collect$$$$00000000 mc_w.l(entry.o)
0x080000ec 0x080000ec 0x00000004 Code RO 761 .ARM.Collect$$$$00000001 mc_w.l(entry2.o)
0x080000f0 0x080000f0 0x00000004 Code RO 764 .ARM.Collect$$$$00000004 mc_w.l(entry5.o)
0x080000f4 0x080000f4 0x00000000 Code RO 766 .ARM.Collect$$$$00000008 mc_w.l(entry7b.o)
0x080000f4 0x080000f4 0x00000000 Code RO 768 .ARM.Collect$$$$0000000A mc_w.l(entry8b.o)
0x080000f4 0x080000f4 0x00000008 Code RO 769 .ARM.Collect$$$$0000000B mc_w.l(entry9a.o)
0x080000fc 0x080000fc 0x00000000 Code RO 771 .ARM.Collect$$$$0000000D mc_w.l(entry10a.o)
0x080000fc 0x080000fc 0x00000000 Code RO 773 .ARM.Collect$$$$0000000F mc_w.l(entry11a.o)
0x080000fc 0x080000fc 0x00000004 Code RO 762 .ARM.Collect$$$$00002712 mc_w.l(entry2.o)
0x08000100 0x08000100 0x00000024 Code RO 754 .text startup_stm32f103xb.o
0x08000124 0x08000124 0x00000024 Code RO 775 .text mc_w.l(init.o)
0x08000148 0x08000148 0x00000044 Code RO 117 i.Chrono_Conf chrono.o
0x0800018c 0x0800018c 0x00000010 Code RO 120 i.Chrono_Start chrono.o
0x0800019c 0x0800019c 0x00000048 Code RO 122 i.Chrono_Task_10ms chrono.o
0x080001e4 0x080001e4 0x0000001c Code RO 239 i.LL_APB1_GRP1_EnableClock timer.o
0x08000200 0x08000200 0x0000001c Code RO 461 i.LL_Init1msTick stm32f1xx_ll_utils.o
0x0800021c 0x0800021c 0x0000000c Code RO 468 i.LL_SetSystemCoreClock stm32f1xx_ll_utils.o
0x08000228 0x08000228 0x00000008 Code RO 240 i.LL_TIM_ClearFlag_UPDATE timer.o
0x08000230 0x08000230 0x0000000a Code RO 241 i.LL_TIM_DisableCounter timer.o
0x0800023a 0x0800023a 0x0000000a Code RO 242 i.LL_TIM_DisableIT_UPDATE timer.o
0x08000244 0x08000244 0x00000114 Code RO 573 i.LL_TIM_Init stm32f1xx_ll_tim.o
0x08000358 0x08000358 0x00000084 Code RO 243 i.MyTimer_Conf timer.o
0x080003dc 0x080003dc 0x000000c8 Code RO 244 i.MyTimer_IT_Conf timer.o
0x080004a4 0x080004a4 0x0000000e Code RO 246 i.MyTimer_IT_Enable timer.o
0x080004b2 0x080004b2 0x0000000e Code RO 247 i.MyTimer_Start timer.o
0x080004c0 0x080004c0 0x000000f0 Code RO 4 i.SystemClock_Config main.o
0x080005b0 0x080005b0 0x00000058 Code RO 718 i.SystemInit system_stm32f1xx.o
0x08000608 0x08000608 0x00000018 Code RO 249 i.TIM1_UP_IRQHandler timer.o
0x08000620 0x08000620 0x00000018 Code RO 250 i.TIM2_IRQHandler timer.o
0x08000638 0x08000638 0x00000018 Code RO 251 i.TIM3_IRQHandler timer.o
0x08000650 0x08000650 0x00000018 Code RO 252 i.TIM4_IRQHandler timer.o
0x08000668 0x08000668 0x0000000e Code RO 779 i.__scatterload_copy mc_w.l(handlers.o)
0x08000676 0x08000676 0x00000002 Code RO 780 i.__scatterload_null mc_w.l(handlers.o)
0x08000678 0x08000678 0x0000000e Code RO 781 i.__scatterload_zeroinit mc_w.l(handlers.o)
0x08000686 0x08000686 0x00000004 Code RO 5 i.assert_failed main.o
0x0800068a 0x0800068a 0x00000002 PAD
0x0800068c 0x0800068c 0x00000018 Code RO 6 i.main main.o
0x080006a4 0x080006a4 0x00000020 Data RO 777 Region$$Table anon$$obj.o
Execution Region RW_IRAM1 (Exec base: 0x20000000, Load base: 0x080006c4, Size: 0x00000420, Max: 0x00005000, ABSOLUTE)
Exec Addr Load Addr Size Type Attr Idx E Section Name Object
0x20000000 0x080006c4 0x00000008 Data RW 123 .data chrono.o
0x20000008 0x080006cc 0x00000010 Data RW 254 .data timer.o
0x20000018 0x080006dc 0x00000004 Data RW 720 .data system_stm32f1xx.o
0x2000001c 0x080006e0 0x00000004 PAD
0x20000020 - 0x00000400 Zero RW 751 STACK startup_stm32f103xb.o
==============================================================================
Image component sizes
Code (inc. data) RO Data RW Data ZI Data Debug Object Name
156 22 0 8 0 2000 chrono.o
268 20 0 0 0 356672 main.o
36 8 236 0 1024 780 startup_stm32f103xb.o
276 48 0 0 0 28994 stm32f1xx_ll_tim.o
40 6 0 0 0 2105 stm32f1xx_ll_utils.o
88 18 0 4 0 1171 system_stm32f1xx.o
512 82 0 16 0 59169 timer.o
----------------------------------------------------------------------
1378 204 268 28 1028 450891 Object Totals
0 0 32 0 0 0 (incl. Generated)
2 0 0 0 4 0 (incl. Padding)
----------------------------------------------------------------------
Code (inc. data) RO Data RW Data ZI Data Debug Library Member Name
0 0 0 0 0 0 entry.o
0 0 0 0 0 0 entry10a.o
0 0 0 0 0 0 entry11a.o
8 4 0 0 0 0 entry2.o
4 0 0 0 0 0 entry5.o
0 0 0 0 0 0 entry7b.o
0 0 0 0 0 0 entry8b.o
8 4 0 0 0 0 entry9a.o
30 0 0 0 0 0 handlers.o
36 8 0 0 0 68 init.o
----------------------------------------------------------------------
86 16 0 0 0 68 Library Totals
0 0 0 0 0 0 (incl. Padding)
----------------------------------------------------------------------
Code (inc. data) RO Data RW Data ZI Data Debug Library Name
86 16 0 0 0 68 mc_w.l
----------------------------------------------------------------------
86 16 0 0 0 68 Library Totals
----------------------------------------------------------------------
==============================================================================
Code (inc. data) RO Data RW Data ZI Data Debug
1464 220 268 28 1028 450071 Grand Totals
1464 220 268 28 1028 450071 ELF Image Totals
1464 220 268 28 0 0 ROM Totals
==============================================================================
Total RO Size (Code + RO Data) 1732 ( 1.69kB)
Total RW Size (RW Data + ZI Data) 1056 ( 1.03kB)
Total ROM Size (Code + RO Data + RW Data) 1760 ( 1.72kB)
==============================================================================

View file

@ -1,16 +0,0 @@
; *************************************************************
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************
LR_IROM1 0x08000000 0x00020000 { ; load region size_region
ER_IROM1 0x08000000 0x00020000 { ; load address = execution address
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
.ANY (+XO)
}
RW_IRAM1 0x20000000 0x00005000 { ; RW data
.ANY (+RW +ZI)
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -1,2 +0,0 @@
nucleo-f103rb\stm32f1xx_ll_adc.o: ../../../../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_adc.c
nucleo-f103rb\stm32f1xx_ll_adc.o: ../../../../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_adc.h

View file

@ -1,2 +0,0 @@
nucleo-f103rb\stm32f1xx_ll_crc.o: ../../../../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_crc.c
nucleo-f103rb\stm32f1xx_ll_crc.o: ../../../../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_crc.h

View file

@ -1,2 +0,0 @@
nucleo-f103rb\stm32f1xx_ll_dac.o: ../../../../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_dac.c
nucleo-f103rb\stm32f1xx_ll_dac.o: ../../../../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_dac.h

View file

@ -1,2 +0,0 @@
nucleo-f103rb\stm32f1xx_ll_dma.o: ../../../../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_dma.c
nucleo-f103rb\stm32f1xx_ll_dma.o: ../../../../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_dma.h

View file

@ -1,2 +0,0 @@
nucleo-f103rb\stm32f1xx_ll_exti.o: ../../../../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_exti.c
nucleo-f103rb\stm32f1xx_ll_exti.o: ../../../../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_exti.h

View file

@ -1,2 +0,0 @@
nucleo-f103rb\stm32f1xx_ll_gpio.o: ../../../../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_gpio.c
nucleo-f103rb\stm32f1xx_ll_gpio.o: ../../../../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_gpio.h

View file

@ -1,2 +0,0 @@
nucleo-f103rb\stm32f1xx_ll_i2c.o: ../../../../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_i2c.c
nucleo-f103rb\stm32f1xx_ll_i2c.o: ../../../../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_i2c.h

View file

@ -1,2 +0,0 @@
nucleo-f103rb\stm32f1xx_ll_pwr.o: ../../../../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_pwr.c
nucleo-f103rb\stm32f1xx_ll_pwr.o: ../../../../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_pwr.h

View file

@ -1,2 +0,0 @@
nucleo-f103rb\stm32f1xx_ll_rtc.o: ../../../../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rtc.c
nucleo-f103rb\stm32f1xx_ll_rtc.o: ../../../../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_rtc.h

View file

@ -1,2 +0,0 @@
nucleo-f103rb\stm32f1xx_ll_spi.o: ../../../../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_spi.c
nucleo-f103rb\stm32f1xx_ll_spi.o: ../../../../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_spi.h

View file

@ -1,2 +0,0 @@
nucleo-f103rb\stm32f1xx_ll_usart.o: ../../../../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usart.c
nucleo-f103rb\stm32f1xx_ll_usart.o: ../../../../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_usart.h

File diff suppressed because one or more lines are too long

View file

@ -75,7 +75,7 @@
<OPTFL>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<IsCurrentTarget>0</IsCurrentTarget>
<IsCurrentTarget>1</IsCurrentTarget>
</OPTFL>
<CpuCode>18</CpuCode>
<DebugOpt>
@ -103,7 +103,7 @@
<bEvRecOn>1</bEvRecOn>
<bSchkAxf>0</bSchkAxf>
<bTchkAxf>0</bTchkAxf>
<nTsel>5</nTsel>
<nTsel>0</nTsel>
<sDll></sDll>
<sDllPa></sDllPa>
<sDlgDll></sDlgDll>
@ -114,7 +114,7 @@
<tDlgDll></tDlgDll>
<tDlgPa></tDlgPa>
<tIfile></tIfile>
<pMon>STLink\ST-LINKIII-KEIL_SWO.dll</pMon>
<pMon>BIN\UL2CM3.DLL</pMon>
</DebugOpt>
<TargetDriverDllRegistry>
<SetRegEntry>
@ -130,7 +130,7 @@
<SetRegEntry>
<Number>0</Number>
<Key>DLGTARM</Key>
<Name>(1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)(100=-1,-1,-1,-1,0)(110=-1,-1,-1,-1,0)(111=-1,-1,-1,-1,0)(1011=-1,-1,-1,-1,0)(180=-1,-1,-1,-1,0)(120=100,127,658,622,0)(121=-1,-1,-1,-1,0)(122=-1,-1,-1,-1,0)(123=-1,-1,-1,-1,0)(140=-1,-1,-1,-1,0)(240=-1,-1,-1,-1,0)(190=-1,-1,-1,-1,0)(200=-1,-1,-1,-1,0)(170=-1,-1,-1,-1,0)(130=-1,-1,-1,-1,0)(131=-1,-1,-1,-1,0)(132=-1,-1,-1,-1,0)(133=-1,-1,-1,-1,0)(160=-1,-1,-1,-1,0)(161=-1,-1,-1,-1,0)(162=-1,-1,-1,-1,0)(210=-1,-1,-1,-1,0)(211=-1,-1,-1,-1,0)(220=-1,-1,-1,-1,0)(221=-1,-1,-1,-1,0)(230=-1,-1,-1,-1,0)(231=-1,-1,-1,-1,0)(232=-1,-1,-1,-1,0)(233=-1,-1,-1,-1,0)(150=-1,-1,-1,-1,0)(151=-1,-1,-1,-1,0)</Name>
<Name>(1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=204,363,702,652,0)(1009=-1,-1,-1,-1,0)(100=-1,-1,-1,-1,0)(110=-1,-1,-1,-1,0)(111=-1,-1,-1,-1,0)(1011=-1,-1,-1,-1,0)(180=-1,-1,-1,-1,0)(120=293,271,851,768,0)(121=854,376,1412,873,0)(122=-1,-1,-1,-1,0)(123=-1,-1,-1,-1,0)(140=-1,-1,-1,-1,0)(240=-1,-1,-1,-1,0)(190=-1,-1,-1,-1,0)(200=-1,-1,-1,-1,0)(170=-1,-1,-1,-1,0)(130=200,173,988,1026,0)(131=410,141,1198,994,0)(132=161,47,949,900,0)(133=966,188,1754,1041,0)(160=-1,-1,-1,-1,0)(161=-1,-1,-1,-1,0)(162=-1,-1,-1,-1,0)(210=-1,-1,-1,-1,0)(211=-1,-1,-1,-1,0)(220=-1,-1,-1,-1,0)(221=-1,-1,-1,-1,0)(230=-1,-1,-1,-1,0)(231=-1,-1,-1,-1,0)(232=-1,-1,-1,-1,0)(233=-1,-1,-1,-1,0)(150=320,247,1120,1026,0)(151=1120,301,1920,1080,0)</Name>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
@ -145,7 +145,7 @@
<SetRegEntry>
<Number>0</Number>
<Key>UL2CM3</Key>
<Name>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32F10x_128 -FS08000000 -FL020000 -FP0($$Device:STM32F103RB$Flash\STM32F10x_128.FLM))</Name>
<Name>-UAny -O206 -S8 -C0 -P00 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(0) -TO65554 -TC10000000 -TT10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC1000 -FN1 -FF0STM32F10x_128.FLM -FS08000000 -FL020000 -FP0($$Device:STM32F103RB$Flash\STM32F10x_128.FLM)</Name>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
@ -157,41 +157,30 @@
<Bp>
<Number>0</Number>
<Type>0</Type>
<LineNumber>47</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>134219058</Address>
<LineNumber>33</LineNumber>
<EnabledFlag>0</EnabledFlag>
<Address>134231986</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>1</BreakIfRCount>
<Filename>../Src/main.c</Filename>
<Filename>..\Src\Sail.c</Filename>
<ExecCommand></ExecCommand>
<Expression>\\NUCLEO_F103RB\../Src/main.c\47</Expression>
</Bp>
<Bp>
<Number>1</Number>
<Type>0</Type>
<LineNumber>44</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>134219052</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>1</BreakIfRCount>
<Filename>../Src/main.c</Filename>
<ExecCommand></ExecCommand>
<Expression>\\NUCLEO_F103RB\../Src/main.c\44</Expression>
<Expression>\\NUCLEO_F103RB\../Src/Sail.c\33</Expression>
</Bp>
</Breakpoint>
<WatchWindow1>
<Ww>
<count>0</count>
<WinNumber>1</WinNumber>
<ItemText>Main_Time</ItemText>
<ItemText>sailAngle,0x0A</ItemText>
</Ww>
<Ww>
<count>1</count>
<WinNumber>1</WinNumber>
<ItemText>dutyCycle</ItemText>
</Ww>
</WatchWindow1>
<Tracepoint>
@ -200,7 +189,7 @@
<DebugFlag>
<trace>0</trace>
<periodic>1</periodic>
<aLwin>1</aLwin>
<aLwin>0</aLwin>
<aCover>0</aCover>
<aSer1>0</aSer1>
<aSer2>0</aSer2>
@ -236,6 +225,12 @@
<pszMrulep></pszMrulep>
<pSingCmdsp></pSingCmdsp>
<pMultCmdsp></pMultCmdsp>
<SystemViewers>
<Entry>
<Name>System Viewer\ADC2</Name>
<WinId>35905</WinId>
</Entry>
</SystemViewers>
<DebugDescription>
<Enable>1</Enable>
<EnableFlashSeq>0</EnableFlashSeq>
@ -300,7 +295,7 @@
<OPTFL>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<IsCurrentTarget>1</IsCurrentTarget>
<IsCurrentTarget>0</IsCurrentTarget>
</OPTFL>
<CpuCode>18</CpuCode>
<DebugOpt>
@ -345,7 +340,7 @@
<SetRegEntry>
<Number>0</Number>
<Key>DLGDARM</Key>
<Name>(1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=1554,213,1920,450,0)(1009=-1,-1,-1,-1,0)(100=-1,-1,-1,-1,0)(110=-1,-1,-1,-1,0)(111=-1,-1,-1,-1,0)(1011=-1,-1,-1,-1,0)(180=-1,-1,-1,-1,0)(120=-1,-1,-1,-1,0)(121=1509,217,1920,660,0)(122=-1,-1,-1,-1,0)(123=-1,-1,-1,-1,0)(140=-1,-1,-1,-1,0)(240=-1,-1,-1,-1,0)(190=-1,-1,-1,-1,0)(200=-1,-1,-1,-1,0)(170=-1,-1,-1,-1,0)(130=-1,-1,-1,-1,0)(131=-1,-1,-1,-1,0)(132=1336,105,1920,897,0)(133=1148,116,1732,908,0)(160=-1,-1,-1,-1,0)(161=-1,-1,-1,-1,0)(162=-1,-1,-1,-1,0)(210=-1,-1,-1,-1,0)(211=-1,-1,-1,-1,0)(220=-1,-1,-1,-1,0)(221=-1,-1,-1,-1,0)(230=-1,-1,-1,-1,0)(234=-1,-1,-1,-1,0)(231=-1,-1,-1,-1,0)(232=-1,-1,-1,-1,0)(233=-1,-1,-1,-1,0)(150=915,87,1508,879,0)(151=-1,-1,-1,-1,0)</Name>
<Name>(1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=1554,213,1920,450,0)(1009=-1,-1,-1,-1,0)(100=-1,-1,-1,-1,0)(110=-1,-1,-1,-1,0)(111=-1,-1,-1,-1,0)(1011=-1,-1,-1,-1,0)(180=-1,-1,-1,-1,0)(120=129,555,687,1080,0)(121=924,444,1482,969,0)(122=-1,-1,-1,-1,0)(123=-1,-1,-1,-1,0)(140=-1,-1,-1,-1,0)(240=-1,-1,-1,-1,0)(190=-1,-1,-1,-1,0)(200=-1,-1,-1,-1,0)(170=-1,-1,-1,-1,0)(130=-1,-1,-1,-1,0)(131=-1,-1,-1,-1,0)(132=150,46,938,969,0)(133=0,157,788,1080,0)(160=1046,190,1640,699,0)(161=-1,-1,-1,-1,0)(162=-1,-1,-1,-1,0)(210=-1,-1,-1,-1,0)(211=-1,-1,-1,-1,0)(220=-1,-1,-1,-1,0)(221=-1,-1,-1,-1,0)(230=-1,-1,-1,-1,0)(234=-1,-1,-1,-1,0)(231=-1,-1,-1,-1,0)(232=-1,-1,-1,-1,0)(233=-1,-1,-1,-1,0)(150=130,96,930,1019,0)(151=127,38,927,961,0)</Name>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
@ -378,29 +373,12 @@
<Name>-U-O142 -O2254 -S0 -C0 -A0 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC800 -FN1 -FF0STM32F10x_128.FLM -FS08000000 -FL020000 -FP0($$Device:STM32F103RB$Flash\STM32F10x_128.FLM)</Name>
</SetRegEntry>
</TargetDriverDllRegistry>
<Breakpoint>
<Bp>
<Number>0</Number>
<Type>0</Type>
<LineNumber>84</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>134226236</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>1</BreakIfRCount>
<Filename>../Src/main.c</Filename>
<ExecCommand></ExecCommand>
<Expression>\\NUCLEO_F103RB\../Src/main.c\84</Expression>
</Bp>
</Breakpoint>
<Breakpoint/>
<WatchWindow1>
<Ww>
<count>0</count>
<WinNumber>1</WinNumber>
<ItemText>counter,0x10</ItemText>
<ItemText>secCounter</ItemText>
</Ww>
<Ww>
<count>1</count>
@ -417,6 +395,31 @@
<WinNumber>1</WinNumber>
<ItemText>angle,0x0A</ItemText>
</Ww>
<Ww>
<count>4</count>
<WinNumber>1</WinNumber>
<ItemText>displayStr</ItemText>
</Ww>
<Ww>
<count>5</count>
<WinNumber>1</WinNumber>
<ItemText>adcStatus</ItemText>
</Ww>
<Ww>
<count>6</count>
<WinNumber>1</WinNumber>
<ItemText>val1</ItemText>
</Ww>
<Ww>
<count>7</count>
<WinNumber>1</WinNumber>
<ItemText>val2</ItemText>
</Ww>
<Ww>
<count>8</count>
<WinNumber>1</WinNumber>
<ItemText>message</ItemText>
</Ww>
</WatchWindow1>
<Tracepoint>
<THDelay>0</THDelay>
@ -424,7 +427,7 @@
<DebugFlag>
<trace>0</trace>
<periodic>1</periodic>
<aLwin>1</aLwin>
<aLwin>0</aLwin>
<aCover>0</aCover>
<aSer1>0</aSer1>
<aSer2>0</aSer2>
@ -438,7 +441,7 @@
<AscS3>0</AscS3>
<aSer3>0</aSer3>
<eProf>0</eProf>
<aLa>1</aLa>
<aLa>0</aLa>
<aPa1>0</aPa1>
<AscS4>0</AscS4>
<aSer4>0</aSer4>
@ -464,9 +467,19 @@
<Wi>
<IntNumber>0</IntNumber>
<FirstString>((PORTB &amp; 0x00000100) &gt;&gt; 8 &amp; 0x100) &gt;&gt; 8</FirstString>
<SecondString>FF000000000000000000000000000000E0FFEF400100000000000000000000000000000028504F5254422026203078303030303031303029203E3E2038000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000001000000000000000000F03F1300000000000000000000000000000000000000AE110008</SecondString>
<SecondString>FF000000000000000000000000000000E0FFEF400100000000000000000000000000000028504F5254422026203078303030303031303029203E3E2038000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000001000000000000000000F03F1200000000000000000000000000000000000000AE110008</SecondString>
</Wi>
</LogicAnalyzers>
<SystemViewers>
<Entry>
<Name>System Viewer\ADC1</Name>
<WinId>35904</WinId>
</Entry>
<Entry>
<Name>System Viewer\ADC2</Name>
<WinId>35905</WinId>
</Entry>
</SystemViewers>
<DebugDescription>
<Enable>1</Enable>
<EnableFlashSeq>0</EnableFlashSeq>
@ -535,7 +548,7 @@
<GroupNumber>1</GroupNumber>
<FileNumber>5</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\Src\Sail.c</PathWithFileName>
@ -603,7 +616,7 @@
<GroupNumber>2</GroupNumber>
<FileNumber>10</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\Services\RFEmitter.c</PathWithFileName>

View file

@ -10,7 +10,7 @@
<TargetName>NUCLEO-F103RB</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>5060422::V5.06 update 4 (build 422)::ARMCC</pCCUsed>
<pCCUsed>5060750::V5.06 update 6 (build 750)::ARMCC</pCCUsed>
<uAC6>8</uAC6>
<TargetOption>
<TargetCommonOption>
@ -185,7 +185,6 @@
<uocXRam>0</uocXRam>
<RvdsVP>0</RvdsVP>
<RvdsMve>0</RvdsMve>
<RvdsCdeCp>0</RvdsCdeCp>
<hadIRAM2>0</hadIRAM2>
<hadIROM2>0</hadIROM2>
<StupSel>8</StupSel>
@ -352,7 +351,7 @@
<NoWarn>0</NoWarn>
<uSurpInc>0</uSurpInc>
<useXO>0</useXO>
<ClangAsOpt>4</ClangAsOpt>
<uClangAs>0</uClangAs>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
@ -559,7 +558,7 @@
<TargetName>Simulateur</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>5060750::V5.06 update 6 (build 750)::.\ARMCC</pCCUsed>
<pCCUsed>5060750::V5.06 update 6 (build 750)::ARMCC</pCCUsed>
<uAC6>0</uAC6>
<TargetOption>
<TargetCommonOption>
@ -734,7 +733,6 @@
<uocXRam>0</uocXRam>
<RvdsVP>0</RvdsVP>
<RvdsMve>0</RvdsMve>
<RvdsCdeCp>0</RvdsCdeCp>
<hadIRAM2>0</hadIRAM2>
<hadIROM2>0</hadIROM2>
<StupSel>8</StupSel>
@ -901,7 +899,7 @@
<NoWarn>0</NoWarn>
<uSurpInc>0</uSurpInc>
<useXO>0</useXO>
<ClangAsOpt>4</ClangAsOpt>
<uClangAs>0</uClangAs>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
@ -1120,19 +1118,4 @@
<files/>
</RTE>
<LayerInfo>
<Layers>
<Layer>
<LayName>&lt;Project Info&gt;</LayName>
<LayDesc></LayDesc>
<LayUrl></LayUrl>
<LayKeys></LayKeys>
<LayCat></LayCat>
<LayLic></LayLic>
<LayTarg>0</LayTarg>
<LayPrjMark>1</LayPrjMark>
</Layer>
</Layers>
</LayerInfo>
</Project>

View file

@ -1,20 +0,0 @@
/*
* Auto generated Run-Time-Environment Component Configuration File
* *** Do not modify ! ***
*
* Project: 'Project'
* Target: 'NUCLEO-F103RB'
*/
#ifndef RTE_COMPONENTS_H
#define RTE_COMPONENTS_H
/*
* Define the Device Header File:
*/
#define CMSIS_device_header "stm32f10x.h"
#endif /* RTE_COMPONENTS_H */

View file

@ -1,21 +0,0 @@
/*
* Auto generated Run-Time-Environment Configuration File
* *** Do not modify ! ***
*
* Project: 'Project'
* Target: 'Simulateur'
*/
#ifndef RTE_COMPONENTS_H
#define RTE_COMPONENTS_H
/*
* Define the Device Header File:
*/
#define CMSIS_device_header "stm32f10x.h"
#endif /* RTE_COMPONENTS_H */

View file

@ -4,25 +4,23 @@
const float MAX_VOLTS = 3.3;
const float MAX_CONVERTED_VALUE = 4095.0;
void ADC_conf(ADC_TypeDef *adc)
void ADC_conf(ADC_TypeDef *adc)
{
if (adc == ADC1) {
LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_ADC1);
} else if (adc == ADC2) {
LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_ADC2);
}
// Division de la frequence
RCC->CFGR |= RCC_CFGR_ADCPRE_DIV6;
// Fixe le nombre de conversion à 1
adc->SQR1 &= ADC_SQR1_L;
// Calibration
adc->CR2 |= ADC_CR2_CAL_Msk;
while ((adc->CR2 & ADC_CR2_CAL_Msk));
// Fixe le nombre de conversion <20> 1
adc->SQR1 &= ADC_SQR1_L;
// Calibration (ne fonctionne pas, mais pas necessaire donc ok)
// adc->CR2 |= ADC_CR2_CAL_Msk;
// while ((adc->CR2 & ADC_CR2_CAL_Msk));
}
@ -31,22 +29,21 @@ void ADC_start(ADC_TypeDef *adc)
adc->CR2 |= ADC_CR2_ADON;
}
uint16_t ADC_readRaw(ADC_TypeDef *adc, int channel)
{
// Indique la voie a convertir
adc->SQR3 = channel;
adc->SQR3 = channel;
// Lancement de la conversion
adc->CR2 |= ADC_CR2_ADON;
while(!(ADC1->SR & ADC_SR_EOC)) {}
adc->CR2 |= ADC_CR2_ADON;
while(!(adc->SR & ADC_SR_EOC)) {}
return ADC1->DR & ADC_DR_DATA_Msk;
return adc->DR & ADC_DR_DATA_Msk;
}
float ADC_convertToVolt(uint16_t value)
{
return ((double) value) / MAX_CONVERTED_VALUE * MAX_VOLTS;
return ((float) value) / MAX_CONVERTED_VALUE * MAX_VOLTS;
}

View file

@ -3,12 +3,46 @@
#include "stm32f1xx_ll_adc.h"
/**
* @brief Active l'horloge et calibre l'ADC donné
* @note
* @param ADC_TypeDef adc : indique l'ADC à utiliser
* @retval None
*/
void ADC_conf(ADC_TypeDef *adc);
/**
* @brief Démarre l'ADC donné
* @note
* @param ADC_TypeDef adc : indique l'ADC à utiliser
* @retval None
*/
void ADC_start(ADC_TypeDef *adc);
/**
* @brief Récupère la valeur brute donnée par l'ADC
* @note
* @param ADC_TypeDef adc : indique l'ADC à utiliser
* int channel : le channel à lire
* @retval Valeur brute lue
*/
uint16_t ADC_readRaw(ADC_TypeDef *adc, int channel);
/**
* @brief Récupère la valeur en volts donnée par l'ADC
* @note
* @param ADC_TypeDef adc : indique l'ADC à utiliser
* int channel : le channel à lire
* @retval Valeur lue en volts
*/
float ADC_readVolt(ADC_TypeDef *adc, int channel);
/**
* @brief Converti la valeur brute donnée en volts
* @note
* @param int value : La valeur à convertir
* @retval La conversion en volts
*/
float ADC_convertToVolt(uint16_t value);

View file

@ -1,37 +1,37 @@
#include "GPIO.h"
#include "stm32f1xx_ll_gpio.h"
void GPIO_conf(GPIO_TypeDef * GPIOx, uint32_t PINx, uint32_t mode, uint32_t outputType, uint32_t pullMode)
void GPIO_conf(GPIO_TypeDef * gpio, uint32_t pin, uint32_t mode, uint32_t outputType, uint32_t pullMode)
{
LL_GPIO_InitTypeDef init;
//Activation de l'horloge
if (GPIOx == GPIOA) LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_GPIOA);
else if (GPIOx == GPIOB) LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_GPIOB);
else if (GPIOx == GPIOC) LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_GPIOC);
else if (GPIOx == GPIOD) LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_GPIOD);
if (gpio == GPIOA) LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_GPIOA);
else if (gpio == GPIOB) LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_GPIOB);
else if (gpio == GPIOC) LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_GPIOC);
else if (gpio == GPIOD) LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_GPIOD);
//Configuration du PIN
LL_GPIO_StructInit(&init);
init.Pin = PINx;
init.Pin = pin;
init.Mode = mode;
//init.Speed = ;
init.OutputType = outputType;
init.Pull = pullMode;
LL_GPIO_Init(GPIOx, &init);
LL_GPIO_Init(gpio, &init);
}
void GPIO_setPin(GPIO_TypeDef * GPIOx, uint32_t PINx, int output)
void GPIO_setPin(GPIO_TypeDef * gpio, uint32_t pin, int output)
{
if (output) {
LL_GPIO_SetOutputPin(GPIOx, PINx);
LL_GPIO_SetOutputPin(gpio, pin);
} else {
LL_GPIO_ResetOutputPin(GPIOx,PINx);
LL_GPIO_ResetOutputPin(gpio,pin);
}
};
int GPIO_readPin(GPIO_TypeDef * GPIOx, uint32_t PINx)
int GPIO_readPin(GPIO_TypeDef * gpio, uint32_t pin)
{
return LL_GPIO_IsOutputPinSet(GPIOx, PINx);
return LL_GPIO_IsOutputPinSet(gpio, pin);
}

View file

@ -7,17 +7,31 @@
/**
* @brief Configure le GPIO considéré
* @brief Active l'horloge du GPIO et configure le pin donné
* @note
* @param GPIO_TypeDef * GPIOx indique le GPIO à configurer : GPIOA, GPIOB, GPIOC ou GPIOD
uint32_t PINx indique le PIN à configurer, sous la forme LL_GPIO_PIN_x
Pour une liste des modes disponibles, consulter la librairie LL
* @param GPIO_TypeDef * gpio : indique le GPIO à configurer : GPIOA, GPIOB, GPIOC ou GPIOD
* uint32_t pin : indique le PIN à configurer, sous la forme LL_GPIO_PIN_x
* @retval None
*/
void GPIO_conf(GPIO_TypeDef * GPIOx, uint32_t PINx, uint32_t mode, uint32_t outputType, uint32_t pullMode);
void GPIO_conf(GPIO_TypeDef * gpio, uint32_t pin, uint32_t mode, uint32_t outputType, uint32_t pullMode);
void GPIO_setPin(GPIO_TypeDef * GPIOx, uint32_t PINx, int output);
/**
* @brief Mets le PIN à la valeur donnée
* @note
* @param GPIO_TypeDef * gpio : indique le GPIO à configurer : GPIOA, GPIOB, GPIOC ou GPIOD
* uint32_t pin : indique le PIN à configurer, sous la forme LL_GPIO_PIN_x
* int output : valeur du pin à mettre
* @retval None
*/
void GPIO_setPin(GPIO_TypeDef * gpio, uint32_t pin, int output);
int GPIO_readPin(GPIO_TypeDef * GPIOx, uint32_t PINx);
/**
* @brief Récupère la valeur du PIN
* @note
* @param GPIO_TypeDef * gpio : indique le GPIO à configurer : GPIOA, GPIOB, GPIOC ou GPIOD
* uint32_t pin : indique le PIN à configurer, sous la forme LL_GPIO_PIN_x
* @retval 0 ou 1
*/
int GPIO_readPin(GPIO_TypeDef * gpio, uint32_t pin);
#endif

View file

@ -10,10 +10,10 @@
// variable pointeur de fonction permettant de m<>moriser le callback <20> appeler depuis
// le handler d'IT
void (*it_callback_TIM1)(void);
void (*it_callback_TIM2)(void);
void (*it_callback_TIM3)(void);
void (*it_callback_TIM4)(void);
void (*it_callback_TIM1)(void);
void (*it_callback_TIM2)(void);
void (*it_callback_TIM3)(void);
void (*it_callback_TIM4)(void);
void TIM1_UP_IRQHandler(void)
@ -21,61 +21,42 @@ void TIM1_UP_IRQHandler(void)
// rabaisser le flag d'IT
LL_TIM_ClearFlag_UPDATE(TIM1);
(*it_callback_TIM1)();
}
}
void TIM2_IRQHandler(void)
{
// rabaisser le flag d'IT
LL_TIM_ClearFlag_UPDATE(TIM2);
(*it_callback_TIM2)();
}
}
void TIM3_IRQHandler(void)
{
// rabaisser le flag d'IT
LL_TIM_ClearFlag_UPDATE(TIM3);
(*it_callback_TIM3)();
}
}
void TIM4_IRQHandler(void)
{
// rabaisser le flag d'IT
LL_TIM_ClearFlag_UPDATE(TIM4);
(*it_callback_TIM4)();
}
}
/**
* @brief Autorise les interruptions
* @note
* @param TIM_TypeDef Timer : indique le timer <EFBFBD> utiliser par le chronom<EFBFBD>tre, TIM1, TIM2, TIM3 ou TIM4
* @retval None
*/
void Timer_IT_enable(TIM_TypeDef * timer)
{
LL_TIM_EnableIT_UPDATE(timer);
}
/**
* @brief Interdit les interruptions
* @note
* @param TIM_TypeDef Timer : indique le timer <EFBFBD> utiliser par le chronom<EFBFBD>tre, TIM1, TIM2, TIM3 ou TIM4
* @retval None
*/
void Timer_IT_disable(TIM_TypeDef * timer)
{
LL_TIM_DisableIT_UPDATE(timer);
LL_TIM_DisableIT_UPDATE(timer);
}
/**
* @brief Configure le Timer consid<EFBFBD>r<EFBFBD> en interruption sur d<EFBFBD>bordement.
* @note A ce stade, les interruptions ne sont pas valid<EFBFBD>s (voir MyTimer_IT_Enable )
* @param TIM_TypeDef Timer : indique le timer <EFBFBD> utiliser par le chronom<EFBFBD>tre, TIM1, TIM2, TIM3 ou TIM4
* void (*IT_function) (void) : nom (adresse) de la fonction <EFBFBD> lancer sur interruption
* int Prio : priorit<EFBFBD> associ<EFBFBD>e <EFBFBD> l'interruption
* @retval None
*/
void Timer_IT_conf(TIM_TypeDef * timer, void (*it_callback) (void), int prio)
{
// affectation de la fonction
@ -84,80 +65,61 @@ void Timer_IT_conf(TIM_TypeDef * timer, void (*it_callback) (void), int prio)
else if (timer == TIM3) it_callback_TIM3 = it_callback;
else it_callback_TIM4 = it_callback;
// Blocage IT (il faudra la d<EFBFBD>bloquer voir fct suivante)
// Blocage IT (il faudra la debloquer voir fct suivante)
LL_TIM_DisableIT_UPDATE(timer);
// validation du canal NVIC
IRQn_Type TIM_irq;
if (timer == TIM1) TIM_irq = TIM1_UP_IRQn;
else if (timer == TIM2) TIM_irq = TIM2_IRQn;
else if (timer == TIM3) TIM_irq = TIM3_IRQn;
else TIM_irq = TIM4_IRQn;
NVIC_SetPriority(TIM_irq, prio);
NVIC_EnableIRQ(TIM_irq);
}
/****************************************************************************
* TIMER
***************************************************************************/
/**
* @brief D<EFBFBD>marre le timer consid<EFBFBD>r<EFBFBD> et active les interruptions
* @note
* @param TIM_TypeDef Timer : indique le timer <EFBFBD> utiliser par le chronom<EFBFBD>tre, TIM1, TIM2, TIM3 ou TIM4
* @retval None
*/
void Timer_start(TIM_TypeDef * timer)
{
LL_TIM_EnableCounter(timer);
}
/**
* @brief Arr<EFBFBD>t le timer consid<EFBFBD>r<EFBFBD> et d<EFBFBD>sactive les interruptions
* @note
* @param TIM_TypeDef Timer : indique le timer <EFBFBD> utiliser par le chronom<EFBFBD>tre, TIM1, TIM2, TIM3 ou TIM4
* @retval None
*/
void Timer_stop(TIM_TypeDef * timer)
{
LL_TIM_DisableCounter(timer);
}
/**
* @brief Active l'horloge et r<EFBFBD>gle l'ARR et le PSC du timer vis<EFBFBD>.
* @note Fonction <EFBFBD> lancer avant toute autre. Le timer n'est pas encore lanc<EFBFBD> (voir Timer_start)
* @param TIM_TypeDef Timer : indique le timer <EFBFBD> utiliser par le chronom<EFBFBD>tre, TIM1, TIM2, TIM3 ou TIM4
* int Arr : valeur <EFBFBD> placer dans ARR
* int Psc : valeur <EFBFBD> placer dans PSC
* @retval None
*/
void Timer_conf(TIM_TypeDef * timer, int arr, int psc)
{
LL_TIM_InitTypeDef init_struct;
// Validation horloge locale
if (timer == TIM1) LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_TIM1);
else if (timer == TIM2) LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_TIM2);
else if (timer == TIM3) LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_TIM3);
else LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_TIM4);
// chargement structure Arr, Psc, Up Count
init_struct.Autoreload = arr;
init_struct.Prescaler = psc;
init_struct.ClockDivision = LL_TIM_CLOCKDIVISION_DIV1;
init_struct.CounterMode = LL_TIM_COUNTERMODE_UP;
init_struct.RepetitionCounter = 0;
LL_TIM_Init(timer,&init_struct);
// Blocage interruptions
Timer_IT_disable(timer);
// Blocage Timer
Timer_stop(timer);
}
@ -165,61 +127,63 @@ void Timer_conf(TIM_TypeDef * timer, int arr, int psc)
/****************************************************************************
* PWM INPUT
***************************************************************************/
void PWMi_conf(TIM_TypeDef * TIMx, int channel){
//Periode à recuperer dans TIMx_CCR1, duty cycle dans TIMx_CCR2. Seul les 2 premiers channels peuvent être utilisés (cf 315).
void Timer_pwmi_conf(TIM_TypeDef * TIMx, int channel)
{
// Periode à recuperer dans TIMx_CCR1, duty cycle dans TIMx_CCR2. Seul les 2 premiers channels peuvent être utilisés (cf 315).
// Validation horloge locale
if (TIMx == TIM1) LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_TIM1);
else if (TIMx == TIM2) LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_TIM2);
else if (TIMx == TIM3) LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_TIM3);
else LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_TIM4);
if (channel == 1) {
//
TIMx -> CCMR1 |= TIM_CCMR1_CC1S_0;
TIMx -> CCMR1 |= TIM_CCMR1_CC2S_1;
//TIM_CCMR1_IC1F_0; Potentiellement utile, à voir plus tard
TIMx->CCMR1 |= TIM_CCMR1_CC1S_0;
TIMx->CCMR1 |= TIM_CCMR1_CC2S_1;
//On met le channel principal en rising edge, le secondaire en falling edge
TIMx -> CCER &= ~TIM_CCER_CC1P;
TIMx -> CCER |= TIM_CCER_CC2P;
TIMx -> SMCR |= TIM_SMCR_TS_0 | TIM_SMCR_TS_2; //101
TIMx -> SMCR |= TIM_SMCR_SMS_2; //100
// TIM_CCMR1_IC1F_0; Potentiellement utile, à voir plus tard
// On met le channel principal en rising edge, le secondaire en falling edge
TIMx->CCER &= ~TIM_CCER_CC1P;
TIMx->CCER |= TIM_CCER_CC2P;
TIMx->SMCR |= TIM_SMCR_TS_0 | TIM_SMCR_TS_2; //101
TIMx->SMCR |= TIM_SMCR_SMS_2; //100
}
else {
TIMx -> CCMR1 |= TIM_CCMR1_CC1S_1;
TIMx -> CCMR1 |= TIM_CCMR1_CC2S_0;
TIMx -> CCER |= TIM_CCER_CC1P;
TIMx -> CCER &= ~TIM_CCER_CC2P;
TIMx->CCMR1 |= TIM_CCMR1_CC1S_1;
TIMx->CCMR1 |= TIM_CCMR1_CC2S_0;
TIMx -> SMCR |= TIM_SMCR_TS_1 | TIM_SMCR_TS_2; //110
TIMx -> SMCR |= TIM_SMCR_SMS_2; //100
TIMx->CCER |= TIM_CCER_CC1P;
TIMx->CCER &= ~TIM_CCER_CC2P;
TIMx->SMCR |= TIM_SMCR_TS_1 | TIM_SMCR_TS_2; //110
TIMx->SMCR |= TIM_SMCR_SMS_2; //100
}
//On met les prescalers à 0, on veut compter chaque transition
// On met les prescalers à 0, on veut compter chaque transition
TIMx -> CCMR1 &= ~TIM_CCMR1_IC1PSC;
TIMx -> CCMR1 &= ~TIM_CCMR1_IC2PSC;
TIMx -> CCER |= TIM_CCER_CC1E | TIM_CCER_CC2E;
//TIMx -> DIER |= TIM_DIER_CC1IE; gestion des interrupts, probablement pas utile
//TIM_DIER_CC1DE_Pos; Probablement pas utile
// TIMx -> DIER |= TIM_DIER_CC1IE; gestion des interrupts, probablement pas utile
// TIM_DIER_CC1DE_Pos; Probablement pas utile
}
int PWMi_getPeriod(TIM_TypeDef * TIMx) {
return TIMx -> CCR1;
int Timer_pwmi_getPeriod(TIM_TypeDef * TIMx)
{
return TIMx->CCR1;
}
int PWMi_getDutyCycle(TIM_TypeDef * TIMx) {
return TIMx -> CCR2;
float Timer_pwmi_getDutyCycle(TIM_TypeDef * TIMx) {
const float arr = (float)LL_TIM_GetAutoReload(TIMx);
float duty_cycle = (float)TIMx->CCR2 / arr;
return duty_cycle;
}
/****************************************************************************
@ -237,11 +201,11 @@ void Timer_pwmo_conf(TIM_TypeDef * timer, int channel, float freq, float dutyCyc
Timer_conf(timer, arr, 1000);
LL_TIM_OC_InitTypeDef init_struct;
LL_TIM_OC_StructInit(&init_struct);
init_struct.OCMode = LL_TIM_OCMODE_PWM1;
init_struct.OCState = LL_TIM_OCSTATE_ENABLE;
init_struct.CompareValue= dutyCycle * arr;
LL_TIM_OC_Init(timer, channel, &init_struct);
}
@ -265,10 +229,14 @@ float Timer_pwmo_getDutyCycle(TIM_TypeDef * timer, int channel)
{
int compare = 0;
const int arr = LL_TIM_GetAutoReload(timer);
if (channel == LL_TIM_CHANNEL_CH1) compare = LL_TIM_OC_GetCompareCH1(timer);
else if (channel == LL_TIM_CHANNEL_CH2) compare = LL_TIM_OC_GetCompareCH2(timer);
else if (channel == LL_TIM_CHANNEL_CH3) compare = LL_TIM_OC_GetCompareCH3(timer);
else compare = LL_TIM_OC_GetCompareCH4(timer);
if (channel == LL_TIM_CHANNEL_CH1)
compare = LL_TIM_OC_GetCompareCH1(timer);
else if (channel == LL_TIM_CHANNEL_CH2)
compare = LL_TIM_OC_GetCompareCH2(timer);
else if (channel == LL_TIM_CHANNEL_CH3)
compare = LL_TIM_OC_GetCompareCH3(timer);
else
compare = LL_TIM_OC_GetCompareCH4(timer);
return ((float) compare) / ((float) arr);
}
@ -278,18 +246,22 @@ float Timer_pwmo_getDutyCycle(TIM_TypeDef * timer, int channel)
void Timer_encoder_conf(TIM_TypeDef * timer)
{
Timer_conf(timer, 359, 0);
// L'encodeur compte 2 tours quand on en fait qu'un, donc on divise l'angle
// par deux avant de le renvoyer. Il faut donc un autoreload de 360 * 2 = 720
Timer_conf(timer, 719, 0);
LL_TIM_ENCODER_InitTypeDef init_struct;
LL_TIM_ENCODER_StructInit(&init_struct);
init_struct.EncoderMode = LL_TIM_ENCODERMODE_X2_TI1;
LL_TIM_ENCODER_Init(timer, &init_struct);
}
int Timer_encoder_getAngle(TIM_TypeDef * timer)
{
return LL_TIM_GetCounter(timer);
// L'encodeur compte 2 tours quand on en fait qu'un, donc on divise l'angle
// par deux avant de le renvoyer
return LL_TIM_GetCounter(timer)/2;
}
enum CounterDirection Timer_encoder_getDirection(TIM_TypeDef * timer)

View file

@ -14,10 +14,30 @@ enum CounterDirection {
* INTERRUPTIONS
***************************************************************************/
/**
* @brief Autorise les interruptions
* @note
* @param TIM_TypeDef Timer : indique le timer <EFBFBD> utiliser par le chronom<EFBFBD>tre, TIM1, TIM2, TIM3 ou TIM4
* @retval None
*/
void Timer_IT_enable(TIM_TypeDef * timer);
/**
* @brief Interdit les interruptions
* @note
* @param TIM_TypeDef Timer : indique le timer <EFBFBD> utiliser par le chronom<EFBFBD>tre, TIM1, TIM2, TIM3 ou TIM4
* @retval None
*/
void Timer_IT_disable(TIM_TypeDef * timer);
/**
* @brief Configure le Timer consid<EFBFBD>r<EFBFBD> en interruption sur d<EFBFBD>bordement.
* @note A ce stade, les interruptions ne sont pas valid<EFBFBD>s (voir MyTimer_IT_Enable )
* @param TIM_TypeDef Timer : indique le timer <EFBFBD> utiliser par le chronom<EFBFBD>tre, TIM1, TIM2, TIM3 ou TIM4
* void (*IT_function) (void) : nom (adresse) de la fonction <EFBFBD> lancer sur interruption
* int Prio : priorit<EFBFBD> associ<EFBFBD>e <EFBFBD> l'interruption
* @retval None
*/
void Timer_IT_conf(TIM_TypeDef * timer, void (*it_callback) (void), int prio);
@ -25,45 +45,60 @@ void Timer_IT_conf(TIM_TypeDef * timer, void (*it_callback) (void), int prio);
* TIMER
***************************************************************************/
/**
* @brief Active l'horloge et r<EFBFBD>gle l'ARR et le PSC du timer vis<EFBFBD>
* @note Fonction <EFBFBD> lancer avant toute autre. Le timer n'est pas encore lanc<EFBFBD> (voir MyTimerStart)
* @param TIM_TypeDef Timer : indique le timer <EFBFBD> utiliser par le chronom<EFBFBD>tre, TIM1, TIM2, TIM3 ou TIM4
* int Arr : valeur <EFBFBD> placer dans ARR
* int Psc : valeur <EFBFBD> placer dans PSC
* @retval None
*/
void Timer_conf(TIM_TypeDef * timer, int arr, int psc);
/**
* @brief D<EFBFBD>marre le timer consid<EFBFBD>r<EFBFBD>
* @brief Démarre le timer considéré
* @note
* @param TIM_TypeDef Timer : indique le timer <EFBFBD> utiliser par le chronom<EFBFBD>tre, TIM1, TIM2, TIM3 ou TIM4
* @retval None
*/
void Timer_start(TIM_TypeDef * timer);
/**
* @brief Arr<EFBFBD>t le timer consid<EFBFBD>r<EFBFBD>
* @brief Arrête le timer considéré
* @note
* @param TIM_TypeDef Timer : indique le timer <EFBFBD> utiliser par le chronom<EFBFBD>tre, TIM1, TIM2, TIM3 ou TIM4
* @retval None
*/
void Timer_stop(TIM_TypeDef * timer);
/**
* @brief Active l'horloge et regle l'ARR et le PSC du timer visé
* @param TIM_TypeDef Timer : indique le timer à utiliser
* int Arr : valeur à placer dans ARR
* int Psc : valeur à placer dans PSC
* @retval None
*/
void Timer_conf(TIM_TypeDef * timer, int arr, int psc);
/****************************************************************************
* PWM INPUT
***************************************************************************/
void PWMi_conf(TIM_TypeDef * timer, int channel);
/**
* @brief Configure le timer en mode PWM input
* @note
* @param TIM_TypeDef Timer : indique le timer à utiliser : TIM1, TIM2, TIM3 ou TIM4
* int channel : Le channel utilisé par la PWM (pas LL)
* @retval None
*/
void Timer_pwmi_conf(TIM_TypeDef * timer, int channel);
int PWMi_getDutyCycle(TIM_TypeDef * timer);
/**
* @brief Récupère le duty cycle de la PWM donnée
* @note
* @param TIM_TypeDef Timer : indique le timer à utiliser
* @retval None
*/
float Timer_pwmi_getDutyCycle(TIM_TypeDef * timer);
int PWMi_getPeriod(TIM_TypeDef * TIMx);
/**
* @brief Récupère la période de la PWM donnée
* @note
* @param TIM_TypeDef Timer : indique le timer à utiliser
* @retval None
*/
int Timer_pwmi_getPeriod(TIM_TypeDef * timer);
/****************************************************************************
* PWM OUTPUT

View file

@ -3,22 +3,22 @@
#include "stm32f1xx_ll_bus.h" // Pour horloge
void Usart_conf(USART_TypeDef *USARTx)
void USART_conf(USART_TypeDef *usart)
{
int txPin;
GPIO_TypeDef *usartGpio;
if (USARTx == USART1) {
if (usart == USART1) {
LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_USART1);
LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_GPIOA);
txPin = LL_GPIO_PIN_9;
usartGpio = GPIOA;
} else if (USARTx == USART2) {
} else if (usart == USART2) {
LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_USART2);
LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_GPIOA);
txPin = LL_GPIO_PIN_2;
usartGpio = GPIOA;
} else if (USARTx == USART3) {
} else if (usart == USART3) {
LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_USART3);
LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_GPIOB);
txPin = LL_GPIO_PIN_10;
@ -30,30 +30,26 @@ void Usart_conf(USART_TypeDef *USARTx)
usartInit.DataWidth = LL_USART_DATAWIDTH_8B;
usartInit.BaudRate = 9600;
usartInit.TransferDirection = LL_USART_DIRECTION_TX_RX;
LL_USART_Init(USARTx, &usartInit);
LL_USART_Init(usart, &usartInit);
GPIO_conf(usartGpio, txPin, LL_GPIO_MODE_ALTERNATE, LL_GPIO_OUTPUT_PUSHPULL, LL_GPIO_PULL_UP);
}
void Usart_enable(USART_TypeDef *USARTx)
void USART_start(USART_TypeDef *usart)
{
LL_USART_Enable(USARTx);
LL_USART_Enable(usart);
}
void sendChar(USART_TypeDef *USARTx, char c)
void sendChar(USART_TypeDef *usart, char c)
{
LL_USART_TransmitData8(USARTx, c);
while (!LL_USART_IsActiveFlag_TXE(USARTx)) {}
LL_USART_TransmitData8(usart, c);
while (!LL_USART_IsActiveFlag_TXE(usart)) {}
}
void Usart_send(USART_TypeDef *USARTx, char *msg, int length)
void USART_send(USART_TypeDef *usart, char *msg, int length)
{
for (int i = 0; i < length; i++) {
sendChar(USARTx, msg[i]);
sendChar(usart, msg[i]);
}
}

View file

@ -3,8 +3,30 @@
#include "stm32f1xx_ll_usart.h"
void Usart_conf(USART_TypeDef *USARTx);
void Usart_enable(USART_TypeDef *USARTx);
void Usart_send(USART_TypeDef *USARTx, char *msg, int length);
/**
* @brief Active l'horloge de l'USART et configure le pin associé
* @note
* @param USART_TypeDef * usart : indique l'USART à configurer
* @retval None
*/
void USART_conf(USART_TypeDef *USARTx);
/**
* @brief Démarre l'USART
* @note
* @param USART_TypeDef * usart : indique l'USART à configurer
* @retval None
*/
void USART_start(USART_TypeDef *USARTx);
/**
* @brief envoie le message donné par l'USART
* @note
* @param USART_TypeDef * usart : indique l'USART à configurer
* char msg : Le message à envoyer
* int length : La longueur du message
* @retval None
*/
void USART_send(USART_TypeDef *USARTx, char *msg, int length);
#endif

View file

@ -1,6 +1,7 @@
#include "Accelerometer.h"
#include "ADC.h"
#include "math.h"
#include "stdio.h"
#define M_PI 3.14159265358979323846
@ -8,8 +9,10 @@
// Donc sensibilité de +- 480 mv/g
const float ZERO_G = 1.65; // 0 g
const float SENSITIVITY = 0.48;
const float ZERO_G = 1.27; // 0 g
const float SENSITIVITY = 1.35-0.9;
// max: 1.75
// min: 0.935
void Accelerometer_conf(ADC_TypeDef *adc, GPIO_TypeDef * gpio, int pinx, int piny)
{
@ -35,10 +38,11 @@ float voltsToG(float volts)
int Accelerometer_getAngle(ADC_TypeDef *adc, int channel)
{
const float readG = voltsToG(ADC_readVolt(adc, channel));
const float readV = ADC_readVolt(adc, channel);
const float readG = voltsToG(readV);
float angleRad = asin(readG);
int angleDeg = angleRad * (180/M_PI);
return angleDeg;
}

View file

@ -4,10 +4,32 @@
#include "GPIO.h"
#include "stm32f1xx_ll_adc.h"
/**
* @brief Configure l'ADC et les GPIO de l'accéléromètre
* @note
* @param adc : ADC utilisé pour convertir les valeurs
* gpio : Gpio utilisé par l'accéléromètre
* pinx : Pin pour l'axe X
* piny : Pin pour l'axe Y
* @retval None
*/
void Accelerometer_conf(ADC_TypeDef *adc, GPIO_TypeDef * gpio, int pinx, int piny);
/**
* @brief Démarre l'ADC de l'accéléromètre
* @note
* @param None
* @retval None
*/
void Accelerometer_start(ADC_TypeDef *adc);
/**
* @brief Récupère l'angle de l'accéléromètre lié au channel donné
* @note
* @param adc : ADC utilisé pour convertir les valeurs
* channel : channel utilisé par l'axe
* @retval L'ange en degrès de l'axe choisi
*/
int Accelerometer_getAngle(ADC_TypeDef *adc, int channel);
#endif

View file

@ -1,20 +1,29 @@
#include "DCMotor.h"
#include "math.h"
void DCMotor_conf(TIM_TypeDef * timer, int channel, GPIO_TypeDef * gpio, int pin)
const int MOTOR_PWM_FREQ = 50;
void DCMotor_conf(TIM_TypeDef * timer, int channel, GPIO_TypeDef * gpioPwm, int pinPwm, GPIO_TypeDef * gpioDirection, int pinDirection)
{
//On règle la vitesse en valeur absolue, ici à 0
Timer_pwmo_conf(timer, channel, 50, 0);
//On règle le sens du moteur, ici sens direct (?)
GPIO_conf(gpio, pin, LL_GPIO_MODE_OUTPUT, LL_GPIO_OUTPUT_OPENDRAIN, LL_GPIO_PULL_DOWN);
GPIO_setPin(gpio, pin, 0);
// On regle la vitesse en valeur absolue, ici a 0
Timer_pwmo_conf(timer, channel, MOTOR_PWM_FREQ, 0);
// Configuration du GPIO
GPIO_conf(gpioPwm, pinPwm, LL_GPIO_MODE_ALTERNATE, LL_GPIO_OUTPUT_PUSHPULL, LL_GPIO_PULL_UP);
// On regle le sens du moteur
GPIO_conf(gpioDirection, pinDirection, LL_GPIO_MODE_OUTPUT, LL_GPIO_OUTPUT_PUSHPULL, LL_GPIO_PULL_DOWN);
GPIO_setPin(gpioDirection, pinDirection, 0);
Timer_start(timer);
}
void DCMotor_setSpeed(TIM_TypeDef * timer, int channel, GPIO_TypeDef * gpio, int pin, float speed)
{
const int dir = (speed > 0.) ? 1 : 0;
const int dir = speed > 0.0;
Timer_pwmo_setDutyCycle(timer, channel, fabs(speed));
GPIO_setPin(gpio, pin, dir);
}
@ -23,6 +32,5 @@ float DCMotor_getSpeed(TIM_TypeDef * timer, int channel, GPIO_TypeDef * gpio, in
{
const float speedAbs = Timer_pwmo_getDutyCycle(timer, channel);
const int dir = GPIO_readPin(gpio, pin);
return dir ? speedAbs : -speedAbs;
}

View file

@ -4,10 +4,39 @@
#include "GPIO.h"
#include "Timer.h"
void DCMotor_conf(TIM_TypeDef * timer, int channel, GPIO_TypeDef * gpio, int pin);
/**
* @brief Configure le Timer et le GPIO du DCmotor
* @note
* @param timer : Timer utilise pour controler le moteur
* channel : channel du timer
* gpio : GPIO utilise pour regler le sens du moteur
* pin : Pin pour l'axe Y
* @retval None
*/
void DCMotor_conf(TIM_TypeDef * timer, int channel, GPIO_TypeDef * gpioPwm, int pinPwm, GPIO_TypeDef * gpioDirection, int pinDirection);
/**
* @brief Configure le Timer et le GPIO du DCmotor
* @note
* @param timer : Timer utilise pour controler le moteur
* channel : channel du timer
* gpio : GPIO utilise pour regler le sens du moteur
* pin : Pin pour l'axe Y
* speed : vitesse voulue
* @retval None
*/
void DCMotor_setSpeed(TIM_TypeDef * timer, int channel, GPIO_TypeDef * gpio, int pin, float speed);
/**
* @brief Recupere la vitesse actuelle du moteur
* @note
* @param timer : Timer utilise pour controler le moteur
* channel : channel du timer
* gpio : GPIO utilise pour regler le sens du moteur
* pin : Pin pour l'axe Y
* speed : vitesse voulue
* @retval None
*/
float DCMotor_getSpeed(TIM_TypeDef * timer, int channel, GPIO_TypeDef * gpio, int pin);
#endif

View file

@ -4,34 +4,36 @@
#include "stm32f103xb.h"
/**
* @brief Configure le codeur incrémental associé au timer donné
* @note
* @param TIM_TypeDef Timer : indique le timer à utiliser : TIM1, TIM2, TIM3 ou TIM4
* @brief Configure le timer et le pin du gpio pour le codeur incremental
* @note
* @param TIM_TypeDef timer : le timer a utiliser
* GPIO_TypeDef gpio : le gpio a utiliser pour le zero
* int pin : le pin associe au GPIO pour le zero
* @retval None
*/
void IncrementalEncoder_conf(TIM_TypeDef * timer, GPIO_TypeDef * gpio, int pin);
/**
* @brief Démarre le codeur incrémental associé au timer donné
* @note
* @param TIM_TypeDef Timer : indique le timer à utiliser : TIM1, TIM2, TIM3 ou TIM4
* @brief Demarre le timer pour le codeur incremental
* @note
* @param TIM_TypeDef timer : le timer a utiliser
* @retval None
*/
void IncrementalEncoder_start(TIM_TypeDef * timer);
/**
* @brief Récupère l'angle du codeur incrémental associé au timer donné
* @note
* @param TIM_TypeDef Timer : indique le timer à utiliser : TIM1, TIM2, TIM3 ou TIM4
* @retval int angle
* @brief Recupere l'angle du codeur incremental associe au timer donne
* @note
* @param TIM_TypeDef timer : le timer a utiliser
* @retval L'angle en degres
*/
int IncrementalEncoder_getAngle(TIM_TypeDef * timer);
/**
* @brief Récupère la direction du codeur incrémental associé au timer donné
* @note
* @param TIM_TypeDef Timer : indique le timer à utiliser : TIM1, TIM2, TIM3 ou TIM4
* @retval int dir
* @brief Recupere la direction du codeur incremental associe au timer donne
* @note
* @param TIM_TypeDef timer : le timer a utiliser
* @retval la direction actuelle du codeur
*/
enum CounterDirection IncrementalEncoder_getDirection(TIM_TypeDef * timer);

View file

@ -1,16 +1,28 @@
#include "RFEmitter.h"
#include "GPIO.h"
void RFEmitter_conf(USART_TypeDef * usart)
void RFEmitter_conf(USART_TypeDef * usart, GPIO_TypeDef *gpioTXEnable, int pinTXEnable)
{
Usart_conf(usart);
// Configuration du pin TXEnable
GPIO_conf(gpioTXEnable, pinTXEnable, LL_GPIO_MODE_OUTPUT, LL_GPIO_OUTPUT_PUSHPULL, 0);
// Configuration de l'USART
USART_conf(usart);
}
void RFEmitter_start(USART_TypeDef * usart)
{
Usart_enable(usart);
USART_start(usart);
}
void RFEmitter_send(USART_TypeDef * usart, char * message, int longueur)
void RFEmitter_send(USART_TypeDef * usart, char * message, int longueur, GPIO_TypeDef *gpioTXEnable, int pinTXEnable)
{
Usart_send(usart, message, longueur);
// set PA11 (TXEnable)
GPIO_setPin(gpioTXEnable, pinTXEnable, 1);
// Envoi du message
USART_send(usart, message, longueur);
// reset PA11 (TXEnable)
GPIO_setPin(gpioTXEnable, pinTXEnable, 0);
}

View file

@ -3,11 +3,35 @@
#include "USART.h"
void RFEmitter_conf(USART_TypeDef * usart);
/**
* @brief Configure l'USART et le pin du gpio pour l'émetteur
* @note
* @param USART_TypeDef usart : l'usart à utiliser pour transmettre les informations
* GPIO_TypeDef gpioTXEnable : le gpio à utiliser pour activer l'emetteur
* int pinTXEnable : le pin associé au GPIO
* @retval None
*/
void RFEmitter_conf(USART_TypeDef * usart, GPIO_TypeDef *gpioTXEnable, int pinTXEnable);
/**
* @brief Démarre l'USART l'émetteur
* @note
* @param USART_TypeDef usart : l'usart à utiliser pour transmettre les informations
* @retval None
*/
void RFEmitter_start(USART_TypeDef * usart);
void RFEmitter_send(USART_TypeDef * usart, char * message, int longueur);
/**
* @brief Envoie le message donnée par l'émetteur
* @note
* @param USART_TypeDef usart : l'usart à utiliser pour transmettre les informations
* char message : le message à envoyer
* int longueur : la longueur du message
* GPIO_TypeDef gpioTXEnable : le gpio à utiliser pour activer l'emetteur
* int pinTXEnable : le pin associé au GPIO
* @retval None
*/
void RFEmitter_send(USART_TypeDef * usart, char * message, int longueur, GPIO_TypeDef *gpioTXEnable, int pinTXEnable);
#endif

View file

@ -2,14 +2,10 @@
void RFReceiver_conf(TIM_TypeDef * timer, int channel)
{
PWMi_conf(timer, channel);
Timer_pwmi_conf(timer, channel);
}
float RFReceiver_getData(TIM_TypeDef * timer)
{
const int duty_cycle = PWMi_getDutyCycle(timer);
const int period = PWMi_getPeriod(timer);
const float duree_impulsion = duty_cycle * period;
return (duree_impulsion -1) * 200 - 100;
return Timer_pwmi_getDutyCycle(timer);
}

View file

@ -3,8 +3,21 @@
#include "Timer.h"
/**
* @brief Configure le timer en PWM pour recevoir des données
* @note
* @param TIM_TypeDef timer : le timer à utiliser
* int channel : le channel du timer
* @retval None
*/
void RFReceiver_conf(TIM_TypeDef * timer, int channel);
/**
* @brief Lis les données envoyées à la PWM par le recepteur
* @note
* @param TIM_TypeDef timer : le timer à utiliser
* @retval la durée de l'impulsion
*/
float RFReceiver_getData(TIM_TypeDef * timer);
#endif

View file

@ -12,7 +12,7 @@
void Scheduler_conf(void (*it_callback) (void));
/**
* @brief Démarre ordonanceur
* @brief Démarre l'ordonanceur
* @note
* @param None
* @retval None

View file

@ -13,13 +13,23 @@ void ServoMotor_start(TIM_TypeDef * timer)
Timer_start(timer);
}
float convertAngleToDutyCycle(int angle) {
// fonction lineaire [0 - 90] -> [0.05 - 0.1]
return (float)angle / 1800.0 + 0.05;
}
int convertDutyCycleToAngle(float dutyCycle) {
// fonction lineaire [0.049 - 0.1] -> [0 - 90]
return (dutyCycle - 0.049) * 1800;
}
void ServoMotor_setAngle(TIM_TypeDef * timer, int channel, int angle)
{
Timer_pwmo_setDutyCycle(timer, channel, ((float) angle) / 359.0);
Timer_pwmo_setDutyCycle(timer, channel, convertAngleToDutyCycle(angle));
}
int ServoMotor_getAngle(TIM_TypeDef * timer, int channel)
{
const float dutyCycle = Timer_pwmo_getDutyCycle(timer, channel);
return 359 * dutyCycle;
return convertDutyCycleToAngle(dutyCycle);
}

View file

@ -6,7 +6,7 @@
#include "GPIO.h"
/**
* @brief Configure le servo moteur associé au timer donné
* @brief Configure le timer PWM et le GPIO pour le servo moteur
* @note
* @param TIM_TypeDef Timer : indique le timer à utiliser : TIM1, TIM2, TIM3 ou TIM4
* int channel : Le channel utilisé par le servo moteur
@ -17,7 +17,7 @@
void ServoMotor_conf(TIM_TypeDef * timer, int channel, GPIO_TypeDef * gpio, int pin);
/**
* @brief Démarre les servo moteurs associés au timer donné
* @brief Démarre la PWM du servo moteur
* @note
* @param TIM_TypeDef Timer : indique le timer à utiliser : TIM1, TIM2, TIM3 ou TIM4
* @retval None
@ -39,7 +39,7 @@ void ServoMotor_setAngle(TIM_TypeDef * timer, int channel, int angle);
* @note
* @param TIM_TypeDef Timer : indique le timer à utiliser : TIM1, TIM2, TIM3 ou TIM4
* int channel : Le channel utilisé par le servo moteur
* @retval int angle
* @retval L'angle en degrès
*/
int ServoMotor_getAngle(TIM_TypeDef * timer, int channel);

View file

@ -17,5 +17,6 @@ void Voltage_start(ADC_TypeDef * adc)
float Voltage_getVoltage(ADC_TypeDef * adc, int channel)
{
return ADC_readVolt(adc, channel);
// 13 * la valeur de l'ADC, car pont diviseur de tension en amont de l'ADC
return 13.0f * ADC_readVolt(adc, channel);
}

View file

@ -4,10 +4,30 @@
#include "ADC.h"
#include "GPIO.h"
/**
* @brief Configure le GPIO et l'ADC pour lire les données de la batterie
* @note
* @param ADC_TypeDef adc : l'ADC à utiliser
* GPIO_TypeDef gpio : le GPIO à utiliser
* int pin : le pin à utiliser
* @retval None
*/
void Voltage_conf(ADC_TypeDef * adc, GPIO_TypeDef * gpio, int pin);
/**
* @brief Démarre l'ADC pour lire les données de la batterie
* @note
* @param ADC_TypeDef adc : l'ADC à utiliser
* @retval None
*/
void Voltage_start(ADC_TypeDef * adc);
/**
* @brief Récupère la tension de la batterie
* @note
* @param ADC_TypeDef adc : l'ADC à utiliser
* @retval La tension
*/
float Voltage_getVoltage(ADC_TypeDef * adc, int channel);
#endif

View file

@ -1,18 +1,25 @@
#include "Display.h"
#include "Voltage.h"
#include "RFEmitter.h"
#include "Sail.h"
#include "stdio.h"
#include "string.h"
// Composants utilisés par l'emetteur
USART_TypeDef * EMITTER_USART = USART1;
GPIO_TypeDef * EMITTER_GPIO = GPIOA;
const int EMITTER_PIN = LL_GPIO_PIN_11;
// Composants utilisés par la batterie
ADC_TypeDef * VOLTAGE_ADC = ADC2;
const int VOLTAGE_CHANNEL = LL_ADC_CHANNEL_12;
const int VOLTAGE_CHANNEL = 12;
GPIO_TypeDef * VOLTAGE_GPIO = GPIOC;
const int VOLTAGE_PIN = LL_GPIO_PIN_2;
void Display_conf()
{
Voltage_conf(VOLTAGE_ADC, VOLTAGE_GPIO, VOLTAGE_PIN);
RFEmitter_conf(EMITTER_USART);
RFEmitter_conf(EMITTER_USART, EMITTER_GPIO, EMITTER_PIN);
}
void Display_start()
@ -21,7 +28,36 @@ void Display_start()
RFEmitter_start(EMITTER_USART);
}
void Display_background()
void Display_background(int secCounter)
{
float voltage = Voltage_getVoltage(ADC2, LL_ADC_CHANNEL_12);
static int previousEmergencyState = 0;
static int prevSendSec = 0;
const int emergency = Sail_getEmergencyState();
if (secCounter - prevSendSec == 1 || (emergency && !previousEmergencyState)) {
previousEmergencyState = emergency;
prevSendSec = secCounter;
const float voltage = Voltage_getVoltage(VOLTAGE_ADC, VOLTAGE_CHANNEL);
const int sailAngle = Sail_getSailAngle();
const int sailPercent = sailAngle * 100 / 90.0;
// const int relativeAngle = sailAngle >= 180 ? 360 - sailAngle : sailAngle;
// const int sailPercent = (90 - relativeAngle) * 100 / 90;
char displayStr[100] = "";
char emergStr[30] = "";
if (emergency) {
sprintf(emergStr, "Limite de roulis atteinte !\n\r");
RFEmitter_send(EMITTER_USART, emergStr, strlen(emergStr), EMITTER_GPIO, EMITTER_PIN);
}
sprintf(displayStr, "Angle de la voile : %ddeg\n\rBordage actuel = %d%% \n\rTension de la batterie = %fV \n\r\n\r", sailAngle, sailPercent, voltage);
RFEmitter_send(EMITTER_USART, displayStr, strlen(displayStr), EMITTER_GPIO, EMITTER_PIN);
}
previousEmergencyState = emergency;
}

View file

@ -1,10 +1,29 @@
#ifndef DISPLAY_H
#define DISPLAY_H
/**
* @brief Configure l'ADC de la batterie et le RFEmitter pour l'affichage
* @note
* @param None
* @retval None
*/
void Display_conf(void);
/**
* @brief Démarre l'ADC de la batterie et le RFEmitter
* @note
* @param None
* @retval None
*/
void Display_start(void);
void Display_background(void);
/**
* @brief Envoie au pupitre toutes les 3 secondes le bordage et la tension de la batterie.
* Si jamais l'alarme de roulis est déclenchée, elle sera tout de suite envoyée au pupitre.
* @note
* @param secCounter : Nombre de secondes écoulées depuis le début du programme
* @retval None
*/
void Display_background(int secCounter);
#endif

View file

@ -1,31 +1,40 @@
#include "Orientation.h"
#include "math.h"
#define THRESHOLD 30
const float THRESHOLD = 0.05;
const float MIN_DUTY_CYCLE = 0.05;
const float ZERO_DUTY_CYCLE = 0.075;
const float MAX_DUTY_CYCLE = 0.1;
// Recepteur
TIM_TypeDef * RECEIVER_TIMER = TIM4;
const int RECEIVER_CHANNEL = LL_TIM_CHANNEL_CH1;
// Moteur
TIM_TypeDef * DCMOTOR_TIMER = TIM2;
const int DCMOTOR_CHANNEL = LL_TIM_CHANNEL_CH2;
GPIO_TypeDef * DCMOTOR_GPIO = GPIOA;
const int DCMOTOR_PIN = LL_GPIO_PIN_2;
const int DCMOTOR_PIN_PWM = LL_GPIO_PIN_1;
const int DCMOTOR_PIN_DIRECTION = LL_GPIO_PIN_2;
void Orientation_conf()
void Orientation_conf()
{
DCMotor_conf(DCMOTOR_TIMER, DCMOTOR_CHANNEL, DCMOTOR_GPIO, DCMOTOR_PIN);
DCMotor_conf(DCMOTOR_TIMER, DCMOTOR_CHANNEL, DCMOTOR_GPIO, DCMOTOR_PIN_PWM, DCMOTOR_GPIO, DCMOTOR_PIN_DIRECTION);
RFReceiver_conf(RECEIVER_TIMER, LL_TIM_CHANNEL_CH1);
}
void Orientation_background()
{
const float speed = RFReceiver_getData(RECEIVER_TIMER);
//Si la vitesse (en valeur absolue) ne dépasse pas un certain seuil, on ne démarre pas le moteur
if (THRESHOLD < fabs(speed)) {
DCMotor_setSpeed(DCMOTOR_TIMER, DCMOTOR_CHANNEL, DCMOTOR_GPIO, DCMOTOR_PIN, 0);
}
else {
DCMotor_setSpeed(DCMOTOR_TIMER, DCMOTOR_CHANNEL, DCMOTOR_GPIO, DCMOTOR_PIN, speed);
}
const float duty_cycle = RFReceiver_getData(RECEIVER_TIMER);
// Calcul de la vitesse du moteur (entre 0 et 1)
const float speed = (duty_cycle - ZERO_DUTY_CYCLE) / (MAX_DUTY_CYCLE - ZERO_DUTY_CYCLE);
// On ne demarre le moteur que si la vitesse depasse un certain seuil
if (fabs(speed) > THRESHOLD)
DCMotor_setSpeed(DCMOTOR_TIMER, DCMOTOR_CHANNEL, DCMOTOR_GPIO, DCMOTOR_PIN_DIRECTION, speed);
else
DCMotor_setSpeed(DCMOTOR_TIMER, DCMOTOR_CHANNEL, DCMOTOR_GPIO, DCMOTOR_PIN_DIRECTION, 0);
}

View file

@ -4,8 +4,20 @@
#include "DCMotor.h"
#include "RFReceiver.h"
/**
* @brief Configure le moteur continu et le RFReceiver pour l'orientation du voilier
* @note
* @param None
* @retval None
*/
void Orientation_conf(void);
/**
* @brief Récupère la vitesse demandée par l'utilisateur et la transmets au moteur DC
* @note
* @param None
* @retval None
*/
void Orientation_background(void);
#endif

View file

@ -3,9 +3,9 @@
#include "Accelerometer.h"
#include "stdlib.h"
ADC_TypeDef * ROLL_ADC = ADC1;
const int ROLL_X_CHANNEL = LL_ADC_CHANNEL_11;
const int ROLL_Y_CHANNEL = LL_ADC_CHANNEL_10;
ADC_TypeDef * ROLL_ADC = ADC2;
const int ROLL_X_CHANNEL = 11;
const int ROLL_Y_CHANNEL = 10;
GPIO_TypeDef * ROLL_GPIO = GPIOC;
const int ROLL_X_PIN = LL_GPIO_PIN_0;
const int ROLL_Y_PIN = LL_GPIO_PIN_1;
@ -29,14 +29,19 @@ int Roll_getEmergencyState(void)
return Roll_isEmergencyState;
}
int current = 0;
int angle= 0;
void Roll_background(void)
{
const int xAngle = Accelerometer_getAngle(ROLL_ADC, ROLL_X_CHANNEL);
//const int yAngle = Accelerometer_getAngle(ROLL_ADC, ROLL_Y_CHANNEL);
// const int xAngle = Accelerometer_getAngle(ROLL_ADC, ROLL_X_CHANNEL);
const int yAngle = Accelerometer_getAngle(ROLL_ADC, ROLL_Y_CHANNEL);
angle = yAngle;
const int currentState = abs(xAngle) >= 40;
if (Roll_isEmergencyState && !currentState)
Sail_setEmergency(1);
else if (!Roll_isEmergencyState && currentState)
Sail_setEmergency(0);
const int currentState = Roll_isEmergencyState ? abs(yAngle) >= 10 : abs(yAngle) >= 40;
current = currentState;
if (Roll_isEmergencyState != currentState) {
Sail_setEmergency(currentState);
Roll_isEmergencyState = currentState;
}
}

View file

@ -1,12 +1,36 @@
#ifndef ROLL_H
#define ROLL_H
/**
* @brief Configure l'accelerometre pour la détection de roulis
* @note
* @param None
* @retval None
*/
void Roll_conf(void);
/**
* @brief Démarre l'accelerometre pour la détection de roulis
* @note
* @param None
* @retval None
*/
void Roll_start(void);
/**
* @brief Récupère l'état d'alarme de dépassement de roulis
* @note
* @param None
* @retval 1 si l'alarme est active, 0 sinon
*/
int Roll_getEmergencyState(void);
/**
* @brief Récupère l'angle de roulis et déclenche l'alarme si il dépasse le seuil autorisé
* @note
* @param None
* @retval None
*/
void Roll_background(void);
#endif

View file

@ -11,7 +11,7 @@ TIM_TypeDef * ENCODER_TIMER = TIM3;
GPIO_TypeDef * ENCODER_GPIO = GPIOA;
const int ENCODER_PIN = LL_GPIO_PIN_5;
const int RESET_ANGLE = 90;
const int RESET_ANGLE = 0;
int Sail_isEmergencyState = 0;
@ -28,25 +28,17 @@ void Sail_start()
IncrementalEncoder_start(ENCODER_TIMER);
}
int getSailAngle(int windAngle)
int windToSailAngle(int windAngle)
{
if (windAngle > 180)
if (windAngle < 180)
return 90 * (windAngle - 45) / 135;
else
return 360 - 90 * ((360 - windAngle) - 45) / 135;
return 90 * ((360 - windAngle) - 45) / 135;
}
void Sail_background()
int Sail_getSailAngle(void)
{
if (Sail_isEmergencyState)
return;
const int windAngle = IncrementalEncoder_getAngle(ENCODER_TIMER);
if (windAngle < 45 || windAngle > 315)
ServoMotor_setAngle(MOTOR_TIMER, MOTOR_CHANNEL, 0);
else
ServoMotor_setAngle(MOTOR_TIMER, MOTOR_CHANNEL, getSailAngle(windAngle));
return ServoMotor_getAngle(MOTOR_TIMER, MOTOR_CHANNEL);
}
void Sail_setEmergency(int state)
@ -55,3 +47,21 @@ void Sail_setEmergency(int state)
if (Sail_isEmergencyState)
ServoMotor_setAngle(MOTOR_TIMER, MOTOR_CHANNEL, RESET_ANGLE);
}
int Sail_getEmergencyState()
{
return Sail_isEmergencyState;
}
void Sail_background()
{
if (Sail_isEmergencyState)
return;
const int windAngle = IncrementalEncoder_getAngle(ENCODER_TIMER);
if (windAngle < 45 || windAngle > 315)
ServoMotor_setAngle(MOTOR_TIMER, MOTOR_CHANNEL, 0);
else
ServoMotor_setAngle(MOTOR_TIMER, MOTOR_CHANNEL, windToSailAngle(windAngle));
}

View file

@ -2,7 +2,7 @@
#define SAIL_H
/**
* @brief Configure la voile
* @brief Configure le servo moteur et le codeur incrémental pour la manipulation de la voile
* @note
* @param None
* @retval None
@ -10,15 +10,15 @@
void Sail_conf(void);
/**
* @brief Execute la tache de fond des voiles en fonction des valeurs récupérées par les drivers
* @brief Démarre le servo moteur et le codeur incrémental pour la manipulation de la voile
* @note
* @param None
* @retval None
*/
void Sail_background(void);
void Sail_start(void);
/**
* @brief Mets la voile à 90 degres
* @brief Active le mode urgence des voiles pour les détendre
* @note
* @param None
* @retval None
@ -26,11 +26,28 @@ void Sail_background(void);
void Sail_setEmergency(int state);
/**
* @brief Réinitialise la voile à sa position initiale
* @brief Retourne l'état d'alarme de la voile
* @note
* @param None
* @retval 1 si l'alarme est active, 0 sinon
*/
int Sail_getEmergencyState(void);
/**
* @brief Retourne l'angle du servo moteur de la voile
* @note
* @param None
* @retval angle en degrès entre 0 (tendu) et 90 (détendu)
*/
int Sail_getSailAngle(void);
/**
* @brief Ajuste l'angle du servo moteur de la voile en fonction de l'angle du vent capté par la girouette
* @note
* @param None
* @retval None
*/
void Sail_start(void);
void Sail_background(void);
#endif

View file

@ -26,57 +26,62 @@
#include "Orientation.h"
#include "Scheduler.h"
#include "ADC.h"
#include "GPIO.h"
#include "Accelerometer.h"
#include "RFEmitter.h"
#include "stdio.h"
void SystemClock_Config(void);
// Compteur de secondes
int secCounter = 0;
/* Private functions ---------------------------------------------------------*/
int counter = 1;
int adcRaw1 = 0;
int adcRaw2 = 0;
double adcVolt1 = 0.0;
double adcVolt2 = 0.0;
int angle = 0;
/**
* @brief Effectue la tache de fond (programmee toutes les ms)
* @note
* @param None
* @retval None
*/
void backgroundTask()
{
counter++;
// Compte les millisecondes et secondes
static int msCounter;
msCounter++;
if (msCounter == 1000) {
msCounter = 0;
secCounter++;
}
Sail_background();
Roll_background();
Orientation_background();
// DEBUG
angle = Accelerometer_getAngle(ADC1, LL_ADC_CHANNEL_11);
adcRaw1 = ADC_readRaw(ADC1, LL_ADC_CHANNEL_11);
adcRaw2 = ADC_readRaw(ADC1, LL_ADC_CHANNEL_10);
adcVolt1 = ADC_convertToVolt(adcRaw1);
adcVolt2 = ADC_convertToVolt(adcRaw2);
}
/**
* @brief Configure les peripheriques
* @note
* @param None
* @retval None
*/
void configurePeripherals()
{
Sail_conf();
Roll_conf();
Display_conf();
Orientation_conf();
// DEBUG
ADC_conf(ADC1);
}
/**
* @brief Demarre les peripheriques
* @note
* @param None
* @retval None
*/
void startPeripherals()
{
Sail_start();
Roll_start();
Display_start();
// DEBUG
ADC_start(ADC1);
}
/**
@ -92,13 +97,29 @@ int main(void)
/* Add your application code here */
configurePeripherals();
startPeripherals();
Scheduler_conf(backgroundTask);
Scheduler_start();
while (1) {
Display_background();
Display_background(secCounter);
}
//// ADC 2 marche niquel, ADC1 ne marche pas :(
// ADC_conf(ADC1);
// ADC_start(ADC1);
//
// ADC_conf(ADC2);
// ADC_start(ADC2);
//
// while (1) {
// val1 = ADC_readRaw(ADC1, 10);
// val2 = ADC_readRaw(ADC2, 10);
// }
}
@ -129,8 +150,8 @@ void SystemClock_Config(void)
/* Enable HSE oscillator */
// ********* Commenter la ligne ci-dessous pour MCBSTM32 *****************
// ********* Conserver la ligne si Nucléo*********************************
LL_RCC_HSE_EnableBypass();
// ********* Conserver la ligne si Nucleo*********************************
// LL_RCC_HSE_EnableBypass();
LL_RCC_HSE_Enable();
while(LL_RCC_HSE_IsReady() != 1)
{
@ -177,8 +198,8 @@ void SystemClock_Config(void)
*/
void assert_failed(uint8_t *file, uint32_t line)
{
/* User can add his own implementation to report the file name and line number,
ex: printf("Wrong parameters value: file %s on line %d", file, line) */
/* User can add his own implementation to report the file name and line number*/
printf("Wrong parameters value: file %s on line %d", file, line);
/* Infinite loop */
while (1)