printing text onto the screen
Embed:
(wiki syntax)
Show/hide line numbers
MAX7456.h
00001 #ifndef MAX7456_H 00002 #define MAX7456_H 00003 00004 #include "mbed.h" 00005 #include "Stream.h" 00006 00007 00008 #define VM0 0x00 00009 #define VM1 0x01 00010 #define HOS 0x02 00011 #define VOS 0x03 00012 #define DMM 0x04 00013 #define DMAH 0x05 00014 #define DMAL 0x06 00015 #define DMDI 0x07 00016 #define CMM 0x08 00017 #define CMAH 0x09 00018 #define CMAL 0x0A 00019 #define CMDI 0x0B 00020 #define OSDM 0x0C 00021 #define OSDBL 0x6C 00022 #define STAT 0xA0 00023 00024 namespace mbed { 00025 00026 class MAX7456 : public Stream { 00027 00028 // Public 00029 public: 00030 00031 MAX7456(PinName mosi, PinName miso, PinName clk, PinName ncs, PinName nrst, const char* name=NULL); 00032 00033 void cls (void); 00034 void locate (int x, int y); 00035 void vtrim (int v); 00036 void htrim (int h); 00037 void format (); 00038 int _getc(int character); 00039 // Private 00040 private: 00041 00042 SPI _spi; 00043 DigitalOut _ncs; 00044 DigitalOut _nrst; 00045 00046 // register access functions 00047 int _read (int addrress); 00048 void _write (int address, int data); 00049 00050 // putc method used by printf 00051 virtual int _putc(int c); 00052 virtual int _getc(); 00053 00054 }; 00055 00056 } 00057 00058 #endif
Generated on Tue Jul 12 2022 18:24:27 by
1.7.2