User manual

Table Of Contents
448
mikoC PRO for PIC32
MikroElektronika
SPI_Ethernet_putBytes
SPI_Ethernet_putConstBytes
Prototype
void SPI_Ethernet_putBytes(unsigned char *ptr, unsigned int n);
Description This is MAC module routine. It stores requested number of bytes into ENC28J60 RAM starting from
current ENC28J60 write pointer (EWRPT) location.
Parameters - ptr: RAM buffer containing bytes to be written into ENC28J60 RAM.
- n: number of bytes to be written.
Returns Nothing.
Requires Ethernet module has to be initialized. See SPI_Ethernet_Init.
Example
char *buffer = “mikroElektronika”;
...
SPI_Ethernet_putBytes(buffer, 16); // put an RAM array into ENC28J60
buffer
Notes None.
Prototype
void SPI_Ethernet_putConstBytes(const unsigned char *ptr, unsigned int n);
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.
Returns Nothing.
Requires Ethernet module has to be initialized. See SPI_Ethernet_Init.
Example
const char *buffer = “mikroElektronika”;
...
SPI_Ethernet_putConstBytes(buffer, 16); // put a const array into ENC28J60
buffer
Notes None.
SPI_Ethernet_putString
Prototype
unsigned int SPI_Ethernet_putString(unsigned char *ptr);
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
char *buffer = “mikroElektronika”;
...
SPI_Ethernet_putString(buffer); // put a RAM string into ENC28J60 buffer
Notes None.