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

  • 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 153
mikroC
- C Compiler for Microchip PIC microcontrollers
mikroC
making it simple...
146
MikroElektronika:
Development
tools
-
Books
-
Compilers
page
Prototype
char CANRead(long *id, char *data, char *datalen, char
*CAN_RX_MSG_FLAGS);
Returns Message from receive buffer or zero if no message found.
Description Function reads message from receive buffer. If at least one full receive buffer is found, it
is extracted and returned. If none found, function returns zero.
Parameters:
id is message identifier; data is an array of bytes up to 8 bytes in length;
datalen is data length, from 1–8; CAN_RX_MSG_FLAGS is value formed from constants
(see CAN constants).
Requires CAN must be in mode in which receiving is possible.
Example
char rcv, rx, len, data[8]; long id;
rcv = CANRead(id, data, len, 0);
CANRead
Prototype
char CANWrite(long id, char *data, char datalen, char
CAN_TX_MSG_FLAGS);
Returns Returns zero if message cannot be queued (buffer full).
Description If at least one empty transmit buffer is found, function sends message on queue for
transmission. If buffer is full, function returns 0.
Parameters:
id is CAN message identifier. Only 11 or 29 bits may be used depending
on message type (standard or extended); data is array of bytes up to 8 bytes in length;
datalen is data length from 1–8; CAN_TX_MSG_FLAGS is value formed from constants
(see CAN constants).
Requires CAN must be in Normal mode.
Example
char tx, data; long id;
tx = CAN_TX_PRIORITY_0 & CAN_TX_XTD_FRAME;
CANWrite(id, data, 2, tx);
CANWrite
Vue de la page 153
1 2 ... 149 150 151 152 153 154 155 156 157 158 159 ... 311 312

Commentaires sur ces manuels

Pas de commentaire