Mikroelektronika MIKROE-724 データシート

ページ / 726
mikroBasic PRO for dsPIC30/33 and PIC24
MikroElektronika
505
SPI_Ethernet_24j600_Enable
Prototype
sub procedure SPI_Ethernet_24j600_Enable(dim enFlt as word)
Description This  is  MAC  module  routine.  This  routine  enables  appropriate  network  traffic  on  the 
ENC24J600
 
module by the means of it’s receive filters (unicast, multicast, broadcast, crc). Specific type of network 
traffic will be enabled if a corresponding bit of this routine’s input parameter is set. Therefore, more 
than one type of network traffic can be enabled at the same time. For this purpose, predefined library 
constants (see the table below) can be ORed to form appropriate input value. 
Advanced filtering available in the 
ENC24J600
 module such as 
Pattern Match, Magic Packet 
and
  Hash  Table
 can not be enabled by this routine. Additionaly, all filters, except CRC, enabled 
with this routine will work in OR mode, which means that packet will be received if any of the enabled 
filters accepts it.
This routine will change receive filter configuration on-the-fly. It will not, in any way, mess with enabling/
disabling receive/transmit logic or any other part of the 
ENC24J600
 module. The 
ENC24J600
 module 
should be properly cofigured by the means of SPI_Ethernet_24j600_Init routine.
Parameters 
enFlt
: network traffic/receive filter flags. Each bit corresponds to the appropriate network traffic/
receive filter: 
Returns
Nothing.
Requires
Ethernet module has to be initialized. See SPI_Ethernet_24j600_Init.
Example
SPI_Ethernet_24j600_Enable(_SPI_Ethernet_24j600_CRC or _SPI_Ethernet_24j600_
UNICAST) ‘ enable CRC checking and Unicast traffic
Notes
Advanced filtering available in the 
ENC24J600
 module such as 
Pattern Match, Magic Packet 
and
  Hash  Table
 can not be enabled by this routine. Additionaly, all filters, except CRC, enabled 
with this routine will work in OR mode, which means that packet will be received if any of the enabled 
filters accepts it.
This routine will change receive filter configuration on-the-fly. It will not, in any way, mess with enabling/
disabling receive/transmit logic or any other part of the E
NC24J600
 module. The 
ENC24J600
 module 
should be properly cofigured by the means of SPI_Ethernet_24j600_Init routine.
Bit
Mask
Description
Predefined library const
0
0x01
MAC Broadcast traffic/receive filter flag. When set, MAC 
broadcast traffic will be enabled. 
_SPI_Ethernet_24j600_
BROADCAST
1
0x02
MAC Multicast traffic/receive filter flag. When set, MAC 
multicast traffic will be enabled. 
_SPI_Ethernet_24j600_
MULTICAST
2
0x04
not used
none
3
0x08
not used
none
4
0x10
not used
none
5
0x20
CRC check flag. When set, packets with invalid CRC field 
will be discarded.
_SPI_Ethernet_24j600_CRC
6
0x40
not used
none
7
0x80
MAC Unicast traffic/receive filter flag. When set, MAC 
unicast traffic will be enabled. 
_SPI_Ethernet_24j600_
UNICAST