3

I'm thinking about doing a project using an NXP eval board with the RT 1020 processor. I want to experiment with and get familiar with Zephyr RTOS.

How, in code, would I access the various Arduino header PINS with the given Device Tree snippet?

    arduino_header: connector {
    compatible = "arduino-header-r3";
    #gpio-cells = < 0x2 >;
    gpio-map-mask = < 0xffffffff 0xffffffc0 >;
    gpio-map-pass-thru = < 0x0 0x3f >;
    gpio-map = < 0x0 0x0 &gpio1 0x1a 0x0 >, < 0x1 0x0 &gpio1 0x1b 0x0 >, < 0x2 0x0 &gpio1 0x1c 0x0 >, < 0x3 0x0 &gpio1 0x1d 0x0 >, < 0x4 0x0 &gpio1 0x1f 0x0 >, < 0x5 0x0 &gpio1 0x1e 0x0 >, < 0x6 0x0 &gpio1 0x19 0x0 >, < 0x7 0x0 &gpio1 0x18 0x0 >, < 0x8 0x0 &gpio1 0x9 0x0 >, < 0x9 0x0 &gpio1 0x7 0x0 >, < 0xa 0x0 &gpio1 0x5 0x0 >, < 0xb 0x0 &gpio1 0x6 0x0 >, < 0xc 0x0 &gpio1 0xe 0x0 >, < 0xd 0x0 &gpio1 0x16 0x0 >, < 0xe 0x0 &gpio1 0x17 0x0 >, < 0xf 0x0 &gpio1 0xf 0x0 >, < 0x10 0x0 &gpio1 0xb 0x0 >, < 0x11 0x0 &gpio1 0xc 0x0 >, < 0x12 0x0 &gpio1 0xd 0x0 >, < 0x13 0x0 &gpio1 0xa 0x0 >, < 0x14 0x0 &gpio3 0x17 0x0 >, < 0x15 0x0 &gpio3 0x16 0x0 >;
};

I know that I can use device_get_binding() and gpio_pin_configure() with DT_GPIO_LABEL and DT_GPIO_PIN easily enough with a single pin that has a device tree alias.

I'm not clear how I'd access the Arduino header pins from the device tree snippet above.

Chimera
  • 5,884
  • 7
  • 49
  • 81
  • I'm sorry but this question is more for the Arduino stack exchange: https://arduino.stackexchange.com/ – c0d3r Apr 03 '21 at 20:16
  • 3
    @c0d3r this is not about Arduino, AT ALL. You should actually read the question before assuming it's about Arduino just because the hardware I'm using has Arduino compatible headers. This is about DEVICE TREE and ZEPHYR OS - clearly not Arduino. – Chimera Apr 04 '21 at 02:28

0 Answers0