Mikroelektronika MIKROE-350 Fiche De Données

Page de 526
External dependencies of SPI Ethernet Library
368
MIKROELEKTRONIKA
- SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroBasic PRO for AVR
CHAPTER 6
The following variables
must be defined in all
projects using SPI Eth-
ernet Library:
Description: 
Example : 
dim SPI_Ethernet_CS
as sbit sfr external
ENC28J60 chip select pin.
dim SPI_Ethernet_CS
as sbit at PORTB.B4
dim SPI_Ethernet_RST
as sbit sfr external
ENC28J60 reset pin.
dim SPI_Ethernet_RST
as sbit at PORTB.B5
dim
SPI_Ethernet_CS_Direc
tion 
as sbit sfr
external
Direction of the ENC28J60
chip select pin.
dim
SPI_Ethernet_CS_Direc
tion 
as sbit at
DDRB.B4
dim
SPI_Ethernet_RST_Dire
ction 
as sbit sfr
external
Direction of the ENC28J60
reset pin.
dim
SPI_Ethernet_RST_Dire
ction 
as sbit at
DDRB.B5
The following routines must be defined in all project
using SPI Ethernet Library:
Description: 
Example : 
sub function Spi_Ethernet_UserTCP(dim remoteHost
as ^byte,
dim
remotePort 
as word,
dim
localPort 
as word,
dim
reqLength
as wordas word
TCP request
handler.
Refer to the
library example
at the bottom
of this page 
for code
implementation.
sub function Spi_Ethernet_UserUDP(dim remoteHost
as ^byte,
dim remotePort
as word,
dim destPort as
word,
dim reqLength as
wordas word
UDP request
handler.
Refer to the
library example
at the bottom
of this page 
for code
implementation.