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 #include "platform/mbed_toolchain.h"
25 
26 #if DEVICE_ETHERNET
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 // Connection constants
33 MBED_DEPRECATED(
34  "Ethernet drivers are provided by a class derived from `EMAC` attached to"
35  " either lwIP or Nanostack."
36 )
37 int ethernet_init(void);
38 MBED_DEPRECATED(
39  "Ethernet drivers are provided by a class derived from `EMAC` attached to"
40  " either lwIP or Nanostack."
41 )
42 void ethernet_free(void);
43 
44 // write size bytes from data to ethernet buffer
45 // return num bytes written
46 // or -1 if size is too big
47 MBED_DEPRECATED(
48  "Ethernet drivers are provided by a class derived from `EMAC` attached to"
49  " either lwIP or Nanostack."
50 )
51 int ethernet_write(const char *data, int size);
52 
53 // send ethernet write buffer, returning the packet size sent
54 MBED_DEPRECATED(
55  "Ethernet drivers are provided by a class derived from `EMAC` attached to"
56  " either lwIP or Nanostack."
57 )
58 int ethernet_send(void);
59 
60 // receive from ethernet buffer, returning packet size, or 0 if no packet
61 MBED_DEPRECATED(
62  "Ethernet drivers are provided by a class derived from `EMAC` attached to"
63  " either lwIP or Nanostack."
64 )
65 int ethernet_receive(void);
66 
67 // read size bytes in to data, return actual num bytes read (0..size)
68 // if data == NULL, throw the bytes away
69 MBED_DEPRECATED(
70  "Ethernet drivers are provided by a class derived from `EMAC` attached to"
71  " either lwIP or Nanostack."
72 )
73 int ethernet_read(char *data, int size);
74 
75 // get the ethernet address
76 MBED_DEPRECATED(
77  "Ethernet drivers are provided by a class derived from `EMAC` attached to"
78  " either lwIP or Nanostack."
79 )
80 void ethernet_address(char *mac);
81 
82 // see if the link is up
83 MBED_DEPRECATED(
84  "Ethernet drivers are provided by a class derived from `EMAC` attached to"
85  " either lwIP or Nanostack."
86 )
87 int ethernet_link(void);
88 
89 // force link settings
90 MBED_DEPRECATED(
91  "Ethernet drivers are provided by a class derived from `EMAC` attached to"
92  " either lwIP or Nanostack."
93 )
94 void ethernet_set_link(int speed, int duplex);
95 
96 #ifdef __cplusplus
97 }
98 #endif
99 
100 #endif
101 
102 #endif
103 
104 
105 /** @}*/
This interface should be used to abstract low level access to networking hardware All operations rece...
Definition: EMAC.h:32
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.