Naze32 clone with Frysky receiver
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

ethernet_api.h 1.6KB

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