mikroElektronika PIC Microcontrollers PIC12 User Manual page 163

Mikroc user's manual
Table of Contents

Advertisement

mikroC
making it simple...
CANSPIInitialize
Prototype
void CANSPIInitialize(char SJW, char BRP, char PHSEG1, char
PHSEG2, char PROPSEG, char CAN_CONFIG_FLAGS);
Description
Initializes CANSPI. All pending transmissions are aborted. Sets all mask registers to 0
to allow all messages.
Filter registers are set according to flag value:
if (CAN_CONFIG_FLAGS & CAN_CONFIG_VALID_XTD_MSG != 0)
else if (config & CONFIG_VALID_STD_MSG != 0)
else
Parameters:
SJW
BRP
PHSEG1
PHSEG2
PROPSEG
CAN_CONFIG_FLAGS
145).
Requires
CANSPI must be in Config mode; otherwise the function will be ignored.
Example
init = CAN_CONFIG_SAMPLE_THRICE
...
CANSPIInitialize(1, 1, 3, 3, 1, init);
MikroElektronika: Development tools - Books - Compilers
// Set all filters to XTD_MSG
// Set all filters to STD_MSG
// Set half the filters to STD, and the rest to XTD_MSG
as defined in 18XXX8 datasheet (1–4)
as defined in 18XXX8 datasheet (1–64)
as defined in 18XXX8 datasheet (1–8)
as defined in 18XXX8 datasheet (1–8)
as defined in 18XXX8 datasheet (1–8)
is formed from predefined constants (see CAN constants, page
CAN_CONFIG_PHSEG2_PRG_ON
CAN_CONFIG_STD_MSG
CAN_CONFIG_DBL_BUFFER_ON
CAN_CONFIG_VALID_XTD_MSG
CAN_CONFIG_LINE_FILTER_OFF;
mikroC - C Compiler for Microchip PIC microcontrollers
&
&
&
&
&
// initialize CANSPI
page
155

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the PIC Microcontrollers PIC12 and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Pic microcontrollers pic16Pic microcontrollers pic18

Table of Contents