12.07.2015 Views

Programming Manual Elektor Proton Robot - ELEKTOR.se

Programming Manual Elektor Proton Robot - ELEKTOR.se

Programming Manual Elektor Proton Robot - ELEKTOR.se

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

char STR_PREFIX( const char *p, const char *q );//This function copies up to n characters from string q to string p. S is the size of string n.void STR_COPY( char *p, unsigned char s, char *q, unsigned char n );//bit char_in( char c, const char * s );//This functions returns whether character c appears in string s.char CHAR_IN( char c, const char * s );//bit STRING_IN( const char * p, const char * q );//This function returns whether the string p appears somewhere in string q.char STRING_IN( const char * p, const char * q );/*************************************************************************RS232/UART FUNCTIONS - RS232/UART FUNCTIONS - RS232/UART FUNCTIONS**************************************************************************/void UART_INIT( void ); \\//This function returns true when a received character is available, fal<strong>se</strong> otherwi<strong>se</strong>.char UART_CHAR_AVAILABLE( void );//This function waits for a character to become available, reads it and returns it. Note that this function will//not return until a character is available. If you want to avoid such waiting, u<strong>se</strong> the function//uart_char_available to check whether a character is available, and call uart_char_receive only when one is//available.char UART_CHAR_RECEIVE( void );//This returns true when the transmitter is idle- and can not be u<strong>se</strong>dchar UART_SEND_IDLE( void );//This function waits for the transmitter to become idle, and then starts transmission of the character. It//does not wait for the transmission to complete.void UART_CHAR_SEND( char c );//This function u<strong>se</strong>s uart_char_<strong>se</strong>nd to <strong>se</strong>nd a 0-terminated string of characters.void UART_STRING_SEND( const char *p );//This function receives a string of characters. The pointer received must point to a caller-allocated string.//Characters that are in the string ignore will be skipped. Receiving will terminate as soon as one of the//following conditions holds:// ? received_size - 1 characters have been received (not counting skipped characters, - 1 to have room// for the terminating \0), or// ? milli<strong>se</strong>conds milli<strong>se</strong>conds have elap<strong>se</strong>d, or// ? A character that is in the string terminate has been received.void UART_STRING_RECEIVE(char *received,unsigned char received_size,unsigned int milli<strong>se</strong>conds,Bart Huyskens <strong>Manual</strong> <strong>Elektor</strong> <strong>Proton</strong> V1.0 3 April 2011 163

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!