Mikroelektronika MIKROE-350 Data Sheet

Page of 526
Spi_Ethernet_getBytes
378
MIKROELEKTRONIKA
- SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroBasic PRO for AVR
CHAPTER 6
Prototype
sub procedure Spi_Ethernet_getBytes(dim ptr as ^bytedim addr as
word
dim as byte)
Returns
Nothing.
Description
This is MAC module routine. It fetches equested number of bytes from
ENC28J60
RAM starting from given address. If value of 
0xFFFF
is passed as the
address parameter, the reading will start from current 
ENC28J60
read pointer
(
ERDPT
) location.
Parameters:
ptr:
buffer for storing bytes read from 
ENC28J60
RAM. 
addr: ENC28J60
RAM start address. Valid values: 
0..8192
n:
number of bytes to be read. 
Requires
Ethernet module has to be initialized. See Spi_Ethernet_Init.
Example
dim
buffer 
as byte[16] 
...
Spi_Ethernet_getBytes(buffer, 0x100, 16) ' read 16 bytes,
starting from address 0x100