Give water to plants if dry amd pla meanwhile music the music vou can define with note length bind and breake also select several instruments for the sound

Dependencies:   mbed

Committer:
helmut
Date:
Wed Sep 19 14:16:56 2012 +0000
Revision:
0:5150b09127e3
plays mostly music that you can do with notes length breakes and bind; Some already defined; Tool is to start a pump for water to give plant is too dry.; Meanwhie plays music the most part of all

Who changed what in which revision?

UserRevisionLine numberNew contents of line
helmut 0:5150b09127e3 1 /*
helmut 0:5150b09127e3 2 * Copyright (c) 2001-2004 Swedish Institute of Computer Science.
helmut 0:5150b09127e3 3 * All rights reserved.
helmut 0:5150b09127e3 4 *
helmut 0:5150b09127e3 5 * Redistribution and use in source and binary forms, with or without modification,
helmut 0:5150b09127e3 6 * are permitted provided that the following conditions are met:
helmut 0:5150b09127e3 7 *
helmut 0:5150b09127e3 8 * 1. Redistributions of source code must retain the above copyright notice,
helmut 0:5150b09127e3 9 * this list of conditions and the following disclaimer.
helmut 0:5150b09127e3 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
helmut 0:5150b09127e3 11 * this list of conditions and the following disclaimer in the documentation
helmut 0:5150b09127e3 12 * and/or other materials provided with the distribution.
helmut 0:5150b09127e3 13 * 3. The name of the author may not be used to endorse or promote products
helmut 0:5150b09127e3 14 * derived from this software without specific prior written permission.
helmut 0:5150b09127e3 15 *
helmut 0:5150b09127e3 16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
helmut 0:5150b09127e3 17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
helmut 0:5150b09127e3 18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
helmut 0:5150b09127e3 19 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
helmut 0:5150b09127e3 20 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
helmut 0:5150b09127e3 21 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
helmut 0:5150b09127e3 22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
helmut 0:5150b09127e3 23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
helmut 0:5150b09127e3 24 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
helmut 0:5150b09127e3 25 * OF SUCH DAMAGE.
helmut 0:5150b09127e3 26 *
helmut 0:5150b09127e3 27 * This file is part of the lwIP TCP/IP stack.
helmut 0:5150b09127e3 28 */
helmut 0:5150b09127e3 29
helmut 0:5150b09127e3 30 /*
helmut 0:5150b09127e3 31 * This is the interface to the platform specific serial IO module
helmut 0:5150b09127e3 32 * It needs to be implemented by those platforms which need SLIP or PPP
helmut 0:5150b09127e3 33 */
helmut 0:5150b09127e3 34
helmut 0:5150b09127e3 35 #ifndef __SIO_H__
helmut 0:5150b09127e3 36 #define __SIO_H__
helmut 0:5150b09127e3 37
helmut 0:5150b09127e3 38 #include "lwip/arch.h"
helmut 0:5150b09127e3 39
helmut 0:5150b09127e3 40 #ifdef __cplusplus
helmut 0:5150b09127e3 41 extern "C" {
helmut 0:5150b09127e3 42 #endif
helmut 0:5150b09127e3 43
helmut 0:5150b09127e3 44 /* If you want to define sio_fd_t elsewhere or differently,
helmut 0:5150b09127e3 45 define this in your cc.h file. */
helmut 0:5150b09127e3 46 #ifndef __sio_fd_t_defined
helmut 0:5150b09127e3 47 typedef void * sio_fd_t;
helmut 0:5150b09127e3 48 #endif
helmut 0:5150b09127e3 49
helmut 0:5150b09127e3 50 /* The following functions can be defined to something else in your cc.h file
helmut 0:5150b09127e3 51 or be implemented in your custom sio.c file. */
helmut 0:5150b09127e3 52
helmut 0:5150b09127e3 53 #ifndef sio_open
helmut 0:5150b09127e3 54 /**
helmut 0:5150b09127e3 55 * Opens a serial device for communication.
helmut 0:5150b09127e3 56 *
helmut 0:5150b09127e3 57 * @param devnum device number
helmut 0:5150b09127e3 58 * @return handle to serial device if successful, NULL otherwise
helmut 0:5150b09127e3 59 */
helmut 0:5150b09127e3 60 sio_fd_t sio_open(u8_t devnum);
helmut 0:5150b09127e3 61 #endif
helmut 0:5150b09127e3 62
helmut 0:5150b09127e3 63 #ifndef sio_send
helmut 0:5150b09127e3 64 /**
helmut 0:5150b09127e3 65 * Sends a single character to the serial device.
helmut 0:5150b09127e3 66 *
helmut 0:5150b09127e3 67 * @param c character to send
helmut 0:5150b09127e3 68 * @param fd serial device handle
helmut 0:5150b09127e3 69 *
helmut 0:5150b09127e3 70 * @note This function will block until the character can be sent.
helmut 0:5150b09127e3 71 */
helmut 0:5150b09127e3 72 void sio_send(u8_t c, sio_fd_t fd);
helmut 0:5150b09127e3 73 #endif
helmut 0:5150b09127e3 74
helmut 0:5150b09127e3 75 #ifndef sio_recv
helmut 0:5150b09127e3 76 /**
helmut 0:5150b09127e3 77 * Receives a single character from the serial device.
helmut 0:5150b09127e3 78 *
helmut 0:5150b09127e3 79 * @param fd serial device handle
helmut 0:5150b09127e3 80 *
helmut 0:5150b09127e3 81 * @note This function will block until a character is received.
helmut 0:5150b09127e3 82 */
helmut 0:5150b09127e3 83 u8_t sio_recv(sio_fd_t fd);
helmut 0:5150b09127e3 84 #endif
helmut 0:5150b09127e3 85
helmut 0:5150b09127e3 86 #ifndef sio_read
helmut 0:5150b09127e3 87 /**
helmut 0:5150b09127e3 88 * Reads from the serial device.
helmut 0:5150b09127e3 89 *
helmut 0:5150b09127e3 90 * @param fd serial device handle
helmut 0:5150b09127e3 91 * @param data pointer to data buffer for receiving
helmut 0:5150b09127e3 92 * @param len maximum length (in bytes) of data to receive
helmut 0:5150b09127e3 93 * @return number of bytes actually received - may be 0 if aborted by sio_read_abort
helmut 0:5150b09127e3 94 *
helmut 0:5150b09127e3 95 * @note This function will block until data can be received. The blocking
helmut 0:5150b09127e3 96 * can be cancelled by calling sio_read_abort().
helmut 0:5150b09127e3 97 */
helmut 0:5150b09127e3 98 u32_t sio_read(sio_fd_t fd, u8_t *data, u32_t len);
helmut 0:5150b09127e3 99 #endif
helmut 0:5150b09127e3 100
helmut 0:5150b09127e3 101 #ifndef sio_tryread
helmut 0:5150b09127e3 102 /**
helmut 0:5150b09127e3 103 * Tries to read from the serial device. Same as sio_read but returns
helmut 0:5150b09127e3 104 * immediately if no data is available and never blocks.
helmut 0:5150b09127e3 105 *
helmut 0:5150b09127e3 106 * @param fd serial device handle
helmut 0:5150b09127e3 107 * @param data pointer to data buffer for receiving
helmut 0:5150b09127e3 108 * @param len maximum length (in bytes) of data to receive
helmut 0:5150b09127e3 109 * @return number of bytes actually received
helmut 0:5150b09127e3 110 */
helmut 0:5150b09127e3 111 u32_t sio_tryread(sio_fd_t fd, u8_t *data, u32_t len);
helmut 0:5150b09127e3 112 #endif
helmut 0:5150b09127e3 113
helmut 0:5150b09127e3 114 #ifndef sio_write
helmut 0:5150b09127e3 115 /**
helmut 0:5150b09127e3 116 * Writes to the serial device.
helmut 0:5150b09127e3 117 *
helmut 0:5150b09127e3 118 * @param fd serial device handle
helmut 0:5150b09127e3 119 * @param data pointer to data to send
helmut 0:5150b09127e3 120 * @param len length (in bytes) of data to send
helmut 0:5150b09127e3 121 * @return number of bytes actually sent
helmut 0:5150b09127e3 122 *
helmut 0:5150b09127e3 123 * @note This function will block until all data can be sent.
helmut 0:5150b09127e3 124 */
helmut 0:5150b09127e3 125 u32_t sio_write(sio_fd_t fd, u8_t *data, u32_t len);
helmut 0:5150b09127e3 126 #endif
helmut 0:5150b09127e3 127
helmut 0:5150b09127e3 128 #ifndef sio_read_abort
helmut 0:5150b09127e3 129 /**
helmut 0:5150b09127e3 130 * Aborts a blocking sio_read() call.
helmut 0:5150b09127e3 131 *
helmut 0:5150b09127e3 132 * @param fd serial device handle
helmut 0:5150b09127e3 133 */
helmut 0:5150b09127e3 134 void sio_read_abort(sio_fd_t fd);
helmut 0:5150b09127e3 135 #endif
helmut 0:5150b09127e3 136
helmut 0:5150b09127e3 137 #ifdef __cplusplus
helmut 0:5150b09127e3 138 }
helmut 0:5150b09127e3 139 #endif
helmut 0:5150b09127e3 140
helmut 0:5150b09127e3 141 #endif /* __SIO_H__ */