Mikroelektronika MIKROE-724 データシート

ページ / 726
mikroBasic PRO for dsPIC30/33 and PIC24
MikroElektronika
305
ECANxFilterEnable
ECANxSetBufferSize
Prototype
sub procedure ECANxFilterEnable(dim flten as word)
Description The function enables receive filters.
Parameters 
flten
: filter enable selection parameter. Each bit corresponds to appropriate filter. By setting bit the 
corresponding filter will be enabled. 
Returns
Nothing.
Requires
The ECAN routines are supported only by MCUs with the ECAN module.
Microcontroller must be connected to ECAN transceiver which is connected to the ECAN bus.
The ECAN module must be initialized. See the ECANxInitialize routine.
Example
‘ Filters 0, 4, 8, 12 are to be enabled:
ECAN1FilterEnable(0x1111)
Notes
- ECAN library routine require you to specify the module you want to use. To select the desired ECAN 
module, simply change the letter 
x in the routine prototype for a number from 1 to 2
- Number of ECAN modules per MCU differs from chip to chip. Please, read the appropriate datasheet 
before utilizing this library. 
Prototype
sub function ECANxSetBufferSize(dim Ecan1BuffSize as word) as word
Description The function configures the total number of receive and transmit buffers in DMA RAM.
Parameters 
Ecan1BuffSize
: Number of ECAN DMA RAM receive and transmit buffers. Valid values: 4, 6, 8, 
12, 16, 24, 32. Each buffer is 16 bytes long. 
Returns
0
 - if input parameter is valid 
0xFFFF
 - if input parameter is invalid 
Requires
The ECAN routines are supported only by MCUs with the ECAN module.
Microcontroller must be connected to ECAN transceiver which is connected to the ECAN bus.
The ECAN module must be initialized. See the ECANxInitialize routine.
Example
‘ DMA RAM will have 16 rx+tx buffers 
ECAN1SetBufferSize(16)
Notes
- The same value should be used for DMA RAM buffer definition in the 
ECan_Defs.mbas
 header file 
located in the ECAN project folder. 
- ECAN library routine require you to specify the module you want to use. To select the desired ECAN 
module, simply change the letter 
x in the routine prototype for a number from 1 to 2
- Number of ECAN modules per MCU differs from chip to chip. Please, read the appropriate datasheet 
before utilizing this library.