FRDM-K64F, Avnet M14A2A, Grove Shield, to create smart home system. In use with AT&Ts M2x & Flow.

Dependencies:   mbed FXOS8700CQ MODSERIAL

Committer:
jwhammel
Date:
Wed Mar 06 21:11:49 2019 +0000
Revision:
84:fc8c9b39723a
Embedded Systems Midterm Project Spring 2019

Who changed what in which revision?

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