Mikroelektronika MIKROE-742 데이터 시트

다운로드
페이지 532
Spi_Ethernet_putConstBytes
Spi_Ethernet_putString
388
MIKROELEKTRONIKA
- SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroPASCAL PRO for AVR
CHAPTER 6
Prototype
procedure Spi_Ethernet_putConstBytes(const ptr : ^byte; n : byte);
Returns
Nothing.
Description
This is MAC module routine. It stores requested number of const bytes into
ENC28J60
RAM starting from current ENC28J60 write pointer (EWRPT) location.
Parameters:
ptr
: const buffer containing bytes to be written into ENC28J60 RAM. 
n
: number of bytes to be written. 
Requires
Ethernet module has to be initialized. See Spi_Ethernet_Init.
Example
const 
buffer : 
array[17] of byte;
...
buffer := 'mikroElektronika';
...
Spi_Ethernet_putConstBytes(buffer, 16); // put a const array
into ENC28J60 buffer
Prototype
function Spi_Ethernet_putString(^ptr : byte) : word;
Returns
Number of bytes written into ENC28J60 RAM.
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. 
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