Mikroelektronika MIKROE-742 데이터 시트

다운로드
페이지 532
Library Routines
- CANSPISetOperationMode 
- CANSPIGetOperationMode 
- CANSPIInitialize 
- CANSPISetBaudRate 
- CANSPISetMask 
- CANSPISetFilter 
- CANSPIread 
- CANSPIWrite 
The following routines are for an internal use by the library only:
- RegsToCANSPIID 
- CANSPIIDToRegs 
Be sure to check CANSPI constants necessary for using some of the functions.
CANSPISetOperationMode
188
MIKROELEKTRONIKA
- SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroPASCAL PRO for AVR
CHAPTER 6
Prototype
procedure CANSPISetOperationMode(mode: byte; WAIT: byte);
Returns
Nothing.
Description
Sets the CANSPI module to requested mode.
Parameters : 
mode
: CANSPI module operation mode. Valid values: 
CANSPI_OP_MODE
constants (see CANSPI 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 request-
ed mode or not. Caller must use 
CANSPIGetOperationMode
to verify correct oper-  
tion mode before performing mode specific operation. If 
WAIT != 0
, the call is  
blocking – the function won’t “return” until the requested mode is set. 
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);