embedded-software
reusable software modules for embedded systems
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
buffer_printf.h
Go to the documentation of this file.
1 
14 #ifndef _BUFFER_PRINTF_H_
15 #define _BUFFER_PRINTF_H_
16 
17 #include <stdarg.h>
18 #include <stdint.h>
19 
20 #include "project_settings.h"
21 
22 #ifndef USE_MODULE_BUFFER_PRINTF
23 #warning "USE_MODULE_BUFFER_PRINTF not defined in project_settings.h. Other modules won't be able to utilize this module."
24 #endif
25 
26 
27 #include "buffer.h"
28 
67 void Buffer_printf(buffer_t * buf, char * str, ...);
68 
93 void Buffer_vprintf(buffer_t * buf, char * str, va_list vars);
94 
100 void Buffer_Binary16(buffer_t * buf, uint16_t x);
101 
108 void Buffer_uint16(buffer_t * buf, uint16_t x);
109 
118 void Buffer_int16(buffer_t * buf, int16_t x);
119 
126 void Buffer_uint32(buffer_t * buf, uint32_t x);
127 
136 void Buffer_int32(buffer_t * buf, int32_t x);
137 
144 void Buffer_Str(buffer_t * buf, char * str);
145 
155 void Buffer_HexN(buffer_t * buf, uint32_t x, uint8_t n);
156 #define Buffer_Hex(buf, x) Buffer_HexN(buf, x, 4)
157 
169 void Buffer_Float(buffer_t * buf, float x);
170 
172 #endif /* _BUFFER_PRINTF_H_ */
void Buffer_printf(buffer_t *buf, char *str,...)
printf implementation to char buffer
Definition: buffer_printf.c:12
void Buffer_vprintf(buffer_t *buf, char *str, va_list vars)
vprintf implementation to char buffer
Definition: buffer_printf.c:22
void Buffer_Str(buffer_t *buf, char *str)
Push char array (string) to char buffer.
Definition: buffer_printf.c:164
void Buffer_Float(buffer_t *buf, float x)
Cheap implementation of float to char buffer.
Definition: buffer_printf.c:188
Definition: buffer.h:42
void Buffer_uint32(buffer_t *buf, uint32_t x)
Push unsigned long integer to char buffer.
Definition: buffer_printf.c:151
void Buffer_HexN(buffer_t *buf, uint32_t x, uint8_t n)
Push 32 bit value to char buffer in hex format.
Definition: buffer_printf.c:170
void Buffer_int32(buffer_t *buf, int32_t x)
Push long to char buffer.
Definition: buffer_printf.c:143
void Buffer_Binary16(buffer_t *buf, uint16_t x)
Push 16 bit binary number to char buffer.
Definition: buffer_printf.c:127
void Buffer_uint16(buffer_t *buf, uint16_t x)
Push unsigned integer to char buffer.
Definition: buffer_printf.c:114
void Buffer_int16(buffer_t *buf, int16_t x)
Push integer to char buffer.
Definition: buffer_printf.c:135