From 7ba4d0d58428933967bc194f6bcecf3ca01c228f Mon Sep 17 00:00:00 2001 From: klueska Date: Sat, 14 Jun 2008 19:27:25 +0000 Subject: [PATCH] Added support for the basicsb sensorboards for the mica based platforms --- .../atm128/adc/BlockingAdcReadClientC.nc | 2 +- .../adc/BlockingAdcReadStreamClientC.nc | 2 +- tos/lib/tosthreads/csystem/TosThreadApiC.nc | 10 +++- .../sensorboards/basicsb/BlockingPhotoC.nc | 26 ++++++++++ .../basicsb/BlockingPhotoStreamC.nc | 26 ++++++++++ .../sensorboards/basicsb/BlockingTempC.nc | 25 ++++++++++ .../basicsb/BlockingTempStreamC.nc | 26 ++++++++++ .../sensorboards/basicsb/CPhotoC.nc | 42 ++++++++++++++++ .../sensorboards/basicsb/CPhotoP.nc | 49 +++++++++++++++++++ .../tosthreads/sensorboards/basicsb/CTempC.nc | 42 ++++++++++++++++ .../tosthreads/sensorboards/basicsb/CTempP.nc | 49 +++++++++++++++++++ .../sensorboards/basicsb/basicsb_sensors.h | 42 ++++++++++++++++ .../sensorboards/basicsb/tosthread_photo.h | 44 +++++++++++++++++ .../sensorboards/basicsb/tosthread_temp.h | 44 +++++++++++++++++ 14 files changed, 426 insertions(+), 3 deletions(-) create mode 100644 tos/lib/tosthreads/sensorboards/basicsb/BlockingPhotoC.nc create mode 100644 tos/lib/tosthreads/sensorboards/basicsb/BlockingPhotoStreamC.nc create mode 100644 tos/lib/tosthreads/sensorboards/basicsb/BlockingTempC.nc create mode 100644 tos/lib/tosthreads/sensorboards/basicsb/BlockingTempStreamC.nc create mode 100644 tos/lib/tosthreads/sensorboards/basicsb/CPhotoC.nc create mode 100644 tos/lib/tosthreads/sensorboards/basicsb/CPhotoP.nc create mode 100644 tos/lib/tosthreads/sensorboards/basicsb/CTempC.nc create mode 100644 tos/lib/tosthreads/sensorboards/basicsb/CTempP.nc create mode 100644 tos/lib/tosthreads/sensorboards/basicsb/basicsb_sensors.h create mode 100644 tos/lib/tosthreads/sensorboards/basicsb/tosthread_photo.h create mode 100644 tos/lib/tosthreads/sensorboards/basicsb/tosthread_temp.h diff --git a/tos/lib/tosthreads/chips/atm128/adc/BlockingAdcReadClientC.nc b/tos/lib/tosthreads/chips/atm128/adc/BlockingAdcReadClientC.nc index ae4b76f7..e3277531 100644 --- a/tos/lib/tosthreads/chips/atm128/adc/BlockingAdcReadClientC.nc +++ b/tos/lib/tosthreads/chips/atm128/adc/BlockingAdcReadClientC.nc @@ -36,6 +36,6 @@ implementation { BlockingRead = BlockingAdcP.BlockingRead[ID]; Atm128AdcConfig = BlockingAdcP.Config[ID]; - BlockingAdcP.ReadResource[ID] -> Atm128AdcC.Resource[HAL_ID]; + BlockingAdcP.ResourceRead[ID] -> Atm128AdcC.Resource[HAL_ID]; ResourceConfigure = Atm128AdcC.ResourceConfigure[HAL_ID]; } diff --git a/tos/lib/tosthreads/chips/atm128/adc/BlockingAdcReadStreamClientC.nc b/tos/lib/tosthreads/chips/atm128/adc/BlockingAdcReadStreamClientC.nc index 214092bf..9d88c714 100644 --- a/tos/lib/tosthreads/chips/atm128/adc/BlockingAdcReadStreamClientC.nc +++ b/tos/lib/tosthreads/chips/atm128/adc/BlockingAdcReadStreamClientC.nc @@ -36,6 +36,6 @@ implementation { BlockingReadStream = BlockingAdcP.BlockingReadStream[ID]; Atm128AdcConfig = BlockingAdcP.ConfigReadStream[ID]; - BlockingAdcP.ReadStreamResource[ID] -> Atm128AdcC.Resource[HAL_ID]; + BlockingAdcP.ResourceReadStream[ID] -> Atm128AdcC.Resource[HAL_ID]; ResourceConfigure = Atm128AdcC.ResourceConfigure[HAL_ID]; } diff --git a/tos/lib/tosthreads/csystem/TosThreadApiC.nc b/tos/lib/tosthreads/csystem/TosThreadApiC.nc index d7c4d512..e8fb8af2 100644 --- a/tos/lib/tosthreads/csystem/TosThreadApiC.nc +++ b/tos/lib/tosthreads/csystem/TosThreadApiC.nc @@ -68,7 +68,7 @@ implementation { components CLogStorageC; #endif - //Telosb sensorboard specific. Later need to find conditional way of adding this in + //Telosb sensorboard specific. #if defined(TOSTHREAD_HAMAMATSUS1087_H) || defined(TOSTHREAD_DYNAMIC_LOADER) components CHamamatsuS1087ParC; #endif @@ -83,4 +83,12 @@ implementation { #if defined(TOSTHREAD_SINESENSOR_H) || defined(TOSTHREAD_DYNAMIC_LOADER) components CSineSensorC; #endif + + //Basicsb sensorboard specific + #if defined(TOSTHREAD_PHOTO_H) || defined(TOSTHREAD_DYNAMIC_LOADER) + components CPhotoC; + #endif + #if defined(TOSTHREAD_TEMP_H) || defined(TOSTHREAD_DYNAMIC_LOADER) + components CTempC; + #endif } diff --git a/tos/lib/tosthreads/sensorboards/basicsb/BlockingPhotoC.nc b/tos/lib/tosthreads/sensorboards/basicsb/BlockingPhotoC.nc new file mode 100644 index 00000000..18ee6f1b --- /dev/null +++ b/tos/lib/tosthreads/sensorboards/basicsb/BlockingPhotoC.nc @@ -0,0 +1,26 @@ +/* $Id$ + * Copyright (c) 2006 Intel Corporation + * All rights reserved. + * + * This file is distributed under the terms in the attached INTEL-LICENSE + * file. If you do not find these files, copies can be found by writing to + * Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, Berkeley, CA, + * 94704. Attention: Intel License Inquiry. + */ +/** + * Photodiode of the basicsb sensor board. + * + * @author David Gay + * @author Kevin Klues + */ + +generic configuration BlockingPhotoC() { + provides interface BlockingRead; +} +implementation { + components new BlockingAdcReadClientC(), PhotoDeviceP; + + BlockingRead = BlockingAdcReadClientC; + BlockingAdcReadClientC.Atm128AdcConfig -> PhotoDeviceP; + BlockingAdcReadClientC.ResourceConfigure -> PhotoDeviceP; +} diff --git a/tos/lib/tosthreads/sensorboards/basicsb/BlockingPhotoStreamC.nc b/tos/lib/tosthreads/sensorboards/basicsb/BlockingPhotoStreamC.nc new file mode 100644 index 00000000..8a8e0c28 --- /dev/null +++ b/tos/lib/tosthreads/sensorboards/basicsb/BlockingPhotoStreamC.nc @@ -0,0 +1,26 @@ +/* $Id$ + * Copyright (c) 2006 Intel Corporation + * All rights reserved. + * + * This file is distributed under the terms in the attached INTEL-LICENSE + * file. If you do not find these files, copies can be found by writing to + * Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, Berkeley, CA, + * 94704. Attention: Intel License Inquiry. + */ +/** + * Photodiode of the basicsb sensor board. + * + * @author David Gay + * @author Kevin Klues + */ + +generic configuration BlockingPhotoStreamC() { + provides interface BlockingReadStream; +} +implementation { + components PhotoDeviceP, new BlockingAdcReadStreamClientC(); + + BlockingReadStream = BlockingAdcReadStreamClientC; + BlockingAdcReadStreamClientC.Atm128AdcConfig -> PhotoDeviceP; + BlockingAdcReadStreamClientC.ResourceConfigure -> PhotoDeviceP; +} diff --git a/tos/lib/tosthreads/sensorboards/basicsb/BlockingTempC.nc b/tos/lib/tosthreads/sensorboards/basicsb/BlockingTempC.nc new file mode 100644 index 00000000..cbdebb6a --- /dev/null +++ b/tos/lib/tosthreads/sensorboards/basicsb/BlockingTempC.nc @@ -0,0 +1,25 @@ +/* $Id$ + * Copyright (c) 2006 Intel Corporation + * All rights reserved. + * + * This file is distributed under the terms in the attached INTEL-LICENSE + * file. If you do not find these files, copies can be found by writing to + * Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, Berkeley, CA, + * 94704. Attention: Intel License Inquiry. + */ +/** + * Thermistor of the basicsb sensor board. + * + * @author David Gay + */ + +generic configuration BlockingTempC() { + provides interface BlockingRead; +} +implementation { + components new BlockingAdcReadClientC(), TempDeviceP; + + BlockingRead = BlockingAdcReadClientC; + BlockingAdcReadClientC.Atm128AdcConfig -> TempDeviceP; + BlockingAdcReadClientC.ResourceConfigure -> TempDeviceP; +} diff --git a/tos/lib/tosthreads/sensorboards/basicsb/BlockingTempStreamC.nc b/tos/lib/tosthreads/sensorboards/basicsb/BlockingTempStreamC.nc new file mode 100644 index 00000000..075ab977 --- /dev/null +++ b/tos/lib/tosthreads/sensorboards/basicsb/BlockingTempStreamC.nc @@ -0,0 +1,26 @@ +/* $Id$ + * Copyright (c) 2006 Intel Corporation + * All rights reserved. + * + * This file is distributed under the terms in the attached INTEL-LICENSE + * file. If you do not find these files, copies can be found by writing to + * Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, Berkeley, CA, + * 94704. Attention: Intel License Inquiry. + */ +/** + * Thermistor of the basicsb sensor board. + * + * @author David Gay + * @author Kevin Klues + */ + +generic configuration TempStreamC() { + provides interface BlockingReadStream; +} +implementation { + components TempDeviceP, new BlockingAdcReadStreamClientC(); + + BlockingReadStream = BlockingAdcReadStreamClientC; + BlockingAdcReadStreamClientC.Atm128AdcConfig -> TempDeviceP; + BlockingAdcReadStreamClientC.ResourceConfigure -> TempDeviceP; +} diff --git a/tos/lib/tosthreads/sensorboards/basicsb/CPhotoC.nc b/tos/lib/tosthreads/sensorboards/basicsb/CPhotoC.nc new file mode 100644 index 00000000..66316636 --- /dev/null +++ b/tos/lib/tosthreads/sensorboards/basicsb/CPhotoC.nc @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2008 Stanford University. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the + * distribution. + * - Neither the name of the Stanford University nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL STANFORD + * UNIVERSITY OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * @author Kevin Klues + */ + +configuration CPhotoC {} +implementation { + components CPhotoP; + components new BlockingPhotoC(); + CPhotoP.BlockingRead -> BlockingPhotoC; + CPhotoP.BlockingReadStream -> BlockingPhotoC; +} diff --git a/tos/lib/tosthreads/sensorboards/basicsb/CPhotoP.nc b/tos/lib/tosthreads/sensorboards/basicsb/CPhotoP.nc new file mode 100644 index 00000000..51aeeff3 --- /dev/null +++ b/tos/lib/tosthreads/sensorboards/basicsb/CPhotoP.nc @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2008 Stanford University. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the + * distribution. + * - Neither the name of the Stanford University nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL STANFORD + * UNIVERSITY OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * @author Kevin Klues + */ + +module CPhotoP { + uses { + interface BlockingRead; + interface BlockingReadStream; + } +} +implementation { + error_t photo_read(uint16_t* val) @C() @spontaneous() { + return call BlockingRead.read(val); + } + error_t photo_readStream(uint32_t* usPeriod, uint16_t* buf, uint16_t count) @C() @spontaneous() { + return call BlockingReadStream.read(usPeriod, buf, count); + } +} diff --git a/tos/lib/tosthreads/sensorboards/basicsb/CTempC.nc b/tos/lib/tosthreads/sensorboards/basicsb/CTempC.nc new file mode 100644 index 00000000..8079e7de --- /dev/null +++ b/tos/lib/tosthreads/sensorboards/basicsb/CTempC.nc @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2008 Stanford University. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the + * distribution. + * - Neither the name of the Stanford University nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL STANFORD + * UNIVERSITY OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * @author Kevin Klues + */ + +configuration CTempC {} +implementation { + components CTempP; + components new BlockingTempC(); + CTempP.BlockingRead -> BlockingTempC; + CTempP.BlockingReadStream -> BlockingTempC; +} diff --git a/tos/lib/tosthreads/sensorboards/basicsb/CTempP.nc b/tos/lib/tosthreads/sensorboards/basicsb/CTempP.nc new file mode 100644 index 00000000..1bcc8d9e --- /dev/null +++ b/tos/lib/tosthreads/sensorboards/basicsb/CTempP.nc @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2008 Stanford University. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the + * distribution. + * - Neither the name of the Stanford University nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL STANFORD + * UNIVERSITY OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * @author Kevin Klues + */ + +module CTempP { + uses { + interface BlockingRead; + interface BlockingReadStream; + } +} +implementation { + error_t temp_read(uint16_t* val) @C() @spontaneous() { + return call BlockingRead.read(val); + } + error_t temp_readStream(uint32_t* usPeriod, uint16_t* buf, uint16_t count) @C() @spontaneous() { + return call BlockingReadStream.read(usPeriod, buf, count); + } +} diff --git a/tos/lib/tosthreads/sensorboards/basicsb/basicsb_sensors.h b/tos/lib/tosthreads/sensorboards/basicsb/basicsb_sensors.h new file mode 100644 index 00000000..ec3b13a7 --- /dev/null +++ b/tos/lib/tosthreads/sensorboards/basicsb/basicsb_sensors.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2008 Stanford University. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the + * distribution. + * - Neither the name of the Stanford University nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL STANFORD + * UNIVERSITY OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * @author Kevin Klues + */ + +#ifndef BASICSB_SENSORS_H +#define BASICSB_SENSORS_H + +#include "tosthread_photo.h" +#include "tosthread_temp.h" + +#endif //BASICSB_SENSORS_H diff --git a/tos/lib/tosthreads/sensorboards/basicsb/tosthread_photo.h b/tos/lib/tosthreads/sensorboards/basicsb/tosthread_photo.h new file mode 100644 index 00000000..f3508b51 --- /dev/null +++ b/tos/lib/tosthreads/sensorboards/basicsb/tosthread_photo.h @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2008 Stanford University. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the + * distribution. + * - Neither the name of the Stanford University nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL STANFORD + * UNIVERSITY OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * @author Kevin Klues + */ + +#ifndef TOSTHREAD_PHOTO_H +#define TOSTHREAD_PHOTO_H + +#include "TinyError.h" + +extern error_t photo_read(uint16_t* val); +extern error_t photo_readStream(uint32_t* usPeriod, uint16_t* buf, uint16_t count); + +#endif //TOSTHREAD_PHOTO_H diff --git a/tos/lib/tosthreads/sensorboards/basicsb/tosthread_temp.h b/tos/lib/tosthreads/sensorboards/basicsb/tosthread_temp.h new file mode 100644 index 00000000..adba25a8 --- /dev/null +++ b/tos/lib/tosthreads/sensorboards/basicsb/tosthread_temp.h @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2008 Stanford University. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the + * distribution. + * - Neither the name of the Stanford University nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL STANFORD + * UNIVERSITY OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * @author Kevin Klues + */ + +#ifndef TOSTHREAD_TEMP_H +#define TOSTHREAD_TEMP_H + +#include "TinyError.h" + +extern error_t temp_read(uint16_t* val); +extern error_t temp_readStream(uint32_t* usPeriod, uint16_t* buf, uint16_t count); + +#endif //TOSTHREAD_TEMP_H -- 2.39.2