Compare commits
24 commits
Author | SHA1 | Date | |
---|---|---|---|
|
d91e0bc8ed | ||
|
5723b95405 | ||
|
27c8c1a005 | ||
|
b8e0d2bcd8 | ||
|
d6cedd7e09 | ||
|
1556c5145f | ||
|
7c30feb7fa | ||
|
9fda5dccec | ||
|
efcee57846 | ||
|
67a1107044 | ||
|
17efd9c1a2 | ||
|
0d390c9c27 | ||
|
04f1835265 | ||
|
88050db15f | ||
|
3aa8003776 | ||
|
7e745ca4f9 | ||
|
506c519386 | ||
|
49f261078b | ||
|
6e1c2b1766 | ||
|
5c38d5e1da | ||
|
11a7310a43 | ||
|
325154c167 | ||
|
9c195f3020 | ||
|
fff46d3a15 |
14 changed files with 597 additions and 24 deletions
|
@ -300,12 +300,12 @@
|
||||||
<bEvRecOn>1</bEvRecOn>
|
<bEvRecOn>1</bEvRecOn>
|
||||||
<bSchkAxf>0</bSchkAxf>
|
<bSchkAxf>0</bSchkAxf>
|
||||||
<bTchkAxf>0</bTchkAxf>
|
<bTchkAxf>0</bTchkAxf>
|
||||||
<nTsel>5</nTsel>
|
<nTsel>6</nTsel>
|
||||||
<sDll></sDll>
|
<sDll></sDll>
|
||||||
<sDllPa></sDllPa>
|
<sDllPa></sDllPa>
|
||||||
<sDlgDll></sDlgDll>
|
<sDlgDll></sDlgDll>
|
||||||
<sDlgPa></sDlgPa>
|
<sDlgPa></sDlgPa>
|
||||||
<sIfile></sIfile>
|
<sIfile>..\..\inifiles\Simu_Pulse.ini</sIfile>
|
||||||
<tDll></tDll>
|
<tDll></tDll>
|
||||||
<tDllPa></tDllPa>
|
<tDllPa></tDllPa>
|
||||||
<tDlgDll></tDlgDll>
|
<tDlgDll></tDlgDll>
|
||||||
|
@ -317,7 +317,7 @@
|
||||||
<SetRegEntry>
|
<SetRegEntry>
|
||||||
<Number>0</Number>
|
<Number>0</Number>
|
||||||
<Key>DLGDARM</Key>
|
<Key>DLGDARM</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=98,107,519,534,0)(121=-1,-1,-1,-1,0)(122=674,103,1095,530,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)(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=-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=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)(100=504,37,1150,710,0)(110=60,88,280,548,0)(111=752,104,972,564,0)(1011=-1,-1,-1,-1,0)(180=-1,-1,-1,-1,0)(120=874,38,1295,465,0)(121=892,96,1313,523,0)(122=674,103,1095,530,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=517,8,1111,759,0)(131=150,13,744,764,0)(132=599,17,1193,768,0)(133=-1,-1,-1,-1,0)(160=674,53,1122,467,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=-1,-1,-1,-1,0)(151=-1,-1,-1,-1,0)</Name>
|
||||||
</SetRegEntry>
|
</SetRegEntry>
|
||||||
<SetRegEntry>
|
<SetRegEntry>
|
||||||
<Number>0</Number>
|
<Number>0</Number>
|
||||||
|
@ -358,6 +358,14 @@
|
||||||
<ItemText>time</ItemText>
|
<ItemText>time</ItemText>
|
||||||
</Ww>
|
</Ww>
|
||||||
</WatchWindow1>
|
</WatchWindow1>
|
||||||
|
<MemoryWindow1>
|
||||||
|
<Mm>
|
||||||
|
<WinNumber>1</WinNumber>
|
||||||
|
<SubType>0</SubType>
|
||||||
|
<ItemText>0x08001778</ItemText>
|
||||||
|
<AccSizeX>0</AccSizeX>
|
||||||
|
</Mm>
|
||||||
|
</MemoryWindow1>
|
||||||
<Tracepoint>
|
<Tracepoint>
|
||||||
<THDelay>0</THDelay>
|
<THDelay>0</THDelay>
|
||||||
</Tracepoint>
|
</Tracepoint>
|
||||||
|
@ -366,7 +374,7 @@
|
||||||
<periodic>1</periodic>
|
<periodic>1</periodic>
|
||||||
<aLwin>1</aLwin>
|
<aLwin>1</aLwin>
|
||||||
<aCover>0</aCover>
|
<aCover>0</aCover>
|
||||||
<aSer1>0</aSer1>
|
<aSer1>1</aSer1>
|
||||||
<aSer2>0</aSer2>
|
<aSer2>0</aSer2>
|
||||||
<aPa>0</aPa>
|
<aPa>0</aPa>
|
||||||
<viewmode>1</viewmode>
|
<viewmode>1</viewmode>
|
||||||
|
@ -378,7 +386,7 @@
|
||||||
<AscS3>0</AscS3>
|
<AscS3>0</AscS3>
|
||||||
<aSer3>0</aSer3>
|
<aSer3>0</aSer3>
|
||||||
<eProf>0</eProf>
|
<eProf>0</eProf>
|
||||||
<aLa>0</aLa>
|
<aLa>1</aLa>
|
||||||
<aPa1>0</aPa1>
|
<aPa1>0</aPa1>
|
||||||
<AscS4>0</AscS4>
|
<AscS4>0</AscS4>
|
||||||
<aSer4>0</aSer4>
|
<aSer4>0</aSer4>
|
||||||
|
@ -400,6 +408,13 @@
|
||||||
<pszMrulep></pszMrulep>
|
<pszMrulep></pszMrulep>
|
||||||
<pSingCmdsp></pSingCmdsp>
|
<pSingCmdsp></pSingCmdsp>
|
||||||
<pMultCmdsp></pMultCmdsp>
|
<pMultCmdsp></pMultCmdsp>
|
||||||
|
<LogicAnalyzers>
|
||||||
|
<Wi>
|
||||||
|
<IntNumber>0</IntNumber>
|
||||||
|
<FirstString>((porta & 0x00000800) >> 11 & 0x800) >> 11</FirstString>
|
||||||
|
<SecondString>00800000000000000000000000000000E0FFEF400000000000000000000000000000000028706F7274612026203078303030303038303029203E3E2031310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000001000000000000000000F03F170000000000000000000000000000000000000076150008</SecondString>
|
||||||
|
</Wi>
|
||||||
|
</LogicAnalyzers>
|
||||||
<DebugDescription>
|
<DebugDescription>
|
||||||
<Enable>1</Enable>
|
<Enable>1</Enable>
|
||||||
<EnableFlashSeq>0</EnableFlashSeq>
|
<EnableFlashSeq>0</EnableFlashSeq>
|
||||||
|
@ -420,7 +435,7 @@
|
||||||
<GroupNumber>1</GroupNumber>
|
<GroupNumber>1</GroupNumber>
|
||||||
<FileNumber>1</FileNumber>
|
<FileNumber>1</FileNumber>
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<tvExp>1</tvExp>
|
<tvExp>0</tvExp>
|
||||||
<tvExpOptDlg>0</tvExpOptDlg>
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
<bDave2>0</bDave2>
|
<bDave2>0</bDave2>
|
||||||
<PathWithFileName>../Src/main.c</PathWithFileName>
|
<PathWithFileName>../Src/main.c</PathWithFileName>
|
||||||
|
@ -436,6 +451,18 @@
|
||||||
<tvExpOptDlg>0</tvExpOptDlg>
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
<cbSel>0</cbSel>
|
<cbSel>0</cbSel>
|
||||||
<RteFlg>0</RteFlg>
|
<RteFlg>0</RteFlg>
|
||||||
|
<File>
|
||||||
|
<GroupNumber>2</GroupNumber>
|
||||||
|
<FileNumber>2</FileNumber>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<tvExp>0</tvExp>
|
||||||
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
|
<bDave2>0</bDave2>
|
||||||
|
<PathWithFileName>..\Services\MyRF.c</PathWithFileName>
|
||||||
|
<FilenameWithoutPath>MyRF.c</FilenameWithoutPath>
|
||||||
|
<RteFlg>0</RteFlg>
|
||||||
|
<bShared>0</bShared>
|
||||||
|
</File>
|
||||||
</Group>
|
</Group>
|
||||||
|
|
||||||
<Group>
|
<Group>
|
||||||
|
@ -446,9 +473,9 @@
|
||||||
<RteFlg>0</RteFlg>
|
<RteFlg>0</RteFlg>
|
||||||
<File>
|
<File>
|
||||||
<GroupNumber>3</GroupNumber>
|
<GroupNumber>3</GroupNumber>
|
||||||
<FileNumber>2</FileNumber>
|
<FileNumber>3</FileNumber>
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<tvExp>1</tvExp>
|
<tvExp>0</tvExp>
|
||||||
<tvExpOptDlg>0</tvExpOptDlg>
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
<bDave2>0</bDave2>
|
<bDave2>0</bDave2>
|
||||||
<PathWithFileName>..\MyDrivers\MyTimer.c</PathWithFileName>
|
<PathWithFileName>..\MyDrivers\MyTimer.c</PathWithFileName>
|
||||||
|
@ -456,6 +483,30 @@
|
||||||
<RteFlg>0</RteFlg>
|
<RteFlg>0</RteFlg>
|
||||||
<bShared>0</bShared>
|
<bShared>0</bShared>
|
||||||
</File>
|
</File>
|
||||||
|
<File>
|
||||||
|
<GroupNumber>3</GroupNumber>
|
||||||
|
<FileNumber>4</FileNumber>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<tvExp>0</tvExp>
|
||||||
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
|
<bDave2>0</bDave2>
|
||||||
|
<PathWithFileName>..\MyDrivers\MyPWM.c</PathWithFileName>
|
||||||
|
<FilenameWithoutPath>MyPWM.c</FilenameWithoutPath>
|
||||||
|
<RteFlg>0</RteFlg>
|
||||||
|
<bShared>0</bShared>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<GroupNumber>3</GroupNumber>
|
||||||
|
<FileNumber>5</FileNumber>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<tvExp>0</tvExp>
|
||||||
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
|
<bDave2>0</bDave2>
|
||||||
|
<PathWithFileName>..\MyDrivers\MyUSART.c</PathWithFileName>
|
||||||
|
<FilenameWithoutPath>MyUSART.c</FilenameWithoutPath>
|
||||||
|
<RteFlg>0</RteFlg>
|
||||||
|
<bShared>0</bShared>
|
||||||
|
</File>
|
||||||
</Group>
|
</Group>
|
||||||
|
|
||||||
<Group>
|
<Group>
|
||||||
|
@ -466,7 +517,7 @@
|
||||||
<RteFlg>0</RteFlg>
|
<RteFlg>0</RteFlg>
|
||||||
<File>
|
<File>
|
||||||
<GroupNumber>4</GroupNumber>
|
<GroupNumber>4</GroupNumber>
|
||||||
<FileNumber>3</FileNumber>
|
<FileNumber>6</FileNumber>
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<tvExp>0</tvExp>
|
<tvExp>0</tvExp>
|
||||||
<tvExpOptDlg>0</tvExpOptDlg>
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
|
@ -478,7 +529,7 @@
|
||||||
</File>
|
</File>
|
||||||
<File>
|
<File>
|
||||||
<GroupNumber>4</GroupNumber>
|
<GroupNumber>4</GroupNumber>
|
||||||
<FileNumber>4</FileNumber>
|
<FileNumber>7</FileNumber>
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<tvExp>0</tvExp>
|
<tvExp>0</tvExp>
|
||||||
<tvExpOptDlg>0</tvExpOptDlg>
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
|
@ -490,7 +541,7 @@
|
||||||
</File>
|
</File>
|
||||||
<File>
|
<File>
|
||||||
<GroupNumber>4</GroupNumber>
|
<GroupNumber>4</GroupNumber>
|
||||||
<FileNumber>5</FileNumber>
|
<FileNumber>8</FileNumber>
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<tvExp>0</tvExp>
|
<tvExp>0</tvExp>
|
||||||
<tvExpOptDlg>0</tvExpOptDlg>
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
|
@ -502,7 +553,7 @@
|
||||||
</File>
|
</File>
|
||||||
<File>
|
<File>
|
||||||
<GroupNumber>4</GroupNumber>
|
<GroupNumber>4</GroupNumber>
|
||||||
<FileNumber>6</FileNumber>
|
<FileNumber>9</FileNumber>
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<tvExp>0</tvExp>
|
<tvExp>0</tvExp>
|
||||||
<tvExpOptDlg>0</tvExpOptDlg>
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
|
@ -514,7 +565,7 @@
|
||||||
</File>
|
</File>
|
||||||
<File>
|
<File>
|
||||||
<GroupNumber>4</GroupNumber>
|
<GroupNumber>4</GroupNumber>
|
||||||
<FileNumber>7</FileNumber>
|
<FileNumber>10</FileNumber>
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<tvExp>0</tvExp>
|
<tvExp>0</tvExp>
|
||||||
<tvExpOptDlg>0</tvExpOptDlg>
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
|
@ -534,7 +585,7 @@
|
||||||
<RteFlg>0</RteFlg>
|
<RteFlg>0</RteFlg>
|
||||||
<File>
|
<File>
|
||||||
<GroupNumber>5</GroupNumber>
|
<GroupNumber>5</GroupNumber>
|
||||||
<FileNumber>8</FileNumber>
|
<FileNumber>11</FileNumber>
|
||||||
<FileType>5</FileType>
|
<FileType>5</FileType>
|
||||||
<tvExp>0</tvExp>
|
<tvExp>0</tvExp>
|
||||||
<tvExpOptDlg>0</tvExpOptDlg>
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
|
@ -554,7 +605,7 @@
|
||||||
<RteFlg>0</RteFlg>
|
<RteFlg>0</RteFlg>
|
||||||
<File>
|
<File>
|
||||||
<GroupNumber>6</GroupNumber>
|
<GroupNumber>6</GroupNumber>
|
||||||
<FileNumber>9</FileNumber>
|
<FileNumber>12</FileNumber>
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<tvExp>0</tvExp>
|
<tvExp>0</tvExp>
|
||||||
<tvExpOptDlg>0</tvExpOptDlg>
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
|
@ -574,7 +625,7 @@
|
||||||
<RteFlg>0</RteFlg>
|
<RteFlg>0</RteFlg>
|
||||||
<File>
|
<File>
|
||||||
<GroupNumber>7</GroupNumber>
|
<GroupNumber>7</GroupNumber>
|
||||||
<FileNumber>10</FileNumber>
|
<FileNumber>13</FileNumber>
|
||||||
<FileType>2</FileType>
|
<FileType>2</FileType>
|
||||||
<tvExp>0</tvExp>
|
<tvExp>0</tvExp>
|
||||||
<tvExpOptDlg>0</tvExpOptDlg>
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
|
|
|
@ -391,6 +391,13 @@
|
||||||
</Group>
|
</Group>
|
||||||
<Group>
|
<Group>
|
||||||
<GroupName>User Services</GroupName>
|
<GroupName>User Services</GroupName>
|
||||||
|
<Files>
|
||||||
|
<File>
|
||||||
|
<FileName>MyRF.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>..\Services\MyRF.c</FilePath>
|
||||||
|
</File>
|
||||||
|
</Files>
|
||||||
</Group>
|
</Group>
|
||||||
<Group>
|
<Group>
|
||||||
<GroupName>MyDrivers</GroupName>
|
<GroupName>MyDrivers</GroupName>
|
||||||
|
@ -400,6 +407,16 @@
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<FilePath>..\MyDrivers\MyTimer.c</FilePath>
|
<FilePath>..\MyDrivers\MyTimer.c</FilePath>
|
||||||
</File>
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>MyPWM.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>..\MyDrivers\MyPWM.c</FilePath>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>MyUSART.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>..\MyDrivers\MyUSART.c</FilePath>
|
||||||
|
</File>
|
||||||
</Files>
|
</Files>
|
||||||
</Group>
|
</Group>
|
||||||
<Group>
|
<Group>
|
||||||
|
@ -595,11 +612,11 @@
|
||||||
<RunIndependent>0</RunIndependent>
|
<RunIndependent>0</RunIndependent>
|
||||||
<UpdateFlashBeforeDebugging>1</UpdateFlashBeforeDebugging>
|
<UpdateFlashBeforeDebugging>1</UpdateFlashBeforeDebugging>
|
||||||
<Capability>1</Capability>
|
<Capability>1</Capability>
|
||||||
<DriverSelection>4107</DriverSelection>
|
<DriverSelection>4101</DriverSelection>
|
||||||
</Flash1>
|
</Flash1>
|
||||||
<bUseTDR>1</bUseTDR>
|
<bUseTDR>1</bUseTDR>
|
||||||
<Flash2>STLink\ST-LINKIII-KEIL_SWO.dll</Flash2>
|
<Flash2>STLink\ST-LINKIII-KEIL_SWO.dll</Flash2>
|
||||||
<Flash3></Flash3>
|
<Flash3>"" ()</Flash3>
|
||||||
<Flash4></Flash4>
|
<Flash4></Flash4>
|
||||||
<pFcarmOut></pFcarmOut>
|
<pFcarmOut></pFcarmOut>
|
||||||
<pFcarmGrp></pFcarmGrp>
|
<pFcarmGrp></pFcarmGrp>
|
||||||
|
@ -852,6 +869,13 @@
|
||||||
</Group>
|
</Group>
|
||||||
<Group>
|
<Group>
|
||||||
<GroupName>User Services</GroupName>
|
<GroupName>User Services</GroupName>
|
||||||
|
<Files>
|
||||||
|
<File>
|
||||||
|
<FileName>MyRF.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>..\Services\MyRF.c</FilePath>
|
||||||
|
</File>
|
||||||
|
</Files>
|
||||||
</Group>
|
</Group>
|
||||||
<Group>
|
<Group>
|
||||||
<GroupName>MyDrivers</GroupName>
|
<GroupName>MyDrivers</GroupName>
|
||||||
|
@ -861,6 +885,16 @@
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<FilePath>..\MyDrivers\MyTimer.c</FilePath>
|
<FilePath>..\MyDrivers\MyTimer.c</FilePath>
|
||||||
</File>
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>MyPWM.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>..\MyDrivers\MyPWM.c</FilePath>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>MyUSART.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>..\MyDrivers\MyUSART.c</FilePath>
|
||||||
|
</File>
|
||||||
</Files>
|
</Files>
|
||||||
</Group>
|
</Group>
|
||||||
<Group>
|
<Group>
|
||||||
|
|
66
MyDrivers/MyPWM.c
Normal file
66
MyDrivers/MyPWM.c
Normal file
|
@ -0,0 +1,66 @@
|
||||||
|
#include "MyPWM.h"
|
||||||
|
#include "stm32f1xx_ll_bus.h" // Pour l'activation des horloges
|
||||||
|
#include "stm32f1xx_ll_tim.h"
|
||||||
|
|
||||||
|
void MyPWM_Conf_Output(TIM_TypeDef * Timer, int channel)
|
||||||
|
{
|
||||||
|
LL_TIM_OC_InitTypeDef My_LL_Tim_OC_Init_Struct;
|
||||||
|
|
||||||
|
//Configuration du output channel en PWM
|
||||||
|
LL_TIM_OC_StructInit(&My_LL_Tim_OC_Init_Struct);
|
||||||
|
//Configure le mode de la PWM : PWM1 = 1 jusqu'à la CompareValue puis 0, PWM2 = l'inverse
|
||||||
|
My_LL_Tim_OC_Init_Struct.OCMode = LL_TIM_OCMODE_PWM1;
|
||||||
|
|
||||||
|
LL_TIM_OC_Init(Timer,channel,&My_LL_Tim_OC_Init_Struct);
|
||||||
|
|
||||||
|
//Activation du channel pour le timer considéré
|
||||||
|
LL_TIM_CC_EnableChannel(Timer, channel);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//Configurer obligatoirement les channels 1 et 2 sur IC1 et IC2 ou IC3 et IC4
|
||||||
|
void MyPWM_Conf_Input(TIM_TypeDef * Timer, int channel1, int channel2)
|
||||||
|
{
|
||||||
|
LL_TIM_IC_InitTypeDef My_LL_Tim_IC_Init_Struct;
|
||||||
|
|
||||||
|
//Configuration du channel1 (front montant, mappé sur TI1 = valeurs par défaut)
|
||||||
|
LL_TIM_IC_StructInit(&My_LL_Tim_IC_Init_Struct);
|
||||||
|
LL_TIM_IC_Init(Timer,channel1,&My_LL_Tim_IC_Init_Struct);
|
||||||
|
|
||||||
|
//Configuration du channel2 (front descendant, mappé sur TI1 = valeurs modifiées)
|
||||||
|
LL_TIM_IC_StructInit(&My_LL_Tim_IC_Init_Struct);
|
||||||
|
//Détection sur front descendant
|
||||||
|
My_LL_Tim_IC_Init_Struct.ICPolarity = LL_TIM_IC_POLARITY_FALLING;
|
||||||
|
//Mappage sur TI1
|
||||||
|
My_LL_Tim_IC_Init_Struct.ICActiveInput = LL_TIM_ACTIVEINPUT_INDIRECTTI;
|
||||||
|
LL_TIM_IC_Init(Timer,channel2,&My_LL_Tim_IC_Init_Struct);
|
||||||
|
|
||||||
|
//Definition du trigger
|
||||||
|
LL_TIM_SetTriggerInput(Timer, LL_TIM_TS_TI1FP1);
|
||||||
|
|
||||||
|
//Configure le mode esclave en mode RESET
|
||||||
|
LL_TIM_SetSlaveMode(Timer, LL_TIM_SLAVEMODE_RESET);
|
||||||
|
|
||||||
|
//Activation des 2 channels pour le timer considéré
|
||||||
|
LL_TIM_CC_EnableChannel(Timer, channel1);
|
||||||
|
LL_TIM_CC_EnableChannel(Timer, channel2);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void MyPWM_Set_Impulse_Duration(TIM_TypeDef * Timer, uint32_t CompareValue, int channel)
|
||||||
|
{
|
||||||
|
if (channel==LL_TIM_CHANNEL_CH1) LL_TIM_OC_SetCompareCH1(Timer, CompareValue);
|
||||||
|
else if (channel==LL_TIM_CHANNEL_CH2) LL_TIM_OC_SetCompareCH2(Timer, CompareValue);
|
||||||
|
else if (channel==LL_TIM_CHANNEL_CH3) LL_TIM_OC_SetCompareCH3(Timer, CompareValue);
|
||||||
|
else LL_TIM_OC_SetCompareCH4(Timer, CompareValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int MyPWM_Duty_Cycle_Permilles(TIM_TypeDef * Timer, int channel1, int channel2) {
|
||||||
|
if(channel1 == LL_TIM_CHANNEL_CH1 && channel2 == LL_TIM_CHANNEL_CH2) {
|
||||||
|
return LL_TIM_IC_GetCaptureCH2(Timer) / LL_TIM_IC_GetCaptureCH1(Timer) * 1000;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
15
MyDrivers/MyPWM.h
Normal file
15
MyDrivers/MyPWM.h
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
#ifndef MYPWM_H
|
||||||
|
#define MYPWM_H
|
||||||
|
|
||||||
|
#include "stm32f103xb.h"
|
||||||
|
|
||||||
|
|
||||||
|
void MyPWM_Conf_Output(TIM_TypeDef * Timer, int channel);
|
||||||
|
|
||||||
|
void MyPWM_Conf_Input(TIM_TypeDef * Timer, int channel1, int channel2);
|
||||||
|
|
||||||
|
void MyPWM_Set_Impulse_Duration(TIM_TypeDef * Timer, uint32_t CompareValue, int channel);
|
||||||
|
|
||||||
|
int MyPWM_Duty_Cycle_Permilles(TIM_TypeDef * Timer, int channel1, int channel2);
|
||||||
|
|
||||||
|
#endif
|
|
@ -32,7 +32,7 @@ void (*Ptr_ItFct_TIM4)(void);
|
||||||
* int Psc : valeur à placer dans PSC
|
* int Psc : valeur à placer dans PSC
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
void MyTimer_Conf(TIM_TypeDef * Timer, int Period)
|
void MyTimer_Conf(TIM_TypeDef * Timer, int Arr, int Psc)
|
||||||
{
|
{
|
||||||
LL_TIM_InitTypeDef My_LL_Tim_Init_Struct;
|
LL_TIM_InitTypeDef My_LL_Tim_Init_Struct;
|
||||||
|
|
||||||
|
@ -42,9 +42,6 @@ void MyTimer_Conf(TIM_TypeDef * Timer, int Period)
|
||||||
else if (Timer==TIM3) LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_TIM3);
|
else if (Timer==TIM3) LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_TIM3);
|
||||||
else LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_TIM4);
|
else LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_TIM4);
|
||||||
|
|
||||||
int Psc = (Period*72*1000000)/256 + 2;
|
|
||||||
int Arr = (Period*72*1000000)/Psc + 1;
|
|
||||||
|
|
||||||
// chargement structure Arr, Psc, Up Count
|
// chargement structure Arr, Psc, Up Count
|
||||||
My_LL_Tim_Init_Struct.Autoreload=Arr;
|
My_LL_Tim_Init_Struct.Autoreload=Arr;
|
||||||
My_LL_Tim_Init_Struct.Prescaler=Psc;
|
My_LL_Tim_Init_Struct.Prescaler=Psc;
|
||||||
|
|
|
@ -18,7 +18,7 @@ Driver pour Timer 1
|
||||||
* int Psc : valeur à placer dans PSC
|
* int Psc : valeur à placer dans PSC
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
void MyTimer_Conf(TIM_TypeDef * Timer,int Period);
|
void MyTimer_Conf(TIM_TypeDef * Timer, int Arr, int Psc);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
71
MyDrivers/MyUSART.c
Normal file
71
MyDrivers/MyUSART.c
Normal file
|
@ -0,0 +1,71 @@
|
||||||
|
#include "MyUSART.h"
|
||||||
|
#include "stm32f1xx_ll_bus.h" // Pour l'activation des horloges
|
||||||
|
#include "stm32f1xx_ll_usart.h"
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Active l'horloge et règle les paramètres de transmission
|
||||||
|
* @note Fonction à lancer avant toute autre.
|
||||||
|
* @param USART_TypeDef UsDollar : indique le usart à utiliser par le uC, USART1, USART2 ou USART3
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
void MyUSART_Conf(USART_TypeDef * USART, int TransferDir)
|
||||||
|
{
|
||||||
|
LL_USART_InitTypeDef My_LL_USART_Init_Struct;
|
||||||
|
LL_USART_ClockInitTypeDef My_LL_USART_Clock;
|
||||||
|
|
||||||
|
// Validation horloge locale
|
||||||
|
if (USART==USART1) LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_USART1);
|
||||||
|
else if (USART==USART2) LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_USART2);
|
||||||
|
else LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_USART3);
|
||||||
|
|
||||||
|
//Activation clk de l'USART en entrée et sortie
|
||||||
|
LL_USART_ClockStructInit(&My_LL_USART_Clock);
|
||||||
|
My_LL_USART_Clock.ClockOutput = LL_USART_CLOCK_ENABLE;
|
||||||
|
LL_USART_ClockInit(USART, &My_LL_USART_Clock);
|
||||||
|
|
||||||
|
//Initialisation de l'USART
|
||||||
|
LL_USART_StructInit(&My_LL_USART_Init_Struct);
|
||||||
|
|
||||||
|
//My_LL_USART_Init_Struct.TransferDirection = TransferDir;
|
||||||
|
|
||||||
|
LL_USART_Init(USART, &My_LL_USART_Init_Struct);
|
||||||
|
|
||||||
|
LL_USART_Enable(USART);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Autorise les interruptions de TXE
|
||||||
|
* @note
|
||||||
|
* @param USART_TypeDef UsDollar : indique le usart à utiliser par le uC, USART1, USART2 ou USART3
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
void MyUSART_IT_Enable(USART_TypeDef * USART)
|
||||||
|
{
|
||||||
|
LL_USART_EnableIT_TXE(USART);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Interdit les interruptions de TXE
|
||||||
|
* @note
|
||||||
|
* @param USART_TypeDef UsDollar : indique le usart à utiliser par le uC, USART1, USART2 ou USART3
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
void MyUSART_IT_Disable(USART_TypeDef * USART)
|
||||||
|
{
|
||||||
|
LL_USART_DisableIT_TXE(USART);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Transmet 8bits de donnée
|
||||||
|
* @note
|
||||||
|
* @param USART_TypeDef UsDollar : indique le usart à utiliser par le uC, USART1, USART2 ou USART3
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
void MyUSART_Transmit_Data_8b(USART_TypeDef * USART, int data)
|
||||||
|
{
|
||||||
|
LL_USART_TransmitData8(USART, data);
|
||||||
|
while (LL_USART_IsActiveFlag_TC(USART) != 1){}
|
||||||
|
}
|
44
MyDrivers/MyUSART.h
Normal file
44
MyDrivers/MyUSART.h
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
#ifndef MY_USART_H
|
||||||
|
#define MY_USART_H
|
||||||
|
|
||||||
|
/*
|
||||||
|
Driver pour USART 1 à 3 du STM32F103RB
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "stm32f103xb.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Active l'horloge et règle les paramètres de transmission
|
||||||
|
* @note Fonction à lancer avant toute autre.
|
||||||
|
* @param USART_TypeDef UsDollar : indique le usart à utiliser par le uC, USART1, USART2 ou USART3
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
void MyUSART_Conf(USART_TypeDef * USART, int TransferDir);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Autorise les interruptions de TXE
|
||||||
|
* @note
|
||||||
|
* @param USART_TypeDef UsDollar : indique le usart à utiliser par le uC, USART1, USART2 ou USART3
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
void MyUSART_IT_Enable(USART_TypeDef * USART);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Interdit les interruptions de TXE
|
||||||
|
* @note
|
||||||
|
* @param USART_TypeDef UsDollar : indique le usart à utiliser par le uC, USART1, USART2 ou USART3
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
void MyUSART_IT_Disable(USART_TypeDef * USART);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Transmet 8bits de donnée
|
||||||
|
* @note
|
||||||
|
* @param USART_TypeDef UsDollar : indique le usart à utiliser par le uC, USART1, USART2 ou USART3
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
void MyUSART_Transmit_Data_8b(USART_TypeDef * USART, int data);
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
80
Services/Moteur.c
Normal file
80
Services/Moteur.c
Normal file
|
@ -0,0 +1,80 @@
|
||||||
|
|
||||||
|
#include "Moteur.h"
|
||||||
|
#include "MyPWM.h"
|
||||||
|
#include "MyTimer.h"
|
||||||
|
|
||||||
|
#include "stm32f1xx_ll_bus.h"
|
||||||
|
#include "stm32f1xx_ll_gpio.h"
|
||||||
|
#include "stm32f1xx_ll_tim.h"
|
||||||
|
|
||||||
|
|
||||||
|
void Moteur_Conf(void) {
|
||||||
|
|
||||||
|
//Fpwm = 10kHz = 72Mhz/(7200 = 0x1C20)
|
||||||
|
int Arr = 0x1C1F;
|
||||||
|
int Psc = 0x0;
|
||||||
|
|
||||||
|
//Activation horloge GPIO
|
||||||
|
LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_GPIOA);
|
||||||
|
|
||||||
|
//Config broche PA2 -> Sens
|
||||||
|
LL_GPIO_InitTypeDef My_GPIO_Init_Struct;
|
||||||
|
|
||||||
|
LL_GPIO_StructInit(&My_GPIO_Init_Struct);
|
||||||
|
|
||||||
|
My_GPIO_Init_Struct.Pin = PinSens;
|
||||||
|
My_GPIO_Init_Struct.Mode = LL_GPIO_MODE_OUTPUT;
|
||||||
|
My_GPIO_Init_Struct.OutputType = LL_GPIO_OUTPUT_PUSHPULL;
|
||||||
|
|
||||||
|
LL_GPIO_Init(GPIOPins, &My_GPIO_Init_Struct);
|
||||||
|
|
||||||
|
//Config broche PA1 -> PWM
|
||||||
|
LL_GPIO_StructInit(&My_GPIO_Init_Struct);
|
||||||
|
|
||||||
|
My_GPIO_Init_Struct.Pin = LL_GPIO_PIN_1;
|
||||||
|
My_GPIO_Init_Struct.Mode = LL_GPIO_MODE_ALTERNATE;
|
||||||
|
My_GPIO_Init_Struct.OutputType = LL_GPIO_OUTPUT_PUSHPULL;
|
||||||
|
|
||||||
|
LL_GPIO_Init(GPIOA, &My_GPIO_Init_Struct);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Activation horloge Timer
|
||||||
|
LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_TIM2);
|
||||||
|
|
||||||
|
//Configuration initiale du Timer
|
||||||
|
MyTimer_Conf(TimerPWM, Arr, Psc);
|
||||||
|
//Configuration du Timer en PWM Output
|
||||||
|
MyPWM_Conf_Output(TimerPWM, channelPWM);
|
||||||
|
|
||||||
|
Moteur_Speed(0);
|
||||||
|
Moteur_Sens(0);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void Moteur_Speed(int speedPercentage) {
|
||||||
|
int Arr = 0x1C1F;
|
||||||
|
|
||||||
|
if(speedPercentage == 0) {
|
||||||
|
MyTimer_Stop(TimerPWM);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
MyTimer_Start(TimerPWM);
|
||||||
|
MyPWM_Set_Impulse_Duration(TimerPWM, Arr*speedPercentage/100, channelPWM);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Moteur_Sens(int sens) {
|
||||||
|
|
||||||
|
if(sens == 0) {
|
||||||
|
LL_GPIO_ResetOutputPin(GPIOPins, PinSens);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
LL_GPIO_SetOutputPin(GPIOPins, PinSens);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
18
Services/Moteur.h
Normal file
18
Services/Moteur.h
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
#ifndef MOTEUR_H
|
||||||
|
#define MOTEUR_H
|
||||||
|
|
||||||
|
#include "stm32f103xb.h"
|
||||||
|
|
||||||
|
#define PinSens LL_GPIO_PIN_2
|
||||||
|
#define PinPWM LL_GPIO_PIN_1
|
||||||
|
#define GPIOPins GPIOA
|
||||||
|
#define TimerPWM TIM2
|
||||||
|
#define channelPWM LL_TIM_CHANNEL_CH2
|
||||||
|
|
||||||
|
void Moteur_Conf(void);
|
||||||
|
|
||||||
|
void Moteur_Speed(int speedPercentage);
|
||||||
|
|
||||||
|
void Moteur_Sens(int sens);
|
||||||
|
|
||||||
|
#endif
|
158
Services/MyRF.c
Normal file
158
Services/MyRF.c
Normal file
|
@ -0,0 +1,158 @@
|
||||||
|
#include "MyRF.h"
|
||||||
|
#include "MyTimer.h"
|
||||||
|
#include "MyPWM.h"
|
||||||
|
#include "MyUSART.h"
|
||||||
|
|
||||||
|
#include "stm32f1xx_ll_bus.h" // Pour l'activation des horloges
|
||||||
|
#include "stm32f1xx_ll_tim.h"
|
||||||
|
#include "stm32f1xx_ll_gpio.h"
|
||||||
|
#include "stm32f1xx_ll_usart.h"
|
||||||
|
|
||||||
|
|
||||||
|
void MyRF_Conf(void) {
|
||||||
|
|
||||||
|
//RX
|
||||||
|
//Activation horloge du GPIO
|
||||||
|
LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_GPIOB);
|
||||||
|
|
||||||
|
LL_GPIO_InitTypeDef My_GPIO_Init_Struct;
|
||||||
|
LL_GPIO_StructInit(&My_GPIO_Init_Struct);
|
||||||
|
|
||||||
|
//PB.6 en floating input
|
||||||
|
My_GPIO_Init_Struct.Pin = PinCH1;
|
||||||
|
LL_GPIO_Init(GPIOIn, &My_GPIO_Init_Struct);
|
||||||
|
|
||||||
|
//PB.7 en floating input
|
||||||
|
My_GPIO_Init_Struct.Pin = PinCH2;
|
||||||
|
LL_GPIO_Init(GPIOIn, &My_GPIO_Init_Struct);
|
||||||
|
|
||||||
|
|
||||||
|
//Configuration et lancment du Timer PWM Input
|
||||||
|
MyTimer_Conf(TimerCC,0xFFAD,0x15);
|
||||||
|
MyPWM_Conf_Input(TimerCC, channelCC1, channelCC2);
|
||||||
|
MyTimer_Start(TimerCC);
|
||||||
|
|
||||||
|
//TX
|
||||||
|
//Activation horloge du GPIO
|
||||||
|
LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_GPIOA);
|
||||||
|
|
||||||
|
LL_GPIO_StructInit(&My_GPIO_Init_Struct);
|
||||||
|
|
||||||
|
//PA.9 en alternate output pp
|
||||||
|
My_GPIO_Init_Struct.Pin = PinOut;
|
||||||
|
My_GPIO_Init_Struct.Mode = LL_GPIO_MODE_ALTERNATE;
|
||||||
|
My_GPIO_Init_Struct.OutputType = LL_GPIO_OUTPUT_PUSHPULL;
|
||||||
|
LL_GPIO_Init(GPIOOut, &My_GPIO_Init_Struct);
|
||||||
|
|
||||||
|
//PA.11 en output pp
|
||||||
|
My_GPIO_Init_Struct.Pin = PinTXEn;
|
||||||
|
My_GPIO_Init_Struct.Mode = LL_GPIO_MODE_OUTPUT;
|
||||||
|
My_GPIO_Init_Struct.OutputType = LL_GPIO_OUTPUT_PUSHPULL;
|
||||||
|
LL_GPIO_Init(GPIOOut, &My_GPIO_Init_Struct);
|
||||||
|
|
||||||
|
//Configuration de l'USART
|
||||||
|
MyUSART_Conf(USARTOut, TransferDirTX);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
int MyRF_Input_Duty_Cycle(void) {
|
||||||
|
int duty_cycle_RC = MyPWM_Duty_Cycle_Permilles(TimerCC, channelCC1, channelCC2);
|
||||||
|
if (74<duty_cycle_RC && duty_cycle_RC<77) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return (duty_cycle_RC - 75) * 4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MyRF_Transmit_3s(void) {
|
||||||
|
|
||||||
|
//Récupérer :
|
||||||
|
char bordage[3] = "";
|
||||||
|
char heure[2] = "xx";
|
||||||
|
char min[2] = "xx";
|
||||||
|
char sec[2] = "xx";
|
||||||
|
int allure_ref = 3;
|
||||||
|
|
||||||
|
char allure[7][16]= {"vent debout.",
|
||||||
|
"au plus près.",
|
||||||
|
"au près.",
|
||||||
|
"au bon plein.",
|
||||||
|
"au travers.",
|
||||||
|
"au grand largue.",
|
||||||
|
"au vent arrière."
|
||||||
|
};
|
||||||
|
char data1[14] = "\" - Bordage : ";
|
||||||
|
char data2[24] = " === Le voilier navigue ";
|
||||||
|
|
||||||
|
int i;
|
||||||
|
|
||||||
|
|
||||||
|
//Activation de l'émetteur RF
|
||||||
|
LL_GPIO_SetOutputPin(GPIOOut ,PinTXEn);
|
||||||
|
|
||||||
|
//Heure
|
||||||
|
MyUSART_Transmit_Data_8b(USARTOut, heure[0]);
|
||||||
|
MyUSART_Transmit_Data_8b(USARTOut, heure[1]);
|
||||||
|
MyUSART_Transmit_Data_8b(USARTOut, 'h');
|
||||||
|
//Minutes
|
||||||
|
MyUSART_Transmit_Data_8b(USARTOut, min[0]);
|
||||||
|
MyUSART_Transmit_Data_8b(USARTOut, min[1]);
|
||||||
|
MyUSART_Transmit_Data_8b(USARTOut, '\'');
|
||||||
|
//Secondes
|
||||||
|
MyUSART_Transmit_Data_8b(USARTOut, sec[0]);
|
||||||
|
MyUSART_Transmit_Data_8b(USARTOut, sec[1]);
|
||||||
|
//Texte 1 (bordage)
|
||||||
|
for(i=0; i<14; i++) {
|
||||||
|
MyUSART_Transmit_Data_8b(USARTOut, data1[i]);
|
||||||
|
}
|
||||||
|
//Bordage
|
||||||
|
for(i=0; i<3; i++) {
|
||||||
|
MyUSART_Transmit_Data_8b(USARTOut, bordage[i]);
|
||||||
|
}
|
||||||
|
MyUSART_Transmit_Data_8b(USARTOut, '%');
|
||||||
|
//Texte 2 (allure)
|
||||||
|
for(i=0; i<24; i++) {
|
||||||
|
MyUSART_Transmit_Data_8b(USARTOut, data2[i]);
|
||||||
|
}
|
||||||
|
//Allure
|
||||||
|
for(i=0; i<16; i++) {
|
||||||
|
MyUSART_Transmit_Data_8b(USARTOut, allure[allure_ref][i]);
|
||||||
|
}
|
||||||
|
//Newline (fin)
|
||||||
|
MyUSART_Transmit_Data_8b(USARTOut, '\n');
|
||||||
|
|
||||||
|
//Désactivation de l'émetteur RF
|
||||||
|
LL_GPIO_ResetOutputPin(GPIOOut ,PinTXEn);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void MyRF_Transmit_Batterie_Faible(void) {
|
||||||
|
|
||||||
|
//Activation de l'émetteur RF
|
||||||
|
LL_GPIO_SetOutputPin(GPIOOut ,PinTXEn);
|
||||||
|
|
||||||
|
char data[24] = "/!\\ BATTERIE FAIBLE /!\\\n";
|
||||||
|
for(int i = 0; i<24; i++) {
|
||||||
|
MyUSART_Transmit_Data_8b(USARTOut, data[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Désactivation de l'émetteur RF
|
||||||
|
LL_GPIO_ResetOutputPin(GPIOOut ,PinTXEn);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void MyRF_Transmit_Limite_Roulis(void) {
|
||||||
|
|
||||||
|
//Activation de l'émetteur RF
|
||||||
|
LL_GPIO_SetOutputPin(GPIOOut ,PinTXEn);
|
||||||
|
|
||||||
|
char data[30] = "/!\\ RISQUE DE CHAVIREMENT /!\\\n";
|
||||||
|
for(int i = 0; i<30; i++) {
|
||||||
|
MyUSART_Transmit_Data_8b(USARTOut, data[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Désactivation de l'émetteur RF
|
||||||
|
LL_GPIO_ResetOutputPin(GPIOOut ,PinTXEn);
|
||||||
|
|
||||||
|
}
|
29
Services/MyRF.h
Normal file
29
Services/MyRF.h
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
#ifndef MYRF_H
|
||||||
|
#define MYRF_H
|
||||||
|
|
||||||
|
#include "stm32f103xb.h"
|
||||||
|
|
||||||
|
#define PinCH1 LL_GPIO_PIN_6
|
||||||
|
#define PinCH2 LL_GPIO_PIN_7
|
||||||
|
#define PinOut LL_GPIO_PIN_9
|
||||||
|
#define PinTXEn LL_GPIO_PIN_11
|
||||||
|
#define GPIOIn GPIOB
|
||||||
|
#define GPIOOut GPIOA
|
||||||
|
#define TimerCC TIM4
|
||||||
|
#define channelCC1 LL_TIM_CHANNEL_CH1
|
||||||
|
#define channelCC2 LL_TIM_CHANNEL_CH2
|
||||||
|
#define USARTOut USART1
|
||||||
|
#define TransferDirTX LL_USART_DIRECTION_TX
|
||||||
|
|
||||||
|
|
||||||
|
void MyRF_Conf(void);
|
||||||
|
|
||||||
|
int MyRF_Duty_Cycle_Moteur(void);
|
||||||
|
|
||||||
|
void MyRF_Transmit_3s(void);
|
||||||
|
|
||||||
|
void MyRF_Transmit_Batterie_Faible(void);
|
||||||
|
|
||||||
|
void MyRF_Transmit_Limite_Roulis(void);
|
||||||
|
|
||||||
|
#endif
|
|
@ -1 +0,0 @@
|
||||||
Mettre les services ici
|
|
11
Src/main.c
11
Src/main.c
|
@ -19,6 +19,10 @@
|
||||||
#include "stm32f1xx_ll_rcc.h" // utile dans la fonction SystemClock_Config
|
#include "stm32f1xx_ll_rcc.h" // utile dans la fonction SystemClock_Config
|
||||||
#include "stm32f1xx_ll_utils.h" // utile dans la fonction SystemClock_Config
|
#include "stm32f1xx_ll_utils.h" // utile dans la fonction SystemClock_Config
|
||||||
#include "stm32f1xx_ll_system.h" // utile dans la fonction SystemClock_Config
|
#include "stm32f1xx_ll_system.h" // utile dans la fonction SystemClock_Config
|
||||||
|
#include "stm32f1xx_ll_gpio.h"
|
||||||
|
#include "MyTimer.h"
|
||||||
|
#include "MyPWM.h"
|
||||||
|
#include "MyRF.h"
|
||||||
|
|
||||||
void SystemClock_Config(void);
|
void SystemClock_Config(void);
|
||||||
|
|
||||||
|
@ -36,6 +40,13 @@ int main(void)
|
||||||
/* Configure the system clock to 72 MHz */
|
/* Configure the system clock to 72 MHz */
|
||||||
SystemClock_Config();
|
SystemClock_Config();
|
||||||
|
|
||||||
|
MyRF_Conf();
|
||||||
|
|
||||||
|
for(int i=0; i<0xCFFF; i++) {
|
||||||
|
}
|
||||||
|
|
||||||
|
MyRF_Transmit_3s();
|
||||||
|
|
||||||
/* Infinite loop */
|
/* Infinite loop */
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue