107 #define EADOGM_SPI_HW 1
108 #define EADOGM_PIN_RS LATBbits.LATB14
109 #define EADOGM_PIN_CSB LATBbits.LATB13
115 #define EADMSYM_DEG 0b11011111 // degree symbol
116 #define EADMSYM_DARWL 0b11111011 // double <<
117 #define EADMSYM_DARWR 0b11111100 // double >>
118 #define EADMSYM_LT 0b00111100 // less than <
119 #define EADMSYM_GT 0b00111110 // greater than >
120 #define EADMSYM_OHM 0b00011110 // ohm symbol
123 #define EADMCMD_CONTRAST 0b0111000 // contrast command (0b0111xxxx)
128 #define GLOBAL INTR_GLOBAL
134 #define EADOGM_ROWS 1
136 #define EADOGM_INIT_BIAS_SET 0x1C
137 #define EADOGM_INIT_POWER_CONTROL 0x51
138 #define EADOGM_INIT_FOLLOWER_CONTROL 0x6A
139 #define EADOGM_INIT_CONTRAST_SET 0x74
141 #define EADOGM_INIT_BIAS_SET 0x14
142 #define EADOGM_INIT_POWER_CONTROL 0x55
143 #define EADOGM_INIT_FOLLOWER_CONTROL 0x6D
144 #define EADOGM_INIT_CONTRAST_SET 0x7C
147 #define EADOGM_INIT_FS1 0x31
148 #define EADOGM_INIT_FS2 0x30
149 #define EADOGM_INIT_CLEAR_DISPLAY 0x01
150 #define EADOGM_INIT_ENTRY_MODE 0x06
151 #define EADOGM_COLSPAN 16
157 #define EADOGM_ROWS 2
159 #define EADOGM_INIT_BIAS_SET 0x1C
160 #define EADOGM_INIT_POWER_CONTROL 0x52
161 #define EADOGM_INIT_FOLLOWER_CONTROL 0x69
162 #define EADOGM_INIT_CONTRAST_SET 0x74
164 #define EADOGM_INIT_BIAS_SET 0x14
165 #define EADOGM_INIT_POWER_CONTROL 0x55
166 #define EADOGM_INIT_FOLLOWER_CONTROL 0x6D
167 #define EADOGM_INIT_CONTRAST_SET 0x78
170 #define EADOGM_INIT_FS1 0x39
171 #define EADOGM_INIT_FS2 0x38
172 #define EADOGM_INIT_CLEAR_DISPLAY 0x01
173 #define EADOGM_INIT_ENTRY_MODE 0x06
174 #define EADOGM_COLSPAN 40 // suggested that this be 40 on model 162
179 #define EADOGM_ROWS 3
181 #define EADOGM_INIT_BIAS_SET 0x1D
182 #define EADOGM_INIT_POWER_CONTROL 0x50
183 #define EADOGM_INIT_FOLLOWER_CONTROL 0x6C
184 #define EADOGM_INIT_CONTRAST_SET 0x7C
186 #define EADOGM_INIT_BIAS_SET 0x15
187 #define EADOGM_INIT_POWER_CONTROL 0x55
188 #define EADOGM_INIT_FOLLOWER_CONTROL 0x6E
189 #define EADOGM_INIT_CONTRAST_SET 0x72
192 #define EADOGM_INIT_FS1 0x39
193 #define EADOGM_INIT_FS2 0x38
194 #define EADOGM_INIT_CLEAR_DISPLAY 0x01
195 #define EADOGM_INIT_ENTRY_MODE 0x06
196 #define EADOGM_COLSPAN 16
200 #define EADOGM_CMD_CLR 1
201 #define EADOGM_CMD_CURSOR_ON 0b00001111
202 #define EADOGM_CMD_CURSOR_OFF 0b00001100
203 #define EADOGM_CMD_DISPLAY_ON 0b00001100
204 #define EADOGM_CMD_DISPLAY_OFF 0b00001000
205 #define EADOGM_CMD_DDRAM_ADDR 0b10000000
206 #define EADOGM_CMD_CGRAM_ADDR 0b01000000
207 #define EADOGM_CMD_SELECT_R0 0b00011000
208 #define EADOGM_CMD_SELECT_R1 0b00010000
209 #define EADOGM_CMD_SET_TABLE2 0b00101010
213 #ifndef EADOGM_SPI_DIV
214 #define EADOGM_SPI_DIV SPI_CLK_DIV_4
221 #ifndef EADOGM_SCLK_BB
222 #define EADOGM_SCLK_BB PIN_C3
224 #ifndef EADOGM_MOSI_BB
225 #define EADOGM_MOSI_BB PIN_C5
229 void eaDogM_iniSPI_BB(
void)
231 output_drive(EADOGM_SCLK_BB);
232 output_drive(EADOGM_MOSI_BB);
233 output_low(EADOGM_SCLK_BB);
234 output_low(EADOGM_MOSI_BB);
237 void eaDogM_spiWrite_BB(int8 regData)
244 output_low(EADOGM_SCLK_BB);
247 for (SPICount = 0; SPICount < 8; SPICount++)
249 bitOut = bit_test(SPIData,7);
250 output_bit(EADOGM_MOSI_BB,bitOut);
251 output_high(EADOGM_SCLK_BB);
253 output_low(EADOGM_SCLK_BB);
255 SPIData = SPIData << 1;
258 output_low(EADOGM_MOSI_BB);
263 #define eaDogM_outSPI(c) eaDogM_spiWrite_BB(c)
268 #if EADOGM_SPI_HW == 1
269 #define eaDogM_outSPI(c) spi_write(c)
274 #if EADOGM_SPI_HW == 2
275 #define eaDogM_outSPI(c) spi_write2(c)
280 void eaDogM_ini8Bit(
void)
286 output_drive(EADOGM_PIN_E);
287 output_drive(EADOGM_PIN_RW);
289 output_low(EADOGM_PIN_E);
291 output_low(EADOGM_PIN_RW);
302 output_low(EADOGM_PIN_RW);
303 output_low(EADOGM_PIN_E);
307 output_high(EADOGM_PIN_E);
309 EADOGM_8BIT_PORT(value);
310 output_low(EADOGM_PIN_E);
321 output_low(EADOGM_PIN_RW);
322 output_low(EADOGM_PIN_E);
326 output_high(EADOGM_PIN_E);
328 EADOGM_8BIT_PORT(cmd);
329 output_low(EADOGM_PIN_E);
362 #if EADOGM_SPI_HW == 1
367 #if EADOGM_SPI_HW == 2
400 #define eaDogM_SetContrast(c) eaDogM_WriteCommand(EADMCMD_CONTRAST + (c & 0b00001111))
418 #define eaDogM_DoubleHeightOff() eaDogM_WriteCommand(0b00101000)
419 #define eaDogM_Cls() eaDogM_WriteCommand(EADOGM_CMD_CLR)
420 #define eaDogM_CursorOn() eaDogM_WriteCommand(EADOGM_CMD_CURSOR_ON)
421 #define eaDogM_CursorOff() eaDogM_WriteCommand(EADOGM_CMD_CURSOR_OFF)
422 #define eaDogM_DisplayOn() eaDogM_WriteCommand(EADOGM_CMD_DISPLAY_ON)
423 #define eaDogM_DisplayOff() eaDogM_WriteCommand(EADOGM_CMD_DISPLAY_OFF)
453 disable_interrupts(
GLOBAL);
460 enable_interrupts(
GLOBAL);
469 disable_interrupts(
GLOBAL);
478 enable_interrupts(
GLOBAL);
488 cmd = ndx & 0b00111111;
void eaDogM_WriteByteToCGRAM(char ndx, char data)
void eaDogM_SetPos(int8 r, int8 c)
#define EADOGM_INIT_CLEAR_DISPLAY
#define EADOGM_CMD_SELECT_R0
#define EADOGM_INIT_BIAS_SET
#define EADOGM_INIT_ENTRY_MODE
void eaDogM_ClearRow(int8 r)
void eaDogM_WriteStringAtPos(int8 r, int8 c, char *strPtr, int1 DisGIE=0)
#define EADOGM_CMD_DDRAM_ADDR
void eaDogM_DoubleHeight(int8 row)
#define EADOGM_CMD_CGRAM_ADDR
void eaDogM_WriteChr(char value)
void eaDogM_WriteIntAtPos(int8 r, int8 c, int8 i, int1 DisGIE=0)
#define EADOGM_CMD_SET_TABLE2
void eaDogM_WriteString(char *strPtr)
#define EADOGM_INIT_FOLLOWER_CONTROL
void eaDogM_Initialize(void)
#define EADOGM_CMD_SELECT_R1
#define EADOGM_INIT_POWER_CONTROL
#define EADOGM_INIT_CONTRAST_SET
void eaDogM_WriteCommand(int8 cmd)