mikroElektronika PIC Microcontrollers PIC12 User Manual page 150

Mikroc user's manual
Table of Contents

Advertisement

mikroC - C Compiler for Microchip PIC microcontrollers
CANSetOperationMode
Prototype
void CANSetOperationMode(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).
Parameter
If set to 0xFF, this is a blocking 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
to verify correct operation mode before performing mode specific operation.
Requires
CAN routines are currently supported only by P18XXX8 PICmicros. Microcontroller
must be connected to CAN transceiver (MCP2551 or similar) which is connected to
CAN bus.
Example
CANSetOperationMode(CAN_MODE_CONFIG, 0xFF);
CANGetOperationMode
Prototype
char CANGetOperationMode(void);
Returns
Current opmode.
Description
Function returns current operational mode of CAN module.
Requires
CAN routines are currently supported only by P18XXX8 PICmicros. Microcontroller
must be connected to CAN transceiver (MCP2551 or similar) which is connected to
CAN bus.
Example
if (CANGetOperationMode() == CAN_MODE_NORMAL) { ... };
page
142
needs to be either 0 or 0xFF:
wait_flag
MikroElektronika: Development tools - Books - Compilers
mikroC
making it simple...
needs to
mode
CANGetOperationMode

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?

This manual is also suitable for:

Pic microcontrollers pic16Pic microcontrollers pic18

Table of Contents