Initial commit

Dependencies:   FastPWM

Committer:
lypinator
Date:
Wed Sep 16 01:11:49 2020 +0000
Revision:
0:bb348c97df44
Added PWM

Who changed what in which revision?

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