Mateusz Garwol / Mbed 2 deprecated 2_5

Dependencies:   LCD_DISCO_F429ZI mbed BSP_DISCO_F429ZI

Committer:
matis755
Date:
Wed May 20 15:42:07 2020 +0000
Revision:
2:8788d711db7e
Child:
3:6fc7976cc5bf
Initial version

Who changed what in which revision?

UserRevisionLine numberNew contents of line
matis755 2:8788d711db7e 1 #define NULL 0
matis755 2:8788d711db7e 2 #define TERMINATOR '\r'
matis755 2:8788d711db7e 3 #define DELIMITER_CHAR 0x20
matis755 2:8788d711db7e 4
matis755 2:8788d711db7e 5 #define HEX_bm 0x000F
matis755 2:8788d711db7e 6 #define MAX_TOKEN_NR 2
matis755 2:8788d711db7e 7 #define MAX_KEYWORD_STRING_LTH 6
matis755 2:8788d711db7e 8 #define MAX_KEYWORD_NR 2
matis755 2:8788d711db7e 9
matis755 2:8788d711db7e 10
matis755 2:8788d711db7e 11 typedef enum CompResult
matis755 2:8788d711db7e 12 { DIFFERENT , EQUAL } CompResult;
matis755 2:8788d711db7e 13
matis755 2:8788d711db7e 14 typedef enum Result
matis755 2:8788d711db7e 15 { OK, NOK } Result;
matis755 2:8788d711db7e 16
matis755 2:8788d711db7e 17 typedef enum TokenType
matis755 2:8788d711db7e 18 {KEYWORD, NUMBER, STRING} TokenType;
matis755 2:8788d711db7e 19
matis755 2:8788d711db7e 20 typedef enum KeywordCode
matis755 2:8788d711db7e 21 { CLB, GT} KeywordCode;
matis755 2:8788d711db7e 22
matis755 2:8788d711db7e 23 typedef union TokenValue
matis755 2:8788d711db7e 24 {
matis755 2:8788d711db7e 25 enum KeywordCode eKeyword;
matis755 2:8788d711db7e 26 unsigned int uiNumber;
matis755 2:8788d711db7e 27 char *pcString;
matis755 2:8788d711db7e 28 } TokenValue;
matis755 2:8788d711db7e 29
matis755 2:8788d711db7e 30 typedef struct Token
matis755 2:8788d711db7e 31 {
matis755 2:8788d711db7e 32 enum TokenType eType;
matis755 2:8788d711db7e 33 union TokenValue uValue;
matis755 2:8788d711db7e 34 } Token;
matis755 2:8788d711db7e 35
matis755 2:8788d711db7e 36
matis755 2:8788d711db7e 37 typedef struct Keyword
matis755 2:8788d711db7e 38 {
matis755 2:8788d711db7e 39 enum KeywordCode eCode;
matis755 2:8788d711db7e 40 char cString[MAX_KEYWORD_STRING_LTH + 1];
matis755 2:8788d711db7e 41 } Keyword;
matis755 2:8788d711db7e 42
matis755 2:8788d711db7e 43
matis755 2:8788d711db7e 44 void CopyString(char pcSource[], char pcDestination[]);
matis755 2:8788d711db7e 45 enum CompResult eCompareString(char pcStr1[], char pcStr2[]);
matis755 2:8788d711db7e 46 void AppendString (char pcSourceStr[],char pcDestinationStr[]);
matis755 2:8788d711db7e 47 void ReplaceCharactersInString(char pcString[],char cOldChar,char cNewChar);
matis755 2:8788d711db7e 48 void UIntToHexStr(unsigned int uiValue, char pcStr[]);
matis755 2:8788d711db7e 49 enum Result eHexStringToUInt(char pcStr[],unsigned int *puiValue);
matis755 2:8788d711db7e 50 void AppendUIntToString (unsigned int uiValue, char pcDestinationStr[]);
matis755 2:8788d711db7e 51 unsigned char ucFindTokensInString(char *pcString);
matis755 2:8788d711db7e 52 enum Result eStringToKeyword (char pcStr[],enum KeywordCode *peKeywordCode);
matis755 2:8788d711db7e 53 void DecodeTokens(unsigned char ucTokenCnt);
matis755 2:8788d711db7e 54 void DecodeMsg(char *pcString);