This is a repository for all my programs or modified programs.

Committer:
mturner5
Date:
Sun Sep 11 23:48:09 2016 +0000
Revision:
0:72480818e4a9
Made delays for the LEDS and button presses

Who changed what in which revision?

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