Plateau Start
This commit is contained in:
parent
5de107765d
commit
78c82605ae
7 changed files with 156 additions and 7 deletions
|
@ -9,6 +9,7 @@ char GPIO_Pin ; //numero de 0 a 15
|
||||||
char GPIO_Conf ; // voir ci dessous
|
char GPIO_Conf ; // voir ci dessous
|
||||||
} MyGPIO_Struct_TypeDef ;
|
} MyGPIO_Struct_TypeDef ;
|
||||||
|
|
||||||
|
#define Out_PullUp 0x01
|
||||||
#define In_Floating 0x4
|
#define In_Floating 0x4
|
||||||
#define In_PullDown 0x8
|
#define In_PullDown 0x8
|
||||||
#define In_PullUp 0x8
|
#define In_PullUp 0x8
|
||||||
|
|
1
Drivers/Voilier_fonction/Girouette.c
Normal file
1
Drivers/Voilier_fonction/Girouette.c
Normal file
|
@ -0,0 +1 @@
|
||||||
|
#include "Driver_Timer.h"
|
40
Drivers/Voilier_fonction/Plateau.c
Normal file
40
Drivers/Voilier_fonction/Plateau.c
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
#include "Driver_Timer.h"
|
||||||
|
#include "Driver_Timer.c"
|
||||||
|
#include "Driver_UART.h"
|
||||||
|
#include "Plateau.h"
|
||||||
|
#include "Driver_GPIO.h"
|
||||||
|
|
||||||
|
|
||||||
|
void Plateau_init(void)
|
||||||
|
{
|
||||||
|
MyTimer_Struct_TypeDef Timer;
|
||||||
|
MyGPIO_Struct_TypeDef Pin_Sens;
|
||||||
|
|
||||||
|
//Fréquence
|
||||||
|
Timer.Timer = TIM3;
|
||||||
|
Timer.ARR=3599;
|
||||||
|
Timer.PSC=0;
|
||||||
|
|
||||||
|
Pin_Sens.GPIO=GPIOB;
|
||||||
|
Pin_Sens.GPIO_Pin=1;
|
||||||
|
Pin_Sens.GPIO_Conf = Out_PullUp;
|
||||||
|
|
||||||
|
MyTimer_Base_Init(&Timer);
|
||||||
|
MyGPIO_Init(&Pin_Sens);
|
||||||
|
|
||||||
|
MyTimer_PWM(TIM3, 50);
|
||||||
|
|
||||||
|
MyTimer_Base_Start(Timer);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void MyMotor_ChangeDirection(uint8_t Sens)
|
||||||
|
{
|
||||||
|
if(Sens == DROITE)
|
||||||
|
MyGPIO_Set(GPIOB,1);
|
||||||
|
if (Sens == GAUCHE)
|
||||||
|
MyGPIO_Reset(GPIOB,1);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
12
Drivers/Voilier_fonction/Plateau.h
Normal file
12
Drivers/Voilier_fonction/Plateau.h
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
#ifndef MYPLATEAU_H
|
||||||
|
#define MYPLATEAU_H
|
||||||
|
#include "stm32f10x.h"
|
||||||
|
|
||||||
|
#define DROITE 0x1
|
||||||
|
#define GAUCHE 0x0
|
||||||
|
|
||||||
|
|
||||||
|
void Plateau_init(void);
|
||||||
|
void MyMotor_ChangeDirection(uint8_t Sens);
|
||||||
|
|
||||||
|
#endif
|
|
@ -149,6 +149,22 @@
|
||||||
<Type>0</Type>
|
<Type>0</Type>
|
||||||
<LineNumber>69</LineNumber>
|
<LineNumber>69</LineNumber>
|
||||||
<EnabledFlag>1</EnabledFlag>
|
<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>.\Sources\Main.c</Filename>
|
||||||
|
<ExecCommand></ExecCommand>
|
||||||
|
<Expression></Expression>
|
||||||
|
</Bp>
|
||||||
|
<Bp>
|
||||||
|
<Number>1</Number>
|
||||||
|
<Type>0</Type>
|
||||||
|
<LineNumber>69</LineNumber>
|
||||||
|
<EnabledFlag>1</EnabledFlag>
|
||||||
<Address>134219582</Address>
|
<Address>134219582</Address>
|
||||||
<ByteObject>0</ByteObject>
|
<ByteObject>0</ByteObject>
|
||||||
<HtxType>0</HtxType>
|
<HtxType>0</HtxType>
|
||||||
|
@ -410,7 +426,7 @@
|
||||||
<GroupNumber>1</GroupNumber>
|
<GroupNumber>1</GroupNumber>
|
||||||
<FileNumber>1</FileNumber>
|
<FileNumber>1</FileNumber>
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<tvExp>0</tvExp>
|
<tvExp>1</tvExp>
|
||||||
<tvExpOptDlg>0</tvExpOptDlg>
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
<bDave2>0</bDave2>
|
<bDave2>0</bDave2>
|
||||||
<PathWithFileName>..\Drivers\Sources\Driver_GPIO.c</PathWithFileName>
|
<PathWithFileName>..\Drivers\Sources\Driver_GPIO.c</PathWithFileName>
|
||||||
|
@ -446,11 +462,7 @@
|
||||||
<GroupNumber>1</GroupNumber>
|
<GroupNumber>1</GroupNumber>
|
||||||
<FileNumber>4</FileNumber>
|
<FileNumber>4</FileNumber>
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<<<<<<< HEAD
|
|
||||||
<tvExp>0</tvExp>
|
<tvExp>0</tvExp>
|
||||||
=======
|
|
||||||
<tvExp>1</tvExp>
|
|
||||||
>>>>>>> feature-branch
|
|
||||||
<tvExpOptDlg>0</tvExpOptDlg>
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
<bDave2>0</bDave2>
|
<bDave2>0</bDave2>
|
||||||
<PathWithFileName>C:\Users\chanfreau\Downloads\voilier\Drivers\Sources\Driver_ADC.c</PathWithFileName>
|
<PathWithFileName>C:\Users\chanfreau\Downloads\voilier\Drivers\Sources\Driver_ADC.c</PathWithFileName>
|
||||||
|
@ -480,6 +492,50 @@
|
||||||
</File>
|
</File>
|
||||||
</Group>
|
</Group>
|
||||||
|
|
||||||
|
<Group>
|
||||||
|
<GroupName>Voilier_fonction</GroupName>
|
||||||
|
<tvExp>1</tvExp>
|
||||||
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
|
<cbSel>0</cbSel>
|
||||||
|
<RteFlg>0</RteFlg>
|
||||||
|
<File>
|
||||||
|
<GroupNumber>3</GroupNumber>
|
||||||
|
<FileNumber>6</FileNumber>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<tvExp>0</tvExp>
|
||||||
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
|
<bDave2>0</bDave2>
|
||||||
|
<PathWithFileName>..\Drivers\Voilier_fonction\Girouette.c</PathWithFileName>
|
||||||
|
<FilenameWithoutPath>Girouette.c</FilenameWithoutPath>
|
||||||
|
<RteFlg>0</RteFlg>
|
||||||
|
<bShared>0</bShared>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<GroupNumber>3</GroupNumber>
|
||||||
|
<FileNumber>7</FileNumber>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<tvExp>0</tvExp>
|
||||||
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
|
<bDave2>0</bDave2>
|
||||||
|
<PathWithFileName>..\Drivers\Voilier_fonction\Plateau.c</PathWithFileName>
|
||||||
|
<FilenameWithoutPath>Plateau.c</FilenameWithoutPath>
|
||||||
|
<RteFlg>0</RteFlg>
|
||||||
|
<bShared>0</bShared>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<GroupNumber>3</GroupNumber>
|
||||||
|
<FileNumber>8</FileNumber>
|
||||||
|
<FileType>5</FileType>
|
||||||
|
<tvExp>0</tvExp>
|
||||||
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
|
<bDave2>0</bDave2>
|
||||||
|
<PathWithFileName>..\Drivers\Voilier_fonction\Plateau.h</PathWithFileName>
|
||||||
|
<FilenameWithoutPath>Plateau.h</FilenameWithoutPath>
|
||||||
|
<RteFlg>0</RteFlg>
|
||||||
|
<bShared>0</bShared>
|
||||||
|
</File>
|
||||||
|
</Group>
|
||||||
|
|
||||||
<Group>
|
<Group>
|
||||||
<GroupName>::CMSIS</GroupName>
|
<GroupName>::CMSIS</GroupName>
|
||||||
<tvExp>0</tvExp>
|
<tvExp>0</tvExp>
|
||||||
|
|
|
@ -339,7 +339,7 @@
|
||||||
<MiscControls></MiscControls>
|
<MiscControls></MiscControls>
|
||||||
<Define></Define>
|
<Define></Define>
|
||||||
<Undefine></Undefine>
|
<Undefine></Undefine>
|
||||||
<IncludePath>..\Drivers\Include</IncludePath>
|
<IncludePath>..\Drivers\Include;..\Drivers\Voilier_fonction;..\Drivers\Sources</IncludePath>
|
||||||
</VariousControls>
|
</VariousControls>
|
||||||
</Cads>
|
</Cads>
|
||||||
<Aads>
|
<Aads>
|
||||||
|
@ -415,6 +415,26 @@
|
||||||
</File>
|
</File>
|
||||||
</Files>
|
</Files>
|
||||||
</Group>
|
</Group>
|
||||||
|
<Group>
|
||||||
|
<GroupName>Voilier_fonction</GroupName>
|
||||||
|
<Files>
|
||||||
|
<File>
|
||||||
|
<FileName>Girouette.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>..\Drivers\Voilier_fonction\Girouette.c</FilePath>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>Plateau.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>..\Drivers\Voilier_fonction\Plateau.c</FilePath>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>Plateau.h</FileName>
|
||||||
|
<FileType>5</FileType>
|
||||||
|
<FilePath>..\Drivers\Voilier_fonction\Plateau.h</FilePath>
|
||||||
|
</File>
|
||||||
|
</Files>
|
||||||
|
</Group>
|
||||||
<Group>
|
<Group>
|
||||||
<GroupName>::CMSIS</GroupName>
|
<GroupName>::CMSIS</GroupName>
|
||||||
</Group>
|
</Group>
|
||||||
|
@ -832,6 +852,26 @@
|
||||||
</File>
|
</File>
|
||||||
</Files>
|
</Files>
|
||||||
</Group>
|
</Group>
|
||||||
|
<Group>
|
||||||
|
<GroupName>Voilier_fonction</GroupName>
|
||||||
|
<Files>
|
||||||
|
<File>
|
||||||
|
<FileName>Girouette.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>..\Drivers\Voilier_fonction\Girouette.c</FilePath>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>Plateau.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>..\Drivers\Voilier_fonction\Plateau.c</FilePath>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>Plateau.h</FileName>
|
||||||
|
<FileType>5</FileType>
|
||||||
|
<FilePath>..\Drivers\Voilier_fonction\Plateau.h</FilePath>
|
||||||
|
</File>
|
||||||
|
</Files>
|
||||||
|
</Group>
|
||||||
<Group>
|
<Group>
|
||||||
<GroupName>::CMSIS</GroupName>
|
<GroupName>::CMSIS</GroupName>
|
||||||
</Group>
|
</Group>
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
|
|
||||||
|
|
||||||
int main (void){
|
int main (void){
|
||||||
//Déclaration d'une LED et d'un BP par structure GPIO
|
|
||||||
|
|
||||||
while(1){
|
while(1){
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue