mbed-os

Dependents:   cobaLCDJoyMotor_Thread odometry_omni_3roda_v3 odometry_omni_3roda_v1 odometry_omni_3roda_v2 ... more

Committer:
be_bryan
Date:
Mon Dec 11 17:54:04 2017 +0000
Revision:
0:b74591d5ab33
motor ++

Who changed what in which revision?

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