annotate Discovery/Src/display.c @ 503:734f7ad46bca

Bugfix display of disabled screen. It is possible to select a screen as default which is in parallel disabled in the selection view. To avoid this the enable / disable state is not also checked when entering dive mode. The check function was depending on an ACTION. The functionality has been changed to allow the function call without ACTION. Changed setting of compass circle position from constant position to variable This was needed to reuse the same function in several views with different compass position Added new views Navigation and Depth data Both views were basically already available but the idea behind the layout is to combine all information needed for navigation dives (compass + timer) in one view. The classic maxdepth view just showed the maxdepth with a black box on the right side. this box is now used for display of average depth (shown in classic view Stopwatch) Minor changes in compass paint function to improve code readability Use same Y offset for all views While switching across the views some number were shown ~20 pixel higher than others. This was caused by the usage of the line selection which works for some fonts but not for all => set linenumber to 0 for all views
author Ideenmodellierer
date Mon, 24 Aug 2020 19:53:27 +0200
parents 5ca177d2df5d
children f7318457df4d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2 #include "stm32f4xx_hal.h" /* for HAL_Delay() */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3 #include "ostc.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4 #include "display.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6 #define ENABLE_EXTENDED_COMMANDS 0xB9
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7 #define SET_POWER 0xB1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
8 #define SLEEP_OUT 0x11
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
9 #define DISPLAY_INVERSION_OFF 0x20
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
10 #define MEMORY_ACCESS_ONTROL 0x36
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
11 #define INTERFACE_PIXEL_FORMAT 0x3A
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
12 #define SET_RGB_INTERFACE_RELATED 0xB3
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
13 #define SET_DISPLAY_WAVEFORM 0xB4
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
14 #define SET_PANEL 0xCC
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
15 #define SET_GAMMA_CURVE_RELATED 0xE0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
16 #define DISPLAY_ON 0x29
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
17 #define DISPLAY_OFF 0x28
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
18 #define SLEEP_IN 0x10
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
19
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
20
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
21 static void Display_Error_Handler(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
22
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
23 void display_power_on__1_of_2__pre_RGB(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
24 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
25 /* reset system */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
26 HAL_GPIO_WritePin(DISPLAY_CSB_GPIO_PORT,DISPLAY_CSB_PIN,GPIO_PIN_SET); // chip select
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
27
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
28 HAL_GPIO_WritePin(DISPLAY_RESETB_GPIO_PORT,DISPLAY_RESETB_PIN,GPIO_PIN_RESET);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
29 HAL_Delay(10);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
30 HAL_GPIO_WritePin(DISPLAY_RESETB_GPIO_PORT,DISPLAY_RESETB_PIN,GPIO_PIN_SET);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
31 HAL_Delay(10);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
32
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
33 /* RGB signals should be now for 2 frames or more (datasheet) */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
34 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
35
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
36
300
5ca177d2df5d cleanup: remove commented/unused code, make static
Jan Mulder <jlmulder@xs4all.nl>
parents: 38
diff changeset
37 static void send(uint8_t *pData, uint16_t inputlength)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
38 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
39 HAL_GPIO_WritePin(DISPLAY_CSB_GPIO_PORT,DISPLAY_CSB_PIN,GPIO_PIN_RESET); // chip select
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
40
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
41 if(HAL_SPI_Transmit(&hspiDisplay,(uint8_t*)pData, inputlength, 10000) != HAL_OK)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
42 Display_Error_Handler();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
43
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
44 while (HAL_SPI_GetState(&hspiDisplay) != HAL_SPI_STATE_READY)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
45 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
46 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
47 HAL_GPIO_WritePin(DISPLAY_CSB_GPIO_PORT,DISPLAY_CSB_PIN,GPIO_PIN_SET); // chip select
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
48 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
49
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
50
300
5ca177d2df5d cleanup: remove commented/unused code, make static
Jan Mulder <jlmulder@xs4all.nl>
parents: 38
diff changeset
51 static uint16_t convert8to9to8(uint8_t *pInput, uint8_t *pOutput,uint16_t inputlength)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
52 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
53 uint16_t outputlength;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
54 uint8_t readbit = 0x80;//0b1000000;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
55 uint8_t writebit = 0x40;//0b0100000;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
56 uint16_t i,j,k;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
57
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
58 outputlength = ((inputlength+7)/8)*9;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
59
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
60 for(i=0;i<outputlength;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
61 pOutput[i] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
62
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
63 k = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
64 for(i=0;i<inputlength;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
65 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
66 if(i != 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
67 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
68 pOutput[k] |= writebit; // 9. bit
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
69 writebit = writebit >> 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
70 if(writebit == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
71 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
72 writebit = 0x80;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
73 k++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
74 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
75 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
76 for(j=0;j<8;j++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
77 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
78 if((pInput[i] & readbit) != 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
79 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
80 pOutput[k] |= writebit;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
81 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
82 readbit = readbit >> 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
83 if(readbit == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
84 readbit = 0x80;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
85 writebit = writebit >> 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
86 if(writebit == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
87 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
88 writebit = 0x80;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
89 k++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
90 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
91 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
92 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
93 return outputlength;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
94 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
95
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
96 void display_power_on__2_of_2__post_RGB(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
97 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
98 uint8_t aTxBuffer[32];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
99 uint8_t bTxBuffer[36];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
100 uint16_t i,length;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
101
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
102 for(i=0;i<32;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
103 aTxBuffer[i] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
104 for(i=0;i<36;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
105 bTxBuffer[i] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
106
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
107 aTxBuffer[0] = ENABLE_EXTENDED_COMMANDS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
108 aTxBuffer[1] = 0xFF;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
109 aTxBuffer[2] = 0x83;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
110 aTxBuffer[3] = 0x63;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
111 length = convert8to9to8((uint8_t*)aTxBuffer,(uint8_t*)bTxBuffer,4);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
112 send((uint8_t*)bTxBuffer, length);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
113
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
114 aTxBuffer[0] = SET_POWER;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
115 aTxBuffer[1] = 0x81;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
116 aTxBuffer[2] = 0x24;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
117 aTxBuffer[3] = 0x04;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
118 aTxBuffer[4] = 0x02;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
119 aTxBuffer[5] = 0x02;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
120 aTxBuffer[6] = 0x03;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
121 aTxBuffer[7] = 0x10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
122 aTxBuffer[8] = 0x10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
123 aTxBuffer[9] = 0x34;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
124 aTxBuffer[10] = 0x3C;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
125 aTxBuffer[11] = 0x3F;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
126 aTxBuffer[12] = 0x3F;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
127 length = convert8to9to8((uint8_t*)aTxBuffer,(uint8_t*)bTxBuffer,13);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
128 send((uint8_t*)bTxBuffer, length);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
129
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
130 aTxBuffer[0] = SLEEP_OUT;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
131 length = convert8to9to8((uint8_t*)aTxBuffer,(uint8_t*)bTxBuffer,1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
132 send((uint8_t*)bTxBuffer, length);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
133 HAL_Delay(5+1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
134
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
135 aTxBuffer[0] = DISPLAY_INVERSION_OFF;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
136 length = convert8to9to8((uint8_t*)aTxBuffer,(uint8_t*)bTxBuffer,1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
137 send((uint8_t*)bTxBuffer, length);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
138
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
139 aTxBuffer[0] = MEMORY_ACCESS_ONTROL;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
140 aTxBuffer[1] = 0x00;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
141 length = convert8to9to8((uint8_t*)aTxBuffer,(uint8_t*)bTxBuffer,2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
142 send((uint8_t*)bTxBuffer, length);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
143
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
144 aTxBuffer[0] = INTERFACE_PIXEL_FORMAT;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
145 aTxBuffer[1] = 0x70;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
146 length = convert8to9to8((uint8_t*)aTxBuffer,(uint8_t*)bTxBuffer,2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
147 send((uint8_t*)bTxBuffer, length);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
148 HAL_Delay(120+20);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
149
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
150 aTxBuffer[0] = SET_POWER;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
151 aTxBuffer[1] = 0x78;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
152 aTxBuffer[2] = 0x24;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
153 aTxBuffer[3] = 0x04,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
154 aTxBuffer[4] = 0x02;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
155 aTxBuffer[5] = 0x02;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
156 aTxBuffer[6] = 0x03;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
157 aTxBuffer[7] = 0x10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
158 aTxBuffer[8] = 0x10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
159 aTxBuffer[9] = 0x34;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
160 aTxBuffer[10] = 0x3C;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
161 aTxBuffer[11] = 0x3F;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
162 aTxBuffer[12] = 0x3F;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
163 length = convert8to9to8((uint8_t*)aTxBuffer,(uint8_t*)bTxBuffer,13);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
164 send((uint8_t*)bTxBuffer, length);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
165
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
166 aTxBuffer[0] = SET_RGB_INTERFACE_RELATED;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
167 aTxBuffer[1] = 0x01;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
168 length = convert8to9to8((uint8_t*)aTxBuffer,(uint8_t*)bTxBuffer,2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
169 send((uint8_t*)bTxBuffer, length);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
170
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
171 aTxBuffer[0] = SET_DISPLAY_WAVEFORM;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
172 aTxBuffer[1] = 0x00;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
173 aTxBuffer[2] = 0x08;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
174 aTxBuffer[3] = 0x56;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
175 aTxBuffer[4] = 0x07;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
176 aTxBuffer[5] = 0x01;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
177 aTxBuffer[6] = 0x01;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
178 aTxBuffer[7] = 0x4D;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
179 aTxBuffer[8] = 0x01;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
180 aTxBuffer[9] = 0x42;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
181 length = convert8to9to8((uint8_t*)aTxBuffer,(uint8_t*)bTxBuffer,10);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
182 send((uint8_t*)bTxBuffer, length);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
183
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
184 aTxBuffer[0] = SET_PANEL;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
185 aTxBuffer[1] = 0x0B;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
186 length = convert8to9to8((uint8_t*)aTxBuffer,(uint8_t*)bTxBuffer,2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
187 send((uint8_t*)bTxBuffer, length);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
188
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
189 aTxBuffer[0] = SET_GAMMA_CURVE_RELATED;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
190 aTxBuffer[1] = 0x01;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
191 aTxBuffer[2] = 0x48;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
192 aTxBuffer[3] = 0x4D;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
193 aTxBuffer[4] = 0x4E;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
194 aTxBuffer[5] = 0x58;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
195 aTxBuffer[6] = 0xF6;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
196 aTxBuffer[7] = 0x0B;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
197 aTxBuffer[8] = 0x4E;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
198 aTxBuffer[9] = 0x12;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
199 aTxBuffer[10] = 0xD5;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
200 aTxBuffer[11] = 0x15;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
201 aTxBuffer[12] = 0x95;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
202 aTxBuffer[13] = 0x55;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
203 aTxBuffer[14] = 0x8E;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
204 aTxBuffer[15] = 0x11;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
205 aTxBuffer[16] = 0x01;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
206 aTxBuffer[17] = 0x48;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
207 aTxBuffer[18] = 0x4D;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
208 aTxBuffer[19] = 0x55;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
209 aTxBuffer[20] = 0x5F;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
210 aTxBuffer[21] = 0xFD;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
211 aTxBuffer[22] = 0x0A;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
212 aTxBuffer[23] = 0x4E;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
213 aTxBuffer[24] = 0x51;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
214 aTxBuffer[25] = 0xD3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
215 aTxBuffer[26] = 0x17;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
216 aTxBuffer[27] = 0x95;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
217 aTxBuffer[28] = 0x96;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
218 aTxBuffer[29] = 0x4E;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
219 aTxBuffer[30] = 0x11;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
220 length = convert8to9to8((uint8_t*)aTxBuffer,(uint8_t*)bTxBuffer,31);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
221 send((uint8_t*)bTxBuffer, length);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
222 HAL_Delay(5+1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
223
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
224 aTxBuffer[0] = DISPLAY_ON;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
225 length = convert8to9to8((uint8_t*)aTxBuffer,(uint8_t*)bTxBuffer,1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
226 send((uint8_t*)bTxBuffer, length);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
227 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
228
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
229
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
230 static void Display_Error_Handler(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
231 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
232 while(1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
233 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
234 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
235 }