Discontinous pin numbers (for nRF52840 dongle)

Posted on
  • Hi!

    Trying to make a correct board definition for the nRF52840 dongle, it's working, but got hung up at the pin definitions: A couple of pins are not connected on the dongle. For example P0.03 is not connected.

    Tried two things in the board definition:
    1: create all the pins, and remove the not connected ones:

      pins = pinutils.generate_pins(0,47) # 48 General Purpose I/O Pins.
      ...
      pins.remove(pinutils.findpin(pins, "PD3", True))  # Not connected pin
    

    2: start with empty pin list, and only add the ones really there:

      pins = []
    
      pinutils.findpin(pins, "PD0", False)
      pinutils.findpin(pins, "PD1", False)
      pinutils.findpin(pins, "PD2", False)
      # 0.3 not connected pin
      pinutils.findpin(pins, "PD4", False)
    

    But in both cases, there is still PD3. And looks like it is even working: calling read + toggle + read toggles the value.

    Soo, is there a way to get rid of PD3?

  • There's actually a special definition for it called PIN_NAMES_DIRECT - https://github.com/espruino/Espruino/blob/master/boards/PICO_R1_3.py#L45

    Basically if all the pins are there then Espruino just works out the offset in pinInfo based on the number after D. If they're not then you can use PIN_NAMES_DIRECT and it does a search.

    IMO it wouldn't be the end of the world to leave all the pins defined though?

    edit: I just saw your other post - seems like a good plan to remove them :)

  • Thanks, I will check it out!
    NEGATED did solve the negation.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Discontinous pin numbers (for nRF52840 dongle)

Posted by Avatar for AkosLukacs @AkosLukacs

Actions