Modifications README et création de la fonction Girouette_Angle.

This commit is contained in:
Simon Paris 2023-04-04 16:39:20 +02:00
parent 6edec4d684
commit ed15d8a584
3 changed files with 80 additions and 13 deletions

View file

@ -1,8 +1,40 @@
#include "stm32f10x.h"
#include "../../driver/MyI2C.h"
#include "../../driver/MySPI.h"
#include "../../driver/timer.h"
#include "../../driver/gpio.h"
void Girouette_Angle(void);
int Angle_Girouette=0;
int main (void)
{
MyGPIO_Struct_TypeDef MyGPIO={GPIOB,3,In_PullDown};
MyGPIO_Init(&MyGPIO);
MyGPIO.GPIO_Pin=4;
MyGPIO_Init(&MyGPIO);
//inturutpion sur rise de gbpiob 3 avec appelle de Girouette_Angle
MyTimer_Struct_Typedef MyTimerGirouette ={TIM4,72,1};//500kHZ
MyTimer_Base_Init(&MyTimerGirouette);
MyTimer_ActiveIT(TIM4,4,Girouette_Angle);//changer prio
while(1){};
}
void Girouette_Angle(void)
{
if ( ( Angle_Girouette==360 )||( Angle_Girouette==-360) )
{
Angle_Girouette=0;
}
if(MyGPIO_Read(GPIOB,4))
{
Angle_Girouette =Angle_Girouette-1/4;
}else{
Angle_Girouette =Angle_Girouette+1/4;
}
//print(Angle_Girouette);//a suppr apr test
}

View file

@ -203,6 +203,38 @@
<ExecCommand></ExecCommand>
<Expression></Expression>
</Bp>
<Bp>
<Number>4</Number>
<Type>0</Type>
<LineNumber>11</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>0</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>0</BreakIfRCount>
<Filename>.\Source\Principale.c</Filename>
<ExecCommand></ExecCommand>
<Expression></Expression>
</Bp>
<Bp>
<Number>5</Number>
<Type>0</Type>
<LineNumber>18</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>0</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>0</BreakIfRCount>
<Filename>.\Source\Principale.c</Filename>
<ExecCommand></ExecCommand>
<Expression></Expression>
</Bp>
</Breakpoint>
<WatchWindow1>
<Ww>

View file

@ -10,13 +10,14 @@
<TargetName>Simulé</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>5060960::V5.06 update 7 (build 960)::.\ARMCC</pCCUsed>
<uAC6>0</uAC6>
<pArmCC>6190000::V6.19::ARMCLANG</pArmCC>
<pCCUsed>6190000::V6.19::ARMCLANG</pCCUsed>
<uAC6>1</uAC6>
<TargetOption>
<TargetCommonOption>
<Device>STM32F103RB</Device>
<Vendor>STMicroelectronics</Vendor>
<PackID>Keil.STM32F1xx_DFP.2.3.0</PackID>
<PackID>Keil.STM32F1xx_DFP.2.4.0</PackID>
<PackURL>http://www.keil.com/pack/</PackURL>
<Cpu>IRAM(0x20000000,0x00005000) IROM(0x08000000,0x00020000) CPUTYPE("Cortex-M3") CLOCK(12000000) ELITTLE</Cpu>
<FlashUtilSpec></FlashUtilSpec>
@ -186,6 +187,7 @@
<RvdsVP>0</RvdsVP>
<RvdsMve>0</RvdsMve>
<RvdsCdeCp>0</RvdsCdeCp>
<nBranchProt>0</nBranchProt>
<hadIRAM2>0</hadIRAM2>
<hadIROM2>0</hadIROM2>
<StupSel>8</StupSel>
@ -313,7 +315,7 @@
</ArmAdsMisc>
<Cads>
<interw>1</interw>
<Optim>1</Optim>
<Optim>2</Optim>
<oTime>0</oTime>
<SplitLS>0</SplitLS>
<OneElfS>1</OneElfS>
@ -322,7 +324,7 @@
<PlainCh>0</PlainCh>
<Ropi>0</Ropi>
<Rwpi>0</Rwpi>
<wLevel>2</wLevel>
<wLevel>3</wLevel>
<uThumb>0</uThumb>
<uSurpInc>0</uSurpInc>
<uC99>0</uC99>
@ -418,7 +420,7 @@
<TargetCommonOption>
<Device>STM32F103RB</Device>
<Vendor>STMicroelectronics</Vendor>
<PackID>Keil.STM32F1xx_DFP.2.3.0</PackID>
<PackID>Keil.STM32F1xx_DFP.2.4.0</PackID>
<PackURL>http://www.keil.com/pack/</PackURL>
<Cpu>IRAM(0x20000000,0x00005000) IROM(0x08000000,0x00020000) CPUTYPE("Cortex-M3") CLOCK(12000000) ELITTLE</Cpu>
<FlashUtilSpec></FlashUtilSpec>
@ -588,6 +590,7 @@
<RvdsVP>0</RvdsVP>
<RvdsMve>0</RvdsMve>
<RvdsCdeCp>0</RvdsCdeCp>
<nBranchProt>0</nBranchProt>
<hadIRAM2>0</hadIRAM2>
<hadIROM2>0</hadIROM2>
<StupSel>8</StupSel>
@ -815,15 +818,15 @@
<RTE>
<apis/>
<components>
<component Cclass="CMSIS" Cgroup="CORE" Cvendor="ARM" Cversion="5.4.0" condition="ARMv6_7_8-M Device">
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.7.0"/>
<component Cclass="CMSIS" Cgroup="CORE" Cvendor="ARM" Cversion="5.6.0" condition="ARMv6_7_8-M Device">
<package name="CMSIS" schemaVersion="1.7.7" url="http://www.keil.com/pack/" vendor="ARM" version="5.9.0"/>
<targetInfos>
<targetInfo name="Réel"/>
<targetInfo name="Simulé"/>
</targetInfos>
</component>
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="1.0.0" condition="STM32F1xx CMSIS">
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.3.0"/>
<package name="STM32F1xx_DFP" schemaVersion="1.7.2" url="http://www.keil.com/pack/" vendor="Keil" version="2.4.0"/>
<targetInfos>
<targetInfo name="Réel"/>
<targetInfo name="Simulé"/>
@ -834,7 +837,7 @@
<file attr="config" category="header" name="RTE_Driver\Config\RTE_Device.h" version="1.1.2">
<instance index="0">RTE\Device\STM32F103RB\RTE_Device.h</instance>
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="1.0.0" condition="STM32F1xx CMSIS"/>
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.3.0"/>
<package name="STM32F1xx_DFP" schemaVersion="1.7.2" url="http://www.keil.com/pack/" vendor="Keil" version="2.4.0"/>
<targetInfos>
<targetInfo name="Réel"/>
<targetInfo name="Simulé"/>
@ -843,7 +846,7 @@
<file attr="config" category="source" condition="STM32F1xx MD ARMCC" name="Device\Source\ARM\startup_stm32f10x_md.s" version="1.0.1">
<instance index="0">RTE\Device\STM32F103RB\startup_stm32f10x_md.s</instance>
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="1.0.0" condition="STM32F1xx CMSIS"/>
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.3.0"/>
<package name="STM32F1xx_DFP" schemaVersion="1.7.2" url="http://www.keil.com/pack/" vendor="Keil" version="2.4.0"/>
<targetInfos>
<targetInfo name="Réel"/>
<targetInfo name="Simulé"/>
@ -852,7 +855,7 @@
<file attr="config" category="source" name="Device\Source\system_stm32f10x.c" version="1.0.1">
<instance index="0">RTE\Device\STM32F103RB\system_stm32f10x.c</instance>
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="1.0.0" condition="STM32F1xx CMSIS"/>
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.3.0"/>
<package name="STM32F1xx_DFP" schemaVersion="1.7.2" url="http://www.keil.com/pack/" vendor="Keil" version="2.4.0"/>
<targetInfos>
<targetInfo name="Réel"/>
<targetInfo name="Simulé"/>