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