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.
Diff: Components/tsz124/tsz124_class.h
- Revision:
- 13:9cecc8d66cc1
- Parent:
- 11:91d59b5ac026
- Child:
- 17:cbdee5f7a2aa
diff -r ac16b9a1cad6 -r 9cecc8d66cc1 Components/tsz124/tsz124_class.h --- a/Components/tsz124/tsz124_class.h Thu Apr 07 04:15:34 2016 +0000 +++ b/Components/tsz124/tsz124_class.h Thu Apr 07 07:51:13 2016 +0000 @@ -77,7 +77,7 @@ /* Classes -------------------------------------------------------------------*/ /** - * @brief Class representing a TSZ124 component. + * @brief Class representing a TSZ124 operational amplifier component. */ class TSZ124 : public Instrumentation_amp { @@ -108,36 +108,30 @@ /*** Public Component Related Methods ***/ - /* ACTION 5 --------------------------------------------------------------* - * Implement here the component's public methods, as wrappers of the C * - * component's functions. * - * They should be: * - * + Methods with the same name of the C component's virtual table's * - * functions (1); * - * + Methods with the same name of the C component's extended virtual * - * table's functions, if any (2). * - * * - * Example: * - * virtual int GetValue(float *f) //(1) * - * { * - * return COMPONENT_GetValue(float *f); * - * } * - * * - * virtual int EnableFeature(void) //(2) * - * { * - * return COMPONENT_EnableFeature(); * - * } * - *------------------------------------------------------------------------*/ + + /** + * @brief initialize class for TSZ124 operational amplifier component + * @retval COMPONENT_OK if initialization is successfull + * @retval suitable error code otherwise + */ virtual int Init(void *init = NULL) { return (int) TSZ124_Init((void *) init); } + /** + * @brief obtain component ID for TSZ124 perational amplifier + * @retval component ID for TSZ124 operational amplifier + */ virtual int ReadID(uint8_t *id = NULL) { return (int) TSZ124_ReadID((uint8_t *) id); } + /** + * @brief obtain the amplified differential voltage in instrumentation Amplifier configuration + * @retval amplified differential voltage in instrumentation Amplifier configuration + */ virtual unsigned int GetVoltage(void) { const unsigned int ADC_RANGE_12_BIT = 0xFFF; @@ -145,6 +139,10 @@ return ((double)ain.read())*805.0*ADC_RANGE_12_BIT/1000.0; } + /** + * @brief obtain the current consumed by the application in Current sensing configuration + * @retval current consumed by the application in Current sensing configuration + */ virtual unsigned int GetCurrent(void) { const unsigned int ADC_RANGE_12_BIT = 0xFFF; @@ -207,7 +205,7 @@ *------------------------------------------------------------------------*/ /* TSZ124's generic functions. */ Status_t TSZ124_Init(void *init); - Status_t TSZ124_ReadID(void *id); + unsigned int TSZ124_ReadID(void *id); /* TSZ124's interrupts related functions. */ Status_t TSZ124_ConfigIT(void* a);