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