All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Loading...
Searching...
No Matches

Register definitions for OPT3001 devices. More...

Detailed Description

Register definitions for OPT3001 devices.

Author
Jannes Volkens janne.nosp@m.s.vo.nosp@m.lkens.nosp@m.@haw.nosp@m.-hamb.nosp@m.urg..nosp@m.de

Definition in file opt3001_regs.h.

Go to the source code of this file.

OPT3001 registers

#define OPT3001_REGS_RESULT   0x00
 Result register.
 
#define OPT3001_REGS_CONFIG   0x01
 Configuration register.
 
#define OPT3001_REGS_LOW_LIMIT   0x02
 Low Limit register.
 
#define OPT3001_REGS_HIGH_LIMIT   0x03
 High Limit register.
 
#define OPT3001_REGS_MANUFACTURER_ID   0x7E
 Manufacturer ID register.
 
#define OPT3001_REGS_DEVICE_ID   0x7F
 Device ID register.
 
#define OPT3001_DID_VALUE   (0x3001)
 Device ID value.
 
#define OPT3001_CONFIG_RESET   (0xC810)
 Reset value.
 
#define OPT3001_CONFIG_RN_FSR   (0xC000)
 Automatic full-scale setting mode.
 
#define OPT3001_REGS_CONFIG_CT_MASK   (0x0800)
 Conversion time mask.
 
#define OPT3001_REGS_CONFIG_CT(x)
 Conversion time field.
 
#define OPT3001_CONFIG_M_SHUTDOWN   (0x0)
 Shutdown mode.
 
#define OPT3001_CONFIG_M_SINGLE   (0x1)
 Single-shot mode.
 
#define OPT3001_CONFIG_M_CONTINUOUS   (0x2)
 Continuous mode (also 0x3)
 
#define OPT3001_CONFIG_MOC_SHIFT   (9U)
 Mode of conversion shift.
 
#define OPT3001_CONFIG_MOC_MASK   (0x0600)
 Mode of conversion mask.
 
#define OPT3001_REGS_CONFIG_MOC(x)
 Mode of conversion field.
 
#define OPT3001_REGS_CONFIG_OVF   (1 << 8)
 Overflow flag field.
 
#define OPT3001_REGS_CONFIG_CRF   (1 << 7)
 Conversion ready field.
 
#define OPT3001_REGS_CONFIG_FH   (1 << 6)
 Flag high field.
 
#define OPT3001_REGS_CONFIG_FL   (1 << 5)
 Flag low field.
 
#define OPT3001_REGS_CONFIG_L   (1 << 4)
 Latch field.
 
#define OPT3001_REGS_CONFIG_POL   (1 << 3)
 Polarity field.
 
#define OPT3001_REGS_CONFIG_ME   (1 << 2)
 Mask exponent field.
 
#define OPT3001_REGS_CONFIG_FC_MASK   (0x0003)
 Fault count field mask.
 
#define OPT3001_REGS_LOW_LIMIT_EOC_ENABLE   (0xC000)
 End-of-conversion enable.
 
#define OPT3001_REGS_REG_EXPONENT(x)
 Exponent.
 
#define OPT3001_REGS_REG_MANTISSA(x)
 Mantissa.
 
#define OPT3001_REGS_INT_TIME_SHORT   100000
 Integration time of 100ms.
 
#define OPT3001_REGS_INT_TIME_LONG   800000
 Integration time of 800ms.
 
#define OPT3001_CONVERSION_TIME_OFFSET   4000
 Conversion time offset.
 
#define OPT3001_CONVERSION_TIME_COMBINED
 Combination of the conversion times.
 

Macro Definition Documentation

◆ OPT3001_CONFIG_M_CONTINUOUS

#define OPT3001_CONFIG_M_CONTINUOUS   (0x2)

Continuous mode (also 0x3)

Definition at line 49 of file opt3001_regs.h.

◆ OPT3001_CONFIG_M_SHUTDOWN

#define OPT3001_CONFIG_M_SHUTDOWN   (0x0)

Shutdown mode.

Definition at line 47 of file opt3001_regs.h.

◆ OPT3001_CONFIG_M_SINGLE

#define OPT3001_CONFIG_M_SINGLE   (0x1)

Single-shot mode.

Definition at line 48 of file opt3001_regs.h.

◆ OPT3001_CONFIG_MOC_MASK

#define OPT3001_CONFIG_MOC_MASK   (0x0600)

Mode of conversion mask.

Definition at line 51 of file opt3001_regs.h.

◆ OPT3001_CONFIG_MOC_SHIFT

#define OPT3001_CONFIG_MOC_SHIFT   (9U)

Mode of conversion shift.

Definition at line 50 of file opt3001_regs.h.

◆ OPT3001_CONFIG_RESET

#define OPT3001_CONFIG_RESET   (0xC810)

Reset value.

Definition at line 39 of file opt3001_regs.h.

◆ OPT3001_CONFIG_RN_FSR

#define OPT3001_CONFIG_RN_FSR   (0xC000)

Automatic full-scale setting mode.

Definition at line 41 of file opt3001_regs.h.

◆ OPT3001_CONVERSION_TIME_COMBINED

#define OPT3001_CONVERSION_TIME_COMBINED
Value:
#define OPT3001_REGS_INT_TIME_LONG
Integration time of 800ms.
#define OPT3001_CONVERSION_TIME_OFFSET
Conversion time offset.
#define OPT3001_REGS_INT_TIME_SHORT
Integration time of 100ms.

Combination of the conversion times.

Definition at line 81 of file opt3001_regs.h.

◆ OPT3001_CONVERSION_TIME_OFFSET

#define OPT3001_CONVERSION_TIME_OFFSET   4000

Conversion time offset.

Definition at line 79 of file opt3001_regs.h.

◆ OPT3001_DID_VALUE

#define OPT3001_DID_VALUE   (0x3001)

Device ID value.

Definition at line 37 of file opt3001_regs.h.

◆ OPT3001_REGS_CONFIG

#define OPT3001_REGS_CONFIG   0x01

Configuration register.

Definition at line 31 of file opt3001_regs.h.

◆ OPT3001_REGS_CONFIG_CRF

#define OPT3001_REGS_CONFIG_CRF   (1 << 7)

Conversion ready field.

Definition at line 57 of file opt3001_regs.h.

◆ OPT3001_REGS_CONFIG_CT

#define OPT3001_REGS_CONFIG_CT ( x)
Value:
(((uint16_t)(x)) \
#define OPT3001_REGS_CONFIG_CT_MASK
Conversion time mask.

Conversion time field.

Definition at line 44 of file opt3001_regs.h.

◆ OPT3001_REGS_CONFIG_CT_MASK

#define OPT3001_REGS_CONFIG_CT_MASK   (0x0800)

Conversion time mask.

Definition at line 43 of file opt3001_regs.h.

◆ OPT3001_REGS_CONFIG_FC_MASK

#define OPT3001_REGS_CONFIG_FC_MASK   (0x0003)

Fault count field mask.

Definition at line 64 of file opt3001_regs.h.

◆ OPT3001_REGS_CONFIG_FH

#define OPT3001_REGS_CONFIG_FH   (1 << 6)

Flag high field.

Definition at line 58 of file opt3001_regs.h.

◆ OPT3001_REGS_CONFIG_FL

#define OPT3001_REGS_CONFIG_FL   (1 << 5)

Flag low field.

Definition at line 59 of file opt3001_regs.h.

◆ OPT3001_REGS_CONFIG_L

#define OPT3001_REGS_CONFIG_L   (1 << 4)

Latch field.

Definition at line 60 of file opt3001_regs.h.

◆ OPT3001_REGS_CONFIG_ME

#define OPT3001_REGS_CONFIG_ME   (1 << 2)

Mask exponent field.

Definition at line 62 of file opt3001_regs.h.

◆ OPT3001_REGS_CONFIG_MOC

#define OPT3001_REGS_CONFIG_MOC ( x)
Value:
(((uint16_t)(((uint16_t)(x)) \
#define OPT3001_CONFIG_MOC_MASK
Mode of conversion mask.
#define OPT3001_CONFIG_MOC_SHIFT
Mode of conversion shift.

Mode of conversion field.

Definition at line 52 of file opt3001_regs.h.

◆ OPT3001_REGS_CONFIG_OVF

#define OPT3001_REGS_CONFIG_OVF   (1 << 8)

Overflow flag field.

Definition at line 56 of file opt3001_regs.h.

◆ OPT3001_REGS_CONFIG_POL

#define OPT3001_REGS_CONFIG_POL   (1 << 3)

Polarity field.

Definition at line 61 of file opt3001_regs.h.

◆ OPT3001_REGS_DEVICE_ID

#define OPT3001_REGS_DEVICE_ID   0x7F

Device ID register.

Definition at line 35 of file opt3001_regs.h.

◆ OPT3001_REGS_HIGH_LIMIT

#define OPT3001_REGS_HIGH_LIMIT   0x03

High Limit register.

Definition at line 33 of file opt3001_regs.h.

◆ OPT3001_REGS_INT_TIME_LONG

#define OPT3001_REGS_INT_TIME_LONG   800000

Integration time of 800ms.

Definition at line 77 of file opt3001_regs.h.

◆ OPT3001_REGS_INT_TIME_SHORT

#define OPT3001_REGS_INT_TIME_SHORT   100000

Integration time of 100ms.

Definition at line 76 of file opt3001_regs.h.

◆ OPT3001_REGS_LOW_LIMIT

#define OPT3001_REGS_LOW_LIMIT   0x02

Low Limit register.

Definition at line 32 of file opt3001_regs.h.

◆ OPT3001_REGS_LOW_LIMIT_EOC_ENABLE

#define OPT3001_REGS_LOW_LIMIT_EOC_ENABLE   (0xC000)

End-of-conversion enable.

Definition at line 66 of file opt3001_regs.h.

◆ OPT3001_REGS_MANUFACTURER_ID

#define OPT3001_REGS_MANUFACTURER_ID   0x7E

Manufacturer ID register.

Definition at line 34 of file opt3001_regs.h.

◆ OPT3001_REGS_REG_EXPONENT

#define OPT3001_REGS_REG_EXPONENT ( x)
Value:
((x) >> 12)

Exponent.

Definition at line 68 of file opt3001_regs.h.

◆ OPT3001_REGS_REG_MANTISSA

#define OPT3001_REGS_REG_MANTISSA ( x)
Value:
((x) & 0xFFF)

Mantissa.

Definition at line 69 of file opt3001_regs.h.

◆ OPT3001_REGS_RESULT

#define OPT3001_REGS_RESULT   0x00

Result register.

Definition at line 30 of file opt3001_regs.h.