Kyle Swenson | cc33c24 | 2022-05-16 10:38:04 -0600 | [diff] [blame] | 1 | /* |
| 2 | * ./kernel_modules/qcom-adc/ads7924-regdefs.h |
| 3 | * |
| 4 | * ads7924-regdefs.h - Register definitions for TI ADS7924 4-channel A/D |
| 5 | * converter |
| 6 | * |
| 7 | * Author: Cradlepoint Technology, Inc. <source@cradlepoint.com> |
| 8 | * Kyle Swenson <kswenson@cradlepoint.com> |
| 9 | * Copied from the ADS7924 Datasheet, publicly available from TI |
| 10 | * |
| 11 | * This program is free software; you can redistribute it and/or modify it |
| 12 | * under the terms of the GNU General Public License as published by the Free |
| 13 | * Software Foundation; either version 2 of the License, or (at your option) |
| 14 | * any later version. |
| 15 | * |
| 16 | * This program is distributed in the hope that it will be useful, but WITHOUT |
| 17 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 18 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
| 19 | * more details. |
| 20 | * |
| 21 | */ |
| 22 | |
| 23 | #ifndef __ADS7924_H__ |
| 24 | #define __ADS7924_H__ |
| 25 | |
| 26 | |
| 27 | /*Register definitions */ |
| 28 | enum { |
| 29 | ADS7924_REG_MODECNTRL = 0, |
| 30 | ADS7924_REG_INTCNTRL, |
| 31 | ADS7924_REG_DATA0_U, |
| 32 | ADS7924_REG_DATA0_L, |
| 33 | ADS7924_REG_DATA1_U, |
| 34 | ADS7924_REG_DATA1_L, |
| 35 | ADS7924_REG_DATA2_U, |
| 36 | ADS7924_REG_DATA2_L, |
| 37 | ADS7924_REG_DATA3_U, |
| 38 | ADS7924_REG_DATA3_L, |
| 39 | ADS7924_REG_ULR0, |
| 40 | ADS7924_REG_LLR0, |
| 41 | ADS7924_REG_ULR1, |
| 42 | ADS7924_REG_LLR1, |
| 43 | ADS7924_REG_ULR2, |
| 44 | ADS7924_REG_LLR2, |
| 45 | ADS7924_REG_ULR3, |
| 46 | ADS7924_REG_LLR3, |
| 47 | ADS7924_REG_INTCONFIG, |
| 48 | ADS7924_REG_SLPCONFIG, |
| 49 | ADS7924_REG_ACQCONFIG, |
| 50 | ADS7924_REG_PWRCONFIG, |
| 51 | ADS7924_REG_RESET |
| 52 | }; |
| 53 | |
| 54 | #define ADS7924_MODE_IDLE 0x0 |
| 55 | #define ADS7924_MODE_AWAKE 0x20 |
| 56 | #define ADS7924_MODE_MANUAL_SINGLE 0x30 |
| 57 | #define ADS7924_MODE_MANUAL_SCAN 0x32 |
| 58 | #define ADS7924_MODE_AUTO_SINGLE 0x31 |
| 59 | #define ADS7924_MODE_AUTO_SCAN 0x33 |
| 60 | #define ADS7924_MODE_AUTO_SINGLE_WITH_SLEEP 0x39 |
| 61 | #define ADS7924_MODE_AUTO_SCAN_WITH_SLEEP 0x3B |
| 62 | #define ADS7924_MODE_AUTO_BURST_WITH_SLEEP 0x3F |
| 63 | |
| 64 | enum { |
| 65 | ADS7924_CH_0 = 0, |
| 66 | ADS7924_CH_1, |
| 67 | ADS7924_CH_2, |
| 68 | ADS7924_CH_3, |
| 69 | ADS7924_CH_INVALID |
| 70 | }; |
| 71 | #endif |