Pyrrha-Platform / Pyrrha-Z

Next-generation firmware built on the Zephyr RTOS.
Apache License 2.0
2 stars 0 forks source link

drivers: cc2d23s temp/humidity sensor implementation #6

Closed bpbradley closed 2 years ago

bpbradley commented 2 years ago

Closes #2

Also adds a structure for implementing out of tree drivers and tests.

To do before merge:

bpbradley commented 2 years ago

Driver is implemented, I will need to order samples to properly test them and verify the data is correct though.

Edit: Just ordered a few of these for testing with. https://www.digikey.com/en/products/detail/CC2D23-SIP/235-1359-ND/4732675?itemSeq=377568404

Should be able to test early to mid next week.

bpbradley commented 2 years ago

Unit tests written and passing, but not targeting hardware yet until I get sensors in. Github actions are now running tests on every push.

All that's needed is to test on hardware and then it is ready to merge.

I think I have some formatting issues that need to be addressed as well.

bpbradley commented 2 years ago

Had to fix a few small things, but this appears to be functional and all tests are passing on my setup on hardware. Getting accurate temperature and humidity data as well. image

I believe we are good to merge.

bpbradley commented 2 years ago

Some considerations for future improvements:

  1. This isn't calculating fractional sensor data as it isn't necessary for our application. If we ever plan to upstream this sensor to zephyr, we should implement that.
  2. There are a number of functions on the sensor not currently implemented in this driver as they aren't necessary for us. Again, we should implement these if we plan to upstream. I did implement a couple of them at first, but decided to pull them out as they weren't used.
krook commented 2 years ago

Excellent, nice work @bpbradley