Abl-electronic PIC Microcontrollers PIC16 Manual de usuario Pagina 165

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 312
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 164
MikroElektronika:
Development
tools
-
Books
-
Compilers
157
page
mikroC
- C Compiler for Microchip PIC microcontrollers
mikroC
making it simple...
Prototype
void CANSPISetMask(char CAN_MASK, long value, char
CAN_CONFIG_FLAGS);
Description Function sets mask for advanced filtering of messages. Given value is bit adjusted to
appropriate buffer mask registers.
Parameters:
CAN_MASK is one of predefined constant values (see CAN constants);
value is the mask register value; CAN_CONFIG_FLAGS selects type of message to filter,
either CAN_CONFIG_XTD_MSG or CAN_CONFIG_STD_MSG.
Requires CANSPI must be in Config mode; otherwise the function will be ignored.
Example
// Set all mask bits to 1, i.e. all filtered bits are relevant:
CANSPISetMask(CAN_MASK_B1, -1, CAN_CONFIG_XTD_MSG);
/* Note that -1 is just a cheaper way to write 0xFFFFFFFF.
Complement will do the trick and fill it up with ones. */
CANSPISetMask
Prototype
void CANSPISetFilter(char CAN_FILTER, long value,
char CAN_CONFIG_FLAGS);
Description Function sets mask for advanced filtering of messages. Given value is bit adjusted to
appropriate buffer mask registers.
Parameters:
CAN_MASK is one of predefined constant values (see CAN constants);
value is the filter register value; CAN_CONFIG_FLAGS selects type of message to filter,
either
CAN_CONFIG_XTD_MSG or CAN_CONFIG_STD_MSG.
Requires CANSPI must be in Config mode; otherwise the function will be ignored.
Example
/* Set id of filter B1_F1 to 3: */
CANSPISetFilter(CAN_FILTER_B1_F1, 3, CAN_CONFIG_XTD_MSG);
CANSPISetFilter
Vista de pagina 164
1 2 ... 160 161 162 163 164 165 166 167 168 169 170 ... 311 312

Comentarios a estos manuales

Sin comentarios