]> git.donarmstrong.com Git - qmk_firmware.git/blob - tool/mbed/mbed-sdk/libraries/mbed/hal/ethernet_api.h
Squashed 'tmk_core/' changes from 7967731..b9e0ea0
[qmk_firmware.git] / tool / mbed / mbed-sdk / libraries / mbed / hal / ethernet_api.h
1 /* mbed Microcontroller Library
2  * Copyright (c) 2006-2013 ARM Limited
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #ifndef MBED_ETHERNET_API_H
17 #define MBED_ETHERNET_API_H
18
19 #include "device.h"
20
21 #if DEVICE_ETHERNET
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27 // Connection constants
28
29 int ethernet_init(void);
30 void ethernet_free(void);
31
32 // write size bytes from data to ethernet buffer
33 // return num bytes written
34 // or -1 if size is too big
35 int ethernet_write(const char *data, int size);
36
37 // send ethernet write buffer, returning the packet size sent
38 int ethernet_send(void);
39
40 // recieve from ethernet buffer, returning packet size, or 0 if no packet
41 int ethernet_receive(void);
42
43 // read size bytes in to data, return actual num bytes read (0..size)
44 // if data == NULL, throw the bytes away
45 int ethernet_read(char *data, int size);
46
47 // get the ethernet address
48 void ethernet_address(char *mac);
49
50 // see if the link is up
51 int ethernet_link(void);
52
53 // force link settings
54 void ethernet_set_link(int speed, int duplex);
55
56 #ifdef __cplusplus
57 }
58 #endif
59
60 #endif
61
62 #endif
63