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

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.