I have the NRF52-DK, a 3-digit seven segment display, an RGB LED and a sensor. Using SES to try and get some basic code running.
I manage to open an nRF Connect SDK project (rgb_led) and update it to drive 3 IO via the PWM peripheral. Next up I'm trying to add to that a basic 7-segment display driver - map some GPIO for the a-g segments, decimal and 3 com IO, and write a basic decoder to drive it.
I'm struggling to get my head around the device tree. Here is what I have so far:
in my nrf52dk_nrf52832.overlay file:
The dts file for this DK already specifies an arduino-r3 header for most of the gpio. I attempt to assign the remaining gpio as another header, then finally group the IO i'm using as a seven segment device.
In main.c I attempt to statically assign the gpio specs from the device tree, which I'll use to then configure the gpio..
(note: dt.a in the code above should be three_digit.a - the form input field for my post is stuck in a disabled state with 'upload file(s)' on it so can't edit! I can go to preview and back and the cursor will appear in the disabled text box allowing me to add this!)
On clean build (CMake run after editing the overlay file), get a load of these for all of the GPIO_DT_SPEC calls..
Checking devicetree_unfixed.h there's a section there for seven_seg although I feel it's missing generic property macros:
What am I doing wrong? I've spent three days with this, having gone through the Device tree spec, and the Zephyr documentation. I get having a system in place like the SES and Zephyr makes projects more hardware agnostic while making hardware configuration easier, but it doesn't half add a learning curve to getting started. Would love to just create a blank project for the nRF52 DK, import some nrf headers and add some API calls then build and run!
Cheers.