Added C interface to Ethernet driver configuration.

This commit is contained in:
Oliver Schmidt 2018-07-27 17:23:26 +02:00
parent b9d6a92534
commit 0bd53f3af7
3 changed files with 30 additions and 24 deletions

View File

@ -23,30 +23,6 @@
//
extern uint8_t ip65_error;
// MAC address of local machine (will be overwritten if ip65_init is called)
//
extern uint8_t cfg_mac[6];
// IP address of local machine (will be overwritten if dhcp_init is called)
//
extern uint32_t cfg_ip;
// Netmask of local network (will be overwritten if dhcp_init is called)
//
extern uint32_t cfg_netmask;
// IP address of router on local network (will be overwritten if dhcp_init is called)
//
extern uint32_t cfg_gateway;
// IP address of dns server to use (will be overwritten if dhcp_init is called)
//
extern uint32_t cfg_dns;
// Will be set to address of DHCP server that configuration was obtained from
//
extern uint32_t dhcp_server;
// Driver initialization parameter values
//
#ifdef __APPLE2__
@ -67,6 +43,14 @@ extern uint32_t dhcp_server;
//
bool __fastcall__ ip65_init(uint8_t drv_init);
// Access to Ethernet configuration
//
// Access to the three items below is only valid after ip65_init returned false.
//
extern uint8_t cfg_mac[6]; // MAC address of local machine
extern char eth_driver_name[]; // Zero terminated string containing driver name
extern uint8_t* eth_driver_io_base; // Ethernet chip I/O base address used by driver
// Main IP polling loop
//
// This routine should be periodically called by an application at any time
@ -120,6 +104,16 @@ uint32_t __fastcall__ parse_dotted_quad(char* quad);
//
bool dhcp_init(void);
// Access to IP configuration
//
// The five items below will be overwritten if dhcp_init is called.
//
extern uint32_t cfg_ip; // IP address of local machine
extern uint32_t cfg_netmask; // Netmask of local network
extern uint32_t cfg_gateway; // IP address of router on local network
extern uint32_t cfg_dns; // IP address of DNS server to use
extern uint32_t dhcp_server; // Address of DHCP server that config was obtained from
// Resolve a string containing a hostname (or a dotted quad) to an IP address
//
// Inputs: hostname: Zero terminated string containing either a DNS hostname

View File

@ -23,6 +23,7 @@ IP65OBJS=\
dottedquad_c.o \
download.o \
download_c.o \
driver_c.o \
eth.o \
http.o \
http_c.o \

11
ip65/driver_c.s Normal file
View File

@ -0,0 +1,11 @@
.include "../inc/common.inc"
.export _eth_driver_name
.export _eth_driver_io_base
.import eth_driver_name
.import eth_driver_io_base
_eth_driver_name := eth_driver_name
_eth_driver_io_base := eth_driver_io_base