Adding support for Nordic PDM Driver in Devicetree #nrf52832 #pdm #driver


Frederik David Damsgaard Popp
 

Hello Zephyr development community.

I'm not quite sure where to post this, but I'll start here.
I am currently preparing for my bachelor thesis project, where I will attempt to perform some sort of Audio processing with Zephyr on a Nordic Board with an ARM Cortex M chipset.

For this, I will need to sample audio from a MEMS PDM microphone, on the same board.
In order to set this up, I would like to implement the existing PDM driver present in the FW of the Nordic Thingy 52 into Zephyr.
The source code is available on Github.

I have read the Device Tree guide on the official documentation, and I think I have a basic understanding for how this needs to be done.

As I understand it, I need to do at least the following things:

  • Create the generic api as well as the api struct, located in zephyr/include/drivers.
  • Place the actual implementation in zephyr/drivers where the api struct is then connected to this implementation
    Additionally, setup the config variables in the Kconfig file in the same directory, as well as connecting the source code using CMakeLists.txt
  • Create a YAML driver binding in zephyr/dts/bindings.
  • Bind the driver in the nrf52832.dtsi file, in order to make the SoC compatible with this driver.
  • Enable the driver in the nrf52_pca20020.dts file, in order to make the board able to use the driver.

This is how far I have gotten yet, and was wondering if I have missed anything?

Additionally I would like to ask (and I don't know whether this is the right forum), if there is any possibility that this is pushed to the official upstream, if I succeed?
I would then make a small sample, and document in accordance with the guidelines, so that others may also use it.

Thanks in advance!


Best regards,
Frederik David Damsgaard Popp, Oticon A/S

Join devel@lists.zephyrproject.org to automatically receive all group messages.