mikroC
making it simple...
Eth_Init
Prototype
void Eth_Init(char *addrP, char *dataP, char *ctrlP,
char pinReset, char pinIOW, char pinIOR);
Description
Performs initialization of Ethernet card and library. This includes:
- Setting of control and data ports;
- Initialization of the Ethernet card (also called the Network Interface Card, or NIC);
- Retrieval and local storage of the NIC's hardware (MAC) address;
- Putting the NIC into the LISTEN mode.
Parameter
Parameter
pinReset
pinIOW
control pin.
Requires
As specified for the entire library (please see top of this page).
Example
Eth_Init(&PORTB, &PORTD, &PORTE, 2, 1, 0);
Eth_Set_Ip_Address
Prototype
void Eth_Set_Ip_Address(char ip1, char ip2, char ip3, char ip4);
Description
Sets the IP address of the connected and initialized Ethernet network card. The
arguments are the IP address numbers, in IPv4 format (e.g. 127.0.0.1).
Requires
This function should be called immediately after the NIC initialization (see
You can change your IP address at any time, anywhere in the code.
Example
// Set IP address 192.168.20.25
Eth_Set_Ip_Address(192u, 168u, 20u, 25u);
MikroElektronika: Development tools - Books - Compilers
mikroC - C Compiler for Microchip PIC microcontrollers
is a pointer to address port, which handles the addressing lines.
addrP
is pointer to data port. Parameter
dataP
is the reset/enable pin for the ethernet card chip (on control port). Parameter
is the I/O Write request control pin. Parameter
is the control port. Parameter
ctrlP
is the I/O read request
pinIOR
Eth_Init
).
page
175
Need help?
Do you have a question about the PIC Microcontrollers PIC12 and is the answer not in the manual?