Hardware testing for M24SR-DISCOVERY demo PCB. as help to others

Dependencies:   mbed

Set up to use MB1138 M24SR-DISCOVERY PCB http://www.st.com/content/st_com/en/products/evaluation-tools/product-evaluation-tools/st25-nfc-rfid-eval-boards/st25-nfc-rfid-eval-boards/m24sr-discovery.html with MBED system. based on https://developer.mbed.org/users/hudakz/code/STM32F103C8T6_Hello/ code and https://developer.mbed.org/users/wim/notebook/m24sr64-nfcrfid-tag-with-i2c-interface/ Which lead me to look at Peter Drescher's work on ILI9341 LCD controller

https://developer.mbed.org/users/dreschpe/code/SPI_TFT_ILI9341/

Committer:
lloydg
Date:
Thu Sep 22 10:43:55 2016 +0000
Revision:
0:ce5a25daadce
my start

Who changed what in which revision?

UserRevisionLine numberNew contents of line
lloydg 0:ce5a25daadce 1 /* mbed TextDisplay Library Base Class
lloydg 0:ce5a25daadce 2 * Copyright (c) 2007-2009 sford
lloydg 0:ce5a25daadce 3 * Released under the MIT License: http://mbed.org/license/mit
lloydg 0:ce5a25daadce 4 *
lloydg 0:ce5a25daadce 5 * A common base class for Text displays
lloydg 0:ce5a25daadce 6 * To port a new display, derive from this class and implement
lloydg 0:ce5a25daadce 7 * the constructor (setup the display), character (put a character
lloydg 0:ce5a25daadce 8 * at a location), rows and columns (number of rows/cols) functions.
lloydg 0:ce5a25daadce 9 * Everything else (locate, printf, putc, cls) will come for free
lloydg 0:ce5a25daadce 10 *
lloydg 0:ce5a25daadce 11 * The model is the display will wrap at the right and bottom, so you can
lloydg 0:ce5a25daadce 12 * keep writing and will always get valid characters. The location is
lloydg 0:ce5a25daadce 13 * maintained internally to the class to make this easy
lloydg 0:ce5a25daadce 14 */
lloydg 0:ce5a25daadce 15
lloydg 0:ce5a25daadce 16 #ifndef MBED_TEXTDISPLAY_H
lloydg 0:ce5a25daadce 17 #define MBED_TEXTDISPLAY_H
lloydg 0:ce5a25daadce 18
lloydg 0:ce5a25daadce 19 #include "mbed.h"
lloydg 0:ce5a25daadce 20
lloydg 0:ce5a25daadce 21 class TextDisplay : public Stream {
lloydg 0:ce5a25daadce 22 public:
lloydg 0:ce5a25daadce 23
lloydg 0:ce5a25daadce 24 // functions needing implementation in derived implementation class
lloydg 0:ce5a25daadce 25 /** Create a TextDisplay interface
lloydg 0:ce5a25daadce 26 *
lloydg 0:ce5a25daadce 27 * @param name The name used in the path to access the strean through the filesystem
lloydg 0:ce5a25daadce 28 */
lloydg 0:ce5a25daadce 29 TextDisplay(const char *name = NULL);
lloydg 0:ce5a25daadce 30
lloydg 0:ce5a25daadce 31 /** output a character at the given position
lloydg 0:ce5a25daadce 32 *
lloydg 0:ce5a25daadce 33 * @param column column where charater must be written
lloydg 0:ce5a25daadce 34 * @param row where character must be written
lloydg 0:ce5a25daadce 35 * @param c the character to be written to the TextDisplay
lloydg 0:ce5a25daadce 36 */
lloydg 0:ce5a25daadce 37 virtual void character(int column, int row, int c) = 0;
lloydg 0:ce5a25daadce 38
lloydg 0:ce5a25daadce 39 /** return number if rows on TextDisplay
lloydg 0:ce5a25daadce 40 * @result number of rows
lloydg 0:ce5a25daadce 41 */
lloydg 0:ce5a25daadce 42 virtual int rows() = 0;
lloydg 0:ce5a25daadce 43
lloydg 0:ce5a25daadce 44 /** return number if columns on TextDisplay
lloydg 0:ce5a25daadce 45 * @result number of rows
lloydg 0:ce5a25daadce 46 */
lloydg 0:ce5a25daadce 47 virtual int columns() = 0;
lloydg 0:ce5a25daadce 48
lloydg 0:ce5a25daadce 49 // functions that come for free, but can be overwritten
lloydg 0:ce5a25daadce 50
lloydg 0:ce5a25daadce 51 /** redirect output from a stream (stoud, sterr) to display
lloydg 0:ce5a25daadce 52 * @param stream stream that shall be redirected to the TextDisplay
lloydg 0:ce5a25daadce 53 */
lloydg 0:ce5a25daadce 54 virtual bool claim (FILE *stream);
lloydg 0:ce5a25daadce 55
lloydg 0:ce5a25daadce 56 /** clear screen
lloydg 0:ce5a25daadce 57 */
lloydg 0:ce5a25daadce 58 virtual void cls();
lloydg 0:ce5a25daadce 59 virtual void locate(int column, int row);
lloydg 0:ce5a25daadce 60 virtual void foreground(uint16_t colour);
lloydg 0:ce5a25daadce 61 virtual void background(uint16_t colour);
lloydg 0:ce5a25daadce 62 // putc (from Stream)
lloydg 0:ce5a25daadce 63 // printf (from Stream)
lloydg 0:ce5a25daadce 64
lloydg 0:ce5a25daadce 65 protected:
lloydg 0:ce5a25daadce 66
lloydg 0:ce5a25daadce 67 virtual int _putc(int value);
lloydg 0:ce5a25daadce 68 virtual int _getc();
lloydg 0:ce5a25daadce 69
lloydg 0:ce5a25daadce 70 // character location
lloydg 0:ce5a25daadce 71 uint16_t _column;
lloydg 0:ce5a25daadce 72 uint16_t _row;
lloydg 0:ce5a25daadce 73
lloydg 0:ce5a25daadce 74 // colours
lloydg 0:ce5a25daadce 75 uint16_t _foreground;
lloydg 0:ce5a25daadce 76 uint16_t _background;
lloydg 0:ce5a25daadce 77 char *_path;
lloydg 0:ce5a25daadce 78 };
lloydg 0:ce5a25daadce 79
lloydg 0:ce5a25daadce 80 #endif