|
@@ -26,29 +26,38 @@ void init_oled(void)
|
|
|
|
|
|
SSD1327_Clear(BLACK);
|
|
SSD1327_Clear(BLACK);
|
|
|
|
|
|
|
|
+/*
|
|
|
|
+
|
|
|
|
+ SSD1327_DrawPixel(20, 20, 15);
|
|
|
|
+ SSD1327_DrawPixel(21, 20, 15);
|
|
|
|
+ SSD1327_DrawPixel(22, 20, 15);
|
|
|
|
+
|
|
|
|
+ SSD1327_DrawPixel(20, 21, 15);
|
|
|
|
+ SSD1327_DrawPixel(20, 22, 15);
|
|
|
|
+
|
|
|
|
+ SSD1327_DrawPixel(22, 21, 15);
|
|
|
|
+*/
|
|
|
|
+
|
|
|
|
+
|
|
//GFX_Image(15, 0, (uint8_t*)logo_grayscale, 96, 96);
|
|
//GFX_Image(15, 0, (uint8_t*)logo_grayscale, 96, 96);
|
|
-
|
|
|
|
|
|
+
|
|
SSD1327_Display();
|
|
SSD1327_Display();
|
|
|
|
|
|
- test_oled();
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ //while (1) {}
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
//
|
|
//
|
|
void test_oled(void)
|
|
void test_oled(void)
|
|
{
|
|
{
|
|
- //SSD1327_DrawPixel(int16_t x, int16_t y, uint8_t Color);
|
|
|
|
-
|
|
|
|
#if 0
|
|
#if 0
|
|
- for (int i = 0; i < 16; i++)
|
|
|
|
- {
|
|
|
|
|
|
+ for (int i = 0; i < 16; i++) {
|
|
SSD1327_DrawPixel(10, 20 + i, i);
|
|
SSD1327_DrawPixel(10, 20 + i, i);
|
|
}
|
|
}
|
|
|
|
|
|
SSD1327_DrawPixel(20, 20, 15);
|
|
SSD1327_DrawPixel(20, 20, 15);
|
|
-
|
|
|
|
SSD1327_DrawPixel(30, 20, 15);
|
|
SSD1327_DrawPixel(30, 20, 15);
|
|
-
|
|
|
|
SSD1327_DrawPixel(40, 20, 5);
|
|
SSD1327_DrawPixel(40, 20, 5);
|
|
#endif
|
|
#endif
|
|
//void GFX_DrawLine(int x_start, int y_start, int x_end, int y_end, uint8_t color);
|
|
//void GFX_DrawLine(int x_start, int y_start, int x_end, int y_end, uint8_t color);
|
|
@@ -65,10 +74,18 @@ void test_oled(void)
|
|
GFX_DrawLine(0, 127, 127, 127, 15);
|
|
GFX_DrawLine(0, 127, 127, 127, 15);
|
|
|
|
|
|
GFX_SetFont(font_8x5);
|
|
GFX_SetFont(font_8x5);
|
|
|
|
+
|
|
|
|
+ GFX_SetFontSize(1);
|
|
|
|
+ GFX_DrawString(4, 10, (char*)"BbAa12345", 15, 0);
|
|
|
|
+
|
|
GFX_SetFontSize(2);
|
|
GFX_SetFontSize(2);
|
|
|
|
+ GFX_DrawString(4, 30, (char*)"BbAa12345", 15, 0);
|
|
|
|
+
|
|
|
|
+ GFX_SetFontSize(3);
|
|
|
|
+ GFX_DrawString(4, 60, (char*)"BbAa12345", 15, 0);
|
|
|
|
|
|
//GFX_DrawChar(50, 50, 'F', 15, 0);
|
|
//GFX_DrawChar(50, 50, 'F', 15, 0);
|
|
- GFX_DrawString(10, 100, "Hello!!!", 15, 0);
|
|
|
|
|
|
+ //GFX_DrawString(10, 100, "Hello!!!", 15, 0);
|
|
|
|
|
|
|
|
|
|
#if 0
|
|
#if 0
|
|
@@ -83,6 +100,17 @@ void test_oled(void)
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+// oled_draw_rec(3, 5, 123, 22, 15);
|
|
|
|
+void oled_draw_rec(int x_start, int y_start, int x_end, int y_end, uint8_t color)
|
|
|
|
+{
|
|
|
|
+ for (int i = 0; i < y_end; i++) {
|
|
|
|
+ GFX_DrawLine(x_start, y_start + i, x_end, y_start + i, color);
|
|
|
|
+ }
|
|
|
|
+ //GFX_DrawLine(x_start, y_start, x_end, y_start, color);
|
|
|
|
+ GFX_DrawLine(x_start, y_end, x_end, y_end, color);
|
|
|
|
+ //GFX_DrawLine(x_start, y_start, x_start, y_end, color);
|
|
|
|
+ //GFX_DrawLine(x_end, y_start, x_end, y_end, color);
|
|
|
|
+}
|
|
|
|
|
|
//
|
|
//
|
|
void init_gpio_oled(void)
|
|
void init_gpio_oled(void)
|
|
@@ -97,24 +125,6 @@ void init_gpio_oled(void)
|
|
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
|
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
|
|
|
|
|
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_5, GPIO_PIN_SET);
|
|
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_5, GPIO_PIN_SET);
|
|
-
|
|
|
|
-#if 0
|
|
|
|
- /*Configure GPIO pin Output Level */
|
|
|
|
- HAL_GPIO_WritePin(GPIOC, GPIO_PIN_6, GPIO_PIN_RESET);
|
|
|
|
-
|
|
|
|
- /*Configure GPIO pin : PC13 */
|
|
|
|
- GPIO_InitStruct.Pin = GPIO_PIN_13;
|
|
|
|
- GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
|
|
|
- GPIO_InitStruct.Pull = GPIO_NOPULL;
|
|
|
|
- HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
|
|
|
|
-
|
|
|
|
- /*Configure GPIO pin : PC6 */
|
|
|
|
- GPIO_InitStruct.Pin = GPIO_PIN_6;
|
|
|
|
- GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
|
|
|
- GPIO_InitStruct.Pull = GPIO_NOPULL;
|
|
|
|
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
|
|
|
- HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
|
|
|
|
-#endif
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|