Arduino TKJHAT
Arduino library for Pico HAT extension board
Loading...
Searching...
No Matches
Macros including addresses and registers of peripherals

Register addresses and constants for the different sensors and actuators of the HAT. More...

VEML6030

Light sensor address, and registers

#define VEML6030_I2C_ADDR   0x10
#define VEML6030_CONFIG_REG   0x00
#define VEML6030_ALS_REG   0x04

HDC2021

Humidity sensor address, registers and interruptions thresholds

#define HDC2021_I2C_ADDRESS   0x40
#define HDC2021_TEMP_LOW   0x00
#define HDC2021_TEMP_HIGH   0x01
#define HDC2021_HUMIDITY_LOW   0x02
#define HDC2021_HUMIDITY_HIGH   0x03
#define HDC2021_CONFIG   0x0E
#define HDC2021_MEASUREMENT_CONFIG   0x0F
#define HDC2021_TEMP_THR_L   0x13
#define HDC2021_TEMP_THR_H   0x14
#define HDC2021_HUMID_THR_L   0x15
#define HDC2021_HUMID_THR_H   0x16

Display

SSD1306 display address

#define SSD1306_I2C_ADDRESS   0x3C

Microphone

Microphone's sampling rate and buffer size.

#define MEMS_SAMPLING_FREQUENCY   8000
#define MEMS_BUFFER_SIZE   256

I2C addressing

I2C address and identity registers.

#define ICM42670_I2C_ADDRESS   0x69
#define ICM42670_I2C_ADDRESS_ALT   0x69
#define ICM42670_REG_WHO_AM_I   0x75
#define ICM42670_WHO_AM_I_RESPONSE   0x67

Interrupts

Interrupt configuration registers and defaults.

#define ICM42670_INT_CONFIG   0x06
#define ICM42670_INT1_CONFIG_VALUE   0x02

Transfer limits

Helper limits for SDK buffer handling.

#define ICM42670_MAX_READ_LENGTH   256
#define ICM42670_MAX_WRITE_LENGTH   256

Configuration registers

Top-level configuration register addresses.

#define ICM42670_ACCEL_CONFIG0_REG   0x21
#define ICM42670_GYRO_CONFIG0_REG   0x20
#define ICM42670_PWR_MGMT0_REG   0x1F
#define ICM42670_REG_SIGNAL_PATH_RESET   0x02
#define ICM42670_RESET_CONFIG_BITS   0x10

Accelerometer FSR encodings

ACCEL_CONFIG0[7:5]. Full-scale range selection.

#define ICM42670_ACCEL_FSR_2G   0x03
#define ICM42670_ACCEL_FSR_4G   0x02
#define ICM42670_ACCEL_FSR_8G   0x01
#define ICM42670_ACCEL_FSR_16G   0x00
#define ICM42670_ACCEL_FSR_DEFAULT   4

Gyroscope FSR encodings

GYRO_CONFIG0[7:5]. Full-scale range selection.

#define ICM42670_GYRO_FSR_250DPS   0x03
#define ICM42670_GYRO_FSR_500DPS   0x02
#define ICM42670_GYRO_FSR_1000DPS   0x01
#define ICM42670_GYRO_FSR_2000DPS   0x00
#define ICM42670_GYRO_FSR_DEFAULT   250

Accelerometer ODR encodings (LN mode)

ACCEL_CONFIG0[3:0]. Output Data Rate selection in Low-Noise mode.

#define ICM42670_ACCEL_ODR_25HZ   0x0B
#define ICM42670_ACCEL_ODR_50HZ   0x0A
#define ICM42670_ACCEL_ODR_100HZ   0x09
#define ICM42670_ACCEL_ODR_200HZ   0x08
#define ICM42670_ACCEL_ODR_400HZ   0x07
#define ICM42670_ACCEL_ODR_800HZ   0x06
#define ICM42670_ACCEL_ODR_1600HZ   0x05
#define ICM42670_ACCEL_ODR_DEFAULT   100

Gyroscope ODR encodings

GYRO_CONFIG0[3:0]. Output Data Rate selection.

#define ICM42670_GYRO_ODR_25HZ   0x0B
#define ICM42670_GYRO_ODR_50HZ   0x0A
#define ICM42670_GYRO_ODR_100HZ   0x09
#define ICM42670_GYRO_ODR_200HZ   0x08
#define ICM42670_GYRO_ODR_400HZ   0x07
#define ICM42670_GYRO_ODR_800HZ   0x06
#define ICM42670_GYRO_ODR_1600HZ   0x05
#define ICM42670_GYRO_ODR_DEFAULT   100

Power / mode bits

Encodings for PWR_MGMT0 sensor-mode fields.

#define ICM42670_ACCEL_MODE_LN   0x03
#define ICM42670_GYRO_MODE_LN   0x0C

Sensor data window

Starting register for burst reads of temp/accel/gyro data.

#define ICM42670_SENSOR_DATA_START_REG   0x09

Detailed Description

Register addresses and constants for the different sensors and actuators of the HAT.

Macro Definition Documentation

◆ HDC2021_CONFIG

#define HDC2021_CONFIG   0x0E

Configuration register.

◆ HDC2021_HUMID_THR_H

#define HDC2021_HUMID_THR_H   0x16

High humidity threshold.

◆ HDC2021_HUMID_THR_L

#define HDC2021_HUMID_THR_L   0x15

Low humidity threshold.

◆ HDC2021_HUMIDITY_HIGH

#define HDC2021_HUMIDITY_HIGH   0x03

Humidity high byte register.

◆ HDC2021_HUMIDITY_LOW

#define HDC2021_HUMIDITY_LOW   0x02

Humidity low byte register.

◆ HDC2021_I2C_ADDRESS

#define HDC2021_I2C_ADDRESS   0x40

I2C address of the HDC2021 sensor.

◆ HDC2021_MEASUREMENT_CONFIG

#define HDC2021_MEASUREMENT_CONFIG   0x0F

Measurement configuration register.

◆ HDC2021_TEMP_HIGH

#define HDC2021_TEMP_HIGH   0x01

Temperature high byte register.

◆ HDC2021_TEMP_LOW

#define HDC2021_TEMP_LOW   0x00

Temperature low byte register.

◆ HDC2021_TEMP_THR_H

#define HDC2021_TEMP_THR_H   0x14

High temperature threshold.

◆ HDC2021_TEMP_THR_L

#define HDC2021_TEMP_THR_L   0x13

Low temperature threshold.

◆ ICM42670_ACCEL_CONFIG0_REG

#define ICM42670_ACCEL_CONFIG0_REG   0x21

Accelerometer ODR/FSR (see bit fields below).

◆ ICM42670_ACCEL_FSR_16G

#define ICM42670_ACCEL_FSR_16G   0x00

±16 g.

◆ ICM42670_ACCEL_FSR_2G

#define ICM42670_ACCEL_FSR_2G   0x03

±2 g.

◆ ICM42670_ACCEL_FSR_4G

#define ICM42670_ACCEL_FSR_4G   0x02

±4 g.

◆ ICM42670_ACCEL_FSR_8G

#define ICM42670_ACCEL_FSR_8G   0x01

±8 g.

◆ ICM42670_ACCEL_FSR_DEFAULT

#define ICM42670_ACCEL_FSR_DEFAULT   4

SDK default FSR in g (±4 g).

◆ ICM42670_ACCEL_MODE_LN

#define ICM42670_ACCEL_MODE_LN   0x03

Accel Low-Noise mode code for PWR_MGMT0 accel field.

◆ ICM42670_ACCEL_ODR_100HZ

#define ICM42670_ACCEL_ODR_100HZ   0x09

100 Hz.

◆ ICM42670_ACCEL_ODR_1600HZ

#define ICM42670_ACCEL_ODR_1600HZ   0x05

1600 Hz.

◆ ICM42670_ACCEL_ODR_200HZ

#define ICM42670_ACCEL_ODR_200HZ   0x08

200 Hz.

◆ ICM42670_ACCEL_ODR_25HZ

#define ICM42670_ACCEL_ODR_25HZ   0x0B

25 Hz.

◆ ICM42670_ACCEL_ODR_400HZ

#define ICM42670_ACCEL_ODR_400HZ   0x07

400 Hz.

◆ ICM42670_ACCEL_ODR_50HZ

#define ICM42670_ACCEL_ODR_50HZ   0x0A

50 Hz.

◆ ICM42670_ACCEL_ODR_800HZ

#define ICM42670_ACCEL_ODR_800HZ   0x06

800 Hz.

◆ ICM42670_ACCEL_ODR_DEFAULT

#define ICM42670_ACCEL_ODR_DEFAULT   100

SDK default ODR in Hz (100 Hz).

◆ ICM42670_GYRO_CONFIG0_REG

#define ICM42670_GYRO_CONFIG0_REG   0x20

Gyroscope ODR/FSR (see bit fields below).

◆ ICM42670_GYRO_FSR_1000DPS

#define ICM42670_GYRO_FSR_1000DPS   0x01

±1000 dps.

◆ ICM42670_GYRO_FSR_2000DPS

#define ICM42670_GYRO_FSR_2000DPS   0x00

±2000 dps.

◆ ICM42670_GYRO_FSR_250DPS

#define ICM42670_GYRO_FSR_250DPS   0x03

±250 dps.

◆ ICM42670_GYRO_FSR_500DPS

#define ICM42670_GYRO_FSR_500DPS   0x02

±500 dps.

◆ ICM42670_GYRO_FSR_DEFAULT

#define ICM42670_GYRO_FSR_DEFAULT   250

SDK default FSR in dps (±250 dps).

◆ ICM42670_GYRO_MODE_LN

#define ICM42670_GYRO_MODE_LN   0x0C

Gyro Low-Noise mode code for PWR_MGMT0 gyro field.

◆ ICM42670_GYRO_ODR_100HZ

#define ICM42670_GYRO_ODR_100HZ   0x09

100 Hz.

◆ ICM42670_GYRO_ODR_1600HZ

#define ICM42670_GYRO_ODR_1600HZ   0x05

1600 Hz.

◆ ICM42670_GYRO_ODR_200HZ

#define ICM42670_GYRO_ODR_200HZ   0x08

200 Hz.

◆ ICM42670_GYRO_ODR_25HZ

#define ICM42670_GYRO_ODR_25HZ   0x0B

25 Hz.

◆ ICM42670_GYRO_ODR_400HZ

#define ICM42670_GYRO_ODR_400HZ   0x07

400 Hz.

◆ ICM42670_GYRO_ODR_50HZ

#define ICM42670_GYRO_ODR_50HZ   0x0A

50 Hz.

◆ ICM42670_GYRO_ODR_800HZ

#define ICM42670_GYRO_ODR_800HZ   0x06

800 Hz.

◆ ICM42670_GYRO_ODR_DEFAULT

#define ICM42670_GYRO_ODR_DEFAULT   100

SDK default ODR in Hz (100 Hz).

◆ ICM42670_I2C_ADDRESS

#define ICM42670_I2C_ADDRESS   0x69

Default I2C address (AD0 pulled).

◆ ICM42670_I2C_ADDRESS_ALT

#define ICM42670_I2C_ADDRESS_ALT   0x69

Alternate I2C address (autodetect helper uses both).

◆ ICM42670_INT1_CONFIG_VALUE

#define ICM42670_INT1_CONFIG_VALUE   0x02

Default INT1 config: active-low, pulsed (course default).

◆ ICM42670_INT_CONFIG

#define ICM42670_INT_CONFIG   0x06

INT1/INT2 routing/config register.

◆ ICM42670_MAX_READ_LENGTH

#define ICM42670_MAX_READ_LENGTH   256

Max contiguous read length used by the SDK.

◆ ICM42670_MAX_WRITE_LENGTH

#define ICM42670_MAX_WRITE_LENGTH   256

Max contiguous write length used by the SDK.

◆ ICM42670_PWR_MGMT0_REG

#define ICM42670_PWR_MGMT0_REG   0x1F

Power state / sensor mode control.

◆ ICM42670_REG_SIGNAL_PATH_RESET

#define ICM42670_REG_SIGNAL_PATH_RESET   0x02

Signal path reset register.

◆ ICM42670_REG_WHO_AM_I

#define ICM42670_REG_WHO_AM_I   0x75

WHO_AM_I register address.

◆ ICM42670_RESET_CONFIG_BITS

#define ICM42670_RESET_CONFIG_BITS   0x10

Value used for soft reset sequence.

◆ ICM42670_SENSOR_DATA_START_REG

#define ICM42670_SENSOR_DATA_START_REG   0x09

First data register for TEMP/ACCEL/GYRO burst read.

◆ ICM42670_WHO_AM_I_RESPONSE

#define ICM42670_WHO_AM_I_RESPONSE   0x67

Expected WHO_AM_I value.

◆ MEMS_BUFFER_SIZE

#define MEMS_BUFFER_SIZE   256

Number of samples in each microphone buffer.

◆ MEMS_SAMPLING_FREQUENCY

#define MEMS_SAMPLING_FREQUENCY   8000

Sampling frequency in Hz for PDM microphone.

◆ SSD1306_I2C_ADDRESS

#define SSD1306_I2C_ADDRESS   0x3C

I2C address of the SSD1306 OLED display.

◆ VEML6030_ALS_REG

#define VEML6030_ALS_REG   0x04

Ambient Light Sensing (ALS) data register.

◆ VEML6030_CONFIG_REG

#define VEML6030_CONFIG_REG   0x00

Configuration register.

◆ VEML6030_I2C_ADDR

#define VEML6030_I2C_ADDR   0x10

I2C address of the VEML6030 sensor.