| Nordic Thingy:52 v2.0.0

drv_ccs811_bitfields.h
1 /*
2 Copyright (c) 2010 - 2017, Nordic Semiconductor ASA
3 All rights reserved.
4
5 Redistribution and use in source and binary forms, with or without modification,
6 are permitted provided that the following conditions are met:
7
8 1. Redistributions of source code must retain the above copyright notice, this
9 list of conditions and the following disclaimer.
10
11 2. Redistributions in binary form, except as embedded into a Nordic
12 Semiconductor ASA integrated circuit in a product or a software update for
13 such product, must reproduce the above copyright notice, this list of
14 conditions and the following disclaimer in the documentation and/or other
15 materials provided with the distribution.
16
17 3. Neither the name of Nordic Semiconductor ASA nor the names of its
18 contributors may be used to endorse or promote products derived from this
19 software without specific prior written permission.
20
21 4. This software, with or without modification, must only be used with a
22 Nordic Semiconductor ASA integrated circuit.
23
24 5. Any software provided in binary form under this license must not be reverse
25 engineered, decompiled, modified and/or disassembled.
26
27 THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
28 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
29 OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
30 DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
31 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
33 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
36 OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 */
38
39 #ifndef DRV_CCS811_BITFIELDS_H__
40 #define DRV_CCS811_BITFIELDS_H__
41
42
43 /* Register: STATUS. */
44 /* Description: Status register. */
45
46 /* Field ERR: Error flag. */
47 #define DRV_CCS811_STATUS_ERR_Pos (0)
48 #define DRV_CCS811_STATUS_ERR_Msk (0x1 << DRV_CCS811_STATUS_ERR_Pos)
49 #define DRV_CCS811_STATUS_ERR_None (0)
50 #define DRV_CCS811_STATUS_ERR_Error (1)
53 /* Field DATA_READY: Data ready flag. */
54 #define DRV_CCS811_STATUS_DATA_READY_Pos (3)
55 #define DRV_CCS811_STATUS_DATA_READY_Msk (0x1 << DRV_CCS811_STATUS_DATA_READY_Pos)
56 #define DRV_CCS811_STATUS_DATA_READY_None (0)
57 #define DRV_CCS811_STATUS_DATA_READY_Ready (1)
60 /* Field APP_VALID: Firmware loaded flag. */
61 #define DRV_CCS811_STATUS_APP_VALID_Pos (4)
62 #define DRV_CCS811_STATUS_APP_VALID_Msk (0x1 << DRV_CCS811_STATUS_APP_VALID_Pos)
63 #define DRV_CCS811_STATUS_APP_VALID_No (0)
64 #define DRV_CCS811_STATUS_APP_VALID_Yes (1)
67 /* Field FW_MODE: Toggles from '0' to '1' if the OTP1 (rectifier) temperature sensor falls below the limit. */
68 #define DRV_CCS811_STATUS_FW_MODE_Pos (7)
69 #define DRV_CCS811_STATUS_FW_MODE_Msk (0x1 << DRV_CCS811_STATUS_FW_MODE_Pos)
70 #define DRV_CCS811_STATUS_FW_MODE_Appl (1)
71 #define DRV_CCS811_STATUS_FW_MODE_Boot (0)
74 /* Register: MEAS_MODE. */
75 /* Description: Measure Mode register. */
76
77
78 /* Field THRESH: Interrupt mode configuration bit. */
79 #define DRV_CCS811_MEAS_MODE_THRESH_Pos (2)
80 #define DRV_CCS811_MEAS_MODE_THRESH_Msk (0x1 << DRV_CCS811_MEAS_MODE_THRESH_Pos)
81 #define DRV_CCS811_MEAS_MODE_THRESH_Normal (0)
82 #define DRV_CCS811_MEAS_MODE_THRESH_Activated (1)
85 /* Field INTERRUPT: Interrupt enable bit. */
86 #define DRV_CCS811_MEAS_MODE_INTERRUPT_Pos (3)
87 #define DRV_CCS811_MEAS_MODE_INTERRUPT_Msk (0x1 << DRV_CCS811_MEAS_MODE_INTERRUPT_Pos)
88 #define DRV_CCS811_MEAS_MODE_INTERRUPT_Disable (0)
89 #define DRV_CCS811_MEAS_MODE_INTERRUPT_Enable (1)
92 /* Field DRIVE_MODE: Drive modes. */
93 #define DRV_CCS811_MEAS_MODE_DRIVE_MODE_Pos (4)
94 #define DRV_CCS811_MEAS_MODE_DRIVE_MODE_Msk (0x7 << DRV_CCS811_MEAS_MODE_DRIVE_MODE_Pos)
95 #define DRV_CCS811_MEAS_MODE_DRIVE_MODE_Idle (0)
96 #define DRV_CCS811_MEAS_MODE_DRIVE_MODE_ConstPwr (1)
97 #define DRV_CCS811_MEAS_MODE_DRIVE_MODE_PulseHeat (2)
98 #define DRV_CCS811_MEAS_MODE_DRIVE_MODE_LowPwrPulseHeat (3)
99 #define DRV_CCS811_MEAS_MODE_DRIVE_MODE_FastConstPwr (4)
102 /* Register: RAW_DATA. */
103 /* Description: Raw data register. */
104
105
106 /* Field RAWADC: The raw ADC reading. */
107 #define DRV_CCS811_RAW_DATA_RAWADC_Pos (0)
108 #define DRV_CCS811_RAW_DATA_RAWADC_Msk (0x3ff << DRV_CCS811_RAW_DATA_RAWADC_Pos)
111 /* Field CURRSEL: The currently selected ADC. */
112 #define DRV_CCS811_RAW_DATA_CURRSEL_Pos (10)
113 #define DRV_CCS811_RAW_DATA_CURRSEL_Msk (0x3f << DRV_CCS811_RAW_DATA_CURRSEL_Pos)
116 /* Register: HW_VERSION. */
117 /* Description: Hardware version register. */
118
119
120 /* Field VARIANT: The hardware variant. */
121 #define DRV_CCS811_HW_VERSION_VARIANT_Pos (0)
122 #define DRV_CCS811_HW_VERSION_VARIANT_Msk (0xf << DRV_CCS811_HW_VERSION_VARIANT_Pos)
125 /* Field MAJOR: The hardware major version. */
126 #define DRV_CCS811_HW_VERSION_MAJOR_Pos (4)
127 #define DRV_CCS811_HW_VERSION_MAJOR_Msk (0xf << DRV_CCS811_HW_VERSION_MAJOR_Pos)
130 /* Register: FW_BOOT_VERSION. */
131 /* Description: Firmware bootloader version register. */
132
133
134 /* Field TRIVIAL: Firmware bootloader trivial version. */
135 #define DRV_CCS811_FW_BOOT_VERSION_TRIVIAL_Pos (0)
136 #define DRV_CCS811_FW_BOOT_VERSION_TRIVIAL_Msk (0xff << DRV_CCS811_FW_BOOT_VERSION_TRIVIAL_Pos)
139 /* Field MINOR: Firmware bootloader minor version. */
140 #define DRV_CCS811_FW_BOOT_VERSION_MINOR_Pos (8)
141 #define DRV_CCS811_FW_BOOT_VERSION_MINOR_Msk (0xf << DRV_CCS811_FW_BOOT_VERSION_MINOR_Pos)
144 /* Field MAJOR: Firmware bootloader major version. */
145 #define DRV_CCS811_FW_BOOT_VERSION_MAJOR_Pos (12)
146 #define DRV_CCS811_FW_BOOT_VERSION_MAJOR_Msk (0xf << DRV_CCS811_FW_BOOT_VERSION_MAJOR_Pos)
149 /* Register: FW_APP_VERSION. */
150 /* Description: Firmware application major version. */
151
152
153 /* Field TRIVIAL: Firmware application trivial version. */
154 #define DRV_CCS811_FW_APP_VERSION_TRIVIAL_Pos (0)
155 #define DRV_CCS811_FW_APP_VERSION_TRIVIAL_Msk (0xff << DRV_CCS811_FW_APP_VERSION_TRIVIAL_Pos)
158 /* Field MINOR: Firmware application minor version. */
159 #define DRV_CCS811_FW_APP_VERSION_MINOR_Pos (8)
160 #define DRV_CCS811_FW_APP_VERSION_MINOR_Msk (0xf << DRV_CCS811_FW_APP_VERSION_MINOR_Pos)
163 /* Field MAJOR: Firmware application major version. */
164 #define DRV_CCS811_FW_APP_VERSION_MAJOR_Pos (12)
165 #define DRV_CCS811_FW_APP_VERSION_MAJOR_Msk (0xf << DRV_CCS811_FW_APP_VERSION_MAJOR_Pos)
168 /* Register: ERR_ID. */
169 /* Description: Error identifier register. */
170
171
172 /* Field ERROR_CODE: Error code field. */
173 #define DRV_CCS811_ERR_ID_ERROR_CODE_Pos (0)
174 #define DRV_CCS811_ERR_ID_ERROR_CODE_Msk (0x3 << DRV_CCS811_ERR_ID_ERROR_CODE_Pos)
175 #define DRV_CCS811_ERR_ID_ERROR_CODE_None (0)
176 #define DRV_CCS811_ERR_ID_ERROR_CODE_SmbMsgInvalid (1)
177 #define DRV_CCS811_ERR_ID_ERROR_CODE_SmbReadInvalid (2)
178 #define DRV_CCS811_ERR_ID_ERROR_CODE_MeasModeInvalid (3)
180 #endif // DRV_CCS811_BITFIELDS_H__