Projet

Général

Profil

« Précédent | Suivant » 

Révision 835

Ajouté par Romain CHAMBELLON il y a environ 4 ans

Fin séance TP SP4 c2

Voir les différences:

branch/CHAMBELLON/sp4c12/TPSP4c1/TPSP4c1/TPSP4c1.c
/* NOTE:THIS IS A TYPICAL EXAMPLE. */
/***********************************************************************/
void uart0_init(void){
pd6_2 = 0; //Input RX
pd6_3 = 1; //Output TX
//Registre U0MR :
u0mr = 0x05;
//Registre PS0 /
ps0 = 0x08; // RX en mode reception de donnees
u0c1 = 0x05; //activation transmission et r?ception
u0c0 = 0x11; //diviseur de fr?quence par 8 et CTS d?sactiv?
//Registre PS10 :
psl0 = 0;
u0brg = 0x20; //Transmission des donn?es ? la vitesse de 4800 bauds
}
void reception_trame(char* trame){
}
int i;
void main(void)
{
{
uart0_init();
while(1){
}
}
}
branch/CHAMBELLON/sp4c12/TPSP4c1/TPSP4c1/DefaultSession.hsf
0
[WINDOW_POSITION_STATE_DATA_VD1]
"Help" "TOOLBAR 0" 59419 1 5 "0.00" 0 0 0 0 0 17 0 "" "0.0"
"{WK_00000001_CmdLine}" "WINDOW" 59422 0 1 "0.25" 180 0 0 350 200 17 0 "32771|32772|32778|<<separator>>|32773|32774|<<separator>>|32820|<<separator>>|32801|32824" "0.0"
"{WK_00000001_CmdLine}" "WINDOW" 59422 0 1 "0.20" 180 0 0 350 200 17 0 "32771|32772|32778|<<separator>>|32773|32774|<<separator>>|32820|<<separator>>|32801|32824" "0.0"
"{WK_00000001_OUTPUT}" "WINDOW" 59422 0 0 "1.00" 180 534 287 350 200 18 0 "36756|36757|36758|36759|<<separator>>|36746|36747|<<separator>>|39531|<<separator>>|39500|39534|<<separator>>|36687" "0.0"
"{WK_00000002_WORKSPACE}" "WINDOW" 59420 0 0 "1.00" 180 534 287 350 200 18 0 "" "0.0"
"{WK_TB00000001_STANDARD}" "TOOLBAR 0" 59419 0 2 "0.00" 0 0 0 0 0 18 0 "" "0.0"
branch/CHAMBELLON/sp4c12/TPSP4c1/TPSP4c1/uart0.c
ir_s0ric = 0;
}
char uart0_rx(void){
while(ri_u0c1 != 1);
return u0rb; // Valeur du registre retourn?
}
void uart0_tx(char c)?{
void uart0_tx(char c){
while(ti_u0c1 != 1);
u0tb = c;
}
}
char uart0_rx(void)

Formats disponibles : Unified diff