Driver for HM330X particle matter sensor.
More...
Driver for HM330X particle matter sensor.
About
This driver provides an interface for the HM-330/3600 laser dust sensor. The datasheet can be found here
The device also support an UART mode, but the currently available breakout from seedstudio only supports I2C.
◆ CONFIG_HM330X_INDOOR_ENVIRONMENT
#define CONFIG_HM330X_INDOOR_ENVIRONMENT 1 |
HM330X deployment setting.
The HM330X sensor outputs two set of PM* values, one calibrated for indoor environment and another one for atmospheric environment, set this value according to your deployment.
Definition at line 52 of file hm330x.h.
◆ hm330x_init()
Initialize the given device.
- Parameters
-
[in,out] | dev | Device descriptor of the driver |
[in] | params | Initialization parameters |
- Return values
-
0 | Success |
-EIO | Failed to initialize GPIO pins |
-EPROTO | Sensor did not acknowledge command |
◆ hm330x_read()
Read particle matter measurements.
- Parameters
-
[in] | dev | Device descriptor of the driver |
[out] | data | Pre-allocated particle matter data |
- Return values
-
0 | Success |
-EBADMSG | CRC checksum didn't match |
-EPROTO | Sensor did not acknowledge command |
◆ hm330x_reset()
Reset the sensor.
- Parameters
-
[in] | dev | Device descriptor of the driver |
◆ hm330x_sleep()
Set Device to Sleep.
- Parameters
-
[in] | dev | Device descriptor of the driver |
◆ hm330x_wakeup()
Wakeup Device.
- Parameters
-
[in] | dev | Device descriptor of the driver |