diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2019-01-02 23:08:37 -0700 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2019-01-03 21:23:46 -0700 |
commit | 33a15696519e161cd823baaf4214d1ed452a410a (patch) | |
tree | e3491b0b7b7c570b36c1e4c5235e2d026c651b2c /03-refactor/include | |
parent | 109cdf120ea85f46d664e77c44ea2a311fd49ba2 (diff) | |
download | stm32l4-33a15696519e161cd823baaf4214d1ed452a410a.tar.gz stm32l4-33a15696519e161cd823baaf4214d1ed452a410a.tar.bz2 stm32l4-33a15696519e161cd823baaf4214d1ed452a410a.zip |
Add primitive printf functionality to the USART.
Diffstat (limited to '03-refactor/include')
-rw-r--r-- | 03-refactor/include/printf.h | 15 | ||||
-rw-r--r-- | 03-refactor/include/usart.h | 2 |
2 files changed, 17 insertions, 0 deletions
diff --git a/03-refactor/include/printf.h b/03-refactor/include/printf.h new file mode 100644 index 0000000..ec3eec0 --- /dev/null +++ b/03-refactor/include/printf.h @@ -0,0 +1,15 @@ +#ifndef PRINTF_H_ +#define PRINTF_H_ + +#include <stdarg.h> +#include <stdlib.h> + +typedef void(*printf_callback_t)(volatile void*, char); + +void printf_format( + const char* fmt, + printf_callback_t callback, + volatile void* callback_closure, + va_list lst); + +#endif /* PRINTF_H_ */ diff --git a/03-refactor/include/usart.h b/03-refactor/include/usart.h index 3fea253..377048c 100644 --- a/03-refactor/include/usart.h +++ b/03-refactor/include/usart.h @@ -207,5 +207,7 @@ void usart_transmit_bytes( void usart_transmit_str(__IO usart_t* usart, const char* str); +void usart_printf(__IO usart_t* usart, const char* fmt, ...); + #endif /* H__USART_ */ |