Abl-electronic PIC Microcontrollers PIC16 Manuel d'utilisateur Page 270

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 312
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 269
mikroC
- C Compiler for Microchip PIC microcontrollers
mikroC
making it simple...
262
MikroElektronika:
Development
tools
-
Books
-
Compilers
page
Prototype
unsigned short Soft_Uart_Read(unsigned short *error);
Returns Returns a received byte.
Description Function receives a byte via software UART. Parameter error will be zero if the
transfer was successful. This is a non-blocking function call, so you should test the
error manually (check the example below).
Requires Soft UART must be initialized and communication established before using this func-
tion. See
Soft_Uart_Init.
Example
// Here’s a loop which holds until data is received:
do
data = Soft_Uart_Read(&error);
while (error);
// Now we can work with it:
if (data) {...}
Soft_Uart_Read
Prototype
void Soft_Uart_Write(char data);
Description Function transmits a byte (data) via UART.
Requires Soft UART must be initialized and communication established before using this func-
tion. See Soft_Uart_Init.
Be aware that during transmission, software UART is incapable of receiving data – data
transfer protocol must be set in such a way to prevent loss of information.
Example
char some_byte = 0x0A;
...
Soft_Uart_Write(some_byte);
Soft_Uart_Write
Vue de la page 269
1 2 ... 265 266 267 268 269 270 271 272 273 274 275 ... 311 312

Commentaires sur ces manuels

Pas de commentaire