Edge connectors and pin numbers


Frank Duignan
 

I'm working with the BBC Microbit V2 and can use the peripherals using the NRF port pin numbers etc.  These port pins are brought to an edge connector which numbers them completely differently.  There seems to be some support for this in the bbc_microbit_v2 dts file in the following form:
  edge_connector: connector {
compatible = "microbit,edge-connector";
#gpio-cells = <2>;
gpio-map-mask = <0xffffffff 0xffffffc0>;
gpio-map-pass-thru = <0 0x3f>;
gpio-map = <0 0 &gpio0 2 0>, /* P0 */
   <1 0 &gpio0 3 0>, /* P1 */
   <2 0 &gpio0 4 0>, /* P2 */
   <3 0 &gpio0 31 0>, /* P3 */
   <4 0 &gpio0 28 0>, /* P4 */
   <5 0 &gpio0 14 0>, /* P5 */
   <6 0 &gpio1 5 0>, /* P6 */
   <7 0 &gpio0 11 0>, /* P7 */
   <8 0 &gpio0 10 0>, /* P8 */
   <9 0 &gpio0 9 0>, /* P9 */
   <10 0 &gpio0 30 0>, /* P10 */
   <11 0 &gpio0 23 0>, /* P11 */
   <12 0 &gpio0 12 0>, /* P12 */
   <13 0 &gpio0 17 0>, /* P13 */
   <14 0 &gpio0 1 0>, /* P14 */
   <15 0 &gpio0 13 0>, /* P15 */
   <16 0 &gpio1 2 0>, /* P16 */
   <19 0 &gpio0 26 0>, /* P19 */
   <20 0 &gpio1 0 0>; /* P20 */
};
};

My question is: how do I get a binding to one/all of these i/o pins.  I've tried many many combinations of DT_ macros.  The following returns a non null value for "edge" but I can't figure out how to access the pins on that edge connector using the connector pin  numbering scheme.
struct device *edge; edge=DEVICE_DT_GET(DT_NODELABEL(edge_connector));
It's not a show stopper as I can revert to nordic pin numbering but it would be nice if the numbers in the C code corresponded to the label on the board.

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