introduction du timer3
这个提交包含在:
父节点
dc3df714a8
当前提交
699c16188d
共有 1 个文件被更改,包括 24 次插入 和 18 次删除
|
@ -1,18 +1,16 @@
|
|||
|
||||
#include "GestionSon.h"
|
||||
#include "DriverJeuLaser.h"
|
||||
# define PERIODE 6552
|
||||
# define PERIODE_PWM 720
|
||||
|
||||
#define TE_IN_TICKS 6552
|
||||
#define PERIODE_PWM 720
|
||||
//int modulation(int i);
|
||||
//void CallbackSon(void);
|
||||
|
||||
extern short Sortie_son;
|
||||
//extern short int Son [];
|
||||
//extern short int LongueurSon;
|
||||
|
||||
//short int SortieSon;
|
||||
extern void CallbackSon(void);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
int main(void)
|
||||
{
|
||||
|
||||
|
@ -22,22 +20,30 @@ int main(void)
|
|||
|
||||
// Après exécution : le coeur CPU est clocké à 72MHz ainsi que tous les timers
|
||||
CLOCK_Configure();
|
||||
|
||||
// Timer_1234_Init_ff(TIM4, PeriodeSonMicroSec * US_IN_TICKS);
|
||||
Timer_1234_Init_ff(TIM4, TE_IN_TICKS);
|
||||
//Timer_1234_Init_ff(TIM3, PERIODE_PWM); // periode de la PWM = 10us
|
||||
Active_IT_Debordement_Timer(TIM4, 2, GestionSon);
|
||||
GPIO_Configure(GPIOB, 0, OUTPUT, ALT_PPULL);
|
||||
|
||||
PWM_Init_ff(TIM3, 3, PERIODE_PWM);
|
||||
StartSon();
|
||||
|
||||
|
||||
Timer_1234_Init_ff(TIM4,PERIODE);
|
||||
Active_IT_Debordement_Timer(TIM4, 2, CallbackSon);
|
||||
|
||||
//Timer_1234_Init_ff(TIM3,PERIODE_PWM);
|
||||
|
||||
PWM_Init_ff( TIM3, 3, 720);
|
||||
|
||||
|
||||
GPIO_Configure(GPIOB, 0, OUTPUT, ALT_PPULL);
|
||||
|
||||
//============================================================================
|
||||
|
||||
|
||||
while (1)
|
||||
{
|
||||
//PWM_Set_Value_TIM3_Ch3(SortieSon);
|
||||
}
|
||||
}
|
||||
|
||||
//void CallbackSon(void){
|
||||
//static int i = 0;
|
||||
//if(i < LongueurSon){
|
||||
// SortieSon = (Son[i] + 32768) * 719 / 65535;
|
||||
// i++;
|
||||
// }
|
正在加载…
在新工单中引用