User manual
mikroC PRO for dsPIC
MikroElektronika
291
Library Routines
- CANSPISetOperationMode
- CANSPIGetOperationMode
- CANSPIInitialize
- CANSPISetBaudRate
- CANSPISetMask
- CANSPISetFilter
- CANSPIRead
- CANSPIWrite
CANSPISetOperationMode
Prototype
void CANSPISetOperationMode(char mode, char WAIT);
Description Sets the CANSPI module to requested mode.
Parameters mode: CANSPI module operation mode. Valid values: CANSPI_OP_MODE constants. See CANSPI_
OP_MODE constants.
WAIT: CANSPI mode switching verication request. If WAIT == 0, the call is non-blocking. The
function does not verify if the CANSPI module is switched to requested mode or not. Caller must
use CANSPIGetOperationMode to verify correct operation mode before performing mode specic
operation. If WAIT != 0, the call is blocking – the function won’t “return” until the requested mode is
set.
Returns Nothing.
Requires The CANSPI routines are supported only by MCUs with the SPI module.
MCU has to be properly connected to mikroElektronika’s CANSPI Extra Board or similar hardware.
See connection example at the bottom of this page.
Example
// set the CANSPI module into conguration mode (wait inside
CANSPISetOperationMode until this mode is set)
CANSPISetOperationMode(_CANSPI_MODE_CONFIG, 0xFF);
Notes None.