[综合信息] HC32F120驱动OLED

[复制链接]
 楼主| 比神乐 发表于 2024-12-6 10:31 | 显示全部楼层 |阅读模式
代码:
  1. #include "hc32_ddl.h"

  2. /**
  3. * @addtogroup HC32F120_DDL_Examples
  4. * @{
  5. */

  6. /**
  7. * @addtogroup GPIO_OUTPUT
  8. * @{
  9. */
  10. #define u8 unsigned char
  11. /*******************************************************************************
  12. * Local type definitions ('typedef')
  13. ******************************************************************************/

  14. /*******************************************************************************
  15. * Local pre-processor symbols/macros ('#define')
  16. ******************************************************************************/
  17. #define LED_RGB_PORT    (GPIO_PORT_2)
  18. #define LED_R_PORT      (GPIO_PORT_2)
  19. #define LED_G_PORT      (GPIO_PORT_2)
  20. #define LED_B_PORT      (GPIO_PORT_2)

  21. #define LED_R_PIN       (GPIO_PIN_5)
  22. #define LED_G_PIN       (GPIO_PIN_6)
  23. #define LED_B_PIN       (GPIO_PIN_7)

  24. #define LED_R_ON()      (GPIO_ResetPins(LED_R_PORT, LED_R_PIN))
  25. #define LED_G_ON()      (GPIO_ResetPins(LED_G_PORT, LED_G_PIN))
  26. #define LED_B_ON()      (GPIO_ResetPins(LED_B_PORT, LED_B_PIN))

  27. #define LED_R_OFF()     (GPIO_SetPins(LED_R_PORT, LED_R_PIN))
  28. #define LED_G_OFF()     (GPIO_SetPins(LED_G_PORT, LED_G_PIN))
  29. #define LED_B_OFF()     (GPIO_SetPins(LED_B_PORT, LED_B_PIN))

  30. #define LED_R_TOGGLE()  (GPIO_TogglePins(LED_R_PORT, LED_R_PIN))
  31. #define LED_G_TOGGLE()  (GPIO_TogglePins(LED_G_PORT, LED_G_PIN))
  32. #define LED_B_TOGGLE()  (GPIO_TogglePins(LED_B_PORT, LED_B_PIN))
  33. #define LED_RGB_TOGGLE()                                                        \
  34.         (GPIO_TogglePins(LED_RGB_PORT, LED_R_PIN | LED_G_PIN | LED_B_PIN))

  35. #define LED_RGB_ON()    (GPIO_ResetPins(LED_RGB_PORT, LED_R_PIN | LED_G_PIN | LED_B_PIN))
  36. #define LED_RGB_OFF()   (GPIO_SetPins(LED_RGB_PORT, LED_R_PIN | LED_G_PIN | LED_B_PIN))

  37. #define DLY_MS  (500UL)

  38. #define LCD_SCL_0  (GPIO_ResetPins(LED_B_PORT, GPIO_PIN_0))
  39. #define LCD_SCL_1  (GPIO_SetPins(LED_R_PORT, GPIO_PIN_0))
  40. #define LCD_SDA_0  (GPIO_ResetPins(LED_B_PORT, GPIO_PIN_1))
  41. #define LCD_SDA_1  (GPIO_SetPins(LED_R_PORT, GPIO_PIN_1))
  42. #define LCD_RST_0  (GPIO_ResetPins(LED_B_PORT, GPIO_PIN_2))
  43. #define LCD_RST_1  (GPIO_SetPins(LED_R_PORT, GPIO_PIN_2))
  44. #define LCD_DC_0   (GPIO_ResetPins(LED_B_PORT, GPIO_PIN_3))
  45. #define LCD_DC_1   (GPIO_SetPins(LED_R_PORT, GPIO_PIN_3))

  46. #define XLevelL                0x00
  47. #define XLevelH                0x10
  48. #define XLevel                ((XLevelH&0x0F)*16+XLevelL)
  49. #define Max_Column        128
  50. #define Max_Row                64
  51. #define        Brightness        0xCF


  52. #define X_WIDTH 128
  53. #define Y_WIDTH 64


  54. unsigned char const Dot[]={   //图片--100x36
  55. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x80,
  56. 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
  57. 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
  58. 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
  59. 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
  60. 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
  61. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xF0,0xF8,0xFC,0xFE,0xFF,
  62. 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
  63. 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,0x3F,0x9F,0x9F,0xDF,0xCF,0xEF,0xEF,
  64. 0xE7,0xE7,0xF7,0xF7,0xF7,0xF7,0xF7,0xF3,0xF3,0xFB,0xFB,0xFB,0xFB,0xF9,0xF9,0xFD,
  65. 0xFD,0xFD,0xFD,0xFD,0xFD,0xFD,0xFD,0xFD,0xFD,0xFD,0xFD,0xFD,0xFD,0xFD,0xFD,0xFD,
  66. 0xFD,0xFD,0xFD,0xFD,0xFD,0xFD,0xFD,0xFC,0xFC,0xFC,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,
  67. 0xFC,0xFC,0xF8,0xF0,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,
  68. 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
  69. 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,0x3F,0x0F,0x07,0x03,0xF8,0xFA,0xFB,0xBB,0xBB,
  70. 0x9B,0xBB,0xBB,0x3B,0x03,0x03,0x03,0x83,0xE3,0x73,0xFB,0xF3,0x83,0x03,0x03,0xC3,
  71. 0xE3,0xF3,0xF3,0xFB,0xBB,0x73,0x73,0x33,0x03,0xFB,0xFB,0xFB,0xBB,0x9B,0xBB,0xBB,
  72. 0xBB,0x03,0x03,0x03,0x83,0xE3,0x73,0x7B,0xFB,0x83,0x03,0x03,0xFB,0xFB,0x3B,0x3B,
  73. 0x7B,0xF3,0xF7,0xEF,0x1F,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  74. 0x00,0x00,0x00,0x03,0x07,0x0F,0x1F,0x3F,0x3F,0x3F,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,
  75. 0x7F,0x7F,0x3F,0x3F,0x1F,0x1F,0x0F,0x07,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,
  76. 0x7F,0x7F,0x73,0x73,0x73,0x73,0x73,0x21,0x30,0x7E,0x3F,0x1F,0x0F,0x0C,0x0F,0x3F,
  77. 0x7F,0x78,0x38,0x01,0x7B,0x73,0x73,0x73,0x7B,0x3F,0x3F,0x1F,0x00,0x7F,0x7F,0x73,
  78. 0x73,0x73,0x73,0x73,0x73,0x30,0x7C,0x3F,0x1F,0x0F,0x0C,0x0F,0x3F,0x7F,0x78,0x00,
  79. 0x7F,0x7F,0x0F,0x0F,0x1F,0x3F,0x3F,0x7B,0x30,0x01,0x7F,0xFF,0xFF,0x00,0x00,0x00,
  80. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  81. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  82. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  83. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  84. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  85. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  86. 0x00,0x00,0x00,0x00};



  87. //======================================

  88. const unsigned char F6x8[][6] =
  89. {
  90.     { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },   // sp
  91.     { 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00 },   // !
  92.     { 0x00, 0x00, 0x07, 0x00, 0x07, 0x00 },   // "
  93.     { 0x00, 0x14, 0x7f, 0x14, 0x7f, 0x14 },   // #
  94.     { 0x00, 0x24, 0x2a, 0x7f, 0x2a, 0x12 },   // $
  95.     { 0x00, 0x62, 0x64, 0x08, 0x13, 0x23 },   // %
  96.     { 0x00, 0x36, 0x49, 0x55, 0x22, 0x50 },   // &
  97.     { 0x00, 0x00, 0x05, 0x03, 0x00, 0x00 },   // '
  98.     { 0x00, 0x00, 0x1c, 0x22, 0x41, 0x00 },   // (
  99.     { 0x00, 0x00, 0x41, 0x22, 0x1c, 0x00 },   // )
  100.     { 0x00, 0x14, 0x08, 0x3E, 0x08, 0x14 },   // *
  101.     { 0x00, 0x08, 0x08, 0x3E, 0x08, 0x08 },   // +
  102.     { 0x00, 0x00, 0x00, 0xA0, 0x60, 0x00 },   // ,
  103.     { 0x00, 0x08, 0x08, 0x08, 0x08, 0x08 },   // -
  104.     { 0x00, 0x00, 0x60, 0x60, 0x00, 0x00 },   // .
  105.     { 0x00, 0x20, 0x10, 0x08, 0x04, 0x02 },   // /
  106.     { 0x00, 0x3E, 0x51, 0x49, 0x45, 0x3E },   // 0
  107.     { 0x00, 0x00, 0x42, 0x7F, 0x40, 0x00 },   // 1
  108.     { 0x00, 0x42, 0x61, 0x51, 0x49, 0x46 },   // 2
  109.     { 0x00, 0x21, 0x41, 0x45, 0x4B, 0x31 },   // 3
  110.     { 0x00, 0x18, 0x14, 0x12, 0x7F, 0x10 },   // 4
  111.     { 0x00, 0x27, 0x45, 0x45, 0x45, 0x39 },   // 5
  112.     { 0x00, 0x3C, 0x4A, 0x49, 0x49, 0x30 },   // 6
  113.     { 0x00, 0x01, 0x71, 0x09, 0x05, 0x03 },   // 7
  114.     { 0x00, 0x36, 0x49, 0x49, 0x49, 0x36 },   // 8
  115.     { 0x00, 0x06, 0x49, 0x49, 0x29, 0x1E },   // 9
  116.     { 0x00, 0x00, 0x36, 0x36, 0x00, 0x00 },   // :
  117.     { 0x00, 0x00, 0x56, 0x36, 0x00, 0x00 },   // ;
  118.     { 0x00, 0x08, 0x14, 0x22, 0x41, 0x00 },   // <
  119.     { 0x00, 0x14, 0x14, 0x14, 0x14, 0x14 },   // =
  120.     { 0x00, 0x00, 0x41, 0x22, 0x14, 0x08 },   // >
  121.     { 0x00, 0x02, 0x01, 0x51, 0x09, 0x06 },   // ?
  122.     { 0x00, 0x32, 0x49, 0x59, 0x51, 0x3E },   // @
  123.     { 0x00, 0x7C, 0x12, 0x11, 0x12, 0x7C },   // A
  124.     { 0x00, 0x7F, 0x49, 0x49, 0x49, 0x36 },   // B
  125.     { 0x00, 0x3E, 0x41, 0x41, 0x41, 0x22 },   // C
  126.     { 0x00, 0x7F, 0x41, 0x41, 0x22, 0x1C },   // D
  127.     { 0x00, 0x7F, 0x49, 0x49, 0x49, 0x41 },   // E
  128.     { 0x00, 0x7F, 0x09, 0x09, 0x09, 0x01 },   // F
  129.     { 0x00, 0x3E, 0x41, 0x49, 0x49, 0x7A },   // G
  130.     { 0x00, 0x7F, 0x08, 0x08, 0x08, 0x7F },   // H
  131.     { 0x00, 0x00, 0x41, 0x7F, 0x41, 0x00 },   // I
  132.     { 0x00, 0x20, 0x40, 0x41, 0x3F, 0x01 },   // J
  133.     { 0x00, 0x7F, 0x08, 0x14, 0x22, 0x41 },   // K
  134.     { 0x00, 0x7F, 0x40, 0x40, 0x40, 0x40 },   // L
  135.     { 0x00, 0x7F, 0x02, 0x0C, 0x02, 0x7F },   // M
  136.     { 0x00, 0x7F, 0x04, 0x08, 0x10, 0x7F },   // N
  137.     { 0x00, 0x3E, 0x41, 0x41, 0x41, 0x3E },   // O
  138.     { 0x00, 0x7F, 0x09, 0x09, 0x09, 0x06 },   // P
  139.     { 0x00, 0x3E, 0x41, 0x51, 0x21, 0x5E },   // Q
  140.     { 0x00, 0x7F, 0x09, 0x19, 0x29, 0x46 },   // R
  141.     { 0x00, 0x46, 0x49, 0x49, 0x49, 0x31 },   // S
  142.     { 0x00, 0x01, 0x01, 0x7F, 0x01, 0x01 },   // T
  143.     { 0x00, 0x3F, 0x40, 0x40, 0x40, 0x3F },   // U
  144.     { 0x00, 0x1F, 0x20, 0x40, 0x20, 0x1F },   // V
  145.     { 0x00, 0x3F, 0x40, 0x38, 0x40, 0x3F },   // W
  146.     { 0x00, 0x63, 0x14, 0x08, 0x14, 0x63 },   // X
  147.     { 0x00, 0x07, 0x08, 0x70, 0x08, 0x07 },   // Y
  148.     { 0x00, 0x61, 0x51, 0x49, 0x45, 0x43 },   // Z
  149.     { 0x00, 0x00, 0x7F, 0x41, 0x41, 0x00 },   // [
  150.     { 0x00, 0x55, 0x2A, 0x55, 0x2A, 0x55 },   // 55
  151.     { 0x00, 0x00, 0x41, 0x41, 0x7F, 0x00 },   // ]
  152.     { 0x00, 0x04, 0x02, 0x01, 0x02, 0x04 },   // ^
  153.     { 0x00, 0x40, 0x40, 0x40, 0x40, 0x40 },   // _
  154.     { 0x00, 0x00, 0x01, 0x02, 0x04, 0x00 },   // '
  155.     { 0x00, 0x20, 0x54, 0x54, 0x54, 0x78 },   // a
  156.     { 0x00, 0x7F, 0x48, 0x44, 0x44, 0x38 },   // b
  157.     { 0x00, 0x38, 0x44, 0x44, 0x44, 0x20 },   // c
  158.     { 0x00, 0x38, 0x44, 0x44, 0x48, 0x7F },   // d
  159.     { 0x00, 0x38, 0x54, 0x54, 0x54, 0x18 },   // e
  160.     { 0x00, 0x08, 0x7E, 0x09, 0x01, 0x02 },   // f
  161.     { 0x00, 0x18, 0xA4, 0xA4, 0xA4, 0x7C },   // g
  162.     { 0x00, 0x7F, 0x08, 0x04, 0x04, 0x78 },   // h
  163.     { 0x00, 0x00, 0x44, 0x7D, 0x40, 0x00 },   // i
  164.     { 0x00, 0x40, 0x80, 0x84, 0x7D, 0x00 },   // j
  165.     { 0x00, 0x7F, 0x10, 0x28, 0x44, 0x00 },   // k
  166.     { 0x00, 0x00, 0x41, 0x7F, 0x40, 0x00 },   // l
  167.     { 0x00, 0x7C, 0x04, 0x18, 0x04, 0x78 },   // m
  168.     { 0x00, 0x7C, 0x08, 0x04, 0x04, 0x78 },   // n
  169.     { 0x00, 0x38, 0x44, 0x44, 0x44, 0x38 },   // o
  170.     { 0x00, 0xFC, 0x24, 0x24, 0x24, 0x18 },   // p
  171.     { 0x00, 0x18, 0x24, 0x24, 0x18, 0xFC },   // q
  172.     { 0x00, 0x7C, 0x08, 0x04, 0x04, 0x08 },   // r
  173.     { 0x00, 0x48, 0x54, 0x54, 0x54, 0x20 },   // s
  174.     { 0x00, 0x04, 0x3F, 0x44, 0x40, 0x20 },   // t
  175.     { 0x00, 0x3C, 0x40, 0x40, 0x20, 0x7C },   // u
  176.     { 0x00, 0x1C, 0x20, 0x40, 0x20, 0x1C },   // v
  177.     { 0x00, 0x3C, 0x40, 0x30, 0x40, 0x3C },   // w
  178.     { 0x00, 0x44, 0x28, 0x10, 0x28, 0x44 },   // x
  179.     { 0x00, 0x1C, 0xA0, 0xA0, 0xA0, 0x7C },   // y
  180.     { 0x00, 0x44, 0x64, 0x54, 0x4C, 0x44 },   // z
  181.     { 0x14, 0x14, 0x14, 0x14, 0x14, 0x14 }    // horiz lines
  182. };


  183. const unsigned char F8X16[]=
  184. {
  185.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,// 0
  186.   0x00,0x00,0x00,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x30,0x00,0x00,0x00,//!1
  187.   0x00,0x10,0x0C,0x06,0x10,0x0C,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//"2
  188.   0x40,0xC0,0x78,0x40,0xC0,0x78,0x40,0x00,0x04,0x3F,0x04,0x04,0x3F,0x04,0x04,0x00,//#3
  189.   0x00,0x70,0x88,0xFC,0x08,0x30,0x00,0x00,0x00,0x18,0x20,0xFF,0x21,0x1E,0x00,0x00,//$4
  190.   0xF0,0x08,0xF0,0x00,0xE0,0x18,0x00,0x00,0x00,0x21,0x1C,0x03,0x1E,0x21,0x1E,0x00,//%5
  191.   0x00,0xF0,0x08,0x88,0x70,0x00,0x00,0x00,0x1E,0x21,0x23,0x24,0x19,0x27,0x21,0x10,//&6
  192.   0x10,0x16,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//'7
  193.   0x00,0x00,0x00,0xE0,0x18,0x04,0x02,0x00,0x00,0x00,0x00,0x07,0x18,0x20,0x40,0x00,//(8
  194.   0x00,0x02,0x04,0x18,0xE0,0x00,0x00,0x00,0x00,0x40,0x20,0x18,0x07,0x00,0x00,0x00,//)9
  195.   0x40,0x40,0x80,0xF0,0x80,0x40,0x40,0x00,0x02,0x02,0x01,0x0F,0x01,0x02,0x02,0x00,//*10
  196.   0x00,0x00,0x00,0xF0,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x1F,0x01,0x01,0x01,0x00,//+11
  197.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xB0,0x70,0x00,0x00,0x00,0x00,0x00,//,12
  198.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,//-13
  199.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,0x00,0x00,//.14
  200.   0x00,0x00,0x00,0x00,0x80,0x60,0x18,0x04,0x00,0x60,0x18,0x06,0x01,0x00,0x00,0x00,///15
  201.   0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x0F,0x10,0x20,0x20,0x10,0x0F,0x00,//016
  202.   0x00,0x10,0x10,0xF8,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//117
  203.   0x00,0x70,0x08,0x08,0x08,0x88,0x70,0x00,0x00,0x30,0x28,0x24,0x22,0x21,0x30,0x00,//218
  204.   0x00,0x30,0x08,0x88,0x88,0x48,0x30,0x00,0x00,0x18,0x20,0x20,0x20,0x11,0x0E,0x00,//319
  205.   0x00,0x00,0xC0,0x20,0x10,0xF8,0x00,0x00,0x00,0x07,0x04,0x24,0x24,0x3F,0x24,0x00,//420
  206.   0x00,0xF8,0x08,0x88,0x88,0x08,0x08,0x00,0x00,0x19,0x21,0x20,0x20,0x11,0x0E,0x00,//521
  207.   0x00,0xE0,0x10,0x88,0x88,0x18,0x00,0x00,0x00,0x0F,0x11,0x20,0x20,0x11,0x0E,0x00,//622
  208.   0x00,0x38,0x08,0x08,0xC8,0x38,0x08,0x00,0x00,0x00,0x00,0x3F,0x00,0x00,0x00,0x00,//723
  209.   0x00,0x70,0x88,0x08,0x08,0x88,0x70,0x00,0x00,0x1C,0x22,0x21,0x21,0x22,0x1C,0x00,//824
  210.   0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x00,0x31,0x22,0x22,0x11,0x0F,0x00,//925
  211.   0x00,0x00,0x00,0xC0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,//:26
  212.   0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x60,0x00,0x00,0x00,0x00,//;27
  213.   0x00,0x00,0x80,0x40,0x20,0x10,0x08,0x00,0x00,0x01,0x02,0x04,0x08,0x10,0x20,0x00,//<28
  214.   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x00,//=29
  215.   0x00,0x08,0x10,0x20,0x40,0x80,0x00,0x00,0x00,0x20,0x10,0x08,0x04,0x02,0x01,0x00,//>30
  216.   0x00,0x70,0x48,0x08,0x08,0x08,0xF0,0x00,0x00,0x00,0x00,0x30,0x36,0x01,0x00,0x00,//?31
  217.   0xC0,0x30,0xC8,0x28,0xE8,0x10,0xE0,0x00,0x07,0x18,0x27,0x24,0x23,0x14,0x0B,0x00,//@32
  218.   0x00,0x00,0xC0,0x38,0xE0,0x00,0x00,0x00,0x20,0x3C,0x23,0x02,0x02,0x27,0x38,0x20,//A33
  219.   0x08,0xF8,0x88,0x88,0x88,0x70,0x00,0x00,0x20,0x3F,0x20,0x20,0x20,0x11,0x0E,0x00,//B34
  220.   0xC0,0x30,0x08,0x08,0x08,0x08,0x38,0x00,0x07,0x18,0x20,0x20,0x20,0x10,0x08,0x00,//C35
  221.   0x08,0xF8,0x08,0x08,0x08,0x10,0xE0,0x00,0x20,0x3F,0x20,0x20,0x20,0x10,0x0F,0x00,//D36
  222.   0x08,0xF8,0x88,0x88,0xE8,0x08,0x10,0x00,0x20,0x3F,0x20,0x20,0x23,0x20,0x18,0x00,//E37
  223.   0x08,0xF8,0x88,0x88,0xE8,0x08,0x10,0x00,0x20,0x3F,0x20,0x00,0x03,0x00,0x00,0x00,//F38
  224.   0xC0,0x30,0x08,0x08,0x08,0x38,0x00,0x00,0x07,0x18,0x20,0x20,0x22,0x1E,0x02,0x00,//G39
  225.   0x08,0xF8,0x08,0x00,0x00,0x08,0xF8,0x08,0x20,0x3F,0x21,0x01,0x01,0x21,0x3F,0x20,//H40
  226.   0x00,0x08,0x08,0xF8,0x08,0x08,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//I41
  227.   0x00,0x00,0x08,0x08,0xF8,0x08,0x08,0x00,0xC0,0x80,0x80,0x80,0x7F,0x00,0x00,0x00,//J42
  228.   0x08,0xF8,0x88,0xC0,0x28,0x18,0x08,0x00,0x20,0x3F,0x20,0x01,0x26,0x38,0x20,0x00,//K43
  229.   0x08,0xF8,0x08,0x00,0x00,0x00,0x00,0x00,0x20,0x3F,0x20,0x20,0x20,0x20,0x30,0x00,//L44
  230.   0x08,0xF8,0xF8,0x00,0xF8,0xF8,0x08,0x00,0x20,0x3F,0x00,0x3F,0x00,0x3F,0x20,0x00,//M45
  231.   0x08,0xF8,0x30,0xC0,0x00,0x08,0xF8,0x08,0x20,0x3F,0x20,0x00,0x07,0x18,0x3F,0x00,//N46
  232.   0xE0,0x10,0x08,0x08,0x08,0x10,0xE0,0x00,0x0F,0x10,0x20,0x20,0x20,0x10,0x0F,0x00,//O47
  233.   0x08,0xF8,0x08,0x08,0x08,0x08,0xF0,0x00,0x20,0x3F,0x21,0x01,0x01,0x01,0x00,0x00,//P48
  234.   0xE0,0x10,0x08,0x08,0x08,0x10,0xE0,0x00,0x0F,0x18,0x24,0x24,0x38,0x50,0x4F,0x00,//Q49
  235.   0x08,0xF8,0x88,0x88,0x88,0x88,0x70,0x00,0x20,0x3F,0x20,0x00,0x03,0x0C,0x30,0x20,//R50
  236.   0x00,0x70,0x88,0x08,0x08,0x08,0x38,0x00,0x00,0x38,0x20,0x21,0x21,0x22,0x1C,0x00,//S51
  237.   0x18,0x08,0x08,0xF8,0x08,0x08,0x18,0x00,0x00,0x00,0x20,0x3F,0x20,0x00,0x00,0x00,//T52
  238.   0x08,0xF8,0x08,0x00,0x00,0x08,0xF8,0x08,0x00,0x1F,0x20,0x20,0x20,0x20,0x1F,0x00,//U53
  239.   0x08,0x78,0x88,0x00,0x00,0xC8,0x38,0x08,0x00,0x00,0x07,0x38,0x0E,0x01,0x00,0x00,//V54
  240.   0xF8,0x08,0x00,0xF8,0x00,0x08,0xF8,0x00,0x03,0x3C,0x07,0x00,0x07,0x3C,0x03,0x00,//W55
  241.   0x08,0x18,0x68,0x80,0x80,0x68,0x18,0x08,0x20,0x30,0x2C,0x03,0x03,0x2C,0x30,0x20,//X56
  242.   0x08,0x38,0xC8,0x00,0xC8,0x38,0x08,0x00,0x00,0x00,0x20,0x3F,0x20,0x00,0x00,0x00,//Y57
  243.   0x10,0x08,0x08,0x08,0xC8,0x38,0x08,0x00,0x20,0x38,0x26,0x21,0x20,0x20,0x18,0x00,//Z58
  244.   0x00,0x00,0x00,0xFE,0x02,0x02,0x02,0x00,0x00,0x00,0x00,0x7F,0x40,0x40,0x40,0x00,//[59
  245.   0x00,0x0C,0x30,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x06,0x38,0xC0,0x00,//\60
  246.   0x00,0x02,0x02,0x02,0xFE,0x00,0x00,0x00,0x00,0x40,0x40,0x40,0x7F,0x00,0x00,0x00,//]61
  247.   0x00,0x00,0x04,0x02,0x02,0x02,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//^62
  248.   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,//_63
  249.   0x00,0x02,0x02,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//`64
  250.   0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x19,0x24,0x22,0x22,0x22,0x3F,0x20,//a65
  251.   0x08,0xF8,0x00,0x80,0x80,0x00,0x00,0x00,0x00,0x3F,0x11,0x20,0x20,0x11,0x0E,0x00,//b66
  252.   0x00,0x00,0x00,0x80,0x80,0x80,0x00,0x00,0x00,0x0E,0x11,0x20,0x20,0x20,0x11,0x00,//c67
  253.   0x00,0x00,0x00,0x80,0x80,0x88,0xF8,0x00,0x00,0x0E,0x11,0x20,0x20,0x10,0x3F,0x20,//d68
  254.   0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x1F,0x22,0x22,0x22,0x22,0x13,0x00,//e69
  255.   0x00,0x80,0x80,0xF0,0x88,0x88,0x88,0x18,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//f70
  256.   0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x6B,0x94,0x94,0x94,0x93,0x60,0x00,//g71
  257.   0x08,0xF8,0x00,0x80,0x80,0x80,0x00,0x00,0x20,0x3F,0x21,0x00,0x00,0x20,0x3F,0x20,//h72
  258.   0x00,0x80,0x98,0x98,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//i73
  259.   0x00,0x00,0x00,0x80,0x98,0x98,0x00,0x00,0x00,0xC0,0x80,0x80,0x80,0x7F,0x00,0x00,//j74
  260.   0x08,0xF8,0x00,0x00,0x80,0x80,0x80,0x00,0x20,0x3F,0x24,0x02,0x2D,0x30,0x20,0x00,//k75
  261.   0x00,0x08,0x08,0xF8,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//l76
  262.   0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x20,0x3F,0x20,0x00,0x3F,0x20,0x00,0x3F,//m77
  263.   0x80,0x80,0x00,0x80,0x80,0x80,0x00,0x00,0x20,0x3F,0x21,0x00,0x00,0x20,0x3F,0x20,//n78
  264.   0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x1F,0x20,0x20,0x20,0x20,0x1F,0x00,//o79
  265.   0x80,0x80,0x00,0x80,0x80,0x00,0x00,0x00,0x80,0xFF,0xA1,0x20,0x20,0x11,0x0E,0x00,//p80
  266.   0x00,0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x0E,0x11,0x20,0x20,0xA0,0xFF,0x80,//q81
  267.   0x80,0x80,0x80,0x00,0x80,0x80,0x80,0x00,0x20,0x20,0x3F,0x21,0x20,0x00,0x01,0x00,//r82
  268.   0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x33,0x24,0x24,0x24,0x24,0x19,0x00,//s83
  269.   0x00,0x80,0x80,0xE0,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x1F,0x20,0x20,0x00,0x00,//t84
  270.   0x80,0x80,0x00,0x00,0x00,0x80,0x80,0x00,0x00,0x1F,0x20,0x20,0x20,0x10,0x3F,0x20,//u85
  271.   0x80,0x80,0x80,0x00,0x00,0x80,0x80,0x80,0x00,0x01,0x0E,0x30,0x08,0x06,0x01,0x00,//v86
  272.   0x80,0x80,0x00,0x80,0x00,0x80,0x80,0x80,0x0F,0x30,0x0C,0x03,0x0C,0x30,0x0F,0x00,//w87
  273.   0x00,0x80,0x80,0x00,0x80,0x80,0x80,0x00,0x00,0x20,0x31,0x2E,0x0E,0x31,0x20,0x00,//x88
  274.   0x80,0x80,0x80,0x00,0x00,0x80,0x80,0x80,0x80,0x81,0x8E,0x70,0x18,0x06,0x01,0x00,//y89
  275.   0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x21,0x30,0x2C,0x22,0x21,0x30,0x00,//z90
  276.   0x00,0x00,0x00,0x00,0x80,0x7C,0x02,0x02,0x00,0x00,0x00,0x00,0x00,0x3F,0x40,0x40,//{91
  277.   0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,//|92
  278.   0x00,0x02,0x02,0x7C,0x80,0x00,0x00,0x00,0x00,0x40,0x40,0x3F,0x00,0x00,0x00,0x00,//}93
  279.   0x00,0x06,0x01,0x01,0x02,0x02,0x04,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//~94

  280. };
  281. void delay(unsigned char x)
  282. {
  283.         unsigned char i;
  284.         for(i=0;i<x;i++);
  285. }

  286. void LCD_WrDat(unsigned char dat)
  287. {
  288.         unsigned char i=8;
  289.         //LCD_CS=0;;
  290.         LCD_DC_1;
  291. //        delay(1);
  292.   LCD_SCL_0;
  293. //  delay(1);   
  294.   while(i--)
  295.   {
  296.     if((dat&0x80)==0x80){LCD_SDA_1;}
  297.     else{LCD_SDA_0;}
  298. //        delay(1);
  299.     LCD_SCL_1;
  300. //    delay(1);
  301.                 //;;            
  302.     LCD_SCL_0;;
  303. //        delay(1);   
  304.     dat<<=1;   
  305.   }
  306.         //LCD_CS=1;
  307. }
  308. void LCD_WrCmd(unsigned char cmd)
  309. {
  310.         unsigned char i=8;
  311.        
  312.         //LCD_CS=0;;
  313.         LCD_DC_0;;
  314.         //delay(1);
  315.   LCD_SCL_0;;
  316.   //delay(1);
  317.   //;;   
  318.   while(i--)
  319.   {
  320.     if(cmd&0x80){LCD_SDA_1;}
  321.     else{LCD_SDA_0;;}
  322. //        delay(1);
  323.     LCD_SCL_1;;
  324. //        delay(1);
  325.     ;;;
  326.                 //;;            
  327.     LCD_SCL_0;;
  328. //        delay(5);   
  329.     cmd<<=1;;   
  330.   }        
  331.         //LCD_CS=1;
  332. }
  333. void LCD_Set_Pos(unsigned char x, unsigned char y)
  334. {
  335.   LCD_WrCmd(0xb0+y);
  336.   LCD_WrCmd(((x&0xf0)>>4)|0x10);
  337.   LCD_WrCmd((x&0x0f)|0x00);
  338. }
  339. void LCD_Fill(unsigned char bmp_dat)
  340. {
  341.         unsigned char y,x;
  342.        
  343.         for(y=0;y<8;y++)
  344.         {
  345.                 LCD_WrCmd(0xb0+y);
  346.                 LCD_WrCmd(0x01);
  347.                 LCD_WrCmd(0x10);
  348.                 for(x=0;x<X_WIDTH;x++)
  349.                         LCD_WrDat(bmp_dat);
  350.         }
  351. }
  352. void LCD_CLS(void)
  353. {
  354.         unsigned char y,x;       
  355.         for(y=0;y<8;y++)
  356.         {
  357.                 LCD_WrCmd(0xb0+y);
  358.                 LCD_WrCmd(0x01);
  359.                 LCD_WrCmd(0x10);
  360.                 for(x=0;x<X_WIDTH;x++)
  361.                         LCD_WrDat(0);
  362.         }
  363. }
  364. void LCD_DLY_ms(unsigned int ms)
  365. {   
  366.         unsigned int i;                     
  367.         while(ms--)
  368.         {
  369.                 //GCC_DELAY(2000);//编译器自带延时指定个周期,在主频8Mhz下,一个指令周期为0.5us       
  370.                 //GCC_CLRWDT();
  371.                 for(i=0;i<60000;i++);
  372.         }
  373. }
  374. void LCD_Init(void)        
  375. {  

  376.        
  377.         LCD_SCL_1;
  378.         //LCD_CS=1;        //预制SLK和SS为高电平         
  379.         LCD_RST_0;
  380.         LCD_DLY_ms(50);
  381.         LCD_RST_1;
  382.        
  383.         //从上电到下面开始初始化要有足够的时间,即等待RC复位完毕   
  384.   
  385.   LCD_WrCmd(0xae);//--turn off oled panel
  386.   LCD_WrCmd(0x00);//---set low column address
  387.   LCD_WrCmd(0x10);//---set high column address
  388.   LCD_WrCmd(0x40);//--set start line address  Set Mapping RAM Display Start Line (0x00~0x3F)
  389.   LCD_WrCmd(0x81);//--set contrast control register
  390.   LCD_WrCmd(0xcf); // Set SEG Output Current Brightness
  391.   LCD_WrCmd(0xa1);//--Set SEG/Column Mapping     0xa0左右反置 0xa1正常
  392.   LCD_WrCmd(0xc8);//Set COM/Row Scan Direction   0xc0上下反置 0xc8正常
  393.   LCD_WrCmd(0xa6);//--set normal display
  394.   LCD_WrCmd(0xa8);//--set multiplex ratio(1 to 64)
  395.   LCD_WrCmd(0x3f);//--1/64 duty
  396.   LCD_WrCmd(0xd3);//-set display offset        Shift Mapping RAM Counter (0x00~0x3F)
  397.   LCD_WrCmd(0x00);//-not offset
  398.   LCD_WrCmd(0xd5);//--set display clock divide ratio/oscillator frequency
  399.   LCD_WrCmd(0x80);//--set divide ratio, Set Clock as 100 Frames/Sec
  400.   LCD_WrCmd(0xd9);//--set pre-charge period
  401.   LCD_WrCmd(0xf1);//Set Pre-Charge as 15 Clocks & Discharge as 1 Clock
  402.   LCD_WrCmd(0xda);//--set com pins hardware configuration
  403.   LCD_WrCmd(0x12);
  404.   LCD_WrCmd(0xdb);//--set vcomh
  405.   LCD_WrCmd(0x40);//Set VCOM Deselect Level
  406.   LCD_WrCmd(0x20);//-Set Page Addressing Mode (0x00/0x01/0x02)
  407.   LCD_WrCmd(0x02);//
  408.   LCD_WrCmd(0x8d);//--set Charge Pump enable/disable
  409.   LCD_WrCmd(0x14);//--set(0x10) disable
  410.   LCD_WrCmd(0xa4);// Disable Entire Display On (0xa4/0xa5)
  411.   LCD_WrCmd(0xa6);// Disable Inverse Display On (0xa6/a7)
  412.   LCD_WrCmd(0xaf);//--turn on oled panel
  413.   LCD_Fill(0x00);  //初始清屏
  414.   LCD_Set_Pos(0,0);        
  415. }

  416. //==============================================================
  417. //函数名: void LCD_PutPixel(byte x,byte y)
  418. //功能描述:绘制一个点(x,y)
  419. //参数:真实坐标值(x,y),x的范围0~127,y的范围0~64
  420. //返回:无
  421. //==============================================================
  422. void LCD_PutPixel(unsigned char  x,unsigned char  y)
  423. {
  424.         unsigned char  data1;  //data1当前点的数据
  425.          
  426.   LCD_Set_Pos(x,y);
  427.         data1 = 0x01<<(y%8);        
  428.         LCD_WrCmd(0xb0+(y>>3));
  429.         LCD_WrCmd(((x&0xf0)>>4)|0x10);
  430.         LCD_WrCmd((x&0x0f)|0x00);
  431.         LCD_WrDat(data1);                 
  432. }
  433. //==============================================================
  434. //函数名: void LCD_Rectangle(byte x1,byte y1,
  435. //                   byte x2,byte y2,byte color,byte gif)
  436. //功能描述:绘制一个实心矩形
  437. //参数:左上角坐标(x1,y1),右下角坐标(x2,y2)
  438. //      其中x1、x2的范围0~127,y1,y2的范围0~63,即真实坐标值
  439. //返回:无
  440. //==============================================================
  441. void LCD_Rectangle(unsigned char  x1,unsigned char  y1,unsigned char  x2,unsigned char  y2,unsigned char  gif)
  442. {
  443.         unsigned char  n;
  444.                
  445.         LCD_Set_Pos(x1,y1>>3);
  446.         for(n=x1;n<=x2;n++)
  447.         {
  448.                 LCD_WrDat(0x01<<(y1%8));                        
  449.                 if(gif == 1)         LCD_DLY_ms(50);
  450.         }  
  451.         LCD_Set_Pos(x1,y2>>3);
  452.   for(n=x1;n<=x2;n++)
  453.         {
  454.                 LCD_WrDat(0x01<<(y2%8));                        
  455.                 if(gif == 1)         LCD_DLY_ms(5);
  456.         }
  457.        
  458. }  

  459. //==============================================================
  460. //函数名:LCD_P6x8Str(unsigned char x,unsigned char y,unsigned char *p)
  461. //功能描述:写入一组标准ASCII字符串
  462. //参数:显示的位置(x,y),y为页范围0~7,要显示的字符串
  463. //返回:无
  464. //==============================================================  
  465. void LCD_P6x8Str(unsigned char x,unsigned char y,unsigned char ch[])
  466. {
  467.   unsigned char c=0,i=0,j=0;      
  468.   while (ch[j]!='\0')
  469.   {   
  470.     c =ch[j]-32;
  471.     if(x>126){x=0;y++;}
  472.     LCD_Set_Pos(x,y);   
  473.           for(i=0;i<6;i++)     
  474.             LCD_WrDat(F6x8[c][i]);  
  475.           x+=6;
  476.           j++;
  477.   }
  478. }

  479. void LCD_P8x16Str(unsigned char x,unsigned char y,unsigned char ch[])
  480. {
  481.   unsigned char c=0,i=0,j=0;
  482.         
  483.   while (ch[j]!='\0')
  484.   {   
  485.     c =ch[j]-32;
  486.     if(x>120){x=0;y++;}
  487.     LCD_Set_Pos(x,y);   
  488.           for(i=0;i<8;i++)     
  489.             LCD_WrDat(F8X16[c*16+i]);
  490.           LCD_Set_Pos(x,y+1);   
  491.           for(i=0;i<8;i++)     
  492.             LCD_WrDat(F8X16[c*16+i+8]);  
  493.           x+=8;
  494.           j++;
  495.   }
  496. }
  497. void LCD_P8x16Char(unsigned char x,unsigned char y,unsigned char ch)
  498. {
  499.   unsigned char c=0,i=0;
  500.         
  501.       
  502.     c =ch-32;
  503.     if(x>120){x=0;y++;}
  504.     LCD_Set_Pos(x,y);   
  505.           for(i=0;i<8;i++)     
  506.             LCD_WrDat(F8X16[c*16+i]);
  507.           LCD_Set_Pos(x,y+1);   
  508.           for(i=0;i<8;i++)     
  509.             LCD_WrDat(F8X16[c*16+i+8]);  
  510.           x+=8;
  511.          
  512. }


  513. //==============================================================
  514. //函数名: void Draw_BMP(byte x,byte y)
  515. //功能描述:显示BMP图片128×64
  516. //参数:起始点坐标(x,y),x的范围0~127,y为页的范围0~7
  517. //返回:无
  518. //==============================================================
  519. void Draw_BMP(unsigned char  x0,unsigned char  y0,unsigned char  x1,unsigned char  y1,unsigned char bmp[])
  520. {        
  521.   unsigned int  ii=0;
  522.   unsigned char  x,y;
  523.   
  524.           if(y1%8==0) y=y1/8;      
  525.           else y=y1/8+1;
  526.         for(y=y0;y<=y1;y++)
  527.         {
  528.                 LCD_Set_Pos(x0,y);                               
  529.             for(x=x0;x<x1;x++)
  530.             {      
  531.                     LCD_WrDat(bmp[ii++]);                   
  532.             }
  533.         }
  534. }
  535. /*******************************************************************************
  536. * Global variable definitions (declared in header file with 'extern')
  537. ******************************************************************************/

  538. /*******************************************************************************
  539. * Local function prototypes ('static')
  540. ******************************************************************************/

  541. /*******************************************************************************
  542. * Local variable definitions ('static')
  543. ******************************************************************************/

  544. /*******************************************************************************
  545. * Function implementation - global ('extern') and local ('static')
  546. ******************************************************************************/
  547. /**
  548. * [url=home.php?mod=space&uid=247401]@brief[/url]  Main function of GPIO project
  549. * @param  None
  550. * @retval int32_t return value, if needed
  551. */
  552. int32_t main(void)
  553. {
  554.     stc_gpio_init_t stcGpioInit;

  555.     GPIO_StructInit(&stcGpioInit);

  556.     /* Reset all LED pin to default */
  557.     GPIO_Init(LED_RGB_PORT, (LED_R_PIN | LED_G_PIN | LED_B_PIN), &stcGpioInit);
  558.                 GPIO_Init(LED_RGB_PORT, (GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3), &stcGpioInit);
  559.     /* "Turn off" LED before set to output */
  560.     LED_RGB_OFF();

  561.     /* Output enable */
  562.     GPIO_OE(LED_RGB_PORT, (LED_R_PIN | LED_G_PIN | LED_B_PIN), Enable);
  563.                 GPIO_OE(LED_RGB_PORT, (GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3), Enable);
  564.                 LCD_Init();
  565.      LCD_CLS();
  566.         LCD_P8x16Str(45,5,(u8*)"EASEAR");
  567.         LCD_P6x8Str(0,7,(u8*)"www.holteksupport.com");
  568.         Draw_BMP(0,0,100,3,(u8*)Dot);
  569.     while (1)
  570.     {
  571.         /* LED Red */
  572.         LED_R_ON();
  573.         DDL_Delay1ms(DLY_MS);
  574.         LED_R_OFF();
  575.         DDL_Delay1ms(DLY_MS);

  576.         /* LED Green */
  577.         LED_G_ON();
  578.         DDL_Delay1ms(DLY_MS);
  579.         LED_G_OFF();
  580.         DDL_Delay1ms(DLY_MS);

  581.         /* LED Blue */
  582.         LED_B_ON();
  583.         DDL_Delay1ms(DLY_MS);
  584.         LED_B_OFF();
  585.         DDL_Delay1ms(DLY_MS);

  586.         /* LED Red/Green/Bule */
  587.         LED_RGB_ON();
  588.         DDL_Delay1ms(DLY_MS);
  589.         LED_RGB_OFF();
  590.         DDL_Delay1ms(DLY_MS);

  591.         /* De-init port if necessary */
  592.         //GPIO_DeInit();
  593.     }
  594. }

  595. /**
  596. * @}
  597. */

  598. /**
  599. * @}
  600. */

  601. /*******************************************************************************
  602. * EOF (not truncated)
  603. ******************************************************************************/
效果图:
2.jpg
yang377156216 发表于 2024-12-9 13:33 | 显示全部楼层
好老的芯片
您需要登录后才可以回帖 登录 | 注册

本版积分规则

470

主题

3535

帖子

7

粉丝
快速回复 在线客服 返回列表 返回顶部

470

主题

3535

帖子

7

粉丝
快速回复 在线客服 返回列表 返回顶部