Mikroelektronika MIKROE-724 データシート
264
mikoBasic PRO for dsPIC30/33 and PIC24
MikroElektronika
Library Routines
- CANSPISetOperationMode
- CANSPIGetOperationMode
- CANSPIInit
- CANSPISetBaudRate
- CANSPISetMask
- CANSPISetFilter
- CANSPIRead
- CANSPIWrite
CANSPISetOperationMode
Prototype
sub procedure CANSPISetOperationMode(dim mode as byte, dim WAIT as byte)
Description Sets the CANSPI module to requested mode.
Parameters
Parameters
mode
: CANSPI module operation mode. Valid values:
CANSPI_OP_MODE
constants. See CANSPI_
OP_MODE constants.
WAIT
: CANSPI mode switching verification 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 specific
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 configuration mode (wait inside
CANSPISetOperationMode until this mode is set)
CANSPISetOperationMode(_CANSPI_MODE_CONFIG, 0xFF)
Notes
None.