PIR grove sensor that sends the sensed data to Thingspeak.com through the wifi module ESP 8266

Dependencies:   mbed

Committer:
skrawool
Date:
Mon Dec 05 16:39:27 2016 +0000
Revision:
0:3954a906acc2
PIR grove sensor that sends the sensed data to thingspeak through the wifi module ESP 8266

Who changed what in which revision?

UserRevisionLine numberNew contents of line
skrawool 0:3954a906acc2 1
skrawool 0:3954a906acc2 2 /** \addtogroup hal */
skrawool 0:3954a906acc2 3 /** @{*/
skrawool 0:3954a906acc2 4 /* mbed Microcontroller Library
skrawool 0:3954a906acc2 5 * Copyright (c) 2006-2016 ARM Limited
skrawool 0:3954a906acc2 6 *
skrawool 0:3954a906acc2 7 * Licensed under the Apache License, Version 2.0 (the "License");
skrawool 0:3954a906acc2 8 * you may not use this file except in compliance with the License.
skrawool 0:3954a906acc2 9 * You may obtain a copy of the License at
skrawool 0:3954a906acc2 10 *
skrawool 0:3954a906acc2 11 * http://www.apache.org/licenses/LICENSE-2.0
skrawool 0:3954a906acc2 12 *
skrawool 0:3954a906acc2 13 * Unless required by applicable law or agreed to in writing, software
skrawool 0:3954a906acc2 14 * distributed under the License is distributed on an "AS IS" BASIS,
skrawool 0:3954a906acc2 15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
skrawool 0:3954a906acc2 16 * See the License for the specific language governing permissions and
skrawool 0:3954a906acc2 17 * limitations under the License.
skrawool 0:3954a906acc2 18 */
skrawool 0:3954a906acc2 19 #ifndef MBED_CAN_API_H
skrawool 0:3954a906acc2 20 #define MBED_CAN_API_H
skrawool 0:3954a906acc2 21
skrawool 0:3954a906acc2 22 #include "device.h"
skrawool 0:3954a906acc2 23
skrawool 0:3954a906acc2 24 #if DEVICE_CAN
skrawool 0:3954a906acc2 25
skrawool 0:3954a906acc2 26 #include "PinNames.h"
skrawool 0:3954a906acc2 27 #include "PeripheralNames.h"
skrawool 0:3954a906acc2 28 #include "hal/can_helper.h"
skrawool 0:3954a906acc2 29
skrawool 0:3954a906acc2 30 #ifdef __cplusplus
skrawool 0:3954a906acc2 31 extern "C" {
skrawool 0:3954a906acc2 32 #endif
skrawool 0:3954a906acc2 33
skrawool 0:3954a906acc2 34 typedef enum {
skrawool 0:3954a906acc2 35 IRQ_RX,
skrawool 0:3954a906acc2 36 IRQ_TX,
skrawool 0:3954a906acc2 37 IRQ_ERROR,
skrawool 0:3954a906acc2 38 IRQ_OVERRUN,
skrawool 0:3954a906acc2 39 IRQ_WAKEUP,
skrawool 0:3954a906acc2 40 IRQ_PASSIVE,
skrawool 0:3954a906acc2 41 IRQ_ARB,
skrawool 0:3954a906acc2 42 IRQ_BUS,
skrawool 0:3954a906acc2 43 IRQ_READY
skrawool 0:3954a906acc2 44 } CanIrqType;
skrawool 0:3954a906acc2 45
skrawool 0:3954a906acc2 46
skrawool 0:3954a906acc2 47 typedef enum {
skrawool 0:3954a906acc2 48 MODE_RESET,
skrawool 0:3954a906acc2 49 MODE_NORMAL,
skrawool 0:3954a906acc2 50 MODE_SILENT,
skrawool 0:3954a906acc2 51 MODE_TEST_LOCAL,
skrawool 0:3954a906acc2 52 MODE_TEST_GLOBAL,
skrawool 0:3954a906acc2 53 MODE_TEST_SILENT
skrawool 0:3954a906acc2 54 } CanMode;
skrawool 0:3954a906acc2 55
skrawool 0:3954a906acc2 56 typedef void (*can_irq_handler)(uint32_t id, CanIrqType type);
skrawool 0:3954a906acc2 57
skrawool 0:3954a906acc2 58 typedef struct can_s can_t;
skrawool 0:3954a906acc2 59
skrawool 0:3954a906acc2 60 void can_init (can_t *obj, PinName rd, PinName td);
skrawool 0:3954a906acc2 61 void can_free (can_t *obj);
skrawool 0:3954a906acc2 62 int can_frequency(can_t *obj, int hz);
skrawool 0:3954a906acc2 63
skrawool 0:3954a906acc2 64 void can_irq_init (can_t *obj, can_irq_handler handler, uint32_t id);
skrawool 0:3954a906acc2 65 void can_irq_free (can_t *obj);
skrawool 0:3954a906acc2 66 void can_irq_set (can_t *obj, CanIrqType irq, uint32_t enable);
skrawool 0:3954a906acc2 67
skrawool 0:3954a906acc2 68 int can_write (can_t *obj, CAN_Message, int cc);
skrawool 0:3954a906acc2 69 int can_read (can_t *obj, CAN_Message *msg, int handle);
skrawool 0:3954a906acc2 70 int can_mode (can_t *obj, CanMode mode);
skrawool 0:3954a906acc2 71 int can_filter(can_t *obj, uint32_t id, uint32_t mask, CANFormat format, int32_t handle);
skrawool 0:3954a906acc2 72 void can_reset (can_t *obj);
skrawool 0:3954a906acc2 73 unsigned char can_rderror (can_t *obj);
skrawool 0:3954a906acc2 74 unsigned char can_tderror (can_t *obj);
skrawool 0:3954a906acc2 75 void can_monitor (can_t *obj, int silent);
skrawool 0:3954a906acc2 76
skrawool 0:3954a906acc2 77 #ifdef __cplusplus
skrawool 0:3954a906acc2 78 };
skrawool 0:3954a906acc2 79 #endif
skrawool 0:3954a906acc2 80
skrawool 0:3954a906acc2 81 #endif // MBED_CAN_API_H
skrawool 0:3954a906acc2 82
skrawool 0:3954a906acc2 83 #endif
skrawool 0:3954a906acc2 84
skrawool 0:3954a906acc2 85 /** @}*/