mikroC - C Compiler for Microchip PIC microcontrollers
CANSPISetOperationMode
Prototype
void CANSPISetOperationMode(char mode, char wait_flag);
Description
Sets CAN to requested mode, i.e. copies mode to CANSTAT. Parameter
be one of CAN_OP_MODE constants (see CAN constants, page 145).
Parameter
call – the function won't "return" until the requested mode is set. If 0, this is a non-
blocking call. It does not verify if CAN module is switched to requested mode or not.
Caller must use function
before performing mode specific operation.
Requires
CANSPI functions are supported by any PIC MCU that has SPI interface on PORTC.
Also, CS pin of MCP2510 or MCP2515 must be connected to RC0.
Example
CANSPISetOperationMode(CAN_MODE_CONFIG, 0xFF);
CANSPIGetOperationMode
Prototype
char CANSPIGetOperationMode(void);
Returns
Current opmode.
Description
Function returns current operational mode of CAN module.
Example
if (CANSPIGetOperationMode() == CAN_MODE_NORMAL) { ... };
page
154
needs to be either 0 or 0xFF: If set to 0xFF, this is a blocking
wait_flag
CANSPIGetOperationMode
MikroElektronika: Development tools - Books - Compilers
making it simple...
needs to
mode
to verify correct operation mode
mikroC
Need help?
Do you have a question about the PIC Microcontrollers PIC12 and is the answer not in the manual?