⚲
Projet
Général
Profil
Connexion
S'enregistrer
Accueil
Projets
Aide
Recherche
:
Polytech Ge SP4abc 2021
Tous les projets
Travaux Pratiques
»
Polytech Ge SP4abc 2021
Aperçu
Activité
Demandes
Annonces
Documents
Wiki
Fichiers
Dépôt
Télécharger (566 octets)
Statistiques
| Révision:
root
/
branch
/
MBADINGA
/
sp4c12
/
Sp4c12
/
uart0.c
@ 916
Voir
Historique
Annoter
#include
"sfr32c87.h"
void
uart0_init
(
void
)
{
//initialisation des ports
pd6_1
=
0
;
pd6_2
=
0
;
pd6_3
=
1
;
ps0_1
=
0
;
ps0_2
=
0
;
ps0_3
=
1
;
//initialisation des registres
u0mr
=
0x05
;
u0brg
=
0x20
;
u0c0
=
0x11
;
u0c1
=
0x05
;
}
void
uart0_tx
(
char
c
)
{
while
(
ti_u0c1
!=
1
);
u0tb
=
c
;
}
char
uart0_rx
()
{
char
c
;
while
(
ri_u0c1
!=
1
);
c
=
u0rb
;
uart0_tx
(
c
);
return
c
;
}
« Précédent
1
…
8
9
10
11
Suivant »
(10-10/11)
Chargement...