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