add gd32E507 iar project for tos
add gd32E507 iar project for tos
This commit is contained in:
165
board/GigaDevice_GD32E507Z_EVAL/BSP/Inc/gd32e507z_eval.h
Normal file
165
board/GigaDevice_GD32E507Z_EVAL/BSP/Inc/gd32e507z_eval.h
Normal file
@@ -0,0 +1,165 @@
|
||||
/*!
|
||||
\file gd32e507z_eval.h
|
||||
\brief definitions for GD32E507Z_EVAL's leds, keys and COM ports hardware resources
|
||||
|
||||
\version 2020-06-30, V1.0.0, demo for GD32E50x
|
||||
\version 2020-08-26, V1.1.0, demo for GD32E50x
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (c) 2020, GigaDevice Semiconductor Inc.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
3. Neither the name of the copyright holder nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef GD32E507Z_EVAL_H
|
||||
#define GD32E507Z_EVAL_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "gd32e50x.h"
|
||||
|
||||
/* exported types */
|
||||
typedef enum
|
||||
{
|
||||
LED1 = 0,
|
||||
LED2 = 1,
|
||||
LED3 = 2,
|
||||
LED4 = 3
|
||||
} led_typedef_enum;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
KEY_A = 0,
|
||||
KEY_B = 1,
|
||||
KEY_C = 2,
|
||||
KEY_D = 3,
|
||||
KEY_CET = 4
|
||||
} key_typedef_enum;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
KEY_MODE_GPIO = 0,
|
||||
KEY_MODE_EXTI = 1
|
||||
} keymode_typedef_enum;
|
||||
|
||||
/* eval board low layer led */
|
||||
#define LEDn 4U
|
||||
|
||||
#define LED1_PIN GPIO_PIN_10
|
||||
#define LED1_GPIO_PORT GPIOG
|
||||
#define LED1_GPIO_CLK RCU_GPIOG
|
||||
|
||||
#define LED2_PIN GPIO_PIN_11
|
||||
#define LED2_GPIO_PORT GPIOG
|
||||
#define LED2_GPIO_CLK RCU_GPIOG
|
||||
|
||||
#define LED3_PIN GPIO_PIN_12
|
||||
#define LED3_GPIO_PORT GPIOG
|
||||
#define LED3_GPIO_CLK RCU_GPIOG
|
||||
|
||||
#define LED4_PIN GPIO_PIN_13
|
||||
#define LED4_GPIO_PORT GPIOG
|
||||
#define LED4_GPIO_CLK RCU_GPIOG
|
||||
|
||||
#define COMn 1U
|
||||
|
||||
#define EVAL_COM0 USART0
|
||||
#define EVAL_COM0_CLK RCU_USART0
|
||||
#define EVAL_COM0_TX_PIN GPIO_PIN_9
|
||||
#define EVAL_COM0_RX_PIN GPIO_PIN_10
|
||||
#define EVAL_COM0_GPIO_PORT GPIOA
|
||||
#define EVAL_COM0_GPIO_CLK RCU_GPIOA
|
||||
|
||||
#define KEYn 5U
|
||||
|
||||
/* wakeup push-button */
|
||||
#define KEY_A_PIN GPIO_PIN_0
|
||||
#define KEY_A_GPIO_PORT GPIOA
|
||||
#define KEY_A_GPIO_CLK RCU_GPIOA
|
||||
#define KEY_A_EXTI_LINE EXTI_0
|
||||
#define KEY_A_EXTI_PORT_SOURCE GPIO_PORT_SOURCE_GPIOA
|
||||
#define KEY_A_EXTI_PIN_SOURCE GPIO_PIN_SOURCE_0
|
||||
#define KEY_A_EXTI_IRQn EXTI0_IRQn
|
||||
|
||||
/* tamper push-button */
|
||||
#define KEY_B_PIN GPIO_PIN_13
|
||||
#define KEY_B_GPIO_PORT GPIOC
|
||||
#define KEY_B_GPIO_CLK RCU_GPIOC
|
||||
#define KEY_B_EXTI_LINE EXTI_13
|
||||
#define KEY_B_EXTI_PORT_SOURCE GPIO_PORT_SOURCE_GPIOC
|
||||
#define KEY_B_EXTI_PIN_SOURCE GPIO_PIN_SOURCE_13
|
||||
#define KEY_B_EXTI_IRQn EXTI10_15_IRQn
|
||||
|
||||
/* user push-button */
|
||||
#define KEY_C_PIN GPIO_PIN_13
|
||||
#define KEY_C_GPIO_PORT GPIOF
|
||||
#define KEY_C_GPIO_CLK RCU_GPIOF
|
||||
#define KEY_C_EXTI_LINE EXTI_13
|
||||
#define KEY_C_EXTI_PORT_SOURCE GPIO_PORT_SOURCE_GPIOF
|
||||
#define KEY_C_EXTI_PIN_SOURCE GPIO_PIN_SOURCE_13
|
||||
#define KEY_C_EXTI_IRQn EXTI10_15_IRQn
|
||||
|
||||
/* extension push-button */
|
||||
#define KEY_D_PIN GPIO_PIN_14
|
||||
#define KEY_D_GPIO_PORT GPIOF
|
||||
#define KEY_D_GPIO_CLK RCU_GPIOF
|
||||
#define KEY_D_EXTI_LINE EXTI_14
|
||||
#define KEY_D_EXTI_PORT_SOURCE GPIO_PORT_SOURCE_GPIOF
|
||||
#define KEY_D_EXTI_PIN_SOURCE GPIO_PIN_SOURCE_14
|
||||
#define KEY_D_EXTI_IRQn EXTI10_15_IRQn
|
||||
|
||||
/* extension push-button */
|
||||
#define KEY_CET_PIN GPIO_PIN_15
|
||||
#define KEY_CET_GPIO_PORT GPIOF
|
||||
#define KEY_CET_GPIO_CLK RCU_GPIOF
|
||||
#define KEY_CET_EXTI_LINE EXTI_15
|
||||
#define KEY_CET_EXTI_PORT_SOURCE GPIO_PORT_SOURCE_GPIOF
|
||||
#define KEY_CET_EXTI_PIN_SOURCE GPIO_PIN_SOURCE_15
|
||||
#define KEY_CET_EXTI_IRQn EXTI10_15_IRQn
|
||||
|
||||
/* function declarations */
|
||||
/* configure led GPIO */
|
||||
void gd_eval_led_init(led_typedef_enum lednum);
|
||||
/* turn on selected led */
|
||||
void gd_eval_led_on(led_typedef_enum lednum);
|
||||
/* turn off selected led */
|
||||
void gd_eval_led_off(led_typedef_enum lednum);
|
||||
/* toggle the selected led */
|
||||
void gd_eval_led_toggle(led_typedef_enum lednum);
|
||||
/* configure key */
|
||||
void gd_eval_key_init(key_typedef_enum key_num, keymode_typedef_enum key_mode);
|
||||
/* return the selected key state */
|
||||
uint8_t gd_eval_key_state_get(key_typedef_enum key);
|
||||
/* configure COM port */
|
||||
void gd_eval_com_init(uint32_t com);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* GD32E507Z_EVAL_H */
|
||||
|
238
board/GigaDevice_GD32E507Z_EVAL/BSP/Inc/gd32e507z_lcd_eval.h
Normal file
238
board/GigaDevice_GD32E507Z_EVAL/BSP/Inc/gd32e507z_lcd_eval.h
Normal file
@@ -0,0 +1,238 @@
|
||||
/*!
|
||||
\file gd32e507z_lcd_eval.h
|
||||
\brief LCD driver header file
|
||||
|
||||
\version 2020-06-30, V1.0.0, demo for GD32E50x
|
||||
\version 2020-08-26, V1.1.0, demo for GD32E50x
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (c) 2020, GigaDevice Semiconductor Inc.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
3. Neither the name of the copyright holder nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef GD32E507Z_LCD_EVAL_H
|
||||
#define GD32E507Z_LCD_EVAL_H
|
||||
|
||||
#include "gd32e50x.h"
|
||||
|
||||
#define BANK0_LCD_D ((uint32_t)0x65000000) /*!< LCD data address */
|
||||
#define BANK0_LCD_C ((uint32_t)0x64000000) /*!< LCD register address */
|
||||
|
||||
/* LCD registers */
|
||||
#define R0 0x00
|
||||
#define R1 0x01
|
||||
#define R2 0x02
|
||||
#define R3 0x03
|
||||
#define R4 0x04
|
||||
#define R5 0x05
|
||||
#define R6 0x06
|
||||
#define R7 0x07
|
||||
#define R8 0x08
|
||||
#define R9 0x09
|
||||
#define R10 0x0A
|
||||
#define R11 0x0B
|
||||
#define R12 0x0C
|
||||
#define R13 0x0D
|
||||
#define R14 0x0E
|
||||
#define R15 0x0F
|
||||
#define R16 0x10
|
||||
#define R17 0x11
|
||||
#define R18 0x12
|
||||
#define R19 0x13
|
||||
#define R20 0x14
|
||||
#define R21 0x15
|
||||
#define R22 0x16
|
||||
#define R23 0x17
|
||||
#define R24 0x18
|
||||
#define R25 0x19
|
||||
#define R26 0x1A
|
||||
#define R27 0x1B
|
||||
#define R28 0x1C
|
||||
#define R29 0x1D
|
||||
#define R30 0x1E
|
||||
#define R31 0x1F
|
||||
#define R32 0x20
|
||||
#define R33 0x21
|
||||
#define R34 0x22
|
||||
#define R35 0x23
|
||||
#define R36 0x24
|
||||
#define R37 0x25
|
||||
#define R40 0x28
|
||||
#define R41 0x29
|
||||
#define R43 0x2B
|
||||
#define R45 0x2D
|
||||
#define R48 0x30
|
||||
#define R49 0x31
|
||||
#define R50 0x32
|
||||
#define R51 0x33
|
||||
#define R52 0x34
|
||||
#define R53 0x35
|
||||
#define R54 0x36
|
||||
#define R55 0x37
|
||||
#define R56 0x38
|
||||
#define R57 0x39
|
||||
#define R58 0x3A
|
||||
#define R59 0x3B
|
||||
#define R60 0x3C
|
||||
#define R61 0x3D
|
||||
#define R62 0x3E
|
||||
#define R63 0x3F
|
||||
#define R64 0x40
|
||||
#define R65 0x41
|
||||
#define R66 0x42
|
||||
#define R67 0x43
|
||||
#define R68 0x44
|
||||
#define R69 0x45
|
||||
#define R70 0x46
|
||||
#define R71 0x47
|
||||
#define R72 0x48
|
||||
#define R73 0x49
|
||||
#define R74 0x4A
|
||||
#define R75 0x4B
|
||||
#define R76 0x4C
|
||||
#define R77 0x4D
|
||||
#define R78 0x4E
|
||||
#define R79 0x4F
|
||||
#define R80 0x50
|
||||
#define R81 0x51
|
||||
#define R82 0x52
|
||||
#define R83 0x53
|
||||
#define R96 0x60
|
||||
#define R97 0x61
|
||||
#define R106 0x6A
|
||||
#define R118 0x76
|
||||
#define R128 0x80
|
||||
#define R129 0x81
|
||||
#define R130 0x82
|
||||
#define R131 0x83
|
||||
#define R132 0x84
|
||||
#define R133 0x85
|
||||
#define R134 0x86
|
||||
#define R135 0x87
|
||||
#define R136 0x88
|
||||
#define R137 0x89
|
||||
#define R139 0x8B
|
||||
#define R140 0x8C
|
||||
#define R141 0x8D
|
||||
#define R143 0x8F
|
||||
#define R144 0x90
|
||||
#define R145 0x91
|
||||
#define R146 0x92
|
||||
#define R147 0x93
|
||||
#define R148 0x94
|
||||
#define R149 0x95
|
||||
#define R150 0x96
|
||||
#define R151 0x97
|
||||
#define R152 0x98
|
||||
#define R153 0x99
|
||||
#define R154 0x9A
|
||||
#define R157 0x9D
|
||||
#define R192 0xC0
|
||||
#define R193 0xC1
|
||||
#define R229 0xE5
|
||||
|
||||
/* LCD color */
|
||||
#define LCD_COLOR_WHITE 0xFFFF
|
||||
#define LCD_COLOR_BLACK 0x0000
|
||||
#define LCD_COLOR_GREY 0xF7DE
|
||||
#define LCD_COLOR_BLUE 0x001F
|
||||
#define LCD_COLOR_BLUE2 0x051F
|
||||
#define LCD_COLOR_RED 0xF800
|
||||
#define LCD_COLOR_MAGENTA 0xF81F
|
||||
#define LCD_COLOR_GREEN 0x07E0
|
||||
#define LCD_COLOR_CYAN 0x7FFF
|
||||
#define LCD_COLOR_YELLOW 0xFFE0
|
||||
|
||||
/* definitions of LCD lines */
|
||||
#define LCD_LINE_0 0
|
||||
#define LCD_LINE_1 24
|
||||
#define LCD_LINE_2 48
|
||||
#define LCD_LINE_3 72
|
||||
#define LCD_LINE_4 96
|
||||
#define LCD_LINE_5 120
|
||||
#define LCD_LINE_6 144
|
||||
#define LCD_LINE_7 168
|
||||
#define LCD_LINE_8 192
|
||||
#define LCD_LINE_9 216
|
||||
|
||||
#define CHAR_FONT_8_16 ((uint16_t)0x0000U) /*!< the font of char is 8X16 */
|
||||
#define CHAR_FONT_16_24 ((uint16_t)0x0001U) /*!< the font of char is 16X24 */
|
||||
|
||||
#define CHAR_DIRECTION_HORIZONTAL ((uint16_t)0x0000U) /*!< character display direction is horizontal */
|
||||
#define CHAR_DIRECTION_VERTICAL ((uint16_t)0x0001U) /*!< character display direction is vertical */
|
||||
|
||||
#define LCD_PIXEL_WIDTH ((uint16_t)320)
|
||||
#define LCD_PIXEL_HEIGHT ((uint16_t)240)
|
||||
|
||||
/* char format struct definitions */
|
||||
typedef struct
|
||||
{
|
||||
uint16_t font; /*!< the type of font */
|
||||
uint16_t direction; /*!< the direction of char */
|
||||
uint16_t char_color; /*!< the color of char */
|
||||
uint16_t bk_color; /*!< the color of backgroud */
|
||||
}char_format_struct;
|
||||
|
||||
/* lcd peripheral initialize */
|
||||
void exmc_lcd_init(void);
|
||||
/* initialize the LCD */
|
||||
void lcd_init(void);
|
||||
/* write data to the selected LCD register */
|
||||
void lcd_register_write(uint16_t register_id,uint16_t value);
|
||||
/* read the value of LCD register */
|
||||
uint16_t lcd_register_read(uint8_t register_id);
|
||||
/* write command to LCD register */
|
||||
void lcd_command_write (uint16_t value);
|
||||
/* prepare to write to the LCD GRAM */
|
||||
void lcd_gram_write_prepare(void);
|
||||
/* write RGB code to the LCD GRAM register */
|
||||
void lcd_gram_write(uint16_t rgb_code);
|
||||
/* read data from GRAM */
|
||||
uint16_t lcd_gram_read(void);
|
||||
/* set the cursor of LCD */
|
||||
void lcd_cursor_set(uint16_t x,uint16_t y);
|
||||
/* clear the LCD screen to the specified color */
|
||||
void lcd_clear(uint16_t Color);
|
||||
/* set the point according to the specified position and color */
|
||||
void lcd_point_set(uint16_t x,uint16_t y,uint16_t point);
|
||||
/* get the point according to the specified position */
|
||||
uint16_t lcd_point_get(uint16_t x,uint16_t y);
|
||||
/* set window area */
|
||||
void lcd_windows_set(uint16_t start_x,uint16_t start_y,uint16_t end_x,uint16_t end_y);
|
||||
/* draw a horizontal line on LCD screen */
|
||||
void lcd_hline_draw(uint16_t x,uint16_t start_y,uint16_t end_y,uint16_t color,uint16_t width);
|
||||
/* draw a vertical line on LCD screen */
|
||||
void lcd_vline_draw(uint16_t start_x,uint16_t end_x,uint16_t y,uint16_t color,uint16_t width);
|
||||
/* draw a rectangle according to the specified position and color */
|
||||
void lcd_rectangle_draw(uint16_t start_x,uint16_t start_y,uint16_t end_x,uint16_t end_y,uint16_t point);
|
||||
/* fill the specified color to a rectangle */
|
||||
void lcd_rectangle_fill(uint16_t start_x,uint16_t start_y,uint16_t end_x,uint16_t end_y,uint16_t color);
|
||||
/* draw a picture on LCD screen according to the specified position */
|
||||
void lcd_picture_draw(uint16_t start_x,uint16_t start_y,uint16_t end_x,uint16_t end_y,uint16_t *pic);
|
||||
/* display a char on LCD screen according to the specified position */
|
||||
void lcd_char_display(uint16_t x,uint16_t y,uint8_t c,char_format_struct c_format);
|
||||
|
||||
#endif /* GD32E507Z_LCD_EVAL_H */
|
61
board/GigaDevice_GD32E507Z_EVAL/BSP/Inc/gd32e50x_it.h
Normal file
61
board/GigaDevice_GD32E507Z_EVAL/BSP/Inc/gd32e50x_it.h
Normal file
@@ -0,0 +1,61 @@
|
||||
/*!
|
||||
\file gd32e50x_it.h
|
||||
\brief the header file of the ISR
|
||||
|
||||
\version 2020-06-30, V1.0.0, demo for GD32E50x
|
||||
\version 2020-08-26, V1.1.0, demo for GD32E50x
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (c) 2020, GigaDevice Semiconductor Inc.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
3. Neither the name of the copyright holder nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef GD32E50X_IT_H
|
||||
#define GD32E50X_IT_H
|
||||
|
||||
#include "gd32e50x.h"
|
||||
|
||||
/* function declarations */
|
||||
/* this function handles NMI exception */
|
||||
void NMI_Handler(void);
|
||||
/* this function handles HardFault exception */
|
||||
void HardFault_Handler(void);
|
||||
/* this function handles MemManage exception */
|
||||
void MemManage_Handler(void);
|
||||
/* this function handles BusFault exception */
|
||||
void BusFault_Handler(void);
|
||||
/* this function handles UsageFault exception */
|
||||
void UsageFault_Handler(void);
|
||||
/* this function handles SVC exception */
|
||||
void SVC_Handler(void);
|
||||
/* this function handles DebugMon exception */
|
||||
void DebugMon_Handler(void);
|
||||
/* this function handles PendSV exception */
|
||||
void PendSV_Handler(void);
|
||||
/* this function handles SysTick exception */
|
||||
void SysTick_Handler(void);
|
||||
|
||||
#endif /* GD32E50X_IT_H */
|
100
board/GigaDevice_GD32E507Z_EVAL/BSP/Inc/gd32e50x_libopt.h
Normal file
100
board/GigaDevice_GD32E507Z_EVAL/BSP/Inc/gd32e50x_libopt.h
Normal file
@@ -0,0 +1,100 @@
|
||||
/*!
|
||||
\file gd32e50x_libopt.h
|
||||
\brief library optional for gd32e50x
|
||||
|
||||
\version 2020-03-10, V1.0.0, demo for GD32E50x
|
||||
\version 2020-08-26, V1.1.0, demo for GD32E50x
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (c) 2020, GigaDevice Semiconductor Inc.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
3. Neither the name of the copyright holder nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef GD32E50X_LIBOPT_H
|
||||
#define GD32E50X_LIBOPT_H
|
||||
|
||||
#ifndef GD32EPRT
|
||||
|
||||
#include "gd32e50x_adc.h"
|
||||
#include "gd32e50x_bkp.h"
|
||||
#include "gd32e50x_crc.h"
|
||||
#include "gd32e50x_ctc.h"
|
||||
#include "gd32e50x_dac.h"
|
||||
#include "gd32e50x_dbg.h"
|
||||
#include "gd32e50x_dma.h"
|
||||
#include "gd32e50x_exmc.h"
|
||||
#include "gd32e50x_exti.h"
|
||||
#include "gd32e50x_fmc.h"
|
||||
#include "gd32e50x_fwdgt.h"
|
||||
#include "gd32e50x_gpio.h"
|
||||
#include "gd32e50x_shrtimer.h"
|
||||
#include "gd32e50x_i2c.h"
|
||||
#include "gd32e50x_misc.h"
|
||||
#include "gd32e50x_pmu.h"
|
||||
#include "gd32e50x_rcu.h"
|
||||
#include "gd32e50x_rtc.h"
|
||||
#include "gd32e50x_spi.h"
|
||||
#include "gd32e50x_timer.h"
|
||||
#include "gd32e50x_usart.h"
|
||||
#include "gd32e50x_wwdgt.h"
|
||||
#include "gd32e50x_sqpi.h"
|
||||
|
||||
#ifdef GD32E50X_CL
|
||||
#include "gd32e50x_enet.h"
|
||||
#include "gd32e50x_tmu.h"
|
||||
#include "gd32e50x_cmp.h"
|
||||
#else /* GD32E50X_CL */
|
||||
#include "gd32e50x_sdio.h"
|
||||
#endif /* GD32E50X_CL */
|
||||
|
||||
#else /* GD32EPRT */
|
||||
#include "gd32e50x_adc.h"
|
||||
#include "gd32e50x_bkp.h"
|
||||
#include "gd32e50x_crc.h"
|
||||
#include "gd32e50x_ctc.h"
|
||||
#include "gd32e50x_dac.h"
|
||||
#include "gd32e50x_dbg.h"
|
||||
#include "gd32e50x_dma.h"
|
||||
#include "gd32e50x_enet.h"
|
||||
#include "gd32e50x_exmc.h"
|
||||
#include "gd32e50x_exti.h"
|
||||
#include "gd32e50x_fmc.h"
|
||||
#include "gd32e50x_fwdgt.h"
|
||||
#include "gd32e50x_gpio.h"
|
||||
#include "gd32e50x_i2c.h"
|
||||
#include "gd32e50x_misc.h"
|
||||
#include "gd32e50x_pmu.h"
|
||||
#include "gd32e50x_rcu.h"
|
||||
#include "gd32e50x_rtc.h"
|
||||
#include "gd32e50x_spi.h"
|
||||
#include "gd32e50x_timer.h"
|
||||
#include "gd32e50x_usart.h"
|
||||
#include "gd32e50x_wwdgt.h"
|
||||
#include "gd32e50x_sqpi.h"
|
||||
|
||||
#endif /* GD32EPRT */
|
||||
|
||||
#endif /* GD32E50X_LIBOPT_H */
|
677
board/GigaDevice_GD32E507Z_EVAL/BSP/Inc/lcd_font.h
Normal file
677
board/GigaDevice_GD32E507Z_EVAL/BSP/Inc/lcd_font.h
Normal file
@@ -0,0 +1,677 @@
|
||||
#include "gd32e50x.h"
|
||||
|
||||
// 8x16 ASCII
|
||||
unsigned char const ascii_8x16[1536] = {
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x18,0x3C,0x3C,0x3C,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00,
|
||||
0x00,0x66,0x66,0x66,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x6C,0x6C,0xFE,0x6C,0x6C,0x6C,0xFE,0x6C,0x6C,0x00,0x00,0x00,0x00,
|
||||
0x18,0x18,0x7C,0xC6,0xC2,0xC0,0x7C,0x06,0x86,0xC6,0x7C,0x18,0x18,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0xC2,0xC6,0x0C,0x18,0x30,0x60,0xC6,0x86,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x38,0x6C,0x6C,0x38,0x76,0xDC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,
|
||||
0x00,0x30,0x30,0x30,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x0C,0x18,0x30,0x30,0x30,0x30,0x30,0x30,0x18,0x0C,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x30,0x18,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x18,0x30,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x66,0x3C,0xFF,0x3C,0x66,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x7E,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x30,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x02,0x06,0x0C,0x18,0x30,0x60,0xC0,0x80,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x7C,0xC6,0xC6,0xCE,0xD6,0xD6,0xE6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x18,0x38,0x78,0x18,0x18,0x18,0x18,0x18,0x18,0x7E,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x7C,0xC6,0x06,0x0C,0x18,0x30,0x60,0xC0,0xC6,0xFE,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x7C,0xC6,0x06,0x06,0x3C,0x06,0x06,0x06,0xC6,0x7C,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x0C,0x1C,0x3C,0x6C,0xCC,0xFE,0x0C,0x0C,0x0C,0x1E,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0xFE,0xC0,0xC0,0xC0,0xFC,0x0E,0x06,0x06,0xC6,0x7C,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x38,0x60,0xC0,0xC0,0xFC,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0xFE,0xC6,0x06,0x06,0x0C,0x18,0x30,0x30,0x30,0x30,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x7C,0xC6,0xC6,0xC6,0x7C,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x7C,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0x06,0x0C,0x78,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x30,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x06,0x0C,0x18,0x30,0x60,0x30,0x18,0x0C,0x06,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x60,0x30,0x18,0x0C,0x06,0x0C,0x18,0x30,0x60,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x7C,0xC6,0xC6,0x0C,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x7C,0xC6,0xC6,0xDE,0xDE,0xDE,0xDC,0xC0,0x7C,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x66,0x66,0x66,0x66,0xFC,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xC0,0xC2,0x66,0x3C,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0xF8,0x6C,0x66,0x66,0x66,0x66,0x66,0x66,0x6C,0xF8,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x60,0x62,0x66,0xFE,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xDE,0xC6,0xC6,0x66,0x3A,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x1E,0x0C,0x0C,0x0C,0x0C,0x0C,0xCC,0xCC,0xCC,0x78,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0xE6,0x66,0x6C,0x6C,0x78,0x78,0x6C,0x66,0x66,0xE6,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0xF0,0x60,0x60,0x60,0x60,0x60,0x60,0x62,0x66,0xFE,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0xC6,0xEE,0xFE,0xFE,0xD6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0xC6,0xE6,0xF6,0xFE,0xDE,0xCE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x38,0x6C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x6C,0x38,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xD6,0xDE,0x7C,0x0C,0x0E,0x00,0x00,
|
||||
0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x6C,0x66,0x66,0x66,0xE6,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x7C,0xC6,0xC6,0x60,0x38,0x0C,0x06,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x7E,0x7E,0x5A,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x6C,0x38,0x10,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xD6,0xD6,0xFE,0x6C,0x6C,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0xC6,0xC6,0x6C,0x6C,0x38,0x38,0x6C,0x6C,0xC6,0xC6,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x66,0x66,0x66,0x66,0x3C,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0xFE,0xC6,0x86,0x0C,0x18,0x30,0x60,0xC2,0xC6,0xFE,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x3C,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x3C,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x80,0xC0,0xE0,0x70,0x38,0x1C,0x0E,0x06,0x02,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x3C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x3C,0x00,0x00,0x00,0x00,
|
||||
0x10,0x38,0x6C,0xC6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,
|
||||
0x30,0x30,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0xE0,0x60,0x60,0x78,0x6C,0x66,0x66,0x66,0x66,0xDC,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC0,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x1C,0x0C,0x0C,0x3C,0x6C,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x38,0x6C,0x64,0x60,0xF0,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x76,0xCC,0xCC,0xCC,0xCC,0xCC,0x7C,0x0C,0xCC,0x78,0x00,
|
||||
0x00,0x00,0xE0,0x60,0x60,0x6C,0x76,0x66,0x66,0x66,0x66,0xE6,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x18,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x06,0x06,0x00,0x0E,0x06,0x06,0x06,0x06,0x06,0x06,0x66,0x66,0x3C,0x00,
|
||||
0x00,0x00,0xE0,0x60,0x60,0x66,0x6C,0x78,0x78,0x6C,0x66,0xE6,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0xEC,0xFE,0xD6,0xD6,0xD6,0xD6,0xD6,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x7C,0x60,0x60,0xF0,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x76,0xCC,0xCC,0xCC,0xCC,0xCC,0x7C,0x0C,0x0C,0x1E,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0xDC,0x76,0x62,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0x60,0x38,0x0C,0xC6,0x7C,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x10,0x30,0x30,0xFC,0x30,0x30,0x30,0x30,0x36,0x1C,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x3C,0x18,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xD6,0xD6,0xFE,0x6C,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0xC6,0x6C,0x38,0x38,0x38,0x6C,0xC6,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x0C,0xF8,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0xFE,0xCC,0x18,0x30,0x60,0xC6,0xFE,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x0E,0x18,0x18,0x18,0x70,0x18,0x18,0x18,0x18,0x0E,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x18,0x18,0x18,0x18,0x00,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x70,0x18,0x18,0x18,0x0E,0x18,0x18,0x18,0x18,0x70,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x76,0xDC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xC6,0xFE,0x00,0x00,0x00,0x00,0x00
|
||||
};
|
||||
|
||||
/* ASCII Table: each character is 16 column (16dots large)
|
||||
and 24 raw (24 dots high) */
|
||||
const uint16_t ASCII_Table_16x24[] =
|
||||
{
|
||||
/**
|
||||
* @brief Space ' '
|
||||
*/
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief '!'
|
||||
*/
|
||||
0x0000, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180,
|
||||
0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0000, 0x0000,
|
||||
0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief '"'
|
||||
*/
|
||||
0x0000, 0x0000, 0x00CC, 0x00CC, 0x00CC, 0x00CC, 0x00CC, 0x00CC,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief '#'
|
||||
*/
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0C60, 0x0C60,
|
||||
0x0C60, 0x0630, 0x0630, 0x1FFE, 0x1FFE, 0x0630, 0x0738, 0x0318,
|
||||
0x1FFE, 0x1FFE, 0x0318, 0x0318, 0x018C, 0x018C, 0x018C, 0x0000,
|
||||
/**
|
||||
* @brief '$'
|
||||
*/
|
||||
0x0000, 0x0080, 0x03E0, 0x0FF8, 0x0E9C, 0x1C8C, 0x188C, 0x008C,
|
||||
0x0098, 0x01F8, 0x07E0, 0x0E80, 0x1C80, 0x188C, 0x188C, 0x189C,
|
||||
0x0CB8, 0x0FF0, 0x03E0, 0x0080, 0x0080, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief '%'
|
||||
*/
|
||||
0x0000, 0x0000, 0x0000, 0x180E, 0x0C1B, 0x0C11, 0x0611, 0x0611,
|
||||
0x0311, 0x0311, 0x019B, 0x018E, 0x38C0, 0x6CC0, 0x4460, 0x4460,
|
||||
0x4430, 0x4430, 0x4418, 0x6C18, 0x380C, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief '&'
|
||||
*/
|
||||
0x0000, 0x01E0, 0x03F0, 0x0738, 0x0618, 0x0618, 0x0330, 0x01F0,
|
||||
0x00F0, 0x00F8, 0x319C, 0x330E, 0x1E06, 0x1C06, 0x1C06, 0x3F06,
|
||||
0x73FC, 0x21F0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief '''
|
||||
*/
|
||||
0x0000, 0x0000, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief '('
|
||||
*/
|
||||
0x0000, 0x0200, 0x0300, 0x0180, 0x00C0, 0x00C0, 0x0060, 0x0060,
|
||||
0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030,
|
||||
0x0060, 0x0060, 0x00C0, 0x00C0, 0x0180, 0x0300, 0x0200, 0x0000,
|
||||
/**
|
||||
* @brief ')'
|
||||
*/
|
||||
0x0000, 0x0020, 0x0060, 0x00C0, 0x0180, 0x0180, 0x0300, 0x0300,
|
||||
0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600,
|
||||
0x0300, 0x0300, 0x0180, 0x0180, 0x00C0, 0x0060, 0x0020, 0x0000,
|
||||
/**
|
||||
* @brief '*'
|
||||
*/
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x00C0, 0x00C0,
|
||||
0x06D8, 0x07F8, 0x01E0, 0x0330, 0x0738, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief '+'
|
||||
*/
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0180, 0x0180,
|
||||
0x0180, 0x0180, 0x0180, 0x3FFC, 0x3FFC, 0x0180, 0x0180, 0x0180,
|
||||
0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief ','
|
||||
*/
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0180, 0x0180, 0x0100, 0x0100, 0x0080, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief '-'
|
||||
*/
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x07E0, 0x07E0, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief '.'
|
||||
*/
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief '/'
|
||||
*/
|
||||
0x0000, 0x0C00, 0x0C00, 0x0600, 0x0600, 0x0600, 0x0300, 0x0300,
|
||||
0x0300, 0x0380, 0x0180, 0x0180, 0x0180, 0x00C0, 0x00C0, 0x00C0,
|
||||
0x0060, 0x0060, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief '0'
|
||||
*/
|
||||
0x0000, 0x03E0, 0x07F0, 0x0E38, 0x0C18, 0x180C, 0x180C, 0x180C,
|
||||
0x180C, 0x180C, 0x180C, 0x180C, 0x180C, 0x180C, 0x0C18, 0x0E38,
|
||||
0x07F0, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief '1'
|
||||
*/
|
||||
0x0000, 0x0100, 0x0180, 0x01C0, 0x01F0, 0x0198, 0x0188, 0x0180,
|
||||
0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180,
|
||||
0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief '2'
|
||||
*/
|
||||
0x0000, 0x03E0, 0x0FF8, 0x0C18, 0x180C, 0x180C, 0x1800, 0x1800,
|
||||
0x0C00, 0x0600, 0x0300, 0x0180, 0x00C0, 0x0060, 0x0030, 0x0018,
|
||||
0x1FFC, 0x1FFC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief '3'
|
||||
*/
|
||||
0x0000, 0x01E0, 0x07F8, 0x0E18, 0x0C0C, 0x0C0C, 0x0C00, 0x0600,
|
||||
0x03C0, 0x07C0, 0x0C00, 0x1800, 0x1800, 0x180C, 0x180C, 0x0C18,
|
||||
0x07F8, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief '4'
|
||||
*/
|
||||
0x0000, 0x0C00, 0x0E00, 0x0F00, 0x0F00, 0x0D80, 0x0CC0, 0x0C60,
|
||||
0x0C60, 0x0C30, 0x0C18, 0x0C0C, 0x3FFC, 0x3FFC, 0x0C00, 0x0C00,
|
||||
0x0C00, 0x0C00, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief '5'
|
||||
*/
|
||||
0x0000, 0x0FF8, 0x0FF8, 0x0018, 0x0018, 0x000C, 0x03EC, 0x07FC,
|
||||
0x0E1C, 0x1C00, 0x1800, 0x1800, 0x1800, 0x180C, 0x0C1C, 0x0E18,
|
||||
0x07F8, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief '6'
|
||||
*/
|
||||
0x0000, 0x07C0, 0x0FF0, 0x1C38, 0x1818, 0x0018, 0x000C, 0x03CC,
|
||||
0x0FEC, 0x0E3C, 0x1C1C, 0x180C, 0x180C, 0x180C, 0x1C18, 0x0E38,
|
||||
0x07F0, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief '7'
|
||||
*/
|
||||
0x0000, 0x1FFC, 0x1FFC, 0x0C00, 0x0600, 0x0600, 0x0300, 0x0380,
|
||||
0x0180, 0x01C0, 0x00C0, 0x00E0, 0x0060, 0x0060, 0x0070, 0x0030,
|
||||
0x0030, 0x0030, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief '8'
|
||||
*/
|
||||
0x0000, 0x03E0, 0x07F0, 0x0E38, 0x0C18, 0x0C18, 0x0C18, 0x0638,
|
||||
0x07F0, 0x07F0, 0x0C18, 0x180C, 0x180C, 0x180C, 0x180C, 0x0C38,
|
||||
0x0FF8, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief '9'
|
||||
*/
|
||||
0x0000, 0x03E0, 0x07F0, 0x0E38, 0x0C1C, 0x180C, 0x180C, 0x180C,
|
||||
0x1C1C, 0x1E38, 0x1BF8, 0x19E0, 0x1800, 0x0C00, 0x0C00, 0x0E1C,
|
||||
0x07F8, 0x01F0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief ':'
|
||||
*/
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0180, 0x0180,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief ';'
|
||||
*/
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0180, 0x0180,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0180, 0x0180, 0x0100, 0x0100, 0x0080, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief '<'
|
||||
*/
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x1000, 0x1C00, 0x0F80, 0x03E0, 0x00F8, 0x0018, 0x00F8, 0x03E0,
|
||||
0x0F80, 0x1C00, 0x1000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief '='
|
||||
*/
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x1FF8, 0x0000, 0x0000, 0x0000, 0x1FF8, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief '>'
|
||||
*/
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0008, 0x0038, 0x01F0, 0x07C0, 0x1F00, 0x1800, 0x1F00, 0x07C0,
|
||||
0x01F0, 0x0038, 0x0008, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief '?'
|
||||
*/
|
||||
0x0000, 0x03E0, 0x0FF8, 0x0C18, 0x180C, 0x180C, 0x1800, 0x0C00,
|
||||
0x0600, 0x0300, 0x0180, 0x00C0, 0x00C0, 0x00C0, 0x0000, 0x0000,
|
||||
0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief '@'
|
||||
*/
|
||||
0x0000, 0x0000, 0x07E0, 0x1818, 0x2004, 0x29C2, 0x4A22, 0x4411,
|
||||
0x4409, 0x4409, 0x4409, 0x2209, 0x1311, 0x0CE2, 0x4002, 0x2004,
|
||||
0x1818, 0x07E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief 'A'
|
||||
*/
|
||||
0x0000, 0x0380, 0x0380, 0x06C0, 0x06C0, 0x06C0, 0x0C60, 0x0C60,
|
||||
0x1830, 0x1830, 0x1830, 0x3FF8, 0x3FF8, 0x701C, 0x600C, 0x600C,
|
||||
0xC006, 0xC006, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief 'B'
|
||||
*/
|
||||
0x0000, 0x03FC, 0x0FFC, 0x0C0C, 0x180C, 0x180C, 0x180C, 0x0C0C,
|
||||
0x07FC, 0x0FFC, 0x180C, 0x300C, 0x300C, 0x300C, 0x300C, 0x180C,
|
||||
0x1FFC, 0x07FC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief 'C'
|
||||
*/
|
||||
0x0000, 0x07C0, 0x1FF0, 0x3838, 0x301C, 0x700C, 0x6006, 0x0006,
|
||||
0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x6006, 0x700C, 0x301C,
|
||||
0x1FF0, 0x07E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief 'D'
|
||||
*/
|
||||
0x0000, 0x03FE, 0x0FFE, 0x0E06, 0x1806, 0x1806, 0x3006, 0x3006,
|
||||
0x3006, 0x3006, 0x3006, 0x3006, 0x3006, 0x1806, 0x1806, 0x0E06,
|
||||
0x0FFE, 0x03FE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief 'E'
|
||||
*/
|
||||
0x0000, 0x3FFC, 0x3FFC, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C,
|
||||
0x1FFC, 0x1FFC, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C,
|
||||
0x3FFC, 0x3FFC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief 'F'
|
||||
*/
|
||||
0x0000, 0x3FF8, 0x3FF8, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018,
|
||||
0x1FF8, 0x1FF8, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018,
|
||||
0x0018, 0x0018, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief 'G'
|
||||
*/
|
||||
0x0000, 0x0FE0, 0x3FF8, 0x783C, 0x600E, 0xE006, 0xC007, 0x0003,
|
||||
0x0003, 0xFE03, 0xFE03, 0xC003, 0xC007, 0xC006, 0xC00E, 0xF03C,
|
||||
0x3FF8, 0x0FE0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief 'H'
|
||||
*/
|
||||
0x0000, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C,
|
||||
0x3FFC, 0x3FFC, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C,
|
||||
0x300C, 0x300C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief 'I'
|
||||
*/
|
||||
0x0000, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180,
|
||||
0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180,
|
||||
0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief 'J'
|
||||
*/
|
||||
0x0000, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600,
|
||||
0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0618, 0x0618, 0x0738,
|
||||
0x03F0, 0x01E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief 'K'
|
||||
*/
|
||||
0x0000, 0x3006, 0x1806, 0x0C06, 0x0606, 0x0306, 0x0186, 0x00C6,
|
||||
0x0066, 0x0076, 0x00DE, 0x018E, 0x0306, 0x0606, 0x0C06, 0x1806,
|
||||
0x3006, 0x6006, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief 'L'
|
||||
*/
|
||||
0x0000, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018,
|
||||
0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018,
|
||||
0x1FF8, 0x1FF8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief 'M'
|
||||
*/
|
||||
0x0000, 0xE00E, 0xF01E, 0xF01E, 0xF01E, 0xD836, 0xD836, 0xD836,
|
||||
0xD836, 0xCC66, 0xCC66, 0xCC66, 0xC6C6, 0xC6C6, 0xC6C6, 0xC6C6,
|
||||
0xC386, 0xC386, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief 'N'
|
||||
*/
|
||||
0x0000, 0x300C, 0x301C, 0x303C, 0x303C, 0x306C, 0x306C, 0x30CC,
|
||||
0x30CC, 0x318C, 0x330C, 0x330C, 0x360C, 0x360C, 0x3C0C, 0x3C0C,
|
||||
0x380C, 0x300C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief 'O'
|
||||
*/
|
||||
0x0000, 0x07E0, 0x1FF8, 0x381C, 0x700E, 0x6006, 0xC003, 0xC003,
|
||||
0xC003, 0xC003, 0xC003, 0xC003, 0xC003, 0x6006, 0x700E, 0x381C,
|
||||
0x1FF8, 0x07E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief 'P'
|
||||
*/
|
||||
0x0000, 0x0FFC, 0x1FFC, 0x380C, 0x300C, 0x300C, 0x300C, 0x300C,
|
||||
0x180C, 0x1FFC, 0x07FC, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C,
|
||||
0x000C, 0x000C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief 'Q'
|
||||
*/
|
||||
0x0000, 0x07E0, 0x1FF8, 0x381C, 0x700E, 0x6006, 0xE003, 0xC003,
|
||||
0xC003, 0xC003, 0xC003, 0xC003, 0xE007, 0x6306, 0x3F0E, 0x3C1C,
|
||||
0x3FF8, 0xF7E0, 0xC000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief 'R'
|
||||
*/
|
||||
0x0000, 0x0FFE, 0x1FFE, 0x3806, 0x3006, 0x3006, 0x3006, 0x3806,
|
||||
0x1FFE, 0x07FE, 0x0306, 0x0606, 0x0C06, 0x1806, 0x1806, 0x3006,
|
||||
0x3006, 0x6006, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief 'S'
|
||||
*/
|
||||
0x0000, 0x03E0, 0x0FF8, 0x0C1C, 0x180C, 0x180C, 0x000C, 0x001C,
|
||||
0x03F8, 0x0FE0, 0x1E00, 0x3800, 0x3006, 0x3006, 0x300E, 0x1C1C,
|
||||
0x0FF8, 0x07E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief 'T'
|
||||
*/
|
||||
0x0000, 0x7FFE, 0x7FFE, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180,
|
||||
0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180,
|
||||
0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief 'U'
|
||||
*/
|
||||
0x0000, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C,
|
||||
0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x1818,
|
||||
0x1FF8, 0x07E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief 'V'
|
||||
*/
|
||||
0x0000, 0x6003, 0x3006, 0x3006, 0x3006, 0x180C, 0x180C, 0x180C,
|
||||
0x0C18, 0x0C18, 0x0E38, 0x0630, 0x0630, 0x0770, 0x0360, 0x0360,
|
||||
0x01C0, 0x01C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief 'W'
|
||||
*/
|
||||
0x0000, 0x6003, 0x61C3, 0x61C3, 0x61C3, 0x3366, 0x3366, 0x3366,
|
||||
0x3366, 0x3366, 0x3366, 0x1B6C, 0x1B6C, 0x1B6C, 0x1A2C, 0x1E3C,
|
||||
0x0E38, 0x0E38, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief 'X'
|
||||
*/
|
||||
0x0000, 0xE00F, 0x700C, 0x3018, 0x1830, 0x0C70, 0x0E60, 0x07C0,
|
||||
0x0380, 0x0380, 0x03C0, 0x06E0, 0x0C70, 0x1C30, 0x1818, 0x300C,
|
||||
0x600E, 0xE007, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief 'Y'
|
||||
*/
|
||||
0x0000, 0xC003, 0x6006, 0x300C, 0x381C, 0x1838, 0x0C30, 0x0660,
|
||||
0x07E0, 0x03C0, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180,
|
||||
0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief 'Z'
|
||||
*/
|
||||
0x0000, 0x7FFC, 0x7FFC, 0x6000, 0x3000, 0x1800, 0x0C00, 0x0600,
|
||||
0x0300, 0x0180, 0x00C0, 0x0060, 0x0030, 0x0018, 0x000C, 0x0006,
|
||||
0x7FFE, 0x7FFE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief '['
|
||||
*/
|
||||
0x0000, 0x03E0, 0x03E0, 0x0060, 0x0060, 0x0060, 0x0060, 0x0060,
|
||||
0x0060, 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, 0x0060,
|
||||
0x0060, 0x0060, 0x0060, 0x0060, 0x0060, 0x03E0, 0x03E0, 0x0000,
|
||||
/**
|
||||
* @brief '\'
|
||||
*/
|
||||
0x0000, 0x0030, 0x0030, 0x0060, 0x0060, 0x0060, 0x00C0, 0x00C0,
|
||||
0x00C0, 0x01C0, 0x0180, 0x0180, 0x0180, 0x0300, 0x0300, 0x0300,
|
||||
0x0600, 0x0600, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief ']'
|
||||
*/
|
||||
0x0000, 0x03E0, 0x03E0, 0x0300, 0x0300, 0x0300, 0x0300, 0x0300,
|
||||
0x0300, 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, 0x0300,
|
||||
0x0300, 0x0300, 0x0300, 0x0300, 0x0300, 0x03E0, 0x03E0, 0x0000,
|
||||
/**
|
||||
* @brief '^'
|
||||
*/
|
||||
0x0000, 0x0000, 0x01C0, 0x01C0, 0x0360, 0x0360, 0x0360, 0x0630,
|
||||
0x0630, 0x0C18, 0x0C18, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief '_'
|
||||
*/
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0xFFFF, 0xFFFF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief '''
|
||||
*/
|
||||
0x0000, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief 'a'
|
||||
*/
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03F0, 0x07F8,
|
||||
0x0C1C, 0x0C0C, 0x0F00, 0x0FF0, 0x0CF8, 0x0C0C, 0x0C0C, 0x0F1C,
|
||||
0x0FF8, 0x18F0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief 'b'
|
||||
*/
|
||||
0x0000, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x03D8, 0x0FF8,
|
||||
0x0C38, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x0C38,
|
||||
0x0FF8, 0x03D8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief 'c'
|
||||
*/
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03C0, 0x07F0,
|
||||
0x0E30, 0x0C18, 0x0018, 0x0018, 0x0018, 0x0018, 0x0C18, 0x0E30,
|
||||
0x07F0, 0x03C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief 'd'
|
||||
*/
|
||||
0x0000, 0x1800, 0x1800, 0x1800, 0x1800, 0x1800, 0x1BC0, 0x1FF0,
|
||||
0x1C30, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1C30,
|
||||
0x1FF0, 0x1BC0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief 'e'
|
||||
*/
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03C0, 0x0FF0,
|
||||
0x0C30, 0x1818, 0x1FF8, 0x1FF8, 0x0018, 0x0018, 0x1838, 0x1C30,
|
||||
0x0FF0, 0x07C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief 'f'
|
||||
*/
|
||||
0x0000, 0x0F80, 0x0FC0, 0x00C0, 0x00C0, 0x00C0, 0x07F0, 0x07F0,
|
||||
0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0,
|
||||
0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief 'g'
|
||||
*/
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0DE0, 0x0FF8,
|
||||
0x0E18, 0x0C0C, 0x0C0C, 0x0C0C, 0x0C0C, 0x0C0C, 0x0C0C, 0x0E18,
|
||||
0x0FF8, 0x0DE0, 0x0C00, 0x0C0C, 0x061C, 0x07F8, 0x01F0, 0x0000,
|
||||
/**
|
||||
* @brief 'h'
|
||||
*/
|
||||
0x0000, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x07D8, 0x0FF8,
|
||||
0x1C38, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818,
|
||||
0x1818, 0x1818, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief 'i'
|
||||
*/
|
||||
0x0000, 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x00C0, 0x00C0,
|
||||
0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0,
|
||||
0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief 'j'
|
||||
*/
|
||||
0x0000, 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x00C0, 0x00C0,
|
||||
0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0,
|
||||
0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00F8, 0x0078, 0x0000,
|
||||
/**
|
||||
* @brief 'k'
|
||||
*/
|
||||
0x0000, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x0C0C, 0x060C,
|
||||
0x030C, 0x018C, 0x00CC, 0x006C, 0x00FC, 0x019C, 0x038C, 0x030C,
|
||||
0x060C, 0x0C0C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief 'l'
|
||||
*/
|
||||
0x0000, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0,
|
||||
0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0,
|
||||
0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief 'm'
|
||||
*/
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3C7C, 0x7EFF,
|
||||
0xE3C7, 0xC183, 0xC183, 0xC183, 0xC183, 0xC183, 0xC183, 0xC183,
|
||||
0xC183, 0xC183, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief 'n'
|
||||
*/
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0798, 0x0FF8,
|
||||
0x1C38, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818,
|
||||
0x1818, 0x1818, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief 'o'
|
||||
*/
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03C0, 0x0FF0,
|
||||
0x0C30, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x0C30,
|
||||
0x0FF0, 0x03C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief 'p'
|
||||
*/
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03D8, 0x0FF8,
|
||||
0x0C38, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x0C38,
|
||||
0x0FF8, 0x03D8, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0000,
|
||||
/**
|
||||
* @brief 'q'
|
||||
*/
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1BC0, 0x1FF0,
|
||||
0x1C30, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1C30,
|
||||
0x1FF0, 0x1BC0, 0x1800, 0x1800, 0x1800, 0x1800, 0x1800, 0x0000,
|
||||
/**
|
||||
* @brief 'r'
|
||||
*/
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x07B0, 0x03F0,
|
||||
0x0070, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030,
|
||||
0x0030, 0x0030, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief 's'
|
||||
*/
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03E0, 0x03F0,
|
||||
0x0E38, 0x0C18, 0x0038, 0x03F0, 0x07C0, 0x0C00, 0x0C18, 0x0E38,
|
||||
0x07F0, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief 't'
|
||||
*/
|
||||
0x0000, 0x0000, 0x0080, 0x00C0, 0x00C0, 0x00C0, 0x07F0, 0x07F0,
|
||||
0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0,
|
||||
0x07C0, 0x0780, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief 'u'
|
||||
*/
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1818, 0x1818,
|
||||
0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1C38,
|
||||
0x1FF0, 0x19E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief 'v'
|
||||
*/
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x180C, 0x0C18,
|
||||
0x0C18, 0x0C18, 0x0630, 0x0630, 0x0630, 0x0360, 0x0360, 0x0360,
|
||||
0x01C0, 0x01C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief 'w'
|
||||
*/
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x41C1, 0x41C1,
|
||||
0x61C3, 0x6363, 0x6363, 0x6363, 0x3636, 0x3636, 0x3636, 0x1C1C,
|
||||
0x1C1C, 0x1C1C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief 'x'
|
||||
*/
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x381C, 0x1C38,
|
||||
0x0C30, 0x0660, 0x0360, 0x0360, 0x0360, 0x0360, 0x0660, 0x0C30,
|
||||
0x1C38, 0x381C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief 'y'
|
||||
*/
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3018, 0x1830,
|
||||
0x1830, 0x1870, 0x0C60, 0x0C60, 0x0CE0, 0x06C0, 0x06C0, 0x0380,
|
||||
0x0380, 0x0380, 0x0180, 0x0180, 0x01C0, 0x00F0, 0x0070, 0x0000,
|
||||
/**
|
||||
* @brief 'z'
|
||||
*/
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1FFC, 0x1FFC,
|
||||
0x0C00, 0x0600, 0x0300, 0x0180, 0x00C0, 0x0060, 0x0030, 0x0018,
|
||||
0x1FFC, 0x1FFC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief '{'
|
||||
*/
|
||||
0x0000, 0x0300, 0x0180, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0,
|
||||
0x00C0, 0x0060, 0x0060, 0x0030, 0x0060, 0x0040, 0x00C0, 0x00C0,
|
||||
0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x0180, 0x0300, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief '|'
|
||||
*/
|
||||
0x0000, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180,
|
||||
0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180,
|
||||
0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0000,
|
||||
/**
|
||||
* @brief '}'
|
||||
*/
|
||||
0x0000, 0x0060, 0x00C0, 0x01C0, 0x0180, 0x0180, 0x0180, 0x0180,
|
||||
0x0180, 0x0300, 0x0300, 0x0600, 0x0300, 0x0100, 0x0180, 0x0180,
|
||||
0x0180, 0x0180, 0x0180, 0x0180, 0x00C0, 0x0060, 0x0000, 0x0000,
|
||||
/**
|
||||
* @brief '~'
|
||||
*/
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x10F0, 0x1FF8, 0x0F08, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
};
|
20
board/GigaDevice_GD32E507Z_EVAL/BSP/Inc/main.h
Normal file
20
board/GigaDevice_GD32E507Z_EVAL/BSP/Inc/main.h
Normal file
@@ -0,0 +1,20 @@
|
||||
/*!
|
||||
\file main.h
|
||||
\brief the header file of main
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (C) 2016 GigaDevice
|
||||
|
||||
2016-08-15, V1.0.0, firmware for GD32F4xx
|
||||
*/
|
||||
|
||||
#ifndef __MAIN_H
|
||||
#define __MAIN_H
|
||||
|
||||
/* led spark function */
|
||||
void led_spark(void);
|
||||
|
||||
#endif /* __MAIN_H */
|
||||
|
||||
|
48
board/GigaDevice_GD32E507Z_EVAL/BSP/Inc/systick.h
Normal file
48
board/GigaDevice_GD32E507Z_EVAL/BSP/Inc/systick.h
Normal file
@@ -0,0 +1,48 @@
|
||||
/*!
|
||||
\file systick.h
|
||||
\brief the header file of systick
|
||||
|
||||
\version 2020-06-30, V1.0.0, demo for GD32E50x
|
||||
\version 2020-08-26, V1.1.0, demo for GD32E50x
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (c) 2020, GigaDevice Semiconductor Inc.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
3. Neither the name of the copyright holder nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef SYS_TICK_H
|
||||
#define SYS_TICK_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/* configure systick */
|
||||
void systick_config(void);
|
||||
/* delay a time in milliseconds */
|
||||
void delay_1ms(uint32_t count);
|
||||
/* delay decrement */
|
||||
void delay_decrement(void);
|
||||
|
||||
#endif /* SYS_TICK_H */
|
240
board/GigaDevice_GD32E507Z_EVAL/BSP/Src/gd32e507z_eval.c
Normal file
240
board/GigaDevice_GD32E507Z_EVAL/BSP/Src/gd32e507z_eval.c
Normal file
@@ -0,0 +1,240 @@
|
||||
/*!
|
||||
\file gd32e507z_eval.c
|
||||
\brief firmware functions to manage leds, keys, COM ports
|
||||
|
||||
\version 2020-06-30, V1.0.0, demo for GD32E50x
|
||||
\version 2020-08-26, V1.1.0, demo for GD32E50x
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (c) 2020, GigaDevice Semiconductor Inc.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
3. Neither the name of the copyright holder nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "gd32e507z_eval.h"
|
||||
|
||||
/* private variables */
|
||||
static uint32_t GPIO_PORT[LEDn] = {LED1_GPIO_PORT, LED2_GPIO_PORT,
|
||||
LED3_GPIO_PORT, LED4_GPIO_PORT};
|
||||
static uint32_t GPIO_PIN[LEDn] = {LED1_PIN, LED2_PIN, LED3_PIN, LED4_PIN};
|
||||
|
||||
static rcu_periph_enum COM_CLK[COMn] = {EVAL_COM0_CLK};
|
||||
static uint32_t COM_TX_PIN[COMn] = {EVAL_COM0_TX_PIN};
|
||||
static uint32_t COM_RX_PIN[COMn] = {EVAL_COM0_RX_PIN};
|
||||
static uint32_t COM_GPIO_PORT[COMn] = {EVAL_COM0_GPIO_PORT};
|
||||
static rcu_periph_enum COM_GPIO_CLK[COMn] = {EVAL_COM0_GPIO_CLK};
|
||||
|
||||
static rcu_periph_enum GPIO_CLK[LEDn] = {LED1_GPIO_CLK, LED2_GPIO_CLK,
|
||||
LED3_GPIO_CLK, LED4_GPIO_CLK};
|
||||
|
||||
static uint32_t KEY_PORT[KEYn] = {KEY_A_GPIO_PORT,
|
||||
KEY_B_GPIO_PORT,
|
||||
KEY_C_GPIO_PORT,
|
||||
KEY_D_GPIO_PORT,
|
||||
KEY_CET_GPIO_PORT};
|
||||
static uint32_t KEY_PIN[KEYn] = {KEY_A_PIN,
|
||||
KEY_B_PIN,
|
||||
KEY_C_PIN,
|
||||
KEY_D_PIN,
|
||||
KEY_CET_PIN};
|
||||
static rcu_periph_enum KEY_CLK[KEYn] = {KEY_A_GPIO_CLK,
|
||||
KEY_B_GPIO_CLK,
|
||||
KEY_C_GPIO_CLK,
|
||||
KEY_D_GPIO_CLK,
|
||||
KEY_CET_GPIO_CLK};
|
||||
static exti_line_enum KEY_EXTI_LINE[KEYn] = {KEY_A_EXTI_LINE,
|
||||
KEY_B_EXTI_LINE,
|
||||
KEY_C_EXTI_LINE,
|
||||
KEY_D_EXTI_LINE,
|
||||
KEY_CET_EXTI_LINE};
|
||||
static uint8_t KEY_PORT_SOURCE[KEYn] = {KEY_A_EXTI_PORT_SOURCE,
|
||||
KEY_B_EXTI_PORT_SOURCE,
|
||||
KEY_C_EXTI_PORT_SOURCE,
|
||||
KEY_D_EXTI_PORT_SOURCE,
|
||||
KEY_CET_EXTI_PORT_SOURCE};
|
||||
static uint8_t KEY_PIN_SOURCE[KEYn] = {KEY_A_EXTI_PIN_SOURCE,
|
||||
KEY_B_EXTI_PIN_SOURCE,
|
||||
KEY_C_EXTI_PIN_SOURCE,
|
||||
KEY_D_EXTI_PIN_SOURCE,
|
||||
KEY_CET_EXTI_PIN_SOURCE};
|
||||
static uint8_t KEY_IRQn[KEYn] = {KEY_A_EXTI_IRQn,
|
||||
KEY_B_EXTI_IRQn,
|
||||
KEY_C_EXTI_IRQn,
|
||||
KEY_D_EXTI_IRQn,
|
||||
KEY_CET_EXTI_IRQn};
|
||||
|
||||
/*!
|
||||
\brief configure led GPIO
|
||||
\param[in] lednum: specify the led to be configured
|
||||
\arg LED1
|
||||
\arg LED2
|
||||
\arg LED3
|
||||
\arg LED4
|
||||
\param[out] none
|
||||
\retval none
|
||||
*/
|
||||
void gd_eval_led_init (led_typedef_enum lednum)
|
||||
{
|
||||
/* enable the led clock */
|
||||
rcu_periph_clock_enable(GPIO_CLK[lednum]);
|
||||
/* configure led GPIO port */
|
||||
gpio_init(GPIO_PORT[lednum], GPIO_MODE_OUT_PP, GPIO_OSPEED_50MHZ,GPIO_PIN[lednum]);
|
||||
|
||||
GPIO_BC(GPIO_PORT[lednum]) = GPIO_PIN[lednum];
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief turn on selected led
|
||||
\param[in] lednum: specify the led to be turned on
|
||||
\arg LED1
|
||||
\arg LED2
|
||||
\arg LED3
|
||||
\arg LED4
|
||||
\param[out] none
|
||||
\retval none
|
||||
*/
|
||||
void gd_eval_led_on(led_typedef_enum lednum)
|
||||
{
|
||||
GPIO_BOP(GPIO_PORT[lednum]) = GPIO_PIN[lednum];
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief turn off selected led
|
||||
\param[in] lednum: specify the led to be turned off
|
||||
\arg LED1
|
||||
\arg LED2
|
||||
\arg LED3
|
||||
\arg LED4
|
||||
\param[out] none
|
||||
\retval none
|
||||
*/
|
||||
void gd_eval_led_off(led_typedef_enum lednum)
|
||||
{
|
||||
GPIO_BC(GPIO_PORT[lednum]) = GPIO_PIN[lednum];
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief toggle selected led
|
||||
\param[in] lednum: specify the led to be toggled
|
||||
\arg LED1
|
||||
\arg LED2
|
||||
\arg LED3
|
||||
\arg LED4
|
||||
\param[out] none
|
||||
\retval none
|
||||
*/
|
||||
void gd_eval_led_toggle(led_typedef_enum lednum)
|
||||
{
|
||||
gpio_bit_write(GPIO_PORT[lednum], GPIO_PIN[lednum],
|
||||
(bit_status)(1-gpio_input_bit_get(GPIO_PORT[lednum], GPIO_PIN[lednum])));
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief configure key
|
||||
\param[in] key_num: specify the key to be configured
|
||||
\arg KEY_A: wakeup key
|
||||
\arg KEY_B: tamper key
|
||||
\arg KEY_C: user key
|
||||
\arg KEY_D: extension key
|
||||
\arg KEY_CET: extension key
|
||||
\param[in] key_mode: specify button mode
|
||||
\arg KEY_MODE_GPIO: key will be used as simple IO
|
||||
\arg KEY_MODE_EXTI: key will be connected to EXTI line with interrupt
|
||||
\param[out] none
|
||||
\retval none
|
||||
*/
|
||||
void gd_eval_key_init(key_typedef_enum key_num, keymode_typedef_enum key_mode)
|
||||
{
|
||||
/* enable the key clock */
|
||||
rcu_periph_clock_enable(KEY_CLK[key_num]);
|
||||
rcu_periph_clock_enable(RCU_AF);
|
||||
|
||||
/* configure button pin as input */
|
||||
gpio_init(KEY_PORT[key_num], GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, KEY_PIN[key_num]);
|
||||
|
||||
if (key_mode == KEY_MODE_EXTI) {
|
||||
/* enable and set key EXTI interrupt to the lowest priority */
|
||||
nvic_irq_enable(KEY_IRQn[key_num], 2U, 0U);
|
||||
|
||||
/* connect key EXTI line to key GPIO pin */
|
||||
gpio_exti_source_select(KEY_PORT_SOURCE[key_num], KEY_PIN_SOURCE[key_num]);
|
||||
|
||||
/* configure key EXTI line */
|
||||
exti_init(KEY_EXTI_LINE[key_num], EXTI_INTERRUPT, EXTI_TRIG_FALLING);
|
||||
exti_interrupt_flag_clear(KEY_EXTI_LINE[key_num]);
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief return the selected key state
|
||||
\param[in] key: specify the key to be checked
|
||||
\arg KEY_A: wakeup key
|
||||
\arg KEY_B: tamper key
|
||||
\arg KEY_C: user key
|
||||
\arg KEY_D: extension key
|
||||
\arg KEY_CET: extension key
|
||||
\param[out] none
|
||||
\retval the key's GPIO pin value
|
||||
*/
|
||||
uint8_t gd_eval_key_state_get(key_typedef_enum key)
|
||||
{
|
||||
return gpio_input_bit_get(KEY_PORT[key], KEY_PIN[key]);
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief configure COM port
|
||||
\param[in] com: COM on the board
|
||||
\arg EVAL_COM0: COM0 on the board
|
||||
\param[out] none
|
||||
\retval none
|
||||
*/
|
||||
void gd_eval_com_init(uint32_t com)
|
||||
{
|
||||
uint32_t com_id = 0U;
|
||||
if(EVAL_COM0 == com){
|
||||
com_id = 0U;
|
||||
}else{
|
||||
while(1);
|
||||
}
|
||||
|
||||
/* enable GPIO clock */
|
||||
rcu_periph_clock_enable(COM_GPIO_CLK[com_id]);
|
||||
|
||||
/* enable USART clock */
|
||||
rcu_periph_clock_enable(COM_CLK[com_id]);
|
||||
|
||||
/* connect port to USARTx_Tx */
|
||||
gpio_init(COM_GPIO_PORT[com_id], GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, COM_TX_PIN[com_id]);
|
||||
|
||||
/* connect port to USARTx_Rx */
|
||||
gpio_init(COM_GPIO_PORT[com_id], GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, COM_RX_PIN[com_id]);
|
||||
|
||||
/* USART configure */
|
||||
usart_deinit(com);
|
||||
usart_baudrate_set(com, 115200U);
|
||||
usart_receive_config(com, USART_RECEIVE_ENABLE);
|
||||
usart_transmit_config(com, USART_TRANSMIT_ENABLE);
|
||||
usart_enable(com);
|
||||
}
|
631
board/GigaDevice_GD32E507Z_EVAL/BSP/Src/gd32e507z_lcd_eval.c
Normal file
631
board/GigaDevice_GD32E507Z_EVAL/BSP/Src/gd32e507z_lcd_eval.c
Normal file
@@ -0,0 +1,631 @@
|
||||
/*!
|
||||
\file gd32e507c_lcd_eval.c
|
||||
\brief LCD driver functions
|
||||
|
||||
\version 2020-06-30, V1.0.1, demo for GD32E50x
|
||||
\version 2020-08-26, V1.1.0, demo for GD32E50x
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (c) 2020, GigaDevice Semiconductor Inc.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
3. Neither the name of the copyright holder nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "gd32e50x.h"
|
||||
#include "gd32e507z_lcd_eval.h"
|
||||
#include "lcd_font.h"
|
||||
|
||||
#define LCD_ILI9320 0x9320
|
||||
#define LCD_ILI9325 0x9325
|
||||
|
||||
#define ABS(X) ((X) > 0 ? (X) : -(X))
|
||||
|
||||
uint16_t device_code;
|
||||
|
||||
/*!
|
||||
\brief lcd peripheral initialize
|
||||
\param[in] none
|
||||
\param[out] none
|
||||
\retval none
|
||||
*/
|
||||
void exmc_lcd_init(void)
|
||||
{
|
||||
exmc_norsram_parameter_struct lcd_init_struct;
|
||||
exmc_norsram_timing_parameter_struct lcd_timing_init_struct;
|
||||
|
||||
/* EXMC clock enable */
|
||||
rcu_periph_clock_enable(RCU_EXMC);
|
||||
|
||||
/* GPIO clock enable */
|
||||
rcu_periph_clock_enable(RCU_GPIOD);
|
||||
rcu_periph_clock_enable(RCU_GPIOE);
|
||||
rcu_periph_clock_enable(RCU_GPIOG);
|
||||
|
||||
/* configure EXMC_D[0~15]*/
|
||||
/* PD14(EXMC_D0), PD15(EXMC_D1),PD0(EXMC_D2), PD1(EXMC_D3), PD8(EXMC_D13), PD9(EXMC_D14), PD10(EXMC_D15) */
|
||||
gpio_init(GPIOD, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_0 | GPIO_PIN_1| GPIO_PIN_8 | GPIO_PIN_9 |
|
||||
GPIO_PIN_10 | GPIO_PIN_14 | GPIO_PIN_15);
|
||||
|
||||
/* PE7(EXMC_D4), PE8(EXMC_D5), PE9(EXMC_D6), PE10(EXMC_D7), PE11(EXMC_D8), PE12(EXMC_D9),
|
||||
PE13(EXMC_D10), PE14(EXMC_D11), PE15(EXMC_D12) */
|
||||
gpio_init(GPIOE, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_7 | GPIO_PIN_8 | GPIO_PIN_9 |
|
||||
GPIO_PIN_10 | GPIO_PIN_11 | GPIO_PIN_12 |
|
||||
GPIO_PIN_13 | GPIO_PIN_14 | GPIO_PIN_15);
|
||||
|
||||
/* configure PE2(EXMC_A23) */
|
||||
gpio_init(GPIOE, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_2);
|
||||
|
||||
/* configure PD4(NOE) and PD5(NWE) */
|
||||
gpio_init(GPIOD, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_4 | GPIO_PIN_5);
|
||||
|
||||
/* configure PG9(EXMC NE1) */
|
||||
gpio_init(GPIOG, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_9);
|
||||
|
||||
lcd_timing_init_struct.asyn_access_mode = EXMC_ACCESS_MODE_A;
|
||||
lcd_timing_init_struct.syn_data_latency = EXMC_DATALAT_2_CLK;
|
||||
lcd_timing_init_struct.syn_clk_division = EXMC_SYN_CLOCK_RATIO_DISABLE;
|
||||
lcd_timing_init_struct.bus_latency = 2;
|
||||
lcd_timing_init_struct.asyn_data_setuptime = 18;
|
||||
lcd_timing_init_struct.asyn_address_holdtime = 3;
|
||||
lcd_timing_init_struct.asyn_address_setuptime = 8;
|
||||
|
||||
lcd_init_struct.norsram_region = EXMC_BANK0_NORSRAM_REGION1;
|
||||
lcd_init_struct.write_mode = EXMC_ASYN_WRITE;
|
||||
lcd_init_struct.extended_mode = DISABLE;
|
||||
lcd_init_struct.asyn_wait = DISABLE;
|
||||
lcd_init_struct.nwait_signal = DISABLE;
|
||||
lcd_init_struct.memory_write = ENABLE;
|
||||
lcd_init_struct.nwait_config = EXMC_NWAIT_CONFIG_BEFORE;
|
||||
lcd_init_struct.wrap_burst_mode = DISABLE;
|
||||
lcd_init_struct.nwait_polarity = EXMC_NWAIT_POLARITY_LOW;
|
||||
lcd_init_struct.burst_mode = DISABLE;
|
||||
lcd_init_struct.databus_width = EXMC_NOR_DATABUS_WIDTH_16B;
|
||||
lcd_init_struct.memory_type = EXMC_MEMORY_TYPE_SRAM;
|
||||
lcd_init_struct.address_data_mux = DISABLE;
|
||||
lcd_init_struct.read_write_timing = &lcd_timing_init_struct;
|
||||
lcd_init_struct.write_timing = &lcd_timing_init_struct;
|
||||
|
||||
exmc_norsram_init(&lcd_init_struct);
|
||||
|
||||
exmc_norsram_enable(EXMC_BANK0_NORSRAM_REGION1);
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief write data to the selected LCD register
|
||||
\param[in] register_id: the selected register id
|
||||
\param[in] value: the register value to be written
|
||||
\param[out] none
|
||||
\retval none
|
||||
*/
|
||||
|
||||
void lcd_register_write(uint16_t register_id,uint16_t value)
|
||||
{
|
||||
*(__IO uint16_t *) (BANK0_LCD_C)= register_id;
|
||||
*(__IO uint16_t *) (BANK0_LCD_D)= value;
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief read the value of LCD register
|
||||
\param[in] register_id: the register id
|
||||
\param[out] none
|
||||
\retval the register value
|
||||
*/
|
||||
uint16_t lcd_register_read(uint8_t register_id)
|
||||
{
|
||||
uint16_t data;
|
||||
*(__IO uint16_t *) (BANK0_LCD_C)= register_id;
|
||||
data = *(__IO uint16_t *) (BANK0_LCD_D);
|
||||
return data;
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief write command to LCD register
|
||||
\param[in] value: the register value to be written
|
||||
\param[out] none
|
||||
\retval none
|
||||
*/
|
||||
void lcd_command_write(uint16_t value)
|
||||
{
|
||||
/* write 16-bit index, then write reg */
|
||||
*(__IO uint16_t *) (BANK0_LCD_C) = value;
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief prepare to write to the LCD GRAM register(R22h)
|
||||
\param[in] none
|
||||
\param[out] none
|
||||
\retval none
|
||||
*/
|
||||
void lcd_gram_write_prepare(void)
|
||||
{
|
||||
*(__IO uint16_t *) (BANK0_LCD_C) = 0x0022;
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief write RGB code to the LCD GRAM register
|
||||
\param[in] rgb_code: the pixel color in RGB mode (5-6-5)
|
||||
\param[out] none
|
||||
\retval none
|
||||
*/
|
||||
void lcd_gram_write(uint16_t rgb_code)
|
||||
{
|
||||
/* write 16-bit GRAM register */
|
||||
*(__IO uint16_t *) (BANK0_LCD_D) = rgb_code;
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief read data from GRAM
|
||||
\param[in] none
|
||||
\param[out] none
|
||||
\retval GRAM value
|
||||
*/
|
||||
uint16_t lcd_gram_read(void)
|
||||
{
|
||||
uint16_t data;
|
||||
|
||||
/* write GRAM register (R22h) */
|
||||
*(__IO uint16_t *) (BANK0_LCD_C) = 0x0022;
|
||||
/* dummy read (invalid data) */
|
||||
data = *(__IO uint16_t *) (BANK0_LCD_D);
|
||||
|
||||
data = *(__IO uint16_t *) (BANK0_LCD_D);
|
||||
return data;
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief initialize the LCD
|
||||
\param[in] none
|
||||
\param[out] none
|
||||
\retval none
|
||||
*/
|
||||
void lcd_init(void)
|
||||
{
|
||||
__IO uint16_t i;
|
||||
|
||||
/* read the LCD controller device code */
|
||||
device_code = lcd_register_read(0x0000);
|
||||
|
||||
if(0x8989 == device_code){ // SSD1289
|
||||
lcd_register_write(0x0000,0x0001);
|
||||
lcd_register_write(0x0003,0xA8A4);
|
||||
lcd_register_write(0x000C,0x0000);
|
||||
lcd_register_write(0x000D,0x080C);
|
||||
lcd_register_write(0x000E,0x2B00);
|
||||
lcd_register_write(0x001E,0x00B0);
|
||||
lcd_register_write(0x0001,0x2B3F);
|
||||
lcd_register_write(0x0002,0x0600);
|
||||
lcd_register_write(0x0010,0x0000);
|
||||
lcd_register_write(0x0011,0x6070);
|
||||
lcd_register_write(0x0005,0x0000);
|
||||
lcd_register_write(0x0006,0x0000);
|
||||
lcd_register_write(0x0016,0xEF1C);
|
||||
lcd_register_write(0x0017,0x0003);
|
||||
lcd_register_write(0x0007,0x0233);
|
||||
lcd_register_write(0x000B,0x0000);
|
||||
lcd_register_write(0x000F,0x0000);
|
||||
lcd_register_write(0x0041,0x0000);
|
||||
lcd_register_write(0x0042,0x0000);
|
||||
lcd_register_write(0x0048,0x0000);
|
||||
lcd_register_write(0x0049,0x013F);
|
||||
lcd_register_write(0x004A,0x0000);
|
||||
lcd_register_write(0x004B,0x0000);
|
||||
lcd_register_write(0x0044,0xEF00);
|
||||
lcd_register_write(0x0045,0x0000);
|
||||
lcd_register_write(0x0046,0x013F);
|
||||
lcd_register_write(0x0030,0x0707);
|
||||
lcd_register_write(0x0031,0x0204);
|
||||
lcd_register_write(0x0032,0x0204);
|
||||
lcd_register_write(0x0033,0x0502);
|
||||
lcd_register_write(0x0034,0x0507);
|
||||
lcd_register_write(0x0035,0x0204);
|
||||
lcd_register_write(0x0036,0x0204);
|
||||
lcd_register_write(0x0037,0x0502);
|
||||
lcd_register_write(0x003A,0x0302);
|
||||
lcd_register_write(0x003B,0x0302);
|
||||
lcd_register_write(0x0023,0x0000);
|
||||
lcd_register_write(0x0024,0x0000);
|
||||
lcd_register_write(0x0025,0x8000);
|
||||
lcd_register_write(0x004e,0);
|
||||
lcd_register_write(0x004f,0);
|
||||
}else if((0x9320 == device_code) || (0x9300 == device_code)){ //ILI9320
|
||||
lcd_register_write(0x01,0x0100); //driver output control
|
||||
lcd_register_write(0x02,0x0700); //lcd driver waveform control
|
||||
lcd_register_write(0x03,0x1020); //entry mode set
|
||||
|
||||
lcd_register_write(0x04,0x0000); //resizing control
|
||||
lcd_register_write(0x08,0x0202); //display control 2
|
||||
lcd_register_write(0x09,0x0000); //display control 3
|
||||
lcd_register_write(0x0a,0x0000); //frame cycle control
|
||||
lcd_register_write(0x0c,(1<<0)); //extern display interface control 1
|
||||
lcd_register_write(0x0d,0x0000); //frame maker position
|
||||
lcd_register_write(0x0f,0x0000); //extern display interface control 2
|
||||
|
||||
for(i=50000;i>0;i--);
|
||||
lcd_register_write(0x07,0x0101); //display control
|
||||
for(i=50000;i>0;i--);
|
||||
|
||||
lcd_register_write(0x10,(1<<12)|(0<<8)|(1<<7)|(1<<6)|(0<<4)); //power control 1
|
||||
lcd_register_write(0x11,0x0007); //power control 2
|
||||
lcd_register_write(0x12,(1<<8)|(1<<4)|(0<<0)); //power control 3
|
||||
lcd_register_write(0x13,0x0b00); //power control 4
|
||||
lcd_register_write(0x29,0x0000); //power control 7
|
||||
lcd_register_write(0x2b,(1<<14)|(1<<4));
|
||||
lcd_register_write(0x50,0); //set x start
|
||||
lcd_register_write(0x51,239); //set x end
|
||||
lcd_register_write(0x52,0); //set y start
|
||||
lcd_register_write(0x53,319); //set y end
|
||||
|
||||
lcd_register_write(0x60,0x2700); //driver output control
|
||||
lcd_register_write(0x61,0x0001); //driver output control
|
||||
lcd_register_write(0x6a,0x0000); //vertical srcoll control
|
||||
|
||||
lcd_register_write(0x80,0x0000); //display position? partial display 1
|
||||
lcd_register_write(0x81,0x0000); //ram address start? partial display 1
|
||||
lcd_register_write(0x82,0x0000); //ram address end-partial display 1
|
||||
lcd_register_write(0x83,0x0000); //display position? partial display 2
|
||||
lcd_register_write(0x84,0x0000); //ram address start? partial display 2
|
||||
lcd_register_write(0x85,0x0000); //ram address end? partial display 2
|
||||
|
||||
lcd_register_write(0x90,(0<<7)|(16<<0)); //frame cycle control
|
||||
lcd_register_write(0x92,0x0000); //panel interface control 2
|
||||
lcd_register_write(0x93,0x0001); //panel interface control 3
|
||||
lcd_register_write(0x95,0x0110); //frame cycle control
|
||||
lcd_register_write(0x97,(0<<8));
|
||||
lcd_register_write(0x98,0x0000); //frame cycle control
|
||||
for(i=50000;i>0;i--);
|
||||
lcd_register_write(0x07,0x0173);
|
||||
for(i=50000;i>0;i--);
|
||||
|
||||
}else{
|
||||
return;
|
||||
}
|
||||
|
||||
for(i=50000;i>0;i--);
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief set the cursor of LCD
|
||||
\param[in] x: the row-coordinate
|
||||
\param[in] y: the column-coordinate
|
||||
\param[out] none
|
||||
\retval none
|
||||
*/
|
||||
void lcd_cursor_set(uint16_t x,uint16_t y)
|
||||
{
|
||||
if(0x8989 == device_code){ // SSD1289
|
||||
lcd_register_write(0x004e, x);
|
||||
lcd_register_write(0x004f, y);
|
||||
}else if((0x9320 == device_code) || (0x9300 == device_code)){ //ILI9320
|
||||
lcd_register_write(0x20, x);
|
||||
lcd_register_write(0x21, y);
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief clear the LCD screen to the specified color
|
||||
\param[in] color: specified screen color
|
||||
\param[out] none
|
||||
\retval none
|
||||
*/
|
||||
void lcd_clear(uint16_t color)
|
||||
{
|
||||
uint32_t index=0;
|
||||
if(0x8989 == device_code){ // SSD1289
|
||||
lcd_cursor_set(0,0);
|
||||
/* prepare to write GRAM */
|
||||
lcd_gram_write_prepare();
|
||||
for(index=0; index<LCD_PIXEL_WIDTH*LCD_PIXEL_HEIGHT; index++){
|
||||
*(__IO uint16_t *) (BANK0_LCD_D) = color;
|
||||
}
|
||||
}else if((0x9320 == device_code) || (0x9300 == device_code)){ //ILI9320
|
||||
lcd_register_write(0x20, 0);
|
||||
lcd_register_write(0x21, 0);
|
||||
lcd_command_write(0x22);
|
||||
for(index=0; index<LCD_PIXEL_WIDTH*LCD_PIXEL_HEIGHT; index++){
|
||||
*(__IO uint16_t *) (BANK0_LCD_D) = color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief set the point according to the specified position and color
|
||||
\param[in] x: the row-coordinate
|
||||
\param[in] y: the column-coordinate
|
||||
\param[in] point: specified color of the point
|
||||
\param[out] none
|
||||
\retval none
|
||||
*/
|
||||
void lcd_point_set(uint16_t x,uint16_t y,uint16_t point)
|
||||
{
|
||||
if ((x > LCD_PIXEL_HEIGHT)||(y > LCD_PIXEL_WIDTH)){
|
||||
return;
|
||||
}
|
||||
if(0x8989 == device_code){ // SSD1289
|
||||
lcd_cursor_set(x,y);
|
||||
lcd_gram_write_prepare();
|
||||
lcd_gram_write(point);
|
||||
}else if((0x9320 == device_code) || (0x9300 == device_code)){ //ILI9320
|
||||
lcd_register_write(0x20, x);
|
||||
lcd_register_write(0x21, y);
|
||||
lcd_register_write(0x22, point);
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief get point GRAM according to the specified position
|
||||
\param[in] x: the row-coordinate
|
||||
\param[in] y: the column-coordinate
|
||||
\param[out] none
|
||||
\retval GRAM value of point
|
||||
*/
|
||||
uint16_t lcd_point_get(uint16_t x,uint16_t y)
|
||||
{
|
||||
uint16_t data;
|
||||
|
||||
if ((x > LCD_PIXEL_HEIGHT)||(y > LCD_PIXEL_WIDTH)){
|
||||
return 0;
|
||||
}
|
||||
|
||||
lcd_cursor_set(x,y);
|
||||
data = lcd_gram_read();
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief set window area
|
||||
\param[in] start_x: the start position of row-coordinate
|
||||
\param[in] start_y: the start position of column-coordinate
|
||||
\param[in] end_x: the end position of row-coordinate
|
||||
\param[in] end_y: the end position of column-coordinate
|
||||
\param[out] none
|
||||
\retval none
|
||||
*/
|
||||
void lcd_windows_set(uint16_t start_x,uint16_t start_y,uint16_t end_x,uint16_t end_y)
|
||||
{
|
||||
if(0x8989 == device_code){ // SSD1289
|
||||
lcd_register_write(0x0044, start_x + (end_x<<8));
|
||||
lcd_register_write(0x0045, start_y);
|
||||
lcd_register_write(0x0046, end_y);
|
||||
|
||||
lcd_cursor_set(start_x, start_y);
|
||||
lcd_gram_write_prepare();
|
||||
}else if((0x9320 == device_code) || (0x9300 == device_code)){ //ILI9320
|
||||
lcd_register_write(0x0050, start_x);
|
||||
lcd_register_write(0x0052, start_y);
|
||||
lcd_register_write(0x0051, end_x);
|
||||
lcd_register_write(0x0053, end_y);
|
||||
|
||||
lcd_cursor_set(start_x, start_y);
|
||||
lcd_gram_write_prepare();
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief draw a horizontal line on LCD screen
|
||||
\param[in] x: the row-coordinate
|
||||
\param[in] start_y: the start column-coordinate
|
||||
\param[in] end_y: the end column-coordinate
|
||||
\param[in] color: specified color of the point
|
||||
\param[in] width: line width
|
||||
\param[out] none
|
||||
\retval none
|
||||
*/
|
||||
|
||||
void lcd_hline_draw(uint16_t x,uint16_t start_y,uint16_t end_y,uint16_t color,uint16_t width)
|
||||
{
|
||||
uint16_t i, y;
|
||||
|
||||
for (i = 0; i < width; i++) {
|
||||
uint16_t sx = x + i;
|
||||
|
||||
for (y = start_y; y < end_y; y++) {
|
||||
lcd_point_set(sx, y, color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief draw a vertical line on LCD screen
|
||||
\param[in] start_x: the start column-coordinate
|
||||
\param[in] end_x: the end column-coordinate
|
||||
\param[in] y: the row-coordinate
|
||||
\param[in] color: specified color of the point
|
||||
\param[in] width: line width
|
||||
\param[out] none
|
||||
\retval none
|
||||
*/
|
||||
|
||||
void lcd_vline_draw(uint16_t start_x,uint16_t end_x,uint16_t y,uint16_t color,uint16_t width)
|
||||
{
|
||||
uint16_t i, x;
|
||||
|
||||
for (i = 0; i < width; i++) {
|
||||
uint16_t sy = y + i;
|
||||
|
||||
for (x = start_x; x < end_x; x++) {
|
||||
lcd_point_set(x, sy, color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief draw a rectangle according to the specified position and color
|
||||
\param[in] start_x: the start position of row-coordinate
|
||||
\param[in] start_y: the start position of column-coordinate
|
||||
\param[in] end_x: the end position of row-coordinate
|
||||
\param[in] end_y: the end position of column-coordinate
|
||||
\param[in] point: specified color of the point
|
||||
\param[out] none
|
||||
\retval none
|
||||
*/
|
||||
void lcd_rectangle_draw(uint16_t start_x,uint16_t start_y,uint16_t end_x,uint16_t end_y,uint16_t point)
|
||||
{
|
||||
uint16_t x,y;
|
||||
x=start_x;
|
||||
y=start_y;
|
||||
/* draw four lines */
|
||||
for(x=start_x;x<end_x;x++){
|
||||
/* draw a point */
|
||||
lcd_point_set(x,y,point);
|
||||
}
|
||||
for(y=start_y;y<end_y;y++){
|
||||
lcd_point_set(x,y,point);
|
||||
}
|
||||
for(x=end_x;x>start_x;x--){
|
||||
lcd_point_set(x,y,point);
|
||||
}
|
||||
for(y=end_y;y>start_y;y--){
|
||||
lcd_point_set(x,y,point);
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief fill the specified color to a rectangle
|
||||
\param[in] start_x: the start position of row-coordinate
|
||||
\param[in] start_y: the start position of column-coordinate
|
||||
\param[in] end_x: the end position of row-coordinate
|
||||
\param[in] end_y: the end position of column-coordinate
|
||||
\param[in] color: specified color
|
||||
\param[out] none
|
||||
\retval none
|
||||
*/
|
||||
void lcd_rectangle_fill(uint16_t start_x,uint16_t start_y,uint16_t end_x,uint16_t end_y,uint16_t color)
|
||||
{
|
||||
uint16_t x, y;
|
||||
x = start_x;
|
||||
y = start_y;
|
||||
|
||||
for (x = start_x; x < end_x; x++) {
|
||||
for (y = start_y; y < end_y; y++) {
|
||||
lcd_point_set(x, y, color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief draw a picture on LCD screen according to the specified position
|
||||
\param[in] start_x: the start position of row-coordinate
|
||||
\param[in] start_y: the start position of column-coordinate
|
||||
\param[in] end_x: the end position of row-coordinate
|
||||
\param[in] end_y: the end position of column-coordinate
|
||||
\param[in] pic: the picture pointer
|
||||
\param[out] none
|
||||
\retval none
|
||||
*/
|
||||
void lcd_picture_draw(uint16_t start_x,uint16_t start_y,uint16_t end_x,uint16_t end_y,uint16_t *pic)
|
||||
{
|
||||
uint32_t i, total;
|
||||
uint16_t *picturepointer = pic;
|
||||
uint16_t x,y;
|
||||
|
||||
x = start_x;
|
||||
y = start_y;
|
||||
|
||||
total = (end_x - start_x + 1) * (end_y - start_y + 1);
|
||||
|
||||
for(i = 0; i < total; i ++){
|
||||
/* set point according to the specified position and color */
|
||||
lcd_point_set(x,y,*picturepointer++);
|
||||
x++;
|
||||
if(x > end_x){
|
||||
y++;
|
||||
x = start_x;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief display a char on LCD screen according to the specified position
|
||||
\param[in] x: the start position of row-coordinate
|
||||
\param[in] y: the start position of column-coordinate
|
||||
\param[in] c: the char
|
||||
\param[in] char_color: the color of char
|
||||
\param[in] c_format: the structure of char format
|
||||
font: CHAR_FONT_8_16 or CHAR_FONT_16_24
|
||||
direction: CHAR_DIRECTION_HORIZONTAL or CHAR_DIRECTION_VERTICAL
|
||||
char_color: the color of char
|
||||
bk_color: the color of background
|
||||
\param[out] none
|
||||
\retval none
|
||||
*/
|
||||
void lcd_char_display(uint16_t x,uint16_t y,uint8_t c,char_format_struct c_format)
|
||||
{
|
||||
uint16_t i = 0, j = 0;
|
||||
uint8_t temp_char = 0;
|
||||
uint16_t temp_char_16 = 0;
|
||||
|
||||
if(CHAR_FONT_8_16 == c_format.font){ /* 8x16 ASCII */
|
||||
for (i = 0; i < 16; i++) {
|
||||
temp_char = ascii_8x16[((c - 0x20) * 16) + i];
|
||||
if(CHAR_DIRECTION_HORIZONTAL == c_format.direction){
|
||||
for (j = 0; j < 8; j++) {
|
||||
if (((temp_char >> (7 - j)) & 0x01) == 0x01) {
|
||||
/* set point of char */
|
||||
lcd_point_set(x - i, y + j, c_format.char_color);
|
||||
} else {
|
||||
/* set point of background */
|
||||
lcd_point_set(x - i, y + j, c_format.bk_color);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
for (j = 0; j < 8; j++) {
|
||||
if (((temp_char >> (7 - j)) & 0x01) == 0x01) {
|
||||
/* set point of char */
|
||||
lcd_point_set(x + j, y + i, c_format.char_color);
|
||||
} else {
|
||||
/* set point of background */
|
||||
lcd_point_set(x + j, y + i, c_format.bk_color);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}else if(CHAR_FONT_16_24 == c_format.font){ /* 16x24 ASCII */
|
||||
for (i = 0; i < 24; i++) {
|
||||
temp_char_16 = ASCII_Table_16x24[((c - 0x20) * 24) + i];
|
||||
if(CHAR_DIRECTION_HORIZONTAL == c_format.direction){
|
||||
for (j = 0; j < 16; j++) {
|
||||
if (((temp_char_16 >> j) & 0x01) == 0x01) {
|
||||
/* set point of char */
|
||||
lcd_point_set(x - i, y + j, c_format.char_color);
|
||||
} else {
|
||||
/* set point of background */
|
||||
lcd_point_set(x - i, y + j, c_format.bk_color);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
for (j = 0; j < 16; j++) {
|
||||
if (((temp_char_16 >> j) & 0x01) == 0x01) {
|
||||
/* set point of char */
|
||||
lcd_point_set(x + j, y + i, c_format.char_color);
|
||||
} else {
|
||||
/* set point of background */
|
||||
lcd_point_set(x + j, y + i, c_format.bk_color);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
146
board/GigaDevice_GD32E507Z_EVAL/BSP/Src/gd32e50x_it.c
Normal file
146
board/GigaDevice_GD32E507Z_EVAL/BSP/Src/gd32e50x_it.c
Normal file
@@ -0,0 +1,146 @@
|
||||
/*!
|
||||
\file gd32e50x_it.c
|
||||
\brief interrupt service routines
|
||||
|
||||
\version 2020-06-30, V1.0.0, demo for GD32E50x
|
||||
\version 2020-08-26, V1.1.0, demo for GD32E50x
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (c) 2020, GigaDevice Semiconductor Inc.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
3. Neither the name of the copyright holder nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "gd32e50x_it.h"
|
||||
#include "systick.h"
|
||||
#include "tos_k.h"
|
||||
/*!
|
||||
\brief this function handles NMI exception
|
||||
\param[in] none
|
||||
\param[out] none
|
||||
\retval none
|
||||
*/
|
||||
void NMI_Handler(void)
|
||||
{
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief this function handles HardFault exception
|
||||
\param[in] none
|
||||
\param[out] none
|
||||
\retval none
|
||||
*/
|
||||
void HardFault_Handler(void)
|
||||
{
|
||||
/* if Hard Fault exception occurs, go to infinite loop */
|
||||
while (1){
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief this function handles MemManage exception
|
||||
\param[in] none
|
||||
\param[out] none
|
||||
\retval none
|
||||
*/
|
||||
void MemManage_Handler(void)
|
||||
{
|
||||
/* if Memory Manage exception occurs, go to infinite loop */
|
||||
while (1){
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief this function handles BusFault exception
|
||||
\param[in] none
|
||||
\param[out] none
|
||||
\retval none
|
||||
*/
|
||||
void BusFault_Handler(void)
|
||||
{
|
||||
/* if Bus Fault exception occurs, go to infinite loop */
|
||||
while (1){
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief this function handles UsageFault exception
|
||||
\param[in] none
|
||||
\param[out] none
|
||||
\retval none
|
||||
*/
|
||||
void UsageFault_Handler(void)
|
||||
{
|
||||
/* if Usage Fault exception occurs, go to infinite loop */
|
||||
while (1){
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief this function handles SVC exception
|
||||
\param[in] none
|
||||
\param[out] none
|
||||
\retval none
|
||||
*/
|
||||
void SVC_Handler(void)
|
||||
{
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief this function handles DebugMon exception
|
||||
\param[in] none
|
||||
\param[out] none
|
||||
\retval none
|
||||
*/
|
||||
void DebugMon_Handler(void)
|
||||
{
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief this function handles PendSV exception
|
||||
\param[in] none
|
||||
\param[out] none
|
||||
\retval none
|
||||
*/
|
||||
//void PendSV_Handler(void)
|
||||
//{
|
||||
//}
|
||||
|
||||
/*!
|
||||
\brief this function handles SysTick exception
|
||||
\param[in] none
|
||||
\param[out] none
|
||||
\retval none
|
||||
*/
|
||||
void SysTick_Handler(void)
|
||||
{
|
||||
if(tos_knl_is_running())
|
||||
{
|
||||
tos_knl_irq_enter();
|
||||
tos_tick_handler();
|
||||
tos_knl_irq_leave();
|
||||
}
|
||||
delay_decrement();
|
||||
}
|
71
board/GigaDevice_GD32E507Z_EVAL/BSP/Src/main.c
Normal file
71
board/GigaDevice_GD32E507Z_EVAL/BSP/Src/main.c
Normal file
@@ -0,0 +1,71 @@
|
||||
#include "gd32e50x.h"
|
||||
#include "gd32e507z_eval.h"
|
||||
#include "systick.h"
|
||||
#include <stdio.h>
|
||||
#include "cmsis_os.h"
|
||||
|
||||
#define TASK1_STK_SIZE 512
|
||||
void task1(void *arg);
|
||||
osThreadDef(task1, osPriorityNormal, 2, TASK1_STK_SIZE);
|
||||
|
||||
#define TASK2_STK_SIZE 512
|
||||
void task2(void *arg);
|
||||
osThreadDef(task2, osPriorityNormal, 1, TASK2_STK_SIZE);
|
||||
|
||||
void board_init(void)
|
||||
{
|
||||
/* initialize the leds */
|
||||
gd_eval_led_init(LED1);
|
||||
gd_eval_led_init(LED2);
|
||||
gd_eval_led_init(LED3);
|
||||
gd_eval_led_init(LED4);
|
||||
/* close all of leds */
|
||||
gd_eval_led_off(LED1);
|
||||
gd_eval_led_off(LED2);
|
||||
gd_eval_led_off(LED3);
|
||||
gd_eval_led_off(LED4);
|
||||
/* configure systick */
|
||||
systick_config();
|
||||
/* configure EVAL_COM0 */
|
||||
gd_eval_com_init(EVAL_COM0);
|
||||
}
|
||||
|
||||
|
||||
void task1(void *arg)
|
||||
{
|
||||
while (1) {
|
||||
gd_eval_led_toggle(LED1);
|
||||
gd_eval_led_toggle(LED2);
|
||||
printf("++++++++This is task1!\r\n");
|
||||
osDelay(2000);
|
||||
}
|
||||
}
|
||||
|
||||
void task2(void *arg)
|
||||
{
|
||||
while (1) {
|
||||
gd_eval_led_toggle(LED3);
|
||||
gd_eval_led_toggle(LED4);
|
||||
printf("---------This is task2!\r\n");
|
||||
osDelay(1000);
|
||||
}
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
board_init();
|
||||
printf("Welcome to TencentOS Tiny!\r\n");
|
||||
osKernelInitialize();
|
||||
osThreadCreate(osThread(task1), NULL); // Create task1
|
||||
osThreadCreate(osThread(task2), NULL); // Create task2
|
||||
osKernelStart();
|
||||
}
|
||||
|
||||
|
||||
/* retarget the C library printf function to the USART */
|
||||
int fputc(int ch, FILE *f)
|
||||
{
|
||||
usart_data_transmit(EVAL_COM0, (uint8_t)ch);
|
||||
while(RESET == usart_flag_get(EVAL_COM0, USART_FLAG_TBE));
|
||||
return ch;
|
||||
}
|
85
board/GigaDevice_GD32E507Z_EVAL/BSP/Src/systick.c
Normal file
85
board/GigaDevice_GD32E507Z_EVAL/BSP/Src/systick.c
Normal file
@@ -0,0 +1,85 @@
|
||||
/*!
|
||||
\file systick.c
|
||||
\brief the systick configuration file
|
||||
|
||||
\version 2020-06-30, V1.0.0, demo for GD32E50x
|
||||
\version 2020-08-26, V1.1.0, demo for GD32E50x
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (c) 2020, GigaDevice Semiconductor Inc.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
3. Neither the name of the copyright holder nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
|
||||
#include "gd32e50x.h"
|
||||
#include "systick.h"
|
||||
|
||||
static __IO uint32_t delay;
|
||||
|
||||
/*!
|
||||
\brief configure systick
|
||||
\param[in] none
|
||||
\param[out] none
|
||||
\retval none
|
||||
*/
|
||||
void systick_config(void)
|
||||
{
|
||||
/* setup systick timer for 1000Hz interrupts */
|
||||
if (SysTick_Config(SystemCoreClock / 1000U)){
|
||||
/* capture error */
|
||||
while (1){
|
||||
}
|
||||
}
|
||||
/* configure the systick handler priority */
|
||||
NVIC_SetPriority(SysTick_IRQn, 0x00U);
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief delay a time in milliseconds
|
||||
\param[in] count: count in milliseconds
|
||||
\param[out] none
|
||||
\retval none
|
||||
*/
|
||||
void delay_1ms(uint32_t count)
|
||||
{
|
||||
delay = count;
|
||||
|
||||
while(0U != delay){
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief delay decrement
|
||||
\param[in] none
|
||||
\param[out] none
|
||||
\retval none
|
||||
*/
|
||||
void delay_decrement(void)
|
||||
{
|
||||
if (0U != delay){
|
||||
delay--;
|
||||
}
|
||||
}
|
1489
board/GigaDevice_GD32E507Z_EVAL/IAR/hello_world/GD32E507Z_EVAL.ewd
Normal file
1489
board/GigaDevice_GD32E507Z_EVAL/IAR/hello_world/GD32E507Z_EVAL.ewd
Normal file
File diff suppressed because it is too large
Load Diff
1296
board/GigaDevice_GD32E507Z_EVAL/IAR/hello_world/GD32E507Z_EVAL.ewp
Normal file
1296
board/GigaDevice_GD32E507Z_EVAL/IAR/hello_world/GD32E507Z_EVAL.ewp
Normal file
File diff suppressed because it is too large
Load Diff
1645
board/GigaDevice_GD32E507Z_EVAL/IAR/hello_world/GD32E507Z_EVAL.ewt
Normal file
1645
board/GigaDevice_GD32E507Z_EVAL/IAR/hello_world/GD32E507Z_EVAL.ewt
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
|
||||
<workspace>
|
||||
<project>
|
||||
<path>$WS_DIR$\GD32E507Z_EVAL.ewp</path>
|
||||
</project>
|
||||
<batchBuild/>
|
||||
</workspace>
|
||||
|
||||
|
55
board/GigaDevice_GD32E507Z_EVAL/TOS_CONFIG/tos_config.h
Normal file
55
board/GigaDevice_GD32E507Z_EVAL/TOS_CONFIG/tos_config.h
Normal file
@@ -0,0 +1,55 @@
|
||||
#ifndef _TOS_CONFIG_H_
|
||||
#define _TOS_CONFIG_H_
|
||||
|
||||
#include "gd32e50x.h"
|
||||
|
||||
#define TOS_CFG_TASK_PRIO_MAX 10u
|
||||
|
||||
#define TOS_CFG_ROUND_ROBIN_EN 0u
|
||||
|
||||
#define TOS_CFG_OBJECT_VERIFY_EN 1u
|
||||
|
||||
#define TOS_CFG_TASK_DYNAMIC_CREATE_EN 1u
|
||||
|
||||
#define TOS_CFG_EVENT_EN 1u
|
||||
|
||||
#define TOS_CFG_MMBLK_EN 1u
|
||||
|
||||
#define TOS_CFG_MMHEAP_EN 1u
|
||||
|
||||
#define TOS_CFG_MMHEAP_DEFAULT_POOL_EN 1u
|
||||
|
||||
#define TOS_CFG_MMHEAP_DEFAULT_POOL_SIZE 0x100
|
||||
|
||||
#define TOS_CFG_MUTEX_EN 1u
|
||||
|
||||
#define TOS_CFG_MESSAGE_QUEUE_EN 1u
|
||||
|
||||
#define TOS_CFG_MAIL_QUEUE_EN 1u
|
||||
|
||||
#define TOS_CFG_PRIORITY_MESSAGE_QUEUE_EN 1u
|
||||
|
||||
#define TOS_CFG_PRIORITY_MAIL_QUEUE_EN 1u
|
||||
|
||||
#define TOS_CFG_TIMER_EN 0u
|
||||
|
||||
#define TOS_CFG_PWR_MGR_EN 0u
|
||||
|
||||
#define TOS_CFG_TICKLESS_EN 0u
|
||||
|
||||
#define TOS_CFG_SEM_EN 1u
|
||||
|
||||
#define TOS_CFG_TASK_STACK_DRAUGHT_DEPTH_DETACT_EN 1u
|
||||
|
||||
#define TOS_CFG_FAULT_BACKTRACE_EN 0u
|
||||
|
||||
#define TOS_CFG_IDLE_TASK_STK_SIZE 128u
|
||||
|
||||
#define TOS_CFG_CPU_TICK_PER_SECOND 1000u
|
||||
|
||||
#define TOS_CFG_CPU_CLOCK (SystemCoreClock)
|
||||
|
||||
#define TOS_CFG_TIMER_AS_PROC 1u
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user