mbed library for STMicroelectronics' X-NUCLEO-IKA01A1 expansion board.
Dependents: HelloWorld_IKA01A1
Fork of X_NUCLEO_IKA01A1 by
Library for STMicroelectronics' X-NUCLEO-IKA01A1 multifunctional expansion board based on operational amplifiers.
Components/Common/photosensor_def.h@23:807f66b435d6, 2017-07-13 (annotated)
- Committer:
- Davidroid
- Date:
- Thu Jul 13 15:46:02 2017 +0000
- Revision:
- 23:807f66b435d6
- Parent:
- 22:ff8d071bf79e
Adapting to ARM mbed coding style.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Davidroid | 22:ff8d071bf79e | 1 | /** |
Davidroid | 22:ff8d071bf79e | 2 | ****************************************************************************** |
Davidroid | 22:ff8d071bf79e | 3 | * @file photodiode.h |
Davidroid | 22:ff8d071bf79e | 4 | * @author Central Labs |
Davidroid | 22:ff8d071bf79e | 5 | * @version 1.0.0 |
Davidroid | 22:ff8d071bf79e | 6 | * @date 11-February-2016 |
Davidroid | 22:ff8d071bf79e | 7 | * @brief Portable architecture for TSU104 |
Davidroid | 22:ff8d071bf79e | 8 | ****************************************************************************** |
Davidroid | 22:ff8d071bf79e | 9 | * @attention |
Davidroid | 22:ff8d071bf79e | 10 | * |
Davidroid | 22:ff8d071bf79e | 11 | * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2> |
Davidroid | 22:ff8d071bf79e | 12 | * |
Davidroid | 22:ff8d071bf79e | 13 | * Redistribution and use in source and binary forms, with or without modification, |
Davidroid | 22:ff8d071bf79e | 14 | * are permitted provided that the following conditions are met: |
Davidroid | 22:ff8d071bf79e | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
Davidroid | 22:ff8d071bf79e | 16 | * this list of conditions and the following disclaimer. |
Davidroid | 22:ff8d071bf79e | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
Davidroid | 22:ff8d071bf79e | 18 | * this list of conditions and the following disclaimer in the documentation |
Davidroid | 22:ff8d071bf79e | 19 | * and/or other materials provided with the distribution. |
Davidroid | 22:ff8d071bf79e | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
Davidroid | 22:ff8d071bf79e | 21 | * may be used to endorse or promote products derived from this software |
Davidroid | 22:ff8d071bf79e | 22 | * without specific prior written permission. |
Davidroid | 22:ff8d071bf79e | 23 | * |
Davidroid | 22:ff8d071bf79e | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
Davidroid | 22:ff8d071bf79e | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
Davidroid | 22:ff8d071bf79e | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
Davidroid | 22:ff8d071bf79e | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
Davidroid | 22:ff8d071bf79e | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
Davidroid | 22:ff8d071bf79e | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
Davidroid | 22:ff8d071bf79e | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
Davidroid | 22:ff8d071bf79e | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
Davidroid | 22:ff8d071bf79e | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
Davidroid | 22:ff8d071bf79e | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Davidroid | 22:ff8d071bf79e | 34 | * |
Davidroid | 22:ff8d071bf79e | 35 | ****************************************************************************** |
Davidroid | 22:ff8d071bf79e | 36 | */ |
Davidroid | 22:ff8d071bf79e | 37 | |
Davidroid | 22:ff8d071bf79e | 38 | |
Davidroid | 22:ff8d071bf79e | 39 | /* Define to prevent recursive inclusion -------------------------------------*/ |
Davidroid | 22:ff8d071bf79e | 40 | |
Davidroid | 22:ff8d071bf79e | 41 | #ifndef __PHOTODIODE_H |
Davidroid | 22:ff8d071bf79e | 42 | #define __PHOTODIODE_H |
Davidroid | 22:ff8d071bf79e | 43 | |
Davidroid | 22:ff8d071bf79e | 44 | #ifdef __cplusplus |
Davidroid | 22:ff8d071bf79e | 45 | extern "C" { |
Davidroid | 22:ff8d071bf79e | 46 | #endif |
Davidroid | 22:ff8d071bf79e | 47 | |
Davidroid | 22:ff8d071bf79e | 48 | |
Davidroid | 22:ff8d071bf79e | 49 | /* Includes ------------------------------------------------------------------*/ |
Davidroid | 22:ff8d071bf79e | 50 | |
Davidroid | 22:ff8d071bf79e | 51 | #include <stdint.h> |
Davidroid | 22:ff8d071bf79e | 52 | #include "component_def.h" |
Davidroid | 22:ff8d071bf79e | 53 | |
Davidroid | 22:ff8d071bf79e | 54 | |
Davidroid | 22:ff8d071bf79e | 55 | /* Types ---------------------------------------------------------------------*/ |
Davidroid | 22:ff8d071bf79e | 56 | |
Davidroid | 22:ff8d071bf79e | 57 | /** @addtogroup BSP |
Davidroid | 22:ff8d071bf79e | 58 | * @{ |
Davidroid | 22:ff8d071bf79e | 59 | */ |
Davidroid | 22:ff8d071bf79e | 60 | |
Davidroid | 22:ff8d071bf79e | 61 | /** @addtogroup Components |
Davidroid | 22:ff8d071bf79e | 62 | * @{ |
Davidroid | 22:ff8d071bf79e | 63 | */ |
Davidroid | 22:ff8d071bf79e | 64 | |
Davidroid | 22:ff8d071bf79e | 65 | /** @addtogroup PHOTODIODE |
Davidroid | 22:ff8d071bf79e | 66 | * @{ |
Davidroid | 22:ff8d071bf79e | 67 | */ |
Davidroid | 22:ff8d071bf79e | 68 | |
Davidroid | 22:ff8d071bf79e | 69 | /** @defgroup PHOTODIODE_Exported_Types |
Davidroid | 22:ff8d071bf79e | 70 | * @{ |
Davidroid | 22:ff8d071bf79e | 71 | */ |
Davidroid | 22:ff8d071bf79e | 72 | |
Davidroid | 22:ff8d071bf79e | 73 | /** |
Davidroid | 22:ff8d071bf79e | 74 | * @brief PHOTODIODE component identifier enumerator definition. |
Davidroid | 22:ff8d071bf79e | 75 | */ |
Davidroid | 22:ff8d071bf79e | 76 | typedef enum |
Davidroid | 22:ff8d071bf79e | 77 | { |
Davidroid | 22:ff8d071bf79e | 78 | PHOTODIODE_NONE_COMPONENT = 0, |
Davidroid | 22:ff8d071bf79e | 79 | PHOTODIODE_TSU104_COMPONENT = 1 |
Davidroid | 22:ff8d071bf79e | 80 | } PHOTODIODEE_component_t; |
Davidroid | 22:ff8d071bf79e | 81 | |
Davidroid | 22:ff8d071bf79e | 82 | /** |
Davidroid | 22:ff8d071bf79e | 83 | * @brief PHOTODIODE driver virtual table structure definition. |
Davidroid | 22:ff8d071bf79e | 84 | */ |
Davidroid | 22:ff8d071bf79e | 85 | typedef struct |
Davidroid | 22:ff8d071bf79e | 86 | { |
Davidroid | 22:ff8d071bf79e | 87 | /* ACTION ----------------------------------------------------------------* |
Davidroid | 22:ff8d071bf79e | 88 | * Declare here the component's generic functions. * |
Davidroid | 22:ff8d071bf79e | 89 | * Tag this group of functions with the " Generic " C-style comment. * |
Davidroid | 22:ff8d071bf79e | 90 | * A component's interface has to define at least the two generic * |
Davidroid | 22:ff8d071bf79e | 91 | * functions provided here below within the "Example" section, as the * |
Davidroid | 22:ff8d071bf79e | 92 | * first and second functions of its Virtual Table. They have to be * |
Davidroid | 22:ff8d071bf79e | 93 | * specified exactly in the given way. * |
Davidroid | 22:ff8d071bf79e | 94 | * * |
Davidroid | 22:ff8d071bf79e | 95 | * Example: * |
Davidroid | 22:ff8d071bf79e | 96 | * status_t (*Init) (void *handle, void *init); * |
Davidroid | 22:ff8d071bf79e | 97 | * status_t (*ReadID) (void *handle, uint8_t *id); * |
Davidroid | 22:ff8d071bf79e | 98 | *------------------------------------------------------------------------*/ |
Davidroid | 22:ff8d071bf79e | 99 | /* Generic */ |
Davidroid | 22:ff8d071bf79e | 100 | status_t (*Init) (void *handle, void *init); |
Davidroid | 22:ff8d071bf79e | 101 | status_t (*ReadID) (void *handle, uint8_t *id); |
Davidroid | 22:ff8d071bf79e | 102 | |
Davidroid | 22:ff8d071bf79e | 103 | /* ACTION ----------------------------------------------------------------* |
Davidroid | 22:ff8d071bf79e | 104 | * Declare here the component's specific functions. * |
Davidroid | 22:ff8d071bf79e | 105 | * Tag this group of functions with the " Specific " C-style comment. * |
Davidroid | 22:ff8d071bf79e | 106 | * Do not specify any function if not required. * |
Davidroid | 22:ff8d071bf79e | 107 | * * |
Davidroid | 22:ff8d071bf79e | 108 | * Example: * |
Davidroid | 22:ff8d071bf79e | 109 | * status_t (*GetValue) (void *handle, float *f); * |
Davidroid | 22:ff8d071bf79e | 110 | *------------------------------------------------------------------------*/ |
Davidroid | 22:ff8d071bf79e | 111 | /* Specific */ |
Davidroid | 22:ff8d071bf79e | 112 | unsigned int (*GetGetVoltage) (void *handle); |
Davidroid | 22:ff8d071bf79e | 113 | } WINDCOMP_vt_t; |
Davidroid | 22:ff8d071bf79e | 114 | |
Davidroid | 22:ff8d071bf79e | 115 | #ifdef __cplusplus |
Davidroid | 22:ff8d071bf79e | 116 | } |
Davidroid | 22:ff8d071bf79e | 117 | #endif |
Davidroid | 22:ff8d071bf79e | 118 | |
Davidroid | 22:ff8d071bf79e | 119 | #endif /* __PHOTODIODE_H */ |
Davidroid | 22:ff8d071bf79e | 120 | |
Davidroid | 22:ff8d071bf79e | 121 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |