summaryrefslogtreecommitdiff
path: root/firmware/drivers/lcd-recorder.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers/lcd-recorder.c')
-rw-r--r--firmware/drivers/lcd-recorder.c41
1 files changed, 24 insertions, 17 deletions
diff --git a/firmware/drivers/lcd-recorder.c b/firmware/drivers/lcd-recorder.c
index 00b4ed78b2..597c7d246a 100644
--- a/firmware/drivers/lcd-recorder.c
+++ b/firmware/drivers/lcd-recorder.c
@@ -29,6 +29,7 @@
29#include "debug.h" 29#include "debug.h"
30#include "system.h" 30#include "system.h"
31#include "font.h" 31#include "font.h"
32#include "hwcompat.h"
32 33
33/*** definitions ***/ 34/*** definitions ***/
34 35
@@ -113,6 +114,15 @@ static unsigned char zeros[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
113static unsigned char ones[8] = { 0xff, 0xff, 0xff, 0xff, 114static unsigned char ones[8] = { 0xff, 0xff, 0xff, 0xff,
114 0xff, 0xff, 0xff, 0xff}; 115 0xff, 0xff, 0xff, 0xff};
115 116
117int lcd_default_contrast(void)
118{
119#ifdef SIMULATOR
120 return 30;
121#else
122 return (read_hw_mask() & LCD_CONTRAST_BIAS) ? 31 : 49;
123#endif
124}
125
116#ifdef SIMULATOR 126#ifdef SIMULATOR
117 127
118void lcd_init(void) 128void lcd_init(void)
@@ -132,23 +142,20 @@ void lcd_init (void)
132 PBCR2 &= 0xff00; /* MD = 00 */ 142 PBCR2 &= 0xff00; /* MD = 00 */
133 PBIOR |= 0x000f; /* IOR = 1 */ 143 PBIOR |= 0x000f; /* IOR = 1 */
134 144
135 /* inits like the original firmware */ 145 /* inits like the original firmware */
136 lcd_write(true, LCD_SOFTWARE_RESET); 146 lcd_write(true, LCD_SOFTWARE_RESET);
137 lcd_write(true, LCD_SET_INTERNAL_REGULATOR_RESISTOR_RATIO + 4); 147 lcd_write(true, LCD_SET_INTERNAL_REGULATOR_RESISTOR_RATIO + 4);
138 lcd_write(true, LCD_SET_1OVER4_BIAS_RATIO + 0); /* force 1/4 bias: 0 */ 148 lcd_write(true, LCD_SET_1OVER4_BIAS_RATIO + 0); /* force 1/4 bias: 0 */
139 lcd_write(true, LCD_SET_POWER_CONTROL_REGISTER + 7); /* power control register: op-amp=1, regulator=1, booster=1 */ 149 lcd_write(true, LCD_SET_POWER_CONTROL_REGISTER + 7); /* power control register: op-amp=1, regulator=1, booster=1 */
140 lcd_write(true, LCD_SET_DISPLAY_ON); 150 lcd_write(true, LCD_SET_DISPLAY_ON);
141 lcd_write(true, LCD_SET_NORMAL_DISPLAY); 151 lcd_write(true, LCD_SET_NORMAL_DISPLAY);
142 lcd_write(true, LCD_SET_SEGMENT_REMAP + 1); /* mirror horizontal: 1 */ 152 lcd_write(true, LCD_SET_SEGMENT_REMAP + 1); /* mirror horizontal: 1 */
143 lcd_write(true, LCD_SET_COM_OUTPUT_SCAN_DIRECTION + 8); /* mirror vertical: 1 */ 153 lcd_write(true, LCD_SET_COM_OUTPUT_SCAN_DIRECTION + 8); /* mirror vertical: 1 */
144 lcd_write(true, LCD_SET_DISPLAY_START_LINE + 0); 154 lcd_write(true, LCD_SET_DISPLAY_START_LINE + 0);
145#if 0 /* done later, depending on h/w mask bit and settings */ 155 lcd_set_contrast(lcd_default_contrast());
146 lcd_write(true, LCD_SET_CONTRAST_CONTROL_REGISTER); 156 lcd_write(true, LCD_SET_PAGE_ADDRESS);
147 lcd_write(true, 0xF1); /* contrast set to 49/64 */ 157 lcd_write(true, LCD_SET_LOWER_COLUMN_ADDRESS + 0);
148#endif 158 lcd_write(true, LCD_SET_HIGHER_COLUMN_ADDRESS + 0);
149 lcd_write(true, LCD_SET_PAGE_ADDRESS);
150 lcd_write(true, LCD_SET_LOWER_COLUMN_ADDRESS + 0);
151 lcd_write(true, LCD_SET_HIGHER_COLUMN_ADDRESS + 0);
152 159
153 lcd_clear_display(); 160 lcd_clear_display();
154 lcd_update(); 161 lcd_update();