mikroElektronika PIC Microcontrollers PIC12 User Manual page 184

Mikroc user's manual
Table of Contents

Advertisement

mikroC - C Compiler for Microchip PIC microcontrollers
Eth_Set_Inport
Prototype
unsigned short Eth_Inport(unsigned short address);
Returns
One byte from the specified address.
Description
Retrieves a byte from the specified address of the Ethernet card chip.
Requires
The card (NIC) must be properly initialized. See
Example
udp_length |= Eth_Inport(NIC_DATA);
Eth_Scan_For_Event
Prototype
unsigned Eth_Scan_For_Event(unsigned short *next_ptr);
Returns
Type of the ethernet packet received. Two types are distinguished:
address data request) and
Description
Retrieves sender's MAC (hardware) address and type of the packet received. The
function argument is an (internal) pointer to the next data packet in RTL8019's buffer,
and is of no particular importance to the end user.
Requires
The card (NIC) must be properly initialized. See
called in a proper sequence, i.e. right after the card init, and IP address/UDP port init.
Example
Eth_Init(&PORTB, &PORTD, &PORTE, 2, 1, 0);
Eth_Set_Ip_Address(192u, 168u, 20u, 25u);
Eth_Set_Udp_Port(10001);
do { // Main block of every Ethernet example
event_type = Eth_Scan_For_Event(&next_ptr);
if (event_type) {
}
} while (1);
page
176
(Internet Protocol).
IP
switch (event_type) {case ARP: Arp_Event(); break;
Eth_Outport(CR, 0x22);
Eth_Outport(BNDRY, next_ptr);
MikroElektronika: Development tools - Books - Compilers
.
Eth_Init
. Also, the function must be
Eth_Init
case IP : Ip_Event();}
mikroC
making it simple...
(MAC-IP
ARP

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the PIC Microcontrollers PIC12 and is the answer not in the manual?

This manual is also suitable for:

Pic microcontrollers pic16Pic microcontrollers pic18

Table of Contents