PIR grove sensor that sends the sensed data to Thingspeak.com through the wifi module ESP 8266
Embed:
(wiki syntax)
Show/hide line numbers
ethernet_api.h
00001 00002 /** \addtogroup hal */ 00003 /** @{*/ 00004 /* mbed Microcontroller Library 00005 * Copyright (c) 2006-2013 ARM Limited 00006 * 00007 * Licensed under the Apache License, Version 2.0 (the "License"); 00008 * you may not use this file except in compliance with the License. 00009 * You may obtain a copy of the License at 00010 * 00011 * http://www.apache.org/licenses/LICENSE-2.0 00012 * 00013 * Unless required by applicable law or agreed to in writing, software 00014 * distributed under the License is distributed on an "AS IS" BASIS, 00015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00016 * See the License for the specific language governing permissions and 00017 * limitations under the License. 00018 */ 00019 #ifndef MBED_ETHERNET_API_H 00020 #define MBED_ETHERNET_API_H 00021 00022 #include "device.h" 00023 00024 #if DEVICE_ETHERNET 00025 00026 #ifdef __cplusplus 00027 extern "C" { 00028 #endif 00029 00030 // Connection constants 00031 00032 int ethernet_init(void); 00033 void ethernet_free(void); 00034 00035 // write size bytes from data to ethernet buffer 00036 // return num bytes written 00037 // or -1 if size is too big 00038 int ethernet_write(const char *data, int size); 00039 00040 // send ethernet write buffer, returning the packet size sent 00041 int ethernet_send(void); 00042 00043 // recieve from ethernet buffer, returning packet size, or 0 if no packet 00044 int ethernet_receive(void); 00045 00046 // read size bytes in to data, return actual num bytes read (0..size) 00047 // if data == NULL, throw the bytes away 00048 int ethernet_read(char *data, int size); 00049 00050 // get the ethernet address 00051 void ethernet_address(char *mac); 00052 00053 // see if the link is up 00054 int ethernet_link(void); 00055 00056 // force link settings 00057 void ethernet_set_link(int speed, int duplex); 00058 00059 #ifdef __cplusplus 00060 } 00061 #endif 00062 00063 #endif 00064 00065 #endif 00066 00067 00068 /** @}*/
Generated on Tue Jul 12 2022 14:11:10 by 1.7.2