[riot-notifications] [RIOT-OS/RIOT] drivers/hm3301: initial commit (#16333)

Francisco notifications at github.com
Thu Apr 15 09:17:13 CEST 2021


### Contribution description

This PR adds an initial commit for the [HM3301 laser PM2.5 sesor](https://wiki.seeedstudio.com/Grove-Laser_PM2.5_Sensor-HM3301/). The device supports UART and I2C, but the breakout (the only commercially available one I've found) only supports I2C.

The UART functions very similarly to the PM5003 #16209, so some code could be eventually be put in common there, but the I2C and UART operation has very little in common so it only seems worth it if UART want to be added to this driver. 

### Testing procedure

Run test:

- `make -C tests/driver_hm3301 flash cleanterm`

```
main(): This is RIOT! (Version: 2021.04-devel-1342-g93325-pr_driver_hm3301)
HM3301 test application
+------------Initializing------------+
+------------------------+------------------------+----------------------------------------------+
| Standard concentration | Atmospheric Environment|   # Particles in 0.1l air of diameter >=     |
| PM1.0 | PM2.5 | PM10.0 | PM1.0 | PM2.5 | PM10.0 | 0.3µm | 0.5µm | 1.0µm | 2.5µm | 5.0µm | 10µm |
+-------+-------+--------+-------+-------+--------+-------+-------+-------+-------+-------+------+
|      5|      7|       7|      5|      7|       7|      0|      0|      0|      0|      0|     0|
|      5|      7|       7|      5|      7|       7|      0|      0|      0|      0|      0|     0|
|      5|      7|       7|      5|      7|       7|      0|      0|      0|      0|      0|     0|
|      5|      7|       7|      5|      7|       7|      0|      0|      0|      0|      0|     0|
|      5|      7|       7|      5|      7|       7|      0|      0|      0|      0|      0|     0|
|      5|      7|       7|      5|      7|       7|      0|      0|      0|      0|      0|     0|
|      5|      7|       7|      5|      7|       7|      0|      0|      0|      0|      0|     0|
|      5|      7|       7|      5|      7|       7|      0|      0|      0|      0|      0|     0|
|      5|      7|       7|      5|      7|       7|      0|      0|      0|      0|      0|     0|
|      5|      7|       7|      5|      7|       7|      0|      0|      0|      0|      0|     0|
```

- `USEMODULE=hm3301 make -C tests/saul/ flash cleanterm -j3`

```
##########################

Dev: Led Red	Type: ACT_SWITCH
Data:	              0 

Dev: Led Green	Type: ACT_SWITCH
Data:	              0 

Dev: Led Blue	Type: ACT_SWITCH
Data:	              0 

Dev: Button 1	Type: SENSE_BTN
Data:	              0 

Dev: NRF_TEMP	Type: SENSE_TEMP
Data:	             26 °C

Dev: hm3301	Type: SENSE_PM
Data:	              4 ug/m^3

Dev: hm3301	Type: SENSE_PM
Data:	              6 ug/m^3

Dev: hm3301	Type: SENSE_PM
Data:	              6 ug/m^3

Dev: hm3301	Type: SENSE_PULSE_COUNT
Data:	            0e4 #/m^3

Dev: hm3301	Type: SENSE_PULSE_COUNT
Data:	            0e4 #/m^3

Dev: hm3301	Type: SENSE_PULSE_COUNT
Data:	            0e4 #/m^3

##########################
```

You can view, comment on, or merge this pull request online at:

  https://github.com/RIOT-OS/RIOT/pull/16333

-- Commit Summary --

  * drivers/hm3301: initial commit
  * tests/driver_hm3301: initial import

-- File Changes --

    M drivers/Kconfig (1)
    A drivers/hm3301/Kconfig (31)
    A drivers/hm3301/Makefile (7)
    A drivers/hm3301/Makefile.dep (2)
    A drivers/hm3301/Makefile.include (2)
    A drivers/hm3301/hm3301.c (145)
    A drivers/hm3301/hm3301_saul.c (162)
    A drivers/hm3301/include/hm3301_constants.h (46)
    A drivers/hm3301/include/hm3301_params.h (87)
    A drivers/include/hm3301.h (139)
    A drivers/saul/init_devs/auto_init_hm3301.c (88)
    M drivers/saul/init_devs/init.c (4)
    A tests/driver_hm3301/Makefile (10)
    A tests/driver_hm3301/README.md (40)
    A tests/driver_hm3301/app.config.test (7)
    A tests/driver_hm3301/main.c (109)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/16333.patch
https://github.com/RIOT-OS/RIOT/pull/16333.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/16333
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210415/5d2dabe2/attachment.htm>


More information about the notifications mailing list