Serial UART snooper. Connect RX and TX of the UUT to 2 x RX pins on mbed to inspect the traffic in both directions

Dependencies:   MODSERIAL Terminal mbed

stripe.h

Committer:
cbayley
Date:
2012-09-20
Revision:
5:76d46f565551
Parent:
2:60e6df8211f2

File content as of revision 5:76d46f565551:

#include <stdint.h>
#ifndef STRIPE_H
#define STRIPE_H

struct Row {
    char fgc[sizeof("\033[48;5;249m")-1];
    char hex[16*3];
    char sp[4];
    char asc[16];
    char eol[2];
};
    
struct Strip {
    char bgc[sizeof("\033[48;5;249m")-1];
    struct Row row[2];
};

class Stripe {
private:
    //uint8_t     bg_color;
    //uint8_t     out_color;
    //uint8_t     in_color;
    uint8_t     wp;
    uint8_t     rp;
    //uint8_t     wp;
public:
    struct  Strip  strip;
    
public:
    /* contructor 
        xterm256 color for background, output, input*/
    Stripe( uint8_t bc, uint8_t oc, uint8_t ic  );
    
    int inbyte( uint8_t );
    int outbyte( uint8_t );
    int advance( void );
    uint8_t getc(void);
    
    
    
};

#endif