8-bit External Bus

The NORDIC tutorials are great for demonstrating how to use GPIOs to drive LEDs and read buttons. 

However, I need an 8-bit bus to exchange bytes with an external display IC.

I did a search of the documentation, but failed to find any information on how to do it.

Thanks!

Jim

Parents Reply Children
  • I gave up on Zephyr and began directly writing and reading gpio peripheral registers.   

    Controlling the NORDIC pins via the peripheral registers is so easy, I don't see any reason to use the Zephyr API.  Here's my simple solution:

    Specify the GPIO control register addresses:

    #define PORT_OUT    (*(volatile uint32_t*)                          0x50000504)
    #define PORT_OUTSET (*(volatile uint32_t*)                          0x50000508)
    #define PORT_OUTCLR (*(volatile uint32_t*)                          0x5000050C)
    #define PORT_IN     (*(volatile uint32_t*)                          0x50000510)
    #define PORT_DIR    (*(volatile uint32_t*)                          0x50000514)
    #define PORT_DIRSET (*(volatile uint32_t*)                          0x50000518)
    #define PORT_DIRCLR (*(volatile uint32_t*)                          0x5000051C)
    Then control them by direct writes and read them by direct reads:
        PORT_DIRSET =  0x180000;
        if (x) {
            PORT_OUTSET =  0x180000;        
        } else {
            PORT_OUTCLR =  0x180000;
        }
        int gpio_pin_values = PORT_IN;
    Easy and understandable.
Related