Master Thesis  V1.0
Research and Design of Sensor Node for NMSD Treatment
dbprint.h
Go to the documentation of this file.
1 /***************************************************************************/
36 /* Include guards prevent multiple inclusions of the same header */
37 #ifndef _DBPRINT_H_
38 #define _DBPRINT_H_
39 
40 
41 /* Includes necessary for this header file */
42 #include <stdint.h> /* (u)intXX_t */
43 #include <stdbool.h> /* "bool", "true", "false" */
44 #include "em_usart.h" /* Universal synchr./asynchr. receiver/transmitter (USART/UART) Peripheral API */
45 
46 
48 #define DBPRINT_BUFFER_SIZE 80
49 
50 
52 typedef enum dbprint_colors
53 {
54  RED,
62 
63 
64 /* Public prototypes */
65 void dbprint_INIT (USART_TypeDef* pointer, uint8_t location, bool vcom, bool interrupts);
66 
67 void dbAlert (void);
68 void dbClear (void);
69 
70 void dbprint (char *message);
71 void dbprintln (char *message);
72 
73 void dbprintInt (int32_t value);
74 void dbprintlnInt (int32_t value);
75 
76 void dbprintInt_hex (int32_t value);
77 void dbprintlnInt_hex (int32_t value);
78 
79 void dbprint_color (char *message, dbprint_color_t color);
80 void dbprintln_color (char *message, dbprint_color_t color);
81 
82 void dbinfo (char *message);
83 void dbwarn (char *message);
84 void dbcrit (char *message);
85 
86 void dbinfoInt (char *message1, int32_t value, char *message2);
87 void dbwarnInt (char *message1, int32_t value, char *message2);
88 void dbcritInt (char *message1, int32_t value, char *message2);
89 
90 void dbinfoInt_hex (char *message1, int32_t value, char *message2);
91 void dbwarnInt_hex (char *message1, int32_t value, char *message2);
92 void dbcritInt_hex (char *message1, int32_t value, char *message2);
93 
94 char dbReadChar (void);
95 uint8_t dbReadInt (void);
96 void dbReadLine (char *buf);
97 
98 bool dbGet_RXstatus (void);
99 // void dbSet_TXbuffer (char *message); // TODO: Needs fixing (but probably won't ever be used)
100 void dbGet_RXbuffer (char *buf);
101 
102 
103 #endif /* _DBPRINT_H_ */
dbClear
void dbClear(void)
dbprint_INIT
void dbprint_INIT(USART_TypeDef *pointer, uint8_t location, bool vcom, bool interrupts)
MAGENTA
Definition: dbprint.h:58
dbprint_color
void dbprint_color(char *message, dbprint_color_t color)
dbprintln_color
void dbprintln_color(char *message, dbprint_color_t color)
dbGet_RXbuffer
void dbGet_RXbuffer(char *buf)
dbprintInt_hex
void dbprintInt_hex(int32_t value)
dbinfoInt
void dbinfoInt(char *message1, int32_t value, char *message2)
dbGet_RXstatus
bool dbGet_RXstatus(void)
dbprint
void dbprint(char *message)
dbprintInt
void dbprintInt(int32_t value)
DEFAULT_COLOR
Definition: dbprint.h:60
dbcritInt
void dbcritInt(char *message1, int32_t value, char *message2)
BLUE
Definition: dbprint.h:56
dbwarnInt
void dbwarnInt(char *message1, int32_t value, char *message2)
dbReadChar
char dbReadChar(void)
dbcritInt_hex
void dbcritInt_hex(char *message1, int32_t value, char *message2)
dbprintlnInt
void dbprintlnInt(int32_t value)
dbprint_color_t
enum dbprint_colors dbprint_color_t
dbinfoInt_hex
void dbinfoInt_hex(char *message1, int32_t value, char *message2)
dbwarn
void dbwarn(char *message)
RED
Definition: dbprint.h:54
dbReadInt
uint8_t dbReadInt(void)
dbwarnInt_hex
void dbwarnInt_hex(char *message1, int32_t value, char *message2)
dbprint_colors
dbprint_colors
Definition: dbprint.h:52
dbprintlnInt_hex
void dbprintlnInt_hex(int32_t value)
dbAlert
void dbAlert(void)
dbReadLine
void dbReadLine(char *buf)
CYAN
Definition: dbprint.h:57
dbcrit
void dbcrit(char *message)
GREEN
Definition: dbprint.h:55
YELLOW
Definition: dbprint.h:59
dbinfo
void dbinfo(char *message)
dbprintln
void dbprintln(char *message)