mbed libraries for KL25Z

Dependents:   FRDM_RGBLED

Committer:
emilmont
Date:
Mon Feb 18 09:41:56 2013 +0000
Revision:
9:663789d7729f
Parent:
8:c14af7958ef5
Update mbed-KL25Z to latest build

Who changed what in which revision?

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