Stepper-Motor-Control  v3.0.0
System on a Chip 2014 - Group 04
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
lcdDOGM162.c
Go to the documentation of this file.
1 /**
2  *************************************************************************
3  * @file lcdDOGM162.c
4  * @author Johann Mayr
5  * @author Prof. Dr.-Ing. Ferdinand Englberger
6  * @version V2.0.2
7  * @date 06.11.2014
8  * @copyright 2011 - 2014 UniBw M - ETTI - WE 4
9  * @brief Initialization program for LCD DOGM162. Qsys uses Altera
10  * LCD component "altera_avalon_lcd_16207".
11  * @remark This initialization function extends the standard
12  * initialization by DOGM162 specific initialization. This
13  * function has to be called before the display can be used.
14  *************************************************************************
15  * @par History:
16  * @details V2.0.2 06.11.2014 Kossmann
17  * - moved clear, set-position functionality into
18  * auxilaryFunctions.c because stream not available here
19  * @details V2.0.1 06.11.2014 Riedel
20  * - Created defines for init-codes and moved to header
21  * @details V2.0.0 Ferdinand Englberger
22  * - comments in english
23  * - Remove all functions, but initialization function
24  * - uses component register interface, instead of own access
25  * function.
26  * - uses a base parameter to identify lcd.
27  * @details V1.1 25.06.2012 Johann Mayr
28  * - Initial version
29  * @details V1.0 20.12.2011 Johann Mayr
30  * - Initial version
31  **************************************************************************
32  */
33 
34 #include <stdint.h>
35 #include <system.h>
36 #include "altera_avalon_lcd_16207_regs.h"
37 #include "../INC/lcdDOGM162.h"
38 
39 void DOGM162lcd_init(uint32_t lcdBase) {
40  static const uint8_t initCodes[] = {
46  CONTRAST2,
51  };
52  uint32_t i;
53  uint32_t j;
54 
55  // Wait for Power on not required, due to previous initialization by HAL
56  for (j = 0; j < sizeof(initCodes) / sizeof(initCodes[0]); j++) {
57  IOWR_ALTERA_AVALON_LCD_16207_COMMAND(lcdBase, initCodes[j]);
58  for (i = 0; i < 50000; i++){
59  ;
60  }
61  }
62 }
63 
64 void DOGM162lcd_setCursorMode(uint32_t lcdBase, int32_t cursorMode) {
65  int32_t i;
66  IOWR_ALTERA_AVALON_LCD_16207_COMMAND(lcdBase, (DISPLAY1_CURSOR1_POS0 | (cursorMode & 0x03)));
67  for (i = 0; i < 10000; ++i){
68  ;
69  }
70 }
void DOGM162lcd_setCursorMode(uint32_t lcdBase, int32_t cursorMode)
function changes cursor mode
Definition: lcdDOGM162.c:64
#define DDRAM_INC_SHIFT0
Entry Mode Set: Increment DDRAM-Addr, ShiftEntireDisplay off.
Definition: lcdDOGM162.h:48
#define DISPLAY1_CURSOR1_POS0
Display Set: Display on, Cursor on, Cursor Pos off.
Definition: lcdDOGM162.h:46
#define BIAS1_2LINES2
Bias Set: Bias = 1/5, 2 lines.
Definition: lcdDOGM162.h:42
#define CONTRAST2
Contrast Set: Contrast = 2.
Definition: lcdDOGM162.h:45
#define DATA8_LINES2_TABLE0
Function Set: 8 bit data, 2 lines, instruction table 0.
Definition: lcdDOGM162.h:40
#define DATA8_LINES2_TABLE1
Function Set: 8 bit data, 2 lines, instruction table 1.
Definition: lcdDOGM162.h:41
#define FOLLOWER1_RAB6
Follower Control: Follower on, Rab = 6.
Definition: lcdDOGM162.h:44
#define DISPLAY_CLEAR
Display Clear.
Definition: lcdDOGM162.h:47
#define ICON0_BOOSTER1_CONTRAST_C4_0_C5_1
Power Control: Icon Display off, Booster on, Internal Contrast C5 off, C4 on.
Definition: lcdDOGM162.h:43
void DOGM162lcd_init(uint32_t lcdBase)
Initialization function of LCD DOGM162B-A.
Definition: lcdDOGM162.c:39