lcd_font.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*!
  2. \file lcd_font.h
  3. \brief the header file of LCD font
  4. \version 2017-02-10, V1.0.0, firmware for GD32F30x
  5. \version 2018-10-10, V1.1.0, firmware for GD32F30x
  6. \version 2018-12-25, V2.0.0, firmware for GD32F30x
  7. */
  8. /*
  9. Copyright (c) 2018, GigaDevice Semiconductor Inc.
  10. All rights reserved.
  11. Redistribution and use in source and binary forms, with or without modification,
  12. are permitted provided that the following conditions are met:
  13. 1. Redistributions of source code must retain the above copyright notice, this
  14. list of conditions and the following disclaimer.
  15. 2. Redistributions in binary form must reproduce the above copyright notice,
  16. this list of conditions and the following disclaimer in the documentation
  17. and/or other materials provided with the distribution.
  18. 3. Neither the name of the copyright holder nor the names of its contributors
  19. may be used to endorse or promote products derived from this software without
  20. specific prior written permission.
  21. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  22. AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  23. WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  24. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  25. INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  26. NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  27. PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  28. WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  29. ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
  30. OF SUCH DAMAGE.
  31. */
  32. #ifndef LCD_FONTS_H
  33. #define LCD_FONTS_H
  34. #include <stdint.h>
  35. typedef struct {
  36. const uint16_t *table;
  37. uint16_t width;
  38. uint16_t height;
  39. } font_struct;
  40. typedef struct
  41. {
  42. unsigned char index[3];
  43. char mask[32];
  44. } typefont_GB162;
  45. typedef struct
  46. {
  47. unsigned char index[3];
  48. char mask[72];
  49. } typefont_GB242;
  50. #define hz16_num 100
  51. #define hz24_num 100
  52. extern font_struct font16x24;
  53. extern font_struct font12x12;
  54. extern font_struct font8x16;
  55. extern font_struct font8x12;
  56. extern font_struct font8x8;
  57. extern const unsigned char ASCII16[];
  58. extern const unsigned char sz32[];
  59. extern const typefont_GB162 hz16[];
  60. extern const typefont_GB242 hz24[];
  61. #define LINE(x) ((x) * (((font_struct *)lcd_font_get())->height))
  62. #endif /* LCD_FONTS_H */