Fork of the official mbed C/C SDK provides the software platform and libraries to build your applications for RenBED.
Dependents: 1-RenBuggyTimed RenBED_RGB RenBED_RGB_PWM RenBED_RGB
Fork of mbed by
ethernet_api.h@59:0883845fe643, 2013-02-18 (annotated)
- Committer:
- emilmont
- Date:
- Mon Feb 18 11:12:58 2013 +0000
- Revision:
- 59:0883845fe643
- Parent:
- 54:71b101360fb9
- Child:
- 65:5798e58a58b1
Add pinmap NC terminators for LPC1768 CAN.
Update the license from MIT to Apache v2.
Make the semihost code target independent using opportune defines for the UID and MAC.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
emilmont | 44:24d45a770a51 | 1 | /* mbed Microcontroller Library |
emilmont | 54:71b101360fb9 | 2 | * Copyright (c) 2006-2013 ARM Limited |
emilmont | 44:24d45a770a51 | 3 | * |
emilmont | 59:0883845fe643 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
emilmont | 59:0883845fe643 | 5 | * you may not use this file except in compliance with the License. |
emilmont | 59:0883845fe643 | 6 | * You may obtain a copy of the License at |
emilmont | 59:0883845fe643 | 7 | * |
emilmont | 59:0883845fe643 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
emilmont | 44:24d45a770a51 | 9 | * |
emilmont | 59:0883845fe643 | 10 | * Unless required by applicable law or agreed to in writing, software |
emilmont | 59:0883845fe643 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
emilmont | 59:0883845fe643 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
emilmont | 59:0883845fe643 | 13 | * See the License for the specific language governing permissions and |
emilmont | 59:0883845fe643 | 14 | * limitations under the License. |
emilmont | 44:24d45a770a51 | 15 | */ |
emilmont | 44:24d45a770a51 | 16 | #ifndef MBED_ETHERNET_API_H |
emilmont | 44:24d45a770a51 | 17 | #define MBED_ETHERNET_API_H |
emilmont | 44:24d45a770a51 | 18 | |
emilmont | 44:24d45a770a51 | 19 | #include "device.h" |
emilmont | 44:24d45a770a51 | 20 | |
emilmont | 44:24d45a770a51 | 21 | #if DEVICE_ETHERNET |
emilmont | 44:24d45a770a51 | 22 | |
emilmont | 44:24d45a770a51 | 23 | #ifdef __cplusplus |
emilmont | 44:24d45a770a51 | 24 | extern "C" { |
emilmont | 44:24d45a770a51 | 25 | #endif |
emilmont | 44:24d45a770a51 | 26 | |
emilmont | 44:24d45a770a51 | 27 | // Connection constants |
emilmont | 44:24d45a770a51 | 28 | |
emilmont | 44:24d45a770a51 | 29 | int ethernet_init(void); |
emilmont | 44:24d45a770a51 | 30 | void ethernet_free(void); |
emilmont | 44:24d45a770a51 | 31 | |
emilmont | 44:24d45a770a51 | 32 | // write size bytes from data to ethernet buffer |
emilmont | 44:24d45a770a51 | 33 | // return num bytes written |
emilmont | 44:24d45a770a51 | 34 | // or -1 if size is too big |
emilmont | 44:24d45a770a51 | 35 | int ethernet_write(const char *data, int size); |
emilmont | 44:24d45a770a51 | 36 | |
emilmont | 44:24d45a770a51 | 37 | // send ethernet write buffer, returning the packet size sent |
emilmont | 44:24d45a770a51 | 38 | int ethernet_send(void); |
emilmont | 44:24d45a770a51 | 39 | |
emilmont | 44:24d45a770a51 | 40 | // recieve from ethernet buffer, returning packet size, or 0 if no packet |
emilmont | 44:24d45a770a51 | 41 | int ethernet_receive(void); |
emilmont | 44:24d45a770a51 | 42 | |
emilmont | 44:24d45a770a51 | 43 | // read size bytes in to data, return actual num bytes read (0..size) |
emilmont | 44:24d45a770a51 | 44 | // if data == NULL, throw the bytes away |
emilmont | 44:24d45a770a51 | 45 | int ethernet_read(char *data, int size); |
emilmont | 44:24d45a770a51 | 46 | |
emilmont | 44:24d45a770a51 | 47 | // get the ethernet address |
emilmont | 44:24d45a770a51 | 48 | void ethernet_address(char *mac); |
emilmont | 44:24d45a770a51 | 49 | |
emilmont | 44:24d45a770a51 | 50 | // see if the link is up |
emilmont | 44:24d45a770a51 | 51 | int ethernet_link(void); |
emilmont | 44:24d45a770a51 | 52 | |
emilmont | 44:24d45a770a51 | 53 | // force link settings |
emilmont | 44:24d45a770a51 | 54 | void ethernet_set_link(int speed, int duplex); |
emilmont | 44:24d45a770a51 | 55 | |
emilmont | 44:24d45a770a51 | 56 | #ifdef __cplusplus |
emilmont | 44:24d45a770a51 | 57 | } |
emilmont | 44:24d45a770a51 | 58 | #endif |
emilmont | 44:24d45a770a51 | 59 | |
emilmont | 44:24d45a770a51 | 60 | #endif |
emilmont | 44:24d45a770a51 | 61 | |
emilmont | 44:24d45a770a51 | 62 | #endif |
emilmont | 44:24d45a770a51 | 63 |