EVAL-AD7124 Mbed Example Program.
Dependencies: adi_console_menu platform_drivers
Diff: app/ad7124_support.h
- Revision:
- 3:779bb1e55f1a
- Child:
- 7:3e1005bd4d41
diff -r 0897873979f3 -r 779bb1e55f1a app/ad7124_support.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/ad7124_support.h Mon Mar 02 17:04:20 2020 +0000 @@ -0,0 +1,34 @@ +/*! + ***************************************************************************** + @file: ad7124_support.h + + @brief: Provides useful support functions for the AD7124 NoOS driver + + @details: + ----------------------------------------------------------------------------- + Copyright (c) 2019, 2020 Analog Devices, Inc. + All rights reserved. + + This software is proprietary to Analog Devices, Inc. and its licensors. + By using this software you agree to the terms of the associated + Analog Devices Software License Agreement. +*****************************************************************************/ + +#ifndef AD7124_SUPPORT_H_ +#define AD7124_SUPPORT_H_ + +#include "ad7124.h" + +/* PGA Gain Value */ +#define AD7124_PGA_GAIN(x) (1 << (x)) + +#define AD7124_REF_VOLTAGE 2.5 +#define AD7124_ADC_N_BITS 24 + +uint8_t ad7124_get_channel_setup(struct ad7124_dev *dev, uint8_t channel); +uint8_t ad7124_get_channel_pga(struct ad7124_dev *dev, uint8_t channel); +bool ad7124_get_channel_bipolar(struct ad7124_dev *dev, uint8_t channel); +float ad7124_convert_sample_to_voltage(struct ad7124_dev *dev, uint8_t channel, + uint32_t sample); + +#endif /* AD7124_SUPPORT_H_ */