SERIN
 
Syntax

void SERIN (int pin, int baudrate, int posTrue, char cnt, char *inList );

Description


SERIN receives cnt bytes as asynchronous serial data on pin at a baudrate and saves the data into inList . 

PosTrue if set to 0 then the data is inverted.

inList  is a pointer to a character array.

SERIN will timeout after 0.5 seconds and return -1 and 255 in the next item in the inList before the timeout.  These routines are "bit-banged" by the processor, so the processor is consumed during these operations.  Interupts are also disabled during each byte for these operations. 

The 0.5 second timeout can be changed by SERINtimeout.

Baudrates can be upto 115.2 Kbaud for all pins.

For UART0 support use-

int getline(char *line, int max_len) ;

For ARMexpress modules baudrates for RXD0 can be upto 19.2 Kbaud as it is limited by the level translators. No limit for ARMmite/ARMweb  Use setUART0baud() routine to set this baud.

Example

    while (1) { 
       SERIN (4,19200,1, 1, shortMessage);
       if (shortMessage[0] != 255) printCh( shortMessage[0] );
       if (shortMessage[0] == 'Q') break;
    }  // receive and echo characters from testjig

See also