1 /**************************************************************************/
3 @file samsung_20T202DA2JA.h
4 @author Original source : Limor Fried/ladyada (Adafruit Industries)
5 LPC1343 port : K. Townsend
9 Software License Agreement (BSD License)
11 Copyright (c) 2012 Adafruit Industries
14 Redistribution and use in source and binary forms, with or without
15 modification, are permitted provided that the following conditions are met:
16 1. Redistributions of source code must retain the above copyright
17 notice, this list of conditions and the following disclaimer.
18 2. Redistributions in binary form must reproduce the above copyright
19 notice, this list of conditions and the following disclaimer in the
20 documentation and/or other materials provided with the distribution.
21 3. Neither the name of the copyright holders nor the
22 names of its contributors may be used to endorse or promote products
23 derived from this software without specific prior written permission.
25 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
26 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
27 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
28 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
29 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
30 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
31 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
32 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
34 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 /**************************************************************************/
37 #ifndef __SAMSUNG_20T202DA2JA__
38 #define __SAMSUNG_20T202DA2JA__
40 #include "projectconfig.h"
43 #define SAMSUNGVFD_SIO_PORT (2) // Data
44 #define SAMSUNGVFD_SIO_PIN (1)
45 #define SAMSUNGVFD_STB_PORT (2) // Strobe
46 #define SAMSUNGVFD_STB_PIN (2)
47 #define SAMSUNGVFD_SCK_PORT (2) // Clock
48 #define SAMSUNGVFD_SCK_PIN (3)
51 #define SAMSUNGVFD_CLEARDISPLAY 0x01
52 #define SAMSUNGVFD_RETURNHOME 0x02
53 #define SAMSUNGVFD_ENTRYMODESET 0x04
54 #define SAMSUNGVFD_DISPLAYCONTROL 0x08
55 #define SAMSUNGVFD_CURSORSHIFT 0x10
56 #define SAMSUNGVFD_FUNCTIONSET 0x30
57 #define SAMSUNGVFD_SETCGRAMADDR 0x40
58 #define SAMSUNGVFD_SETDDRAMADDR 0x80
60 // flags for display entry mode
61 #define SAMSUNGVFD_ENTRYRIGHT 0x00
62 #define SAMSUNGVFD_ENTRYLEFT 0x02
63 #define SAMSUNGVFD_ENTRYSHIFTINCREMENT 0x01
64 #define SAMSUNGVFD_ENTRYSHIFTDECREMENT 0x00
66 // flags for display on/off control
67 #define SAMSUNGVFD_DISPLAYON 0x04
68 #define SAMSUNGVFD_DISPLAYOFF 0x00
69 #define SAMSUNGVFD_CURSORON 0x02
70 #define SAMSUNGVFD_CURSOROFF 0x00
71 #define SAMSUNGVFD_BLINKON 0x01
72 #define SAMSUNGVFD_BLINKOFF 0x00
74 // flags for display/cursor shift
75 #define SAMSUNGVFD_DISPLAYMOVE 0x08
76 #define SAMSUNGVFD_CURSORMOVE 0x00
77 #define SAMSUNGVFD_MOVERIGHT 0x04
78 #define SAMSUNGVFD_MOVELEFT 0x00
80 // flags for function set
81 #define SAMSUNGVFD_2LINE 0x08
82 #define SAMSUNGVFD_1LINE 0x00
83 #define SAMSUNGVFD_BRIGHTNESS25 0x03
84 #define SAMSUNGVFD_BRIGHTNESS50 0x02
85 #define SAMSUNGVFD_BRIGHTNESS75 0x01
86 #define SAMSUNGVFD_BRIGHTNESS100 0x00
88 #define SAMSUNGVFD_SPICOMMAND 0xF8
89 #define SAMSUNGVFD_SPIDATA 0xFA
91 // Initialisation/Config Prototypes
92 void samsungvfdInit ( uint8_t brightness
);
93 void samsungvfdWrite ( uint8_t value
);
94 void samsungvfdWriteString( const char * str
);
95 void samsungvfdSetBrightness ( uint8_t brightness
);
96 void samsungvfdNoDisplay ( void );
97 void samsungvfdDisplay ( void );
98 void samsungvfdNoCursor ( void );
99 void samsungvfdCursor ( void );
100 void samsungvfdNoBlink ( void );
101 void samsungvfdBlink ( void );
102 void samsungvfdScrollDisplayLeft ( void );
103 void samsungvfdScrollDisplayRight ( void );
104 void samsungvfdLeftToRight ( void );
105 void samsungvfdRightToLeft ( void );
106 void samsungvfdAutoscroll ( void );
107 void samsungvfdNoAutoscroll ( void );
108 void samsungvfdClear ( void );
109 void samsungvfdHome ( void );
110 void samsungvfdSetCursor ( uint8_t row
, uint8_t col
);
This page took 0.060128 seconds and 5 git commands to generate.