source: asp3_tinet_ecnl_arm/trunk/asp3_dcre/mbed/hal/ethernet_api.h@ 374

Last change on this file since 374 was 374, checked in by coas-nagasima, 5 years ago

mbed関連を更新
シリアルドライバをmbedのHALを使うよう変更
ファイルディスクリプタの処理を更新

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