fin obj3 - generation son
This commit is contained in:
parent
96e0a2f56d
commit
6e12cdda6d
3 changed files with 5567 additions and 6095 deletions
|
@ -154,6 +154,21 @@
|
|||
</SetRegEntry>
|
||||
</TargetDriverDllRegistry>
|
||||
<Breakpoint/>
|
||||
<WatchWindow1>
|
||||
<Ww>
|
||||
<count>0</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>etat,0x0A</ItemText>
|
||||
</Ww>
|
||||
</WatchWindow1>
|
||||
<MemoryWindow1>
|
||||
<Mm>
|
||||
<WinNumber>1</WinNumber>
|
||||
<SubType>265</SubType>
|
||||
<ItemText>0x08001EEC</ItemText>
|
||||
<AccSizeX>0</AccSizeX>
|
||||
</Mm>
|
||||
</MemoryWindow1>
|
||||
<Tracepoint>
|
||||
<THDelay>0</THDelay>
|
||||
</Tracepoint>
|
||||
|
@ -199,8 +214,8 @@
|
|||
<LogicAnalyzers>
|
||||
<Wi>
|
||||
<IntNumber>0</IntNumber>
|
||||
<FirstString>((portb & 0x00000002) >> 1 & 0x2) >> 1</FirstString>
|
||||
<SecondString>FF000000000000000000000000000000E0FFEF400100000000000000000000000000000028706F7274622026203078303030303030303229203E3E2031000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000001000000000000000000F03F0700000000000000000000000000000000000000401E0008</SecondString>
|
||||
<FirstString>`TIM3_CCR3</FirstString>
|
||||
<SecondString>0000FF00000000000000000000000000008499400000000000000000000000000000000054494D335F4343523300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000300000001000000000000000000F03F1600000000000000000000000000000000000000901E0008</SecondString>
|
||||
</Wi>
|
||||
</LogicAnalyzers>
|
||||
<DebugDescription>
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -3,12 +3,12 @@
|
|||
typedef struct {
|
||||
int position; // index courant dans le tableau d'echantillons
|
||||
int taille; // nombre d'echantillons de l'enregistrement
|
||||
short int * son; // adresse de base du tableau d'echantillons en ROM
|
||||
short int *son; // adresse de base du tableau d'echantillons en ROM
|
||||
int resolution; // pleine echelle du modulateur PWM
|
||||
int Tech_en_Tck; // periode d'ech. audio en periodes d'horloge CPU
|
||||
} type_etat;
|
||||
|
||||
// Variables définie en asm
|
||||
// Variables définies en asm
|
||||
extern short Son;
|
||||
extern int LongueurSon;
|
||||
extern int PeriodeSonMicroSec;
|
||||
|
@ -21,14 +21,13 @@ void timer_callback(void);
|
|||
|
||||
|
||||
int main(void) {
|
||||
|
||||
// activation de la PLL qui multiplie la fréquence du quartz par 9
|
||||
CLOCK_Configure();
|
||||
|
||||
// config port PB0 pour être utilisé par TIM3-CH3
|
||||
GPIO_Configure(GPIOB, 0, OUTPUT, ALT_PPULL);
|
||||
// config TIM3-CH3 en mode PWM
|
||||
etat.resolution = PWM_Init_ff( TIM3, 3, Periode_PWM_en_Tck );
|
||||
etat.resolution = PWM_Init_ff(TIM3, 3, Periode_PWM_en_Tck);
|
||||
etat.taille = LongueurSon;
|
||||
etat.son = &Son;
|
||||
etat.position = 0;
|
||||
|
@ -37,19 +36,17 @@ int main(void) {
|
|||
// initialisation du timer 4
|
||||
// Periode_en_Tck doit fournir la durée entre interruptions,
|
||||
// exprimée en périodes Tck de l'horloge principale du STM32 (72 MHz)
|
||||
Timer_1234_Init_ff( TIM4, Periode_ech_en_Tck );
|
||||
Timer_1234_Init_ff(TIM4, Periode_ech_en_Tck);
|
||||
|
||||
// enregistrement de la fonction de traitement de l'interruption timer
|
||||
// ici le 2 est la priorité, timer_callback est l'adresse de cette fonction, a créér en asm,
|
||||
// cette fonction doit être conforme à l'AAPCS
|
||||
Active_IT_Debordement_Timer( TIM4, 2, timer_callback );
|
||||
Active_IT_Debordement_Timer(TIM4, 2, timer_callback);
|
||||
// lancement du timer
|
||||
Run_Timer( TIM4 );
|
||||
Run_Timer(TIM4);
|
||||
|
||||
|
||||
while (1) {
|
||||
|
||||
}
|
||||
while (1) {}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue