Used for verbose tracing via printf(..) to the STM32F746 LCD.

Dependents:   GroveStreams-Temp

Committer:
mmills
Date:
Thu Jan 05 18:40:01 2017 +0000
Revision:
0:ecd4f3e81bcf
Initial Revision.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mmills 0:ecd4f3e81bcf 1 /*
mmills 0:ecd4f3e81bcf 2 License:
mmills 0:ecd4f3e81bcf 3 Copyright (C) 2017 GroveStreams LLC.
mmills 0:ecd4f3e81bcf 4 Licensed under the Apache License, Version 2.0 (the "License");
mmills 0:ecd4f3e81bcf 5 you may not use this file except in compliance with the License.
mmills 0:ecd4f3e81bcf 6 You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
mmills 0:ecd4f3e81bcf 7
mmills 0:ecd4f3e81bcf 8 Unless required by applicable law or agreed to in writing, software
mmills 0:ecd4f3e81bcf 9 distributed under the License is distributed on an "AS IS" BASIS,
mmills 0:ecd4f3e81bcf 10 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
mmills 0:ecd4f3e81bcf 11 See the License for the specific language governing permissions and
mmills 0:ecd4f3e81bcf 12 limitations under the License.
mmills 0:ecd4f3e81bcf 13 */
mmills 0:ecd4f3e81bcf 14
mmills 0:ecd4f3e81bcf 15 #ifndef LCDDISCOF746NG_H_
mmills 0:ecd4f3e81bcf 16 #define LCDDISCOF746NG_H_
mmills 0:ecd4f3e81bcf 17
mmills 0:ecd4f3e81bcf 18 #include "LCD_DISCO_F746NG.h"
mmills 0:ecd4f3e81bcf 19
mmills 0:ecd4f3e81bcf 20 class LcdDiscoF746NgTracer
mmills 0:ecd4f3e81bcf 21 {
mmills 0:ecd4f3e81bcf 22 protected:
mmills 0:ecd4f3e81bcf 23 int _line;
mmills 0:ecd4f3e81bcf 24 int _maxLines;
mmills 0:ecd4f3e81bcf 25 LCD_DISCO_F746NG _lcd;
mmills 0:ecd4f3e81bcf 26
mmills 0:ecd4f3e81bcf 27 public:
mmills 0:ecd4f3e81bcf 28
mmills 0:ecd4f3e81bcf 29 /** Constructor
mmills 0:ecd4f3e81bcf 30 *
mmills 0:ecd4f3e81bcf 31 */
mmills 0:ecd4f3e81bcf 32 LcdDiscoF746NgTracer();
mmills 0:ecd4f3e81bcf 33
mmills 0:ecd4f3e81bcf 34 /** Prints formatted strings to the LCD in a single line for each call. Long
mmills 0:ecd4f3e81bcf 35 * lines are wrapped. The LCD is cleared after it is full.
mmills 0:ecd4f3e81bcf 36 * Utilizes sprintf. sprintf does not support floats on many
mmills 0:ecd4f3e81bcf 37 * embed systems.
mmills 0:ecd4f3e81bcf 38 *
mmills 0:ecd4f3e81bcf 39 * \param format string format.
mmills 0:ecd4f3e81bcf 40 * \param ... variable number of format arguments
mmills 0:ecd4f3e81bcf 41 * Example: printf("Successful update");
mmills 0:ecd4f3e81bcf 42 * Example: printf("Current status: %d", status);
mmills 0:ecd4f3e81bcf 43 * \return 0 on success
mmills 0:ecd4f3e81bcf 44 */
mmills 0:ecd4f3e81bcf 45 void printf(const char* format, ...);
mmills 0:ecd4f3e81bcf 46
mmills 0:ecd4f3e81bcf 47 /** Prints a string to the LCD in a single line for each call. Long
mmills 0:ecd4f3e81bcf 48 * lines are wrapped. The LCD is cleared after it is full.
mmills 0:ecd4f3e81bcf 49 *
mmills 0:ecd4f3e81bcf 50 * \param sbuffer string buffer
mmills 0:ecd4f3e81bcf 51 */
mmills 0:ecd4f3e81bcf 52 void println(const char* sbuffer);
mmills 0:ecd4f3e81bcf 53
mmills 0:ecd4f3e81bcf 54 /** Clears the LCD
mmills 0:ecd4f3e81bcf 55 *
mmills 0:ecd4f3e81bcf 56 */
mmills 0:ecd4f3e81bcf 57 void clear();
mmills 0:ecd4f3e81bcf 58 };
mmills 0:ecd4f3e81bcf 59
mmills 0:ecd4f3e81bcf 60 #endif /* LCDDISCOF746NG_H_ */