A collection of Analog Devices drivers for the mbed platform
For additional information check out the mbed page of the Analog Devices wiki: https://wiki.analog.com/resources/tools-software/mbed-drivers-all
examples/drvdiag/driver_wrapper/ad7790_diag.h@8:6e96c6b3c83f, 2016-04-20 (annotated)
- Committer:
- Adrian Suciu
- Date:
- Wed Apr 20 17:37:32 2016 +0300
- Revision:
- 8:6e96c6b3c83f
- Parent:
- 7:b62398a1d17a
Added license
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| Adrian Suciu |
8:6e96c6b3c83f | 1 | /** |
| Adrian Suciu |
8:6e96c6b3c83f | 2 | * @file ad7790_diag.h |
| Adrian Suciu |
8:6e96c6b3c83f | 3 | * @brief Header file for the AD7790 wrapper used by the driver diag |
| Adrian Suciu |
8:6e96c6b3c83f | 4 | * @author Analog Devices Inc. |
| Adrian Suciu |
8:6e96c6b3c83f | 5 | * |
| Adrian Suciu |
8:6e96c6b3c83f | 6 | * For support please go to: |
| Adrian Suciu |
8:6e96c6b3c83f | 7 | * Github: https://github.com/analogdevicesinc/mbed-adi |
| Adrian Suciu |
8:6e96c6b3c83f | 8 | * Support: https://ez.analog.com/community/linux-device-drivers/microcontroller-no-os-drivers |
| Adrian Suciu |
8:6e96c6b3c83f | 9 | * More: https://wiki.analog.com/resources/tools-software/mbed-drivers-all |
| Adrian Suciu |
7:b62398a1d17a | 10 | |
| Adrian Suciu |
8:6e96c6b3c83f | 11 | ******************************************************************************** |
| Adrian Suciu |
8:6e96c6b3c83f | 12 | * Copyright 2016(c) Analog Devices, Inc. |
| Adrian Suciu |
8:6e96c6b3c83f | 13 | * |
| Adrian Suciu |
8:6e96c6b3c83f | 14 | * All rights reserved. |
| Adrian Suciu |
8:6e96c6b3c83f | 15 | * |
| Adrian Suciu |
8:6e96c6b3c83f | 16 | * Redistribution and use in source and binary forms, with or without |
| Adrian Suciu |
8:6e96c6b3c83f | 17 | * modification, are permitted provided that the following conditions are met: |
| Adrian Suciu |
8:6e96c6b3c83f | 18 | * - Redistributions of source code must retain the above copyright |
| Adrian Suciu |
8:6e96c6b3c83f | 19 | * notice, this list of conditions and the following disclaimer. |
| Adrian Suciu |
8:6e96c6b3c83f | 20 | * - Redistributions in binary form must reproduce the above copyright |
| Adrian Suciu |
8:6e96c6b3c83f | 21 | * notice, this list of conditions and the following disclaimer in |
| Adrian Suciu |
8:6e96c6b3c83f | 22 | * the documentation and/or other materials provided with the |
| Adrian Suciu |
8:6e96c6b3c83f | 23 | * distribution. |
| Adrian Suciu |
8:6e96c6b3c83f | 24 | * - Neither the name of Analog Devices, Inc. nor the names of its |
| Adrian Suciu |
8:6e96c6b3c83f | 25 | * contributors may be used to endorse or promote products derived |
| Adrian Suciu |
8:6e96c6b3c83f | 26 | * from this software without specific prior written permission. |
| Adrian Suciu |
8:6e96c6b3c83f | 27 | * - The use of this software may or may not infringe the patent rights |
| Adrian Suciu |
8:6e96c6b3c83f | 28 | * of one or more patent holders. This license does not release you |
| Adrian Suciu |
8:6e96c6b3c83f | 29 | * from the requirement that you obtain separate licenses from these |
| Adrian Suciu |
8:6e96c6b3c83f | 30 | * patent holders to use this software. |
| Adrian Suciu |
8:6e96c6b3c83f | 31 | * - Use of the software either in source or binary form, must be run |
| Adrian Suciu |
8:6e96c6b3c83f | 32 | * on or directly connected to an Analog Devices Inc. component. |
| Adrian Suciu |
8:6e96c6b3c83f | 33 | * |
| Adrian Suciu |
8:6e96c6b3c83f | 34 | * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR |
| Adrian Suciu |
8:6e96c6b3c83f | 35 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, |
| Adrian Suciu |
8:6e96c6b3c83f | 36 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
| Adrian Suciu |
8:6e96c6b3c83f | 37 | * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, |
| Adrian Suciu |
8:6e96c6b3c83f | 38 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| Adrian Suciu |
8:6e96c6b3c83f | 39 | * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR |
| Adrian Suciu |
8:6e96c6b3c83f | 40 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| Adrian Suciu |
8:6e96c6b3c83f | 41 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| Adrian Suciu |
8:6e96c6b3c83f | 42 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| Adrian Suciu |
8:6e96c6b3c83f | 43 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| Adrian Suciu |
8:6e96c6b3c83f | 44 | * |
| Adrian Suciu |
8:6e96c6b3c83f | 45 | ********************************************************************************/ |
| Adrian Suciu |
7:b62398a1d17a | 46 | #ifndef AD7790_DIAG_H_ |
| Adrian Suciu |
7:b62398a1d17a | 47 | #define AD7790_DIAG_H_ |
| Adrian Suciu |
7:b62398a1d17a | 48 | |
| Adrian Suciu |
7:b62398a1d17a | 49 | #include "AD7790.h" |
| Adrian Suciu |
7:b62398a1d17a | 50 | |
| Adrian Suciu |
7:b62398a1d17a | 51 | class AD7790_Diag |
| Adrian Suciu |
7:b62398a1d17a | 52 | { |
| Adrian Suciu |
7:b62398a1d17a | 53 | |
| Adrian Suciu |
7:b62398a1d17a | 54 | public: |
| Adrian Suciu |
7:b62398a1d17a | 55 | AD7790_Diag(AD7790& ad); |
| Adrian Suciu |
7:b62398a1d17a | 56 | void init(void); |
| Adrian Suciu |
7:b62398a1d17a | 57 | void reset(void); |
| Adrian Suciu |
7:b62398a1d17a | 58 | void write_mode(void); |
| Adrian Suciu |
7:b62398a1d17a | 59 | void write_filter(void); |
| Adrian Suciu |
7:b62398a1d17a | 60 | void read_mode(void); |
| Adrian Suciu |
7:b62398a1d17a | 61 | void read_filter(void); |
| Adrian Suciu |
7:b62398a1d17a | 62 | void read_data(void); |
| Adrian Suciu |
7:b62398a1d17a | 63 | void read_status(void); |
| Adrian Suciu |
7:b62398a1d17a | 64 | void read_u16(void); |
| Adrian Suciu |
7:b62398a1d17a | 65 | void read_voltage(void); |
| Adrian Suciu |
7:b62398a1d17a | 66 | void set_continous_mode(void); |
| Adrian Suciu |
7:b62398a1d17a | 67 | void set_reference_voltage(void); |
| Adrian Suciu |
7:b62398a1d17a | 68 | void set_channel(void); |
| Adrian Suciu |
7:b62398a1d17a | 69 | |
| Adrian Suciu |
7:b62398a1d17a | 70 | private: |
| Adrian Suciu |
7:b62398a1d17a | 71 | AD7790& dut; |
| Adrian Suciu |
7:b62398a1d17a | 72 | }; |
| Adrian Suciu |
7:b62398a1d17a | 73 | |
| Adrian Suciu |
7:b62398a1d17a | 74 | /* |
| Adrian Suciu |
7:b62398a1d17a | 75 | |
| Adrian Suciu |
7:b62398a1d17a | 76 | */ |
| Adrian Suciu |
7:b62398a1d17a | 77 | |
| Adrian Suciu |
7:b62398a1d17a | 78 | |
| Adrian Suciu |
7:b62398a1d17a | 79 | |
| Adrian Suciu |
7:b62398a1d17a | 80 | #endif /* AD7790_DIAG_H_ */ |
CN0357 - Toxic gas measurement
CN0216 - Weight Scale