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/tsz124/tsz124_class.cpp@10:70f329e007e6, 2016-04-06 (annotated)
- Committer:
- hemddabral
- Date:
- Wed Apr 06 09:05:41 2016 +0000
- Revision:
- 10:70f329e007e6
- Parent:
- 9:af8d2d4102ea
- Child:
- 13:9cecc8d66cc1
warning messages;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
hemddabral | 8:0d9e4ee027e4 | 1 | /** |
hemddabral | 8:0d9e4ee027e4 | 2 | ****************************************************************************** |
hemddabral | 8:0d9e4ee027e4 | 3 | * @file TSZ124.c |
hemddabral | 8:0d9e4ee027e4 | 4 | * @author Central Labs |
hemddabral | 8:0d9e4ee027e4 | 5 | * @version 1.0.0 |
hemddabral | 8:0d9e4ee027e4 | 6 | * @date 11-February-2016 |
hemddabral | 8:0d9e4ee027e4 | 7 | * @brief Portable architecture for TSZ124 |
hemddabral | 8:0d9e4ee027e4 | 8 | ****************************************************************************** |
hemddabral | 8:0d9e4ee027e4 | 9 | * @attention |
hemddabral | 8:0d9e4ee027e4 | 10 | * |
hemddabral | 8:0d9e4ee027e4 | 11 | * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2> |
hemddabral | 8:0d9e4ee027e4 | 12 | * |
hemddabral | 8:0d9e4ee027e4 | 13 | * Redistribution and use in source and binary forms, with or without modification, |
hemddabral | 8:0d9e4ee027e4 | 14 | * are permitted provided that the following conditions are met: |
hemddabral | 8:0d9e4ee027e4 | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
hemddabral | 8:0d9e4ee027e4 | 16 | * this list of conditions and the following disclaimer. |
hemddabral | 8:0d9e4ee027e4 | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
hemddabral | 8:0d9e4ee027e4 | 18 | * this list of conditions and the following disclaimer in the documentation |
hemddabral | 8:0d9e4ee027e4 | 19 | * and/or other materials provided with the distribution. |
hemddabral | 8:0d9e4ee027e4 | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
hemddabral | 8:0d9e4ee027e4 | 21 | * may be used to endorse or promote products derived from this software |
hemddabral | 8:0d9e4ee027e4 | 22 | * without specific prior written permission. |
hemddabral | 8:0d9e4ee027e4 | 23 | * |
hemddabral | 8:0d9e4ee027e4 | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
hemddabral | 8:0d9e4ee027e4 | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
hemddabral | 8:0d9e4ee027e4 | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
hemddabral | 8:0d9e4ee027e4 | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
hemddabral | 8:0d9e4ee027e4 | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
hemddabral | 8:0d9e4ee027e4 | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
hemddabral | 8:0d9e4ee027e4 | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
hemddabral | 8:0d9e4ee027e4 | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
hemddabral | 8:0d9e4ee027e4 | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
hemddabral | 8:0d9e4ee027e4 | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
hemddabral | 8:0d9e4ee027e4 | 34 | * |
hemddabral | 8:0d9e4ee027e4 | 35 | ****************************************************************************** |
hemddabral | 8:0d9e4ee027e4 | 36 | */ |
hemddabral | 8:0d9e4ee027e4 | 37 | |
hemddabral | 8:0d9e4ee027e4 | 38 | |
hemddabral | 8:0d9e4ee027e4 | 39 | /* Generated with STM32CubeTOO -----------------------------------------------*/ |
hemddabral | 8:0d9e4ee027e4 | 40 | |
hemddabral | 2:19d1dcef0c0e | 41 | |
hemddabral | 8:0d9e4ee027e4 | 42 | /* Revision ------------------------------------------------------------------*/ |
hemddabral | 8:0d9e4ee027e4 | 43 | /* |
hemddabral | 8:0d9e4ee027e4 | 44 | Repository: http://svn.x-nucleodev.codex.cro.st.com/svnroot/X-NucleoDev |
hemddabral | 8:0d9e4ee027e4 | 45 | Branch/Trunk/Tag: trunk |
hemddabral | 8:0d9e4ee027e4 | 46 | Based on: X-CUBE-IKA01A1/trunk/Drivers/BSP/Components/tsz124/tsz124.c |
hemddabral | 8:0d9e4ee027e4 | 47 | Revision: 410 |
hemddabral | 8:0d9e4ee027e4 | 48 | */ |
hemddabral | 8:0d9e4ee027e4 | 49 | |
hemddabral | 8:0d9e4ee027e4 | 50 | |
hemddabral | 8:0d9e4ee027e4 | 51 | /* Includes ------------------------------------------------------------------*/ |
hemddabral | 8:0d9e4ee027e4 | 52 | |
hemddabral | 8:0d9e4ee027e4 | 53 | #include "tsz124_class.h" |
hemddabral | 8:0d9e4ee027e4 | 54 | #include "tsz124.h" |
hemddabral | 8:0d9e4ee027e4 | 55 | |
hemddabral | 8:0d9e4ee027e4 | 56 | |
hemddabral | 8:0d9e4ee027e4 | 57 | /* Methods -------------------------------------------------------------------*/ |
hemddabral | 8:0d9e4ee027e4 | 58 | |
hemddabral | 10:70f329e007e6 | 59 | //static Status_t GetVoltage(unsigned int *ptrVoltage); |
hemddabral | 10:70f329e007e6 | 60 | //static Status_t GetCurrent(unsigned int *ptrCurrent); |
hemddabral | 8:0d9e4ee027e4 | 61 | |
hemddabral | 8:0d9e4ee027e4 | 62 | /* TSZ124's private functions. */ |
hemddabral | 8:0d9e4ee027e4 | 63 | |
hemddabral | 8:0d9e4ee027e4 | 64 | |
hemddabral | 8:0d9e4ee027e4 | 65 | Status_t TSZ124::TSZ124_Init(void *init) { |
hemddabral | 8:0d9e4ee027e4 | 66 | return COMPONENT_OK; |
hemddabral | 8:0d9e4ee027e4 | 67 | } |
hemddabral | 8:0d9e4ee027e4 | 68 | |
hemddabral | 8:0d9e4ee027e4 | 69 | Status_t TSZ124::TSZ124_ReadID(void *init) { |
hemddabral | 9:af8d2d4102ea | 70 | return COMPONENT_OK; |
hemddabral | 8:0d9e4ee027e4 | 71 | } |
hemddabral | 8:0d9e4ee027e4 | 72 | |
hemddabral | 8:0d9e4ee027e4 | 73 | Status_t TSZ124::TSZ124_ConfigIT(void *init) { |
hemddabral | 9:af8d2d4102ea | 74 | return COMPONENT_OK; |
hemddabral | 8:0d9e4ee027e4 | 75 | } |
hemddabral | 8:0d9e4ee027e4 | 76 | |
hemddabral | 10:70f329e007e6 | 77 | /* |
hemddabral | 8:0d9e4ee027e4 | 78 | static unsigned int TSZ124_GetVoltage(void) { |
hemddabral | 8:0d9e4ee027e4 | 79 | const unsigned int ADC_RANGE_12_BIT = 0xFFF; |
hemddabral | 8:0d9e4ee027e4 | 80 | AnalogIn ain(A1); |
hemddabral | 8:0d9e4ee027e4 | 81 | return ain.read()*805.0*ADC_RANGE_12_BIT/1000.0; |
hemddabral | 8:0d9e4ee027e4 | 82 | } |
hemddabral | 8:0d9e4ee027e4 | 83 | |
hemddabral | 8:0d9e4ee027e4 | 84 | static unsigned int TSZ124_GetCurrent(void) { |
hemddabral | 8:0d9e4ee027e4 | 85 | const unsigned int ADC_RANGE_12_BIT = 0xFFF; |
hemddabral | 8:0d9e4ee027e4 | 86 | AnalogIn ain(A2); |
hemddabral | 8:0d9e4ee027e4 | 87 | return ain.read()*1000.0*805.0*ADC_RANGE_12_BIT/1000.0/1586.0; |
hemddabral | 8:0d9e4ee027e4 | 88 | } |
hemddabral | 10:70f329e007e6 | 89 | */ |
hemddabral | 8:0d9e4ee027e4 | 90 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
hemddabral | 8:0d9e4ee027e4 | 91 |