Mikroelektronika MIKROE-350 Fiche De Données

Page de 526
Spi_Ethernet_putConstBytes
Spi_Ethernet_putString
376
MIKROELEKTRONIKA
- SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroBasic PRO for AVR
CHAPTER 6
Prototype
sub procedure Spi_Ethernet_putConstBytes(const ptr as ^bytedim
as 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 
as byte[17]
...
buffer = "mikroElektronika"
...
Spi_Ethernet_putConstBytes(buffer, 16) ' put a const array into
ENC28J60 buffer
Prototype
sub function Spi_Ethernet_putString(dim ptr as ^byteas 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
dim
buffer 
as string[16]
...
buffer = "mikroElektronika"
...
Spi_Ethernet_putString(buffer) ' put a RAM string into ENC28J60
buffer