User manual

mikroPascal PRO for dsPIC30/33 and PIC24
MikroElektronika
482
SPI_Ethernet_putConstString
SPI_Ethernet_getByte
Prototype
function SPI_Ethernet_putConstString(const ptr : ^byte) : word;
Description This is MAC module routine. It stores whole const string (excluding null termination) into ENC28J60
RAM starting from current ENC28J60 write pointer (EWRPT) location.
Parameters - ptr: const string to be written into ENC28J60 RAM.
Returns Number of bytes written into ENC28J60 RAM.
Requires Ethernet module has to be initialized. See SPI_Ethernet_Init.
Example
const
buffer : string[16];
...
buffer := ‘mikroElektronika’;
...
SPI_Ethernet_putConstString(buffer); // put a const string into ENC28J60
buffer
Notes None.
Prototype
function SPI_Ethernet_getByte() : byte;
Description This is MAC module routine. It fetches a byte from address pointed to by current ENC28J60 read
pointer (ERDPT).
Parameters None.
Returns Byte read from ENC28J60 RAM.
Requires Ethernet module has to be initialized. See SPI_Ethernet_Init.
Example
var
buffer : byte;
...
buffer := SPI_Ethernet_getByte(); // read a byte from ENC28J60 buffer
Notes None.
SPI_Ethernet_putString
Prototype
function SPI_Ethernet_putString(ptr : ^byte) : word;
Description This is MAC module routine. It stores whole string (excluding null termination) into ENC28J60 RAM
starting from current ENC28J60 write pointer (EWRPT) location.
Parameters - ptr: string to be written into ENC28J60 RAM.
Returns Number of bytes written into ENC28J60 RAM.
Requires Ethernet module has to be initialized. See SPI_Ethernet_Init.
Example
var
buffer : string[16];
...
buffer := ‘mikroElektronika’;
...
SPI_Ethernet_putString(buffer); // put a RAM string into ENC28J60 buffer
Notes None.