• @MaBe,
    Try this, it compiles and loads without errors, but has not tried the communication.

    /// Settings passed to jshUSARTSetup to set it the USART up
    typedef struct {
      int baudRate;            /// FIXME uint32_t ???
      Pin pinRX;
      Pin pinTX;
      Pin pinCK;               ///< Clock, or PIN_UNDEFINED
      Pin pinCTS;              ///< Clear to send, or PIN_UNDEFINED
      unsigned char bytesize;  ///< size of byte, 7 or 8
      unsigned char parity;    ///< 0=none, 1=odd, 2=even
    '#if defined(ESP8266)
      unsigned char dummy;      // insert PB
      unsigned char dummy1;     // insert PB
    '#endif
      unsigned char stopbits;  ///< 1 or 2
      bool xOnXOff;            ///< XON XOFF flow control?
      bool errorHandling;      ///< Whether to forward parity/framing errors
    } PACKED_FLAGS JshUSARTInfo;
    
    
    
    Serial2.setup(9600,{rx:D12,tx:D13,ck:D14,cts:D15,bytesize:8,parity:'even',stopbits:1});
    
     1v94.209 Copyright 2017 G.Williams
    Espruino is Open Source. Our work is supported
    only by sales of official boards and donations:
    http://espruino.com/Donate
    Flash map 512KB:256/256, manuf 0xc8 chip 0x4013
    >
    =undefined
    >
    =undefined
    >
    =undefined
    >Se
    Serial3             Serial
    Serial2             Serial
    Serial1             Serial2
    Server
    >Seri
    Serial3             Serial
    Serial2             Serial
    Serial1             Serial2
    >Serial2._options
    ={ "rx": D12, "tx": D13, "ck": D14, "cts": D15,
      "bytesize": 8,
      "parity": "even",
      "stopbits": 1 }
    >
    =undefined
    
    

    '#if defined(ESP8266)
    '#endif
    Remove apostrophe in front of #

About

Avatar for Frida @Frida started