Loading...
Searching...
No Matches

Register definitions for the TCS37727 driver. More...

Detailed Description

Register definitions for the TCS37727 driver.

Author
Johann Fischer j.fis.nosp@m.cher.nosp@m.@phyt.nosp@m.ec.d.nosp@m.e

Definition in file tcs37727-internal.h.

Go to the source code of this file.

#define TCS37727_AG_THRESHOLD_LOW   200
 
#define TCS37727_AG_THRESHOLD_HIGH   (65535 - TCS37727_AG_THRESHOLD_LOW)
 

Register Map

Note
All setting register are defined for repeated byte protocol transaction.
#define TCS37727_ENABLE   0x80
 Enables states and interrupts.
 
#define TCS37727_ATIME   0x81
 RGBC time.
 
#define TCS37727_PTIME   0x82
 Proximity time.
 
#define TCS37727_WTIME   0x83
 Wait time.
 
#define TCS37727_AILTL   0x04
 Clear interrupt low threshold low byte.
 
#define TCS37727_AILTH   0x05
 Clear interrupt low threshold high byte.
 
#define TCS37727_AIHTL   0x06
 Clear interrupt high threshold low byte.
 
#define TCS37727_AIHTH   0x07
 Clear interrupt high threshold high byte.
 
#define TCS37727_PILTL   0x08
 Proximity interrupt low threshold low byte.
 
#define TCS37727_PILTH   0x09
 Proximity interrupt low threshold high byte.
 
#define TCS37727_PIHTL   0x0A
 Proximity interrupt high threshold low byte.
 
#define TCS37727_PIHTH   0x0B
 Proximity interrupt high threshold high byte.
 
#define TCS37727_PERS   0x8C
 Interrupt persistence filters.
 
#define TCS37727_CONFIG   0x8D
 Configuration.
 
#define TCS37727_PPULSE   0x8E
 Proximity pulse count.
 
#define TCS37727_CONTROL   0x8F
 Gain control register.
 
#define TCS37727_ID   0x92
 Device IDID.
 
#define TCS37727_STATUS   0x93
 Device status.
 
#define TCS37727_CDATA   0x14
 Clear ADC data low byte.
 
#define TCS37727_CDATAH   0x15
 Clear ADC data high byte.
 
#define TCS37727_RDATA   0x16
 Red ADC data low byte.
 
#define TCS37727_RDATAH   0x17
 Red ADC data high byte.
 
#define TCS37727_GDATA   0x18
 Green ADC data low byte.
 
#define TCS37727_GDATAH   0x19
 Green ADC data high byte.
 
#define TCS37727_BDATA   0x1A
 Blue ADC data low byte.
 
#define TCS37727_BDATAH   0x1B
 Blue ADC data high byte.
 
#define TCS37727_PDATA   0x1C
 Proximity ADC data low byte.
 
#define TCS37727_PDATAH   0x1D
 Proximity ADC data high byte.
 

Command Register

#define TCS37727_BYTE_TRANS   0x80
 Repeated byte protocol transaction.
 
#define TCS37727_INC_TRANS   0xA0
 Auto-increment protocol transaction.
 
#define TCS37727_SF_PICLR   0xE5
 Proximity interrupt clear.
 
#define TCS37727_SF_CICLR   0xE6
 Clear channel interrupt clear.
 
#define TCS37727_SF_PCICLR   0xE7
 Proximity and Clear channel interrupt clear.
 

Enable Register

#define TCS37727_ENABLE_PIEN   (1 << 5)
 Proximity interrupt enable.
 
#define TCS37727_ENABLE_AIEN   (1 << 4)
 Clear channel interrupt enable.
 
#define TCS37727_ENABLE_WEN   (1 << 3)
 Wait enable, activates the wait feature.
 
#define TCS37727_ENABLE_PEN   (1 << 2)
 Proximity enable, activates the proximity function.
 
#define TCS37727_ENABLE_AEN   (1 << 1)
 RGBC enable, actives the two-channel ADC.
 
#define TCS37727_ENABLE_PON   (1 << 0)
 Power ON.
 

Control Register

#define TCS37727_CONTROL_PDRIVE_100   0x00
 100 mA LED Drive Strength
 
#define TCS37727_CONTROL_PDRIVE_50   0x04
 50 mA LED Drive Strength
 
#define TCS37727_CONTROL_PDRIVE_25   0x08
 25 mA LED Drive Strength
 
#define TCS37727_CONTROL_PDRIVE_12   0x0C
 12.5 mA LED Drive Strength
 
#define TCS37727_CONTROL_PDRIVE_MASK   0x0C
 PDRIVE Mask.
 
#define TCS37727_CONTROL_AGAIN_1   0x00
 1x gain RGBC Gain Value
 
#define TCS37727_CONTROL_AGAIN_4   0x01
 4x gain RGBC Gain Value
 
#define TCS37727_CONTROL_AGAIN_16   0x02
 16x gain RGBC Gain Value
 
#define TCS37727_CONTROL_AGAIN_60   0x03
 60x gain RGBC Gain Value
 
#define TCS37727_CONTROL_AGAIN_MASK   0x03
 AGAIN Mask.
 

Device ID

#define TCS37727_ID_VALUE   0x49
 

Predefined ATIME register values.

#define TCS37727_ATIME_MIN   2400 /* 2.4ms integration time, max count 1024 */
 
#define TCS37727_ATIME_MAX   614000 /* 614ms integration time, max count 0xffff */
 
#define TCS37727_ATIME_TO_REG(val)   (256 - (uint8_t)((val) / 2400))
 
#define TCS37727_ATIME_TO_US(reg)   ((256 - (uint8_t)(reg)) * 2400)
 

Coefficients for Lux and CT Equations (DN40)

Note
Coefficients in integer format, multiplied by 1000.
#define DGF_IF   310
 
#define R_COEF_IF   136
 
#define G_COEF_IF   1000
 
#define B_COEF_IF   -444
 
#define CT_COEF_IF   3810
 
#define CT_OFFSET_IF   1391
 

Macro Definition Documentation

◆ B_COEF_IF

#define B_COEF_IF   -444

Definition at line 139 of file tcs37727-internal.h.

◆ CT_COEF_IF

#define CT_COEF_IF   3810

Definition at line 140 of file tcs37727-internal.h.

◆ CT_OFFSET_IF

#define CT_OFFSET_IF   1391

Definition at line 141 of file tcs37727-internal.h.

◆ DGF_IF

#define DGF_IF   310

Definition at line 136 of file tcs37727-internal.h.

◆ G_COEF_IF

#define G_COEF_IF   1000

Definition at line 138 of file tcs37727-internal.h.

◆ R_COEF_IF

#define R_COEF_IF   136

Definition at line 137 of file tcs37727-internal.h.

◆ TCS37727_AG_THRESHOLD_HIGH

#define TCS37727_AG_THRESHOLD_HIGH   (65535 - TCS37727_AG_THRESHOLD_LOW)

Definition at line 34 of file tcs37727-internal.h.

◆ TCS37727_AG_THRESHOLD_LOW

#define TCS37727_AG_THRESHOLD_LOW   200

Definition at line 30 of file tcs37727-internal.h.

◆ TCS37727_AIHTH

#define TCS37727_AIHTH   0x07

Clear interrupt high threshold high byte.

Definition at line 50 of file tcs37727-internal.h.

◆ TCS37727_AIHTL

#define TCS37727_AIHTL   0x06

Clear interrupt high threshold low byte.

Definition at line 49 of file tcs37727-internal.h.

◆ TCS37727_AILTH

#define TCS37727_AILTH   0x05

Clear interrupt low threshold high byte.

Definition at line 48 of file tcs37727-internal.h.

◆ TCS37727_AILTL

#define TCS37727_AILTL   0x04

Clear interrupt low threshold low byte.

Definition at line 47 of file tcs37727-internal.h.

◆ TCS37727_ATIME

#define TCS37727_ATIME   0x81

RGBC time.

Definition at line 44 of file tcs37727-internal.h.

◆ TCS37727_ATIME_MAX

#define TCS37727_ATIME_MAX   614000 /* 614ms integration time, max count 0xffff */

Definition at line 124 of file tcs37727-internal.h.

◆ TCS37727_ATIME_MIN

#define TCS37727_ATIME_MIN   2400 /* 2.4ms integration time, max count 1024 */

Definition at line 123 of file tcs37727-internal.h.

◆ TCS37727_ATIME_TO_REG

#define TCS37727_ATIME_TO_REG (   val)    (256 - (uint8_t)((val) / 2400))

Definition at line 126 of file tcs37727-internal.h.

◆ TCS37727_ATIME_TO_US

#define TCS37727_ATIME_TO_US (   reg)    ((256 - (uint8_t)(reg)) * 2400)

Definition at line 127 of file tcs37727-internal.h.

◆ TCS37727_BDATA

#define TCS37727_BDATA   0x1A

Blue ADC data low byte.

Definition at line 67 of file tcs37727-internal.h.

◆ TCS37727_BDATAH

#define TCS37727_BDATAH   0x1B

Blue ADC data high byte.

Definition at line 68 of file tcs37727-internal.h.

◆ TCS37727_BYTE_TRANS

#define TCS37727_BYTE_TRANS   0x80

Repeated byte protocol transaction.

Definition at line 77 of file tcs37727-internal.h.

◆ TCS37727_CDATA

#define TCS37727_CDATA   0x14

Clear ADC data low byte.

Definition at line 61 of file tcs37727-internal.h.

◆ TCS37727_CDATAH

#define TCS37727_CDATAH   0x15

Clear ADC data high byte.

Definition at line 62 of file tcs37727-internal.h.

◆ TCS37727_CONFIG

#define TCS37727_CONFIG   0x8D

Configuration.

Definition at line 56 of file tcs37727-internal.h.

◆ TCS37727_CONTROL

#define TCS37727_CONTROL   0x8F

Gain control register.

Definition at line 58 of file tcs37727-internal.h.

◆ TCS37727_CONTROL_AGAIN_1

#define TCS37727_CONTROL_AGAIN_1   0x00

1x gain RGBC Gain Value

Definition at line 105 of file tcs37727-internal.h.

◆ TCS37727_CONTROL_AGAIN_16

#define TCS37727_CONTROL_AGAIN_16   0x02

16x gain RGBC Gain Value

Definition at line 107 of file tcs37727-internal.h.

◆ TCS37727_CONTROL_AGAIN_4

#define TCS37727_CONTROL_AGAIN_4   0x01

4x gain RGBC Gain Value

Definition at line 106 of file tcs37727-internal.h.

◆ TCS37727_CONTROL_AGAIN_60

#define TCS37727_CONTROL_AGAIN_60   0x03

60x gain RGBC Gain Value

Definition at line 108 of file tcs37727-internal.h.

◆ TCS37727_CONTROL_AGAIN_MASK

#define TCS37727_CONTROL_AGAIN_MASK   0x03

AGAIN Mask.

Definition at line 109 of file tcs37727-internal.h.

◆ TCS37727_CONTROL_PDRIVE_100

#define TCS37727_CONTROL_PDRIVE_100   0x00

100 mA LED Drive Strength

Definition at line 100 of file tcs37727-internal.h.

◆ TCS37727_CONTROL_PDRIVE_12

#define TCS37727_CONTROL_PDRIVE_12   0x0C

12.5 mA LED Drive Strength

Definition at line 103 of file tcs37727-internal.h.

◆ TCS37727_CONTROL_PDRIVE_25

#define TCS37727_CONTROL_PDRIVE_25   0x08

25 mA LED Drive Strength

Definition at line 102 of file tcs37727-internal.h.

◆ TCS37727_CONTROL_PDRIVE_50

#define TCS37727_CONTROL_PDRIVE_50   0x04

50 mA LED Drive Strength

Definition at line 101 of file tcs37727-internal.h.

◆ TCS37727_CONTROL_PDRIVE_MASK

#define TCS37727_CONTROL_PDRIVE_MASK   0x0C

PDRIVE Mask.

Definition at line 104 of file tcs37727-internal.h.

◆ TCS37727_ENABLE

#define TCS37727_ENABLE   0x80

Enables states and interrupts.

Definition at line 43 of file tcs37727-internal.h.

◆ TCS37727_ENABLE_AEN

#define TCS37727_ENABLE_AEN   (1 << 1)

RGBC enable, actives the two-channel ADC.

Definition at line 92 of file tcs37727-internal.h.

◆ TCS37727_ENABLE_AIEN

#define TCS37727_ENABLE_AIEN   (1 << 4)

Clear channel interrupt enable.

Definition at line 89 of file tcs37727-internal.h.

◆ TCS37727_ENABLE_PEN

#define TCS37727_ENABLE_PEN   (1 << 2)

Proximity enable, activates the proximity function.

Definition at line 91 of file tcs37727-internal.h.

◆ TCS37727_ENABLE_PIEN

#define TCS37727_ENABLE_PIEN   (1 << 5)

Proximity interrupt enable.

Definition at line 88 of file tcs37727-internal.h.

◆ TCS37727_ENABLE_PON

#define TCS37727_ENABLE_PON   (1 << 0)

Power ON.

Definition at line 93 of file tcs37727-internal.h.

◆ TCS37727_ENABLE_WEN

#define TCS37727_ENABLE_WEN   (1 << 3)

Wait enable, activates the wait feature.

Definition at line 90 of file tcs37727-internal.h.

◆ TCS37727_GDATA

#define TCS37727_GDATA   0x18

Green ADC data low byte.

Definition at line 65 of file tcs37727-internal.h.

◆ TCS37727_GDATAH

#define TCS37727_GDATAH   0x19

Green ADC data high byte.

Definition at line 66 of file tcs37727-internal.h.

◆ TCS37727_ID

#define TCS37727_ID   0x92

Device IDID.

Definition at line 59 of file tcs37727-internal.h.

◆ TCS37727_ID_VALUE

#define TCS37727_ID_VALUE   0x49

Definition at line 116 of file tcs37727-internal.h.

◆ TCS37727_INC_TRANS

#define TCS37727_INC_TRANS   0xA0

Auto-increment protocol transaction.

Definition at line 78 of file tcs37727-internal.h.

◆ TCS37727_PDATA

#define TCS37727_PDATA   0x1C

Proximity ADC data low byte.

Definition at line 69 of file tcs37727-internal.h.

◆ TCS37727_PDATAH

#define TCS37727_PDATAH   0x1D

Proximity ADC data high byte.

Definition at line 70 of file tcs37727-internal.h.

◆ TCS37727_PERS

#define TCS37727_PERS   0x8C

Interrupt persistence filters.

Definition at line 55 of file tcs37727-internal.h.

◆ TCS37727_PIHTH

#define TCS37727_PIHTH   0x0B

Proximity interrupt high threshold high byte.

Definition at line 54 of file tcs37727-internal.h.

◆ TCS37727_PIHTL

#define TCS37727_PIHTL   0x0A

Proximity interrupt high threshold low byte.

Definition at line 53 of file tcs37727-internal.h.

◆ TCS37727_PILTH

#define TCS37727_PILTH   0x09

Proximity interrupt low threshold high byte.

Definition at line 52 of file tcs37727-internal.h.

◆ TCS37727_PILTL

#define TCS37727_PILTL   0x08

Proximity interrupt low threshold low byte.

Definition at line 51 of file tcs37727-internal.h.

◆ TCS37727_PPULSE

#define TCS37727_PPULSE   0x8E

Proximity pulse count.

Definition at line 57 of file tcs37727-internal.h.

◆ TCS37727_PTIME

#define TCS37727_PTIME   0x82

Proximity time.

Definition at line 45 of file tcs37727-internal.h.

◆ TCS37727_RDATA

#define TCS37727_RDATA   0x16

Red ADC data low byte.

Definition at line 63 of file tcs37727-internal.h.

◆ TCS37727_RDATAH

#define TCS37727_RDATAH   0x17

Red ADC data high byte.

Definition at line 64 of file tcs37727-internal.h.

◆ TCS37727_SF_CICLR

#define TCS37727_SF_CICLR   0xE6

Clear channel interrupt clear.

Definition at line 80 of file tcs37727-internal.h.

◆ TCS37727_SF_PCICLR

#define TCS37727_SF_PCICLR   0xE7

Proximity and Clear channel interrupt clear.

Definition at line 81 of file tcs37727-internal.h.

◆ TCS37727_SF_PICLR

#define TCS37727_SF_PICLR   0xE5

Proximity interrupt clear.

Definition at line 79 of file tcs37727-internal.h.

◆ TCS37727_STATUS

#define TCS37727_STATUS   0x93

Device status.

Definition at line 60 of file tcs37727-internal.h.

◆ TCS37727_WTIME

#define TCS37727_WTIME   0x83

Wait time.

Definition at line 46 of file tcs37727-internal.h.