Ajout activation/desact. module RF (PA.11)
This commit is contained in:
parent
5723b95405
commit
d91e0bc8ed
5 changed files with 38 additions and 10 deletions
|
@ -317,7 +317,7 @@
|
|||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<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=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=521,17,1115,768,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>
|
||||
<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>
|
||||
<Number>0</Number>
|
||||
|
@ -411,8 +411,8 @@
|
|||
<LogicAnalyzers>
|
||||
<Wi>
|
||||
<IntNumber>0</IntNumber>
|
||||
<FirstString>((porta & 0x00000200) >> 9 & 0x200) >> 9</FirstString>
|
||||
<SecondString>00008000000000000000000000000000E0FFEF400200000000000000000000000000000028706F7274612026203078303030303032303029203E3E2039000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000900000001000000000000000000F03F17000000000000000000000000000000000000003E160008</SecondString>
|
||||
<FirstString>((porta & 0x00000800) >> 11 & 0x800) >> 11</FirstString>
|
||||
<SecondString>00800000000000000000000000000000E0FFEF400000000000000000000000000000000028706F7274612026203078303030303038303029203E3E2031310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000001000000000000000000F03F170000000000000000000000000000000000000076150008</SecondString>
|
||||
</Wi>
|
||||
</LogicAnalyzers>
|
||||
<DebugDescription>
|
||||
|
|
|
@ -55,6 +55,7 @@ void MyPWM_Set_Impulse_Duration(TIM_TypeDef * Timer, uint32_t CompareValue, int
|
|||
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;
|
||||
|
|
|
@ -44,15 +44,15 @@ void MyRF_Conf(void) {
|
|||
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);
|
||||
|
||||
//Configuration Timer (interruption à 3s, callback MyRF_Transmit_3s) et lancement
|
||||
MyTimer_Conf(TimerRF,65533,3295);
|
||||
MyTimer_IT_Conf(TimerRF,MyRF_Transmit_3s,3);
|
||||
MyTimer_IT_Enable(TimerRF);
|
||||
MyTimer_Start(TimerRF);
|
||||
|
||||
}
|
||||
|
||||
int MyRF_Input_Duty_Cycle(void) {
|
||||
|
@ -87,6 +87,10 @@ void MyRF_Transmit_3s(void) {
|
|||
|
||||
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]);
|
||||
|
@ -118,18 +122,37 @@ void MyRF_Transmit_3s(void) {
|
|||
//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);
|
||||
|
||||
}
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
#define channelCC2 LL_TIM_CHANNEL_CH2
|
||||
#define USARTOut USART1
|
||||
#define TransferDirTX LL_USART_DIRECTION_TX
|
||||
#define TimerRF TIM1
|
||||
|
||||
|
||||
void MyRF_Conf(void);
|
||||
|
|
|
@ -42,6 +42,11 @@ int main(void)
|
|||
|
||||
MyRF_Conf();
|
||||
|
||||
for(int i=0; i<0xCFFF; i++) {
|
||||
}
|
||||
|
||||
MyRF_Transmit_3s();
|
||||
|
||||
/* Infinite loop */
|
||||
while (1)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue