parametrage projet et variables pour obj3
This commit is contained in:
parent
7df48c38d7
commit
96e0a2f56d
3 changed files with 6131 additions and 11 deletions
|
@ -200,7 +200,7 @@
|
|||
<Wi>
|
||||
<IntNumber>0</IntNumber>
|
||||
<FirstString>((portb & 0x00000002) >> 1 & 0x2) >> 1</FirstString>
|
||||
<SecondString>FF000000000000000000000000000000E0FFEF400100000000000000000000000000000028706F7274622026203078303030303030303229203E3E2031000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000001000000000000000000F03F0900000000000000000000000000000000000000401E0008</SecondString>
|
||||
<SecondString>FF000000000000000000000000000000E0FFEF400100000000000000000000000000000028706F7274622026203078303030303030303229203E3E2031000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000001000000000000000000F03F0700000000000000000000000000000000000000401E0008</SecondString>
|
||||
</Wi>
|
||||
</LogicAnalyzers>
|
||||
<DebugDescription>
|
||||
|
@ -235,7 +235,7 @@
|
|||
<GroupNumber>1</GroupNumber>
|
||||
<FileNumber>2</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>.\Src\principal.c</PathWithFileName>
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,21 +1,44 @@
|
|||
#include "gassp72.h"
|
||||
|
||||
int periode_en_tck = 100;
|
||||
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
|
||||
int resolution; // pleine echelle du modulateur PWM
|
||||
int Tech_en_Tck; // periode d'ech. audio en periodes d'horloge CPU
|
||||
} type_etat;
|
||||
|
||||
int current_value = 0;
|
||||
// Variables définie en asm
|
||||
extern short Son;
|
||||
extern int LongueurSon;
|
||||
extern int PeriodeSonMicroSec;
|
||||
|
||||
type_etat etat;
|
||||
int Periode_PWM_en_Tck = 1633;
|
||||
int Periode_ech_en_Tck = 6532;
|
||||
|
||||
void timer_callback(void);
|
||||
|
||||
|
||||
int main(void) {
|
||||
|
||||
// activation de la PLL qui multiplie la fréquence du quartz par 9
|
||||
CLOCK_Configure();
|
||||
// config port PB1 pour être utilisé en sortie
|
||||
GPIO_Configure(GPIOB, 1, OUTPUT, OUTPUT_PPULL);
|
||||
|
||||
// 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.taille = LongueurSon;
|
||||
etat.son = &Son;
|
||||
etat.position = 0;
|
||||
|
||||
|
||||
// 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_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
|
||||
|
|
Loading…
Reference in a new issue