├── .gitignore ├── Firmware ├── For_V1.0.0_PCB │ ├── InkScreen2_13 │ │ ├── Application │ │ │ └── HardDrivers │ │ │ │ ├── E2213JS0C1.c │ │ │ │ ├── E2213JS0C1.h │ │ │ │ ├── font.h │ │ │ │ └── image.h │ │ ├── Core │ │ │ ├── Inc │ │ │ │ ├── gpio.h │ │ │ │ ├── main.h │ │ │ │ ├── spi.h │ │ │ │ ├── stm32_assert.h │ │ │ │ ├── stm32f1xx_hal_conf.h │ │ │ │ └── stm32f1xx_it.h │ │ │ └── Src │ │ │ │ ├── gpio.c │ │ │ │ ├── main.c │ │ │ │ ├── spi.c │ │ │ │ ├── stm32f1xx_hal_msp.c │ │ │ │ ├── stm32f1xx_it.c │ │ │ │ └── system_stm32f1xx.c │ │ ├── Drivers │ │ │ ├── CMSIS │ │ │ │ ├── Device │ │ │ │ │ └── ST │ │ │ │ │ │ └── STM32F1xx │ │ │ │ │ │ ├── Include │ │ │ │ │ │ ├── stm32f103xb.h │ │ │ │ │ │ ├── stm32f1xx.h │ │ │ │ │ │ └── system_stm32f1xx.h │ │ │ │ │ │ └── License.md │ │ │ │ ├── Include │ │ │ │ │ ├── cmsis_armcc.h │ │ │ │ │ ├── cmsis_armclang.h │ │ │ │ │ ├── cmsis_compiler.h │ │ │ │ │ ├── cmsis_gcc.h │ │ │ │ │ ├── cmsis_iccarm.h │ │ │ │ │ ├── cmsis_version.h │ │ │ │ │ ├── core_armv8mbl.h │ │ │ │ │ ├── core_armv8mml.h │ │ │ │ │ ├── core_cm0.h │ │ │ │ │ ├── core_cm0plus.h │ │ │ │ │ ├── core_cm1.h │ │ │ │ │ ├── core_cm23.h │ │ │ │ │ ├── core_cm3.h │ │ │ │ │ ├── core_cm33.h │ │ │ │ │ ├── core_cm4.h │ │ │ │ │ ├── core_cm7.h │ │ │ │ │ ├── core_sc000.h │ │ │ │ │ ├── core_sc300.h │ │ │ │ │ ├── mpu_armv7.h │ │ │ │ │ ├── mpu_armv8.h │ │ │ │ │ └── tz_context.h │ │ │ │ └── LICENSE.txt │ │ │ └── STM32F1xx_HAL_Driver │ │ │ │ ├── Inc │ │ │ │ ├── Legacy │ │ │ │ │ └── stm32_hal_legacy.h │ │ │ │ ├── stm32f1xx_hal.h │ │ │ │ ├── stm32f1xx_hal_cortex.h │ │ │ │ ├── stm32f1xx_hal_def.h │ │ │ │ ├── stm32f1xx_hal_dma.h │ │ │ │ ├── stm32f1xx_hal_dma_ex.h │ │ │ │ ├── stm32f1xx_hal_exti.h │ │ │ │ ├── stm32f1xx_hal_flash.h │ │ │ │ ├── stm32f1xx_hal_flash_ex.h │ │ │ │ ├── stm32f1xx_hal_gpio.h │ │ │ │ ├── stm32f1xx_hal_gpio_ex.h │ │ │ │ ├── stm32f1xx_hal_pwr.h │ │ │ │ ├── stm32f1xx_hal_rcc.h │ │ │ │ ├── stm32f1xx_hal_rcc_ex.h │ │ │ │ ├── stm32f1xx_hal_tim.h │ │ │ │ ├── stm32f1xx_hal_tim_ex.h │ │ │ │ ├── stm32f1xx_ll_bus.h │ │ │ │ ├── stm32f1xx_ll_cortex.h │ │ │ │ ├── stm32f1xx_ll_dma.h │ │ │ │ ├── stm32f1xx_ll_exti.h │ │ │ │ ├── stm32f1xx_ll_gpio.h │ │ │ │ ├── stm32f1xx_ll_pwr.h │ │ │ │ ├── stm32f1xx_ll_rcc.h │ │ │ │ ├── stm32f1xx_ll_spi.h │ │ │ │ ├── stm32f1xx_ll_system.h │ │ │ │ └── stm32f1xx_ll_utils.h │ │ │ │ ├── License.md │ │ │ │ └── Src │ │ │ │ ├── stm32f1xx_hal.c │ │ │ │ ├── stm32f1xx_hal_cortex.c │ │ │ │ ├── stm32f1xx_hal_dma.c │ │ │ │ ├── stm32f1xx_hal_exti.c │ │ │ │ ├── stm32f1xx_hal_flash.c │ │ │ │ ├── stm32f1xx_hal_flash_ex.c │ │ │ │ ├── stm32f1xx_hal_gpio.c │ │ │ │ ├── stm32f1xx_hal_gpio_ex.c │ │ │ │ ├── stm32f1xx_hal_pwr.c │ │ │ │ ├── stm32f1xx_hal_rcc.c │ │ │ │ ├── stm32f1xx_hal_rcc_ex.c │ │ │ │ ├── stm32f1xx_hal_tim.c │ │ │ │ ├── stm32f1xx_hal_tim_ex.c │ │ │ │ ├── stm32f1xx_ll_dma.c │ │ │ │ ├── stm32f1xx_ll_exti.c │ │ │ │ ├── stm32f1xx_ll_gpio.c │ │ │ │ ├── stm32f1xx_ll_rcc.c │ │ │ │ ├── stm32f1xx_ll_spi.c │ │ │ │ └── stm32f1xx_ll_utils.c │ │ ├── InkScreen2_13.ioc │ │ ├── MDK-ARM │ │ │ ├── DebugConfig │ │ │ │ └── InkScreen2_13_STM32F103C8_1.0.0.dbgconf │ │ │ ├── EventRecorderStub.scvd │ │ │ ├── InkScreen2_13.uvguix.Administrator │ │ │ ├── InkScreen2_13.uvoptx │ │ │ ├── InkScreen2_13.uvprojx │ │ │ ├── InkScreen2_13 │ │ │ │ └── InkScreen2_13.hex │ │ │ ├── JLinkSettings.ini │ │ │ ├── RTE │ │ │ │ └── _InkScreen2_13 │ │ │ │ │ └── RTE_Components.h │ │ │ └── startup_stm32f103xb.s │ │ └── kill.bat │ └── Release_HEX │ │ └── InkScreen2_13.hex └── For_V2.1.0_PCB │ ├── ExternalFlashresources_Bin │ ├── ASCII_FONT_16.bin │ ├── BMP.bin │ ├── BMP.txt │ ├── CH_GBK+ASCII+BMP+IMAGE.bin │ ├── CH_GBK+ASCII+BMP+IMAGE.txt │ ├── CH_GBK_FONT_16.bin │ ├── IMAGE.bin │ └── IMAGE.txt │ ├── InkScreen2_13 │ ├── .mxproject │ ├── .vscode │ │ └── settings.json │ ├── Application │ │ └── HardDrivers │ │ │ ├── E2213JS0C1.c │ │ │ ├── E2213JS0C1.h │ │ │ ├── font.h │ │ │ ├── image.h │ │ │ ├── spiFlash.c │ │ │ └── spiFlash.h │ ├── Core │ │ ├── Inc │ │ │ ├── gpio.h │ │ │ ├── main.h │ │ │ ├── spi.h │ │ │ ├── stm32_assert.h │ │ │ ├── stm32f1xx_hal_conf.h │ │ │ └── stm32f1xx_it.h │ │ └── Src │ │ │ ├── gpio.c │ │ │ ├── main.c │ │ │ ├── spi.c │ │ │ ├── stm32f1xx_hal_msp.c │ │ │ ├── stm32f1xx_it.c │ │ │ └── system_stm32f1xx.c │ ├── Drivers.rar │ ├── InkScreen2_13.ioc │ ├── MDK-ARM.rar │ └── kill.bat │ └── Release_HEX │ └── InkScreen2_13.hex ├── Hardware ├── V1.0.0 │ ├── My_E-Paper_Driver_V1.0.0(Gerber).rar │ ├── My_E-Paper_Driver_V1.0.0.pdf │ ├── My_E-Paper_Driver_V1.0.0.rar │ └── 更新说明.txt ├── V2.0.0 │ ├── My_E-Paper_Driver_V2.0.0(Gerber).rar │ ├── My_E-Paper_Driver_V2.0.0.pdf │ ├── My_E-Paper_Driver_V2.0.0.rar │ └── 更新说明.txt └── V2.1.0 │ ├── My_E-Paper_Driver_V2.1.0(Gerber).rar │ ├── My_E-Paper_Driver_V2.1.0.pdf │ ├── My_E-Paper_Driver_V2.1.0.rar │ └── 更新说明.txt ├── LICENSE ├── README.md ├── Readme_Image ├── 5.7_1.jpg ├── EXTERNAL_SPI_FLASH_CONFIG.png ├── ExternalFlashResources_Bin.png ├── Image2LcdParamSet.png ├── OfficialDriveBoard.png ├── OfficialLibrary.png ├── ShowScreen_1.jpg ├── ShowScreen_2.jpg ├── ShowScreen_3.jpg ├── UBIN_1.jpg ├── UBIN_2.jpg └── order.png └── Tool ├── ASCII.rar ├── C2B V2.0.rar ├── Image2Lcd 2.9(破解版).rar ├── PCtoLCD2002完美版.rar ├── UBIN.rar └── 字库制作软件.rar /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BUYITAO/My_E-Paper_Driver/d78ec6fbcef9611fbeb8ad80f2b692ac6e225ed6/.gitignore -------------------------------------------------------------------------------- /Firmware/For_V1.0.0_PCB/InkScreen2_13/Application/HardDrivers/E2213JS0C1.h: -------------------------------------------------------------------------------- 1 | #ifndef __E2213JS0C1_H 2 | #define __E2213JS0C1_H 3 | 4 | #include "main.h" 5 | 6 | /*引脚定义*************************************************************************/ 7 | /* SPI号 */ 8 | #define E2213JS0C1_SPI (SPI1) 9 | /* CS */ 10 | #define E2213JS0C1_CS_ENABLE() \ 11 | LL_GPIO_ResetOutputPin(DO_SCREEN_CS_GPIO_Port, DO_SCREEN_CS_Pin) 12 | #define E2213JS0C1_CS_DISABLE() \ 13 | LL_GPIO_SetOutputPin(DO_SCREEN_CS_GPIO_Port, DO_SCREEN_CS_Pin) 14 | /* DC */ 15 | #define E2213JS0C1_DC_DATA() \ 16 | LL_GPIO_SetOutputPin(DO_SCREEN_DC_GPIO_Port, DO_SCREEN_DC_Pin) 17 | #define E2213JS0C1_DC_CMD() \ 18 | LL_GPIO_ResetOutputPin(DO_SCREEN_DC_GPIO_Port, DO_SCREEN_DC_Pin) 19 | /* RST */ 20 | #define E2213JS0C1_RST_ENABLE() \ 21 | LL_GPIO_SetOutputPin(DO_SCREEN_RST_GPIO_Port, DO_SCREEN_RST_Pin) 22 | #define E2213JS0C1_RST_DISABLE() \ 23 | LL_GPIO_ResetOutputPin(DO_SCREEN_RST_GPIO_Port, DO_SCREEN_RST_Pin) 24 | /* BUSY */ 25 | #define E2213JS0C1_BUSY_READ() \ 26 | LL_GPIO_IsInputPinSet(DI_SCREEN_BUSY_GPIO_Port,DI_SCREEN_BUSY_Pin) 27 | /*枚举*****************************************************************************/ 28 | /* 方向:水平/垂直 */ 29 | enum ENUM_ORIENTATION 30 | { 31 | HORIZONTAL, 32 | VERTICAL 33 | }; 34 | /* 填充:实心/空心 */ 35 | enum ENUM_FILL 36 | { 37 | SOLID, 38 | HOLLOW 39 | }; 40 | /*屏幕参数*************************************************************************/ 41 | /* X轴坐标0~103;Y轴坐标0~211 */ 42 | #define E2213JS0C1_W 104 43 | #define E2213JS0C1_H 212 44 | #define E2213JS0C1_XPOS_MAX 103 45 | #define E2213JS0C1_YPOS_MAX 211 46 | #define E2213JS0C1_BUFFER_SIZE (E2213JS0C1_W * E2213JS0C1_H / 8) 47 | #define E2213JS0C1_BUFFER_WIDTH_SIZE (E2213JS0C1_W / 8) 48 | #define E2213JS0C1_BUFFER_HEIGHT_SIZE (E2213JS0C1_H) 49 | /*颜色*****************************************************************************/ 50 | enum ENUM_COLOR 51 | { 52 | RED, 53 | WHITE, 54 | BLACK, 55 | GREY, 56 | DARKRED, 57 | LIGHTRED 58 | }; 59 | /* 01红,00白,10黑 */ 60 | #define RED_BUFFER1 0X00 61 | #define RED_BUFFER2 0XFF 62 | #define WHITE_BUFFER1 0x00 63 | #define WHITE_BUFFER2 0x00 64 | #define BLACK_BUFFER1 0xFF 65 | #define BLACK_BUFFER2 0x00 66 | /* 红白相间=浅红色,红黑相间=深红色,黑白相间=灰色 */ 67 | #define GREY_BUFFER1_SINGLE 0xAA 68 | #define GREY_BUFFER1_DOUBLE 0x55 69 | #define GREY_BUFFER2 0x00 70 | #define DARKRED_BUFFER1_SINGLE 0xAA 71 | #define DARKRED_BUFFER1_DOUBLE 0x55 72 | #define DARKRED_BUFFER2_SINGLE 0x55 73 | #define DARKRED_BUFFER2_DOUBLE 0xAA 74 | #define LIGHTRED_BUFFER1 0x00 75 | #define LIGHTRED_BUFFER2_SINGLE 0xAA 76 | #define LIGHTRED_BUFFER2_DOUBLE 0x55 77 | /* RGB565 */ 78 | #define RGB565_RED 0xF800 79 | #define RGB565_WHITE 0xFFFF 80 | #define RGB565_BLACK 0x0000 81 | /*字库*****************************************************************************/ 82 | #define FONT_1608 (0) 83 | #define FONT_1608_WIDTH (8) 84 | #define FONT_1608_HEIGHT (16) 85 | /*指令*****************************************************************************/ 86 | #define SOFT_RESET_CMD 0x00 87 | #define SOFT_RESET_DATA 0x0E 88 | #define SET_TEMP_CMD 0xE5 89 | #define SET_TEMP_25_DATA 0x19 90 | #define ACTIVE_TEMP_CMD 0xE0 91 | #define ACTIVE_TEMP_25_DATA 0x02 92 | //#define PANEL_SET_CMD 0x00 93 | //#define PANEL_SET_DATA_1 0xCF 94 | //#define PANEL_SET_DATA_2 0x89 95 | #define FIRST_FRAME_CMD 0x10 96 | #define SECOND_FRAME_CMD 0x13 97 | #define TURN_ON_DCDC_CMD 0x04 98 | #define TURN_OFF_DCDC_CMD 0x02 99 | #define DISPLAY_REFRESH_CMD 0x12 100 | /*位操作***************************************************************************/ 101 | /* 指定的某一位数置1 */ 102 | #define SetBit(x, y) (x |= (1<>y) & 1) 109 | /* 指定的某一位数置为指定的0或1 */ 110 | #define WriteBit(data, position, flag) (flag ? SetBit(data, position) : ClearBit(data, position)) 111 | /*函数*******************************************************************************/ 112 | void E2213JS0C1_Init(void); 113 | void E2213JS0C1_SendImageData(void); 114 | void E2213JS0C1_ClearFullScreen(enum ENUM_COLOR color); 115 | void E2213JS0C1_SendUpdateCmd(void); 116 | void E2213JS0C1_TurnOffDCDC(void); 117 | void E2213JS0C1_DrawPoint(uint8_t xPos, uint8_t yPos, enum ENUM_COLOR color); 118 | void E2213JS0C1_DrawLine(uint8_t xStart, uint8_t yStart, uint8_t length, 119 | enum ENUM_ORIENTATION orientation, enum ENUM_COLOR color); 120 | void E2213JS0C1_DrawRectangle(uint8_t xStart, uint8_t yStart, uint8_t width, 121 | uint8_t height, enum ENUM_FILL fill, enum ENUM_COLOR borderColor, 122 | enum ENUM_COLOR fillColor); 123 | uint8_t E2213JS0C1_ShowChar(uint8_t xStart, uint8_t yStart, char chr, 124 | uint8_t font, enum ENUM_COLOR fontColor, enum ENUM_COLOR backgroundColor); 125 | uint8_t E2213JS0C1_ShowCharStr(uint8_t xStart, uint8_t yStart, char* str, 126 | uint8_t font, enum ENUM_COLOR fontColor, enum ENUM_COLOR backgroundColor); 127 | void E2213JS0C1_DrawBmp(uint8_t xStart, uint8_t yStart, uint8_t bmpWidth, 128 | uint8_t bmpHeight, enum ENUM_COLOR fontColor, enum ENUM_COLOR backgroundColor, 129 | const unsigned char* pic); 130 | void E2213JS0C1_DrawImage(uint8_t xStart, uint8_t yStart, uint8_t imageWidth, 131 | uint8_t imageHeight, const unsigned char* pic); 132 | #endif 133 | -------------------------------------------------------------------------------- /Firmware/For_V1.0.0_PCB/InkScreen2_13/Application/HardDrivers/font.h: -------------------------------------------------------------------------------- 1 | #ifndef __FONT_H 2 | #define __FONT_H 3 | 4 | 5 | //常用ASCII表 6 | //偏移量32 7 | //ASCII字符集: !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ 8 | //PC2LCD2002取模方式设置:阴码+逐行式+顺向+C51格式 9 | 10 | //8*16 ASCII字符集点阵 11 | const unsigned char ACSII_1608[95][16]={ 12 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*" ",0*/ 13 | {0x00,0x00,0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x10,0x10,0x00,0x00},/*"!",1*/ 14 | {0x00,0x12,0x24,0x24,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*""",2*/ 15 | {0x00,0x00,0x00,0x12,0x12,0x12,0x7E,0x24,0x24,0x24,0x7E,0x24,0x24,0x24,0x00,0x00},/*"#",3*/ 16 | {0x00,0x00,0x08,0x3C,0x4A,0x4A,0x48,0x38,0x0C,0x0A,0x0A,0x4A,0x4A,0x3C,0x08,0x08},/*"$",4*/ 17 | {0x00,0x00,0x00,0x44,0xA4,0xA8,0xA8,0xB0,0x54,0x1A,0x2A,0x2A,0x4A,0x44,0x00,0x00},/*"%",5*/ 18 | {0x00,0x00,0x00,0x30,0x48,0x48,0x48,0x50,0x6E,0xA4,0x94,0x98,0x89,0x76,0x00,0x00},/*"&",6*/ 19 | {0x00,0x60,0x20,0x20,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"'",7*/ 20 | {0x00,0x02,0x04,0x08,0x08,0x10,0x10,0x10,0x10,0x10,0x10,0x08,0x08,0x04,0x02,0x00},/*"(",8*/ 21 | {0x00,0x40,0x20,0x10,0x10,0x08,0x08,0x08,0x08,0x08,0x08,0x10,0x10,0x20,0x40,0x00},/*")",9*/ 22 | {0x00,0x00,0x00,0x00,0x10,0x10,0xD6,0x38,0x38,0xD6,0x10,0x10,0x00,0x00,0x00,0x00},/*"*",10*/ 23 | {0x00,0x00,0x00,0x00,0x00,0x08,0x08,0x08,0x7F,0x08,0x08,0x08,0x00,0x00,0x00,0x00},/*"+",11*/ 24 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x20,0x20,0x40},/*",",12*/ 25 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"-",13*/ 26 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x60,0x00,0x00},/*".",14*/ 27 | {0x00,0x00,0x02,0x04,0x04,0x04,0x08,0x08,0x10,0x10,0x10,0x20,0x20,0x40,0x40,0x00},/*"/",15*/ 28 | {0x00,0x00,0x00,0x18,0x24,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x24,0x18,0x00,0x00},/*"0",16*/ 29 | {0x00,0x00,0x00,0x08,0x38,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x3E,0x00,0x00},/*"1",17*/ 30 | {0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x02,0x04,0x08,0x10,0x20,0x42,0x7E,0x00,0x00},/*"2",18*/ 31 | {0x00,0x00,0x00,0x3C,0x42,0x42,0x02,0x04,0x18,0x04,0x02,0x42,0x42,0x3C,0x00,0x00},/*"3",19*/ 32 | {0x00,0x00,0x00,0x04,0x0C,0x0C,0x14,0x24,0x24,0x44,0x7F,0x04,0x04,0x1F,0x00,0x00},/*"4",20*/ 33 | {0x00,0x00,0x00,0x7E,0x40,0x40,0x40,0x78,0x44,0x02,0x02,0x42,0x44,0x38,0x00,0x00},/*"5",21*/ 34 | {0x00,0x00,0x00,0x18,0x24,0x40,0x40,0x5C,0x62,0x42,0x42,0x42,0x22,0x1C,0x00,0x00},/*"6",22*/ 35 | {0x00,0x00,0x00,0x7E,0x42,0x04,0x04,0x08,0x08,0x10,0x10,0x10,0x10,0x10,0x00,0x00},/*"7",23*/ 36 | {0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x24,0x18,0x24,0x42,0x42,0x42,0x3C,0x00,0x00},/*"8",24*/ 37 | {0x00,0x00,0x00,0x38,0x44,0x42,0x42,0x42,0x46,0x3A,0x02,0x02,0x24,0x18,0x00,0x00},/*"9",25*/ 38 | {0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00},/*":",26*/ 39 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x10},/*";",27*/ 40 | {0x00,0x00,0x00,0x02,0x04,0x08,0x10,0x20,0x40,0x20,0x10,0x08,0x04,0x02,0x00,0x00},/*"<",28*/ 41 | {0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00},/*"=",29*/ 42 | {0x00,0x00,0x00,0x40,0x20,0x10,0x08,0x04,0x02,0x04,0x08,0x10,0x20,0x40,0x00,0x00},/*">",30*/ 43 | {0x00,0x00,0x00,0x3C,0x42,0x42,0x62,0x04,0x08,0x08,0x08,0x00,0x18,0x18,0x00,0x00},/*"?",31*/ 44 | {0x00,0x00,0x00,0x38,0x44,0x5A,0xAA,0xAA,0xAA,0xAA,0xAA,0x5C,0x42,0x3C,0x00,0x00},/*"@",32*/ 45 | {0x00,0x00,0x00,0x10,0x10,0x18,0x28,0x28,0x24,0x3C,0x44,0x42,0x42,0xE7,0x00,0x00},/*"A",33*/ 46 | {0x00,0x00,0x00,0xF8,0x44,0x44,0x44,0x78,0x44,0x42,0x42,0x42,0x44,0xF8,0x00,0x00},/*"B",34*/ 47 | {0x00,0x00,0x00,0x3E,0x42,0x42,0x80,0x80,0x80,0x80,0x80,0x42,0x44,0x38,0x00,0x00},/*"C",35*/ 48 | {0x00,0x00,0x00,0xF8,0x44,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x44,0xF8,0x00,0x00},/*"D",36*/ 49 | {0x00,0x00,0x00,0xFC,0x42,0x48,0x48,0x78,0x48,0x48,0x40,0x42,0x42,0xFC,0x00,0x00},/*"E",37*/ 50 | {0x00,0x00,0x00,0xFC,0x42,0x48,0x48,0x78,0x48,0x48,0x40,0x40,0x40,0xE0,0x00,0x00},/*"F",38*/ 51 | {0x00,0x00,0x00,0x3C,0x44,0x44,0x80,0x80,0x80,0x8E,0x84,0x44,0x44,0x38,0x00,0x00},/*"G",39*/ 52 | {0x00,0x00,0x00,0xE7,0x42,0x42,0x42,0x42,0x7E,0x42,0x42,0x42,0x42,0xE7,0x00,0x00},/*"H",40*/ 53 | {0x00,0x00,0x00,0x7C,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x7C,0x00,0x00},/*"I",41*/ 54 | {0x00,0x00,0x00,0x3E,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x88,0xF0},/*"J",42*/ 55 | {0x00,0x00,0x00,0xEE,0x44,0x48,0x50,0x70,0x50,0x48,0x48,0x44,0x44,0xEE,0x00,0x00},/*"K",43*/ 56 | {0x00,0x00,0x00,0xE0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x42,0xFE,0x00,0x00},/*"L",44*/ 57 | {0x00,0x00,0x00,0xEE,0x6C,0x6C,0x6C,0x6C,0x6C,0x54,0x54,0x54,0x54,0xD6,0x00,0x00},/*"M",45*/ 58 | {0x00,0x00,0x00,0xC7,0x62,0x62,0x52,0x52,0x4A,0x4A,0x4A,0x46,0x46,0xE2,0x00,0x00},/*"N",46*/ 59 | {0x00,0x00,0x00,0x38,0x44,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x44,0x38,0x00,0x00},/*"O",47*/ 60 | {0x00,0x00,0x00,0xFC,0x42,0x42,0x42,0x42,0x7C,0x40,0x40,0x40,0x40,0xE0,0x00,0x00},/*"P",48*/ 61 | {0x00,0x00,0x00,0x38,0x44,0x82,0x82,0x82,0x82,0x82,0x82,0xB2,0x4C,0x38,0x06,0x00},/*"Q",49*/ 62 | {0x00,0x00,0x00,0xFC,0x42,0x42,0x42,0x7C,0x48,0x48,0x44,0x44,0x42,0xE3,0x00,0x00},/*"R",50*/ 63 | {0x00,0x00,0x00,0x3E,0x42,0x42,0x40,0x20,0x18,0x04,0x02,0x42,0x42,0x7C,0x00,0x00},/*"S",51*/ 64 | {0x00,0x00,0x00,0xFE,0x92,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x38,0x00,0x00},/*"T",52*/ 65 | {0x00,0x00,0x00,0xE7,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00},/*"U",53*/ 66 | {0x00,0x00,0x00,0xE7,0x42,0x42,0x44,0x24,0x24,0x28,0x28,0x18,0x10,0x10,0x00,0x00},/*"V",54*/ 67 | {0x00,0x00,0x00,0xD6,0x54,0x54,0x54,0x54,0x54,0x6C,0x28,0x28,0x28,0x28,0x00,0x00},/*"W",55*/ 68 | {0x00,0x00,0x00,0xE7,0x42,0x24,0x24,0x18,0x18,0x18,0x24,0x24,0x42,0xE7,0x00,0x00},/*"X",56*/ 69 | {0x00,0x00,0x00,0xEE,0x44,0x44,0x28,0x28,0x10,0x10,0x10,0x10,0x10,0x38,0x00,0x00},/*"Y",57*/ 70 | {0x00,0x00,0x00,0x7E,0x84,0x04,0x08,0x08,0x10,0x20,0x20,0x42,0x42,0xFC,0x00,0x00},/*"Z",58*/ 71 | {0x00,0x1E,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x1E,0x00},/*"[",59*/ 72 | {0x00,0x00,0x40,0x20,0x20,0x20,0x10,0x10,0x10,0x08,0x08,0x04,0x04,0x04,0x02,0x02},/*"\",60*/ 73 | {0x00,0x78,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x78,0x00},/*"]",61*/ 74 | {0x00,0x18,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"^",62*/ 75 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF},/*"_",63*/ 76 | {0x00,0x60,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"`",64*/ 77 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x44,0x0C,0x34,0x44,0x4C,0x36,0x00,0x00},/*"a",65*/ 78 | {0x00,0x00,0x00,0x00,0xC0,0x40,0x40,0x58,0x64,0x42,0x42,0x42,0x64,0x58,0x00,0x00},/*"b",66*/ 79 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x22,0x40,0x40,0x40,0x22,0x1C,0x00,0x00},/*"c",67*/ 80 | {0x00,0x00,0x00,0x00,0x06,0x02,0x02,0x3E,0x42,0x42,0x42,0x42,0x46,0x3B,0x00,0x00},/*"d",68*/ 81 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x42,0x7E,0x40,0x42,0x3C,0x00,0x00},/*"e",69*/ 82 | {0x00,0x00,0x00,0x00,0x0C,0x12,0x10,0x7C,0x10,0x10,0x10,0x10,0x10,0x7C,0x00,0x00},/*"f",70*/ 83 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x44,0x44,0x38,0x40,0x3C,0x42,0x42,0x3C},/*"g",71*/ 84 | {0x00,0x00,0x00,0x00,0xC0,0x40,0x40,0x5C,0x62,0x42,0x42,0x42,0x42,0xE7,0x00,0x00},/*"h",72*/ 85 | {0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x70,0x10,0x10,0x10,0x10,0x10,0x7C,0x00,0x00},/*"i",73*/ 86 | {0x00,0x00,0x00,0x0C,0x0C,0x00,0x00,0x1C,0x04,0x04,0x04,0x04,0x04,0x04,0x44,0x78},/*"j",74*/ 87 | {0x00,0x00,0x00,0x00,0xC0,0x40,0x40,0x4E,0x48,0x50,0x70,0x48,0x44,0xEE,0x00,0x00},/*"k",75*/ 88 | {0x00,0x00,0x00,0x10,0x70,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x7C,0x00,0x00},/*"l",76*/ 89 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x49,0x49,0x49,0x49,0x49,0xED,0x00,0x00},/*"m",77*/ 90 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDC,0x62,0x42,0x42,0x42,0x42,0xE7,0x00,0x00},/*"n",78*/ 91 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00},/*"o",79*/ 92 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD8,0x64,0x42,0x42,0x42,0x64,0x58,0x40,0xE0},/*"p",80*/ 93 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1A,0x26,0x42,0x42,0x42,0x26,0x1A,0x02,0x07},/*"q",81*/ 94 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xEE,0x32,0x20,0x20,0x20,0x20,0xF8,0x00,0x00},/*"r",82*/ 95 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x42,0x40,0x3C,0x02,0x42,0x7C,0x00,0x00},/*"s",83*/ 96 | {0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x7C,0x10,0x10,0x10,0x10,0x12,0x0C,0x00,0x00},/*"t",84*/ 97 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC6,0x42,0x42,0x42,0x42,0x46,0x3B,0x00,0x00},/*"u",85*/ 98 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xEE,0x44,0x44,0x28,0x28,0x10,0x10,0x00,0x00},/*"v",86*/ 99 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDB,0x89,0x4A,0x5A,0x54,0x24,0x24,0x00,0x00},/*"w",87*/ 100 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x76,0x24,0x18,0x18,0x18,0x24,0x6E,0x00,0x00},/*"x",88*/ 101 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE7,0x42,0x24,0x24,0x18,0x18,0x10,0x10,0x60},/*"y",89*/ 102 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x44,0x08,0x10,0x10,0x22,0x7E,0x00,0x00},/*"z",90*/ 103 | {0x00,0x03,0x04,0x04,0x04,0x04,0x04,0x04,0x08,0x04,0x04,0x04,0x04,0x04,0x03,0x00},/*"{",91*/ 104 | {0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08},/*"|",92*/ 105 | {0x00,0xC0,0x20,0x20,0x20,0x20,0x20,0x20,0x10,0x20,0x20,0x20,0x20,0x20,0xC0,0x00},/*"}",93*/ 106 | {0x20,0x5A,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"~",94*/ 107 | }; 108 | 109 | 110 | 111 | 112 | #endif 113 | 114 | -------------------------------------------------------------------------------- /Firmware/For_V1.0.0_PCB/InkScreen2_13/Core/Inc/gpio.h: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file gpio.h 5 | * @brief This file contains all the function prototypes for 6 | * the gpio.c file 7 | ****************************************************************************** 8 | * @attention 9 | * 10 | * Copyright (c) 2022 STMicroelectronics. 11 | * All rights reserved. 12 | * 13 | * This software is licensed under terms that can be found in the LICENSE file 14 | * in the root directory of this software component. 15 | * If no LICENSE file comes with this software, it is provided AS-IS. 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* USER CODE END Header */ 20 | /* Define to prevent recursive inclusion -------------------------------------*/ 21 | #ifndef __GPIO_H__ 22 | #define __GPIO_H__ 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /* Includes ------------------------------------------------------------------*/ 29 | #include "main.h" 30 | 31 | /* USER CODE BEGIN Includes */ 32 | 33 | /* USER CODE END Includes */ 34 | 35 | /* USER CODE BEGIN Private defines */ 36 | 37 | /* USER CODE END Private defines */ 38 | 39 | void MX_GPIO_Init(void); 40 | 41 | /* USER CODE BEGIN Prototypes */ 42 | 43 | /* USER CODE END Prototypes */ 44 | 45 | #ifdef __cplusplus 46 | } 47 | #endif 48 | #endif /*__ GPIO_H__ */ 49 | 50 | -------------------------------------------------------------------------------- /Firmware/For_V1.0.0_PCB/InkScreen2_13/Core/Inc/main.h: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file : main.h 5 | * @brief : Header for main.c file. 6 | * This file contains the common defines of the application. 7 | ****************************************************************************** 8 | * @attention 9 | * 10 | * Copyright (c) 2022 STMicroelectronics. 11 | * All rights reserved. 12 | * 13 | * This software is licensed under terms that can be found in the LICENSE file 14 | * in the root directory of this software component. 15 | * If no LICENSE file comes with this software, it is provided AS-IS. 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* USER CODE END Header */ 20 | 21 | /* Define to prevent recursive inclusion -------------------------------------*/ 22 | #ifndef __MAIN_H 23 | #define __MAIN_H 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | /* Includes ------------------------------------------------------------------*/ 30 | #include "stm32f1xx_hal.h" 31 | 32 | #include "stm32f1xx_ll_spi.h" 33 | #include "stm32f1xx_ll_system.h" 34 | #include "stm32f1xx_ll_gpio.h" 35 | #include "stm32f1xx_ll_exti.h" 36 | #include "stm32f1xx_ll_bus.h" 37 | #include "stm32f1xx_ll_cortex.h" 38 | #include "stm32f1xx_ll_rcc.h" 39 | #include "stm32f1xx_ll_utils.h" 40 | #include "stm32f1xx_ll_pwr.h" 41 | #include "stm32f1xx_ll_dma.h" 42 | 43 | /* Private includes ----------------------------------------------------------*/ 44 | /* USER CODE BEGIN Includes */ 45 | 46 | /* USER CODE END Includes */ 47 | 48 | /* Exported types ------------------------------------------------------------*/ 49 | /* USER CODE BEGIN ET */ 50 | 51 | /* USER CODE END ET */ 52 | 53 | /* Exported constants --------------------------------------------------------*/ 54 | /* USER CODE BEGIN EC */ 55 | 56 | /* USER CODE END EC */ 57 | 58 | /* Exported macro ------------------------------------------------------------*/ 59 | /* USER CODE BEGIN EM */ 60 | 61 | /* USER CODE END EM */ 62 | 63 | /* Exported functions prototypes ---------------------------------------------*/ 64 | void Error_Handler(void); 65 | 66 | /* USER CODE BEGIN EFP */ 67 | 68 | /* USER CODE END EFP */ 69 | 70 | /* Private defines -----------------------------------------------------------*/ 71 | #define DI_SCREEN_BUSY_Pin LL_GPIO_PIN_1 72 | #define DI_SCREEN_BUSY_GPIO_Port GPIOA 73 | #define DO_SCREEN_DC_Pin LL_GPIO_PIN_2 74 | #define DO_SCREEN_DC_GPIO_Port GPIOA 75 | #define DO_SCREEN_RST_Pin LL_GPIO_PIN_3 76 | #define DO_SCREEN_RST_GPIO_Port GPIOA 77 | #define DO_SCREEN_CS_Pin LL_GPIO_PIN_4 78 | #define DO_SCREEN_CS_GPIO_Port GPIOA 79 | #define DO_SCREEN_CLK_Pin LL_GPIO_PIN_5 80 | #define DO_SCREEN_CLK_GPIO_Port GPIOA 81 | #define MO_SCREEN_MOSI_Pin LL_GPIO_PIN_7 82 | #define MO_SCREEN_MOSI_GPIO_Port GPIOA 83 | /* USER CODE BEGIN Private defines */ 84 | 85 | /* USER CODE END Private defines */ 86 | 87 | #ifdef __cplusplus 88 | } 89 | #endif 90 | 91 | #endif /* __MAIN_H */ 92 | -------------------------------------------------------------------------------- /Firmware/For_V1.0.0_PCB/InkScreen2_13/Core/Inc/spi.h: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file spi.h 5 | * @brief This file contains all the function prototypes for 6 | * the spi.c file 7 | ****************************************************************************** 8 | * @attention 9 | * 10 | * Copyright (c) 2022 STMicroelectronics. 11 | * All rights reserved. 12 | * 13 | * This software is licensed under terms that can be found in the LICENSE file 14 | * in the root directory of this software component. 15 | * If no LICENSE file comes with this software, it is provided AS-IS. 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* USER CODE END Header */ 20 | /* Define to prevent recursive inclusion -------------------------------------*/ 21 | #ifndef __SPI_H__ 22 | #define __SPI_H__ 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /* Includes ------------------------------------------------------------------*/ 29 | #include "main.h" 30 | 31 | /* USER CODE BEGIN Includes */ 32 | 33 | /* USER CODE END Includes */ 34 | 35 | /* USER CODE BEGIN Private defines */ 36 | 37 | /* USER CODE END Private defines */ 38 | 39 | void MX_SPI1_Init(void); 40 | 41 | /* USER CODE BEGIN Prototypes */ 42 | 43 | /* USER CODE END Prototypes */ 44 | 45 | #ifdef __cplusplus 46 | } 47 | #endif 48 | 49 | #endif /* __SPI_H__ */ 50 | 51 | -------------------------------------------------------------------------------- /Firmware/For_V1.0.0_PCB/InkScreen2_13/Core/Inc/stm32_assert.h: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file stm32_assert.h 5 | * @brief STM32 assert file. 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | * Copyright (c) 2018 STMicroelectronics. 10 | * All rights reserved. 11 | * 12 | * This software is licensed under terms that can be found in the LICENSE file 13 | * in the root directory of this software component. 14 | * If no LICENSE file comes with this software, it is provided AS-IS. 15 | * 16 | ****************************************************************************** 17 | */ 18 | /* USER CODE END Header */ 19 | 20 | /* Define to prevent recursive inclusion -------------------------------------*/ 21 | #ifndef __STM32_ASSERT_H 22 | #define __STM32_ASSERT_H 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /* Exported types ------------------------------------------------------------*/ 29 | /* Exported constants --------------------------------------------------------*/ 30 | /* Includes ------------------------------------------------------------------*/ 31 | /* Exported macro ------------------------------------------------------------*/ 32 | #ifdef USE_FULL_ASSERT 33 | /** 34 | * @brief The assert_param macro is used for function's parameters check. 35 | * @param expr: If expr is false, it calls assert_failed function 36 | * which reports the name of the source file and the source 37 | * line number of the call that failed. 38 | * If expr is true, it returns no value. 39 | * @retval None 40 | */ 41 | #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) 42 | /* Exported functions ------------------------------------------------------- */ 43 | void assert_failed(uint8_t* file, uint32_t line); 44 | #else 45 | #define assert_param(expr) ((void)0U) 46 | #endif /* USE_FULL_ASSERT */ 47 | 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | 52 | #endif /* __STM32_ASSERT_H */ 53 | 54 | -------------------------------------------------------------------------------- /Firmware/For_V1.0.0_PCB/InkScreen2_13/Core/Inc/stm32f1xx_it.h: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file stm32f1xx_it.h 5 | * @brief This file contains the headers of the interrupt handlers. 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | * Copyright (c) 2022 STMicroelectronics. 10 | * All rights reserved. 11 | * 12 | * This software is licensed under terms that can be found in the LICENSE file 13 | * in the root directory of this software component. 14 | * If no LICENSE file comes with this software, it is provided AS-IS. 15 | * 16 | ****************************************************************************** 17 | */ 18 | /* USER CODE END Header */ 19 | 20 | /* Define to prevent recursive inclusion -------------------------------------*/ 21 | #ifndef __STM32F1xx_IT_H 22 | #define __STM32F1xx_IT_H 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /* Private includes ----------------------------------------------------------*/ 29 | /* USER CODE BEGIN Includes */ 30 | 31 | /* USER CODE END Includes */ 32 | 33 | /* Exported types ------------------------------------------------------------*/ 34 | /* USER CODE BEGIN ET */ 35 | 36 | /* USER CODE END ET */ 37 | 38 | /* Exported constants --------------------------------------------------------*/ 39 | /* USER CODE BEGIN EC */ 40 | 41 | /* USER CODE END EC */ 42 | 43 | /* Exported macro ------------------------------------------------------------*/ 44 | /* USER CODE BEGIN EM */ 45 | 46 | /* USER CODE END EM */ 47 | 48 | /* Exported functions prototypes ---------------------------------------------*/ 49 | void NMI_Handler(void); 50 | void HardFault_Handler(void); 51 | void MemManage_Handler(void); 52 | void BusFault_Handler(void); 53 | void UsageFault_Handler(void); 54 | void SVC_Handler(void); 55 | void DebugMon_Handler(void); 56 | void PendSV_Handler(void); 57 | void SysTick_Handler(void); 58 | /* USER CODE BEGIN EFP */ 59 | 60 | /* USER CODE END EFP */ 61 | 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | 66 | #endif /* __STM32F1xx_IT_H */ 67 | -------------------------------------------------------------------------------- /Firmware/For_V1.0.0_PCB/InkScreen2_13/Core/Src/gpio.c: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file gpio.c 5 | * @brief This file provides code for the configuration 6 | * of all used GPIO pins. 7 | ****************************************************************************** 8 | * @attention 9 | * 10 | * Copyright (c) 2022 STMicroelectronics. 11 | * All rights reserved. 12 | * 13 | * This software is licensed under terms that can be found in the LICENSE file 14 | * in the root directory of this software component. 15 | * If no LICENSE file comes with this software, it is provided AS-IS. 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* USER CODE END Header */ 20 | 21 | /* Includes ------------------------------------------------------------------*/ 22 | #include "gpio.h" 23 | 24 | /* USER CODE BEGIN 0 */ 25 | 26 | /* USER CODE END 0 */ 27 | 28 | /*----------------------------------------------------------------------------*/ 29 | /* Configure GPIO */ 30 | /*----------------------------------------------------------------------------*/ 31 | /* USER CODE BEGIN 1 */ 32 | 33 | /* USER CODE END 1 */ 34 | 35 | /** Configure pins as 36 | * Analog 37 | * Input 38 | * Output 39 | * EVENT_OUT 40 | * EXTI 41 | * Free pins are configured automatically as Analog (this feature is enabled through 42 | * the Code Generation settings) 43 | */ 44 | void MX_GPIO_Init(void) 45 | { 46 | 47 | LL_GPIO_InitTypeDef GPIO_InitStruct = {0}; 48 | 49 | /* GPIO Ports Clock Enable */ 50 | LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_GPIOC); 51 | LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_GPIOD); 52 | LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_GPIOA); 53 | LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_GPIOB); 54 | 55 | /**/ 56 | LL_GPIO_ResetOutputPin(GPIOA, DO_SCREEN_DC_Pin|DO_SCREEN_RST_Pin); 57 | 58 | /**/ 59 | LL_GPIO_SetOutputPin(DO_SCREEN_CS_GPIO_Port, DO_SCREEN_CS_Pin); 60 | 61 | /**/ 62 | GPIO_InitStruct.Pin = LL_GPIO_PIN_13|LL_GPIO_PIN_14|LL_GPIO_PIN_15; 63 | GPIO_InitStruct.Mode = LL_GPIO_MODE_ANALOG; 64 | LL_GPIO_Init(GPIOC, &GPIO_InitStruct); 65 | 66 | /**/ 67 | GPIO_InitStruct.Pin = LL_GPIO_PIN_0|LL_GPIO_PIN_6|LL_GPIO_PIN_8|LL_GPIO_PIN_9 68 | |LL_GPIO_PIN_10|LL_GPIO_PIN_11|LL_GPIO_PIN_12|LL_GPIO_PIN_15; 69 | GPIO_InitStruct.Mode = LL_GPIO_MODE_ANALOG; 70 | LL_GPIO_Init(GPIOA, &GPIO_InitStruct); 71 | 72 | /**/ 73 | GPIO_InitStruct.Pin = DI_SCREEN_BUSY_Pin; 74 | GPIO_InitStruct.Mode = LL_GPIO_MODE_FLOATING; 75 | LL_GPIO_Init(DI_SCREEN_BUSY_GPIO_Port, &GPIO_InitStruct); 76 | 77 | /**/ 78 | GPIO_InitStruct.Pin = DO_SCREEN_DC_Pin|DO_SCREEN_RST_Pin|DO_SCREEN_CS_Pin; 79 | GPIO_InitStruct.Mode = LL_GPIO_MODE_OUTPUT; 80 | GPIO_InitStruct.Speed = LL_GPIO_SPEED_FREQ_LOW; 81 | GPIO_InitStruct.OutputType = LL_GPIO_OUTPUT_PUSHPULL; 82 | LL_GPIO_Init(GPIOA, &GPIO_InitStruct); 83 | 84 | /**/ 85 | GPIO_InitStruct.Pin = LL_GPIO_PIN_0|LL_GPIO_PIN_1|LL_GPIO_PIN_2|LL_GPIO_PIN_10 86 | |LL_GPIO_PIN_11|LL_GPIO_PIN_12|LL_GPIO_PIN_13|LL_GPIO_PIN_14 87 | |LL_GPIO_PIN_15|LL_GPIO_PIN_3|LL_GPIO_PIN_4|LL_GPIO_PIN_5 88 | |LL_GPIO_PIN_6|LL_GPIO_PIN_7|LL_GPIO_PIN_8|LL_GPIO_PIN_9; 89 | GPIO_InitStruct.Mode = LL_GPIO_MODE_ANALOG; 90 | LL_GPIO_Init(GPIOB, &GPIO_InitStruct); 91 | 92 | } 93 | 94 | /* USER CODE BEGIN 2 */ 95 | 96 | /* USER CODE END 2 */ 97 | -------------------------------------------------------------------------------- /Firmware/For_V1.0.0_PCB/InkScreen2_13/Core/Src/main.c: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file : main.c 5 | * @brief : Main program body 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | * Copyright (c) 2022 STMicroelectronics. 10 | * All rights reserved. 11 | * 12 | * This software is licensed under terms that can be found in the LICENSE file 13 | * in the root directory of this software component. 14 | * If no LICENSE file comes with this software, it is provided AS-IS. 15 | * 16 | ****************************************************************************** 17 | */ 18 | /* USER CODE END Header */ 19 | /* Includes ------------------------------------------------------------------*/ 20 | #include "main.h" 21 | #include "spi.h" 22 | #include "gpio.h" 23 | 24 | /* Private includes ----------------------------------------------------------*/ 25 | /* USER CODE BEGIN Includes */ 26 | #include "E2213JS0C1.h" 27 | #include "image.h" 28 | 29 | /* USER CODE END Includes */ 30 | 31 | /* Private typedef -----------------------------------------------------------*/ 32 | /* USER CODE BEGIN PTD */ 33 | 34 | /* USER CODE END PTD */ 35 | 36 | /* Private define ------------------------------------------------------------*/ 37 | /* USER CODE BEGIN PD */ 38 | /* USER CODE END PD */ 39 | 40 | /* Private macro -------------------------------------------------------------*/ 41 | /* USER CODE BEGIN PM */ 42 | 43 | /* USER CODE END PM */ 44 | 45 | /* Private variables ---------------------------------------------------------*/ 46 | 47 | /* USER CODE BEGIN PV */ 48 | 49 | /* USER CODE END PV */ 50 | 51 | /* Private function prototypes -----------------------------------------------*/ 52 | void SystemClock_Config(void); 53 | /* USER CODE BEGIN PFP */ 54 | 55 | /* USER CODE END PFP */ 56 | 57 | /* Private user code ---------------------------------------------------------*/ 58 | /* USER CODE BEGIN 0 */ 59 | 60 | /* USER CODE END 0 */ 61 | 62 | /** 63 | * @brief The application entry point. 64 | * @retval int 65 | */ 66 | int main(void) 67 | { 68 | /* USER CODE BEGIN 1 */ 69 | 70 | /* USER CODE END 1 */ 71 | 72 | /* MCU Configuration--------------------------------------------------------*/ 73 | 74 | /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ 75 | HAL_Init(); 76 | 77 | /* USER CODE BEGIN Init */ 78 | 79 | /* USER CODE END Init */ 80 | 81 | /* Configure the system clock */ 82 | SystemClock_Config(); 83 | 84 | /* USER CODE BEGIN SysInit */ 85 | 86 | /* USER CODE END SysInit */ 87 | 88 | /* Initialize all configured peripherals */ 89 | MX_GPIO_Init(); 90 | MX_SPI1_Init(); 91 | /* USER CODE BEGIN 2 */ 92 | E2213JS0C1_Init(); 93 | /* 显示图片测试 */ 94 | E2213JS0C1_DrawImage(0,0,104,212,gImage_1); 95 | E2213JS0C1_SendImageData(); 96 | E2213JS0C1_SendUpdateCmd(); 97 | E2213JS0C1_TurnOffDCDC(); 98 | HAL_Delay(3000); 99 | /* 显示点、线、矩形、字符、bpm图片测试 */ 100 | E2213JS0C1_ClearFullScreen(WHITE); 101 | E2213JS0C1_DrawPoint(0,0,RED); 102 | E2213JS0C1_DrawLine(0,2,10,HORIZONTAL,BLACK); 103 | E2213JS0C1_DrawLine(0,4,10,VERTICAL,BLACK); 104 | E2213JS0C1_DrawRectangle(0,16,10,10,SOLID,BLACK,RED); 105 | E2213JS0C1_DrawRectangle(20,16,10,10,HOLLOW,BLACK,RED); 106 | E2213JS0C1_ShowCharStr(0,30,"FONT TEST",FONT_1608,BLACK,WHITE); 107 | E2213JS0C1_DrawBmp(0,50,104,41,BLACK,WHITE,BmpImage); 108 | E2213JS0C1_ShowCharStr(0,100,"UID:112222162",FONT_1608,BLACK,WHITE); 109 | E2213JS0C1_ShowCharStr(20,116,"Designed",FONT_1608,BLACK,WHITE); 110 | E2213JS0C1_ShowCharStr(44,132,"By",FONT_1608,BLACK,WHITE); 111 | E2213JS0C1_ShowCharStr(40,148,"BYT",FONT_1608,BLACK,WHITE); 112 | E2213JS0C1_SendImageData(); 113 | E2213JS0C1_SendUpdateCmd(); 114 | E2213JS0C1_TurnOffDCDC(); 115 | /* USER CODE END 2 */ 116 | 117 | /* Infinite loop */ 118 | /* USER CODE BEGIN WHILE */ 119 | while (1) 120 | { 121 | /* USER CODE END WHILE */ 122 | 123 | /* USER CODE BEGIN 3 */ 124 | } 125 | /* USER CODE END 3 */ 126 | } 127 | 128 | /** 129 | * @brief System Clock Configuration 130 | * @retval None 131 | */ 132 | void SystemClock_Config(void) 133 | { 134 | RCC_OscInitTypeDef RCC_OscInitStruct = {0}; 135 | RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; 136 | 137 | /** Initializes the RCC Oscillators according to the specified parameters 138 | * in the RCC_OscInitTypeDef structure. 139 | */ 140 | RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; 141 | RCC_OscInitStruct.HSEState = RCC_HSE_ON; 142 | RCC_OscInitStruct.HSEPredivValue = RCC_HSE_PREDIV_DIV2; 143 | RCC_OscInitStruct.HSIState = RCC_HSI_ON; 144 | RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; 145 | RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; 146 | RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL16; 147 | if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) 148 | { 149 | Error_Handler(); 150 | } 151 | /** Initializes the CPU, AHB and APB buses clocks 152 | */ 153 | RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK 154 | |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2; 155 | RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; 156 | RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; 157 | RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2; 158 | RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; 159 | 160 | if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK) 161 | { 162 | Error_Handler(); 163 | } 164 | } 165 | 166 | /* USER CODE BEGIN 4 */ 167 | 168 | /* USER CODE END 4 */ 169 | 170 | /** 171 | * @brief This function is executed in case of error occurrence. 172 | * @retval None 173 | */ 174 | void Error_Handler(void) 175 | { 176 | /* USER CODE BEGIN Error_Handler_Debug */ 177 | /* User can add his own implementation to report the HAL error return state */ 178 | __disable_irq(); 179 | while (1) 180 | { 181 | } 182 | /* USER CODE END Error_Handler_Debug */ 183 | } 184 | 185 | #ifdef USE_FULL_ASSERT 186 | /** 187 | * @brief Reports the name of the source file and the source line number 188 | * where the assert_param error has occurred. 189 | * @param file: pointer to the source file name 190 | * @param line: assert_param error line source number 191 | * @retval None 192 | */ 193 | void assert_failed(uint8_t *file, uint32_t line) 194 | { 195 | /* USER CODE BEGIN 6 */ 196 | /* User can add his own implementation to report the file name and line number, 197 | ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ 198 | /* USER CODE END 6 */ 199 | } 200 | #endif /* USE_FULL_ASSERT */ 201 | 202 | -------------------------------------------------------------------------------- /Firmware/For_V1.0.0_PCB/InkScreen2_13/Core/Src/spi.c: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file spi.c 5 | * @brief This file provides code for the configuration 6 | * of the SPI instances. 7 | ****************************************************************************** 8 | * @attention 9 | * 10 | * Copyright (c) 2022 STMicroelectronics. 11 | * All rights reserved. 12 | * 13 | * This software is licensed under terms that can be found in the LICENSE file 14 | * in the root directory of this software component. 15 | * If no LICENSE file comes with this software, it is provided AS-IS. 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* USER CODE END Header */ 20 | /* Includes ------------------------------------------------------------------*/ 21 | #include "spi.h" 22 | 23 | /* USER CODE BEGIN 0 */ 24 | 25 | /* USER CODE END 0 */ 26 | 27 | /* SPI1 init function */ 28 | void MX_SPI1_Init(void) 29 | { 30 | 31 | /* USER CODE BEGIN SPI1_Init 0 */ 32 | 33 | /* USER CODE END SPI1_Init 0 */ 34 | 35 | LL_SPI_InitTypeDef SPI_InitStruct = {0}; 36 | 37 | LL_GPIO_InitTypeDef GPIO_InitStruct = {0}; 38 | 39 | /* Peripheral clock enable */ 40 | LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_SPI1); 41 | 42 | LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_GPIOA); 43 | /**SPI1 GPIO Configuration 44 | PA5 ------> SPI1_SCK 45 | PA7 ------> SPI1_MOSI 46 | */ 47 | GPIO_InitStruct.Pin = DO_SCREEN_CLK_Pin|MO_SCREEN_MOSI_Pin; 48 | GPIO_InitStruct.Mode = LL_GPIO_MODE_ALTERNATE; 49 | GPIO_InitStruct.Speed = LL_GPIO_SPEED_FREQ_HIGH; 50 | GPIO_InitStruct.OutputType = LL_GPIO_OUTPUT_PUSHPULL; 51 | LL_GPIO_Init(GPIOA, &GPIO_InitStruct); 52 | 53 | /* USER CODE BEGIN SPI1_Init 1 */ 54 | 55 | /* USER CODE END SPI1_Init 1 */ 56 | SPI_InitStruct.TransferDirection = LL_SPI_FULL_DUPLEX; 57 | SPI_InitStruct.Mode = LL_SPI_MODE_MASTER; 58 | SPI_InitStruct.DataWidth = LL_SPI_DATAWIDTH_8BIT; 59 | SPI_InitStruct.ClockPolarity = LL_SPI_POLARITY_LOW; 60 | SPI_InitStruct.ClockPhase = LL_SPI_PHASE_1EDGE; 61 | SPI_InitStruct.NSS = LL_SPI_NSS_SOFT; 62 | SPI_InitStruct.BaudRate = LL_SPI_BAUDRATEPRESCALER_DIV16; 63 | SPI_InitStruct.BitOrder = LL_SPI_MSB_FIRST; 64 | SPI_InitStruct.CRCCalculation = LL_SPI_CRCCALCULATION_DISABLE; 65 | SPI_InitStruct.CRCPoly = 10; 66 | LL_SPI_Init(SPI1, &SPI_InitStruct); 67 | /* USER CODE BEGIN SPI1_Init 2 */ 68 | 69 | /* USER CODE END SPI1_Init 2 */ 70 | 71 | } 72 | 73 | /* USER CODE BEGIN 1 */ 74 | 75 | /* USER CODE END 1 */ 76 | -------------------------------------------------------------------------------- /Firmware/For_V1.0.0_PCB/InkScreen2_13/Core/Src/stm32f1xx_hal_msp.c: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file stm32f1xx_hal_msp.c 5 | * @brief This file provides code for the MSP Initialization 6 | * and de-Initialization codes. 7 | ****************************************************************************** 8 | * @attention 9 | * 10 | * Copyright (c) 2022 STMicroelectronics. 11 | * All rights reserved. 12 | * 13 | * This software is licensed under terms that can be found in the LICENSE file 14 | * in the root directory of this software component. 15 | * If no LICENSE file comes with this software, it is provided AS-IS. 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* USER CODE END Header */ 20 | 21 | /* Includes ------------------------------------------------------------------*/ 22 | #include "main.h" 23 | /* USER CODE BEGIN Includes */ 24 | 25 | /* USER CODE END Includes */ 26 | 27 | /* Private typedef -----------------------------------------------------------*/ 28 | /* USER CODE BEGIN TD */ 29 | 30 | /* USER CODE END TD */ 31 | 32 | /* Private define ------------------------------------------------------------*/ 33 | /* USER CODE BEGIN Define */ 34 | 35 | /* USER CODE END Define */ 36 | 37 | /* Private macro -------------------------------------------------------------*/ 38 | /* USER CODE BEGIN Macro */ 39 | 40 | /* USER CODE END Macro */ 41 | 42 | /* Private variables ---------------------------------------------------------*/ 43 | /* USER CODE BEGIN PV */ 44 | 45 | /* USER CODE END PV */ 46 | 47 | /* Private function prototypes -----------------------------------------------*/ 48 | /* USER CODE BEGIN PFP */ 49 | 50 | /* USER CODE END PFP */ 51 | 52 | /* External functions --------------------------------------------------------*/ 53 | /* USER CODE BEGIN ExternalFunctions */ 54 | 55 | /* USER CODE END ExternalFunctions */ 56 | 57 | /* USER CODE BEGIN 0 */ 58 | 59 | /* USER CODE END 0 */ 60 | /** 61 | * Initializes the Global MSP. 62 | */ 63 | void HAL_MspInit(void) 64 | { 65 | /* USER CODE BEGIN MspInit 0 */ 66 | 67 | /* USER CODE END MspInit 0 */ 68 | 69 | __HAL_RCC_AFIO_CLK_ENABLE(); 70 | __HAL_RCC_PWR_CLK_ENABLE(); 71 | 72 | /* System interrupt init*/ 73 | 74 | /** NOJTAG: JTAG-DP Disabled and SW-DP Enabled 75 | */ 76 | __HAL_AFIO_REMAP_SWJ_NOJTAG(); 77 | 78 | /* USER CODE BEGIN MspInit 1 */ 79 | 80 | /* USER CODE END MspInit 1 */ 81 | } 82 | 83 | /* USER CODE BEGIN 1 */ 84 | 85 | /* USER CODE END 1 */ 86 | 87 | -------------------------------------------------------------------------------- /Firmware/For_V1.0.0_PCB/InkScreen2_13/Core/Src/stm32f1xx_it.c: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file stm32f1xx_it.c 5 | * @brief Interrupt Service Routines. 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | * Copyright (c) 2022 STMicroelectronics. 10 | * All rights reserved. 11 | * 12 | * This software is licensed under terms that can be found in the LICENSE file 13 | * in the root directory of this software component. 14 | * If no LICENSE file comes with this software, it is provided AS-IS. 15 | * 16 | ****************************************************************************** 17 | */ 18 | /* USER CODE END Header */ 19 | 20 | /* Includes ------------------------------------------------------------------*/ 21 | #include "main.h" 22 | #include "stm32f1xx_it.h" 23 | /* Private includes ----------------------------------------------------------*/ 24 | /* USER CODE BEGIN Includes */ 25 | /* USER CODE END Includes */ 26 | 27 | /* Private typedef -----------------------------------------------------------*/ 28 | /* USER CODE BEGIN TD */ 29 | 30 | /* USER CODE END TD */ 31 | 32 | /* Private define ------------------------------------------------------------*/ 33 | /* USER CODE BEGIN PD */ 34 | 35 | /* USER CODE END PD */ 36 | 37 | /* Private macro -------------------------------------------------------------*/ 38 | /* USER CODE BEGIN PM */ 39 | 40 | /* USER CODE END PM */ 41 | 42 | /* Private variables ---------------------------------------------------------*/ 43 | /* USER CODE BEGIN PV */ 44 | 45 | /* USER CODE END PV */ 46 | 47 | /* Private function prototypes -----------------------------------------------*/ 48 | /* USER CODE BEGIN PFP */ 49 | 50 | /* USER CODE END PFP */ 51 | 52 | /* Private user code ---------------------------------------------------------*/ 53 | /* USER CODE BEGIN 0 */ 54 | 55 | /* USER CODE END 0 */ 56 | 57 | /* External variables --------------------------------------------------------*/ 58 | 59 | /* USER CODE BEGIN EV */ 60 | 61 | /* USER CODE END EV */ 62 | 63 | /******************************************************************************/ 64 | /* Cortex-M3 Processor Interruption and Exception Handlers */ 65 | /******************************************************************************/ 66 | /** 67 | * @brief This function handles Non maskable interrupt. 68 | */ 69 | void NMI_Handler(void) 70 | { 71 | /* USER CODE BEGIN NonMaskableInt_IRQn 0 */ 72 | 73 | /* USER CODE END NonMaskableInt_IRQn 0 */ 74 | /* USER CODE BEGIN NonMaskableInt_IRQn 1 */ 75 | while (1) 76 | { 77 | } 78 | /* USER CODE END NonMaskableInt_IRQn 1 */ 79 | } 80 | 81 | /** 82 | * @brief This function handles Hard fault interrupt. 83 | */ 84 | void HardFault_Handler(void) 85 | { 86 | /* USER CODE BEGIN HardFault_IRQn 0 */ 87 | 88 | /* USER CODE END HardFault_IRQn 0 */ 89 | while (1) 90 | { 91 | /* USER CODE BEGIN W1_HardFault_IRQn 0 */ 92 | /* USER CODE END W1_HardFault_IRQn 0 */ 93 | } 94 | } 95 | 96 | /** 97 | * @brief This function handles Memory management fault. 98 | */ 99 | void MemManage_Handler(void) 100 | { 101 | /* USER CODE BEGIN MemoryManagement_IRQn 0 */ 102 | 103 | /* USER CODE END MemoryManagement_IRQn 0 */ 104 | while (1) 105 | { 106 | /* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */ 107 | /* USER CODE END W1_MemoryManagement_IRQn 0 */ 108 | } 109 | } 110 | 111 | /** 112 | * @brief This function handles Prefetch fault, memory access fault. 113 | */ 114 | void BusFault_Handler(void) 115 | { 116 | /* USER CODE BEGIN BusFault_IRQn 0 */ 117 | 118 | /* USER CODE END BusFault_IRQn 0 */ 119 | while (1) 120 | { 121 | /* USER CODE BEGIN W1_BusFault_IRQn 0 */ 122 | /* USER CODE END W1_BusFault_IRQn 0 */ 123 | } 124 | } 125 | 126 | /** 127 | * @brief This function handles Undefined instruction or illegal state. 128 | */ 129 | void UsageFault_Handler(void) 130 | { 131 | /* USER CODE BEGIN UsageFault_IRQn 0 */ 132 | 133 | /* USER CODE END UsageFault_IRQn 0 */ 134 | while (1) 135 | { 136 | /* USER CODE BEGIN W1_UsageFault_IRQn 0 */ 137 | /* USER CODE END W1_UsageFault_IRQn 0 */ 138 | } 139 | } 140 | 141 | /** 142 | * @brief This function handles System service call via SWI instruction. 143 | */ 144 | void SVC_Handler(void) 145 | { 146 | /* USER CODE BEGIN SVCall_IRQn 0 */ 147 | 148 | /* USER CODE END SVCall_IRQn 0 */ 149 | /* USER CODE BEGIN SVCall_IRQn 1 */ 150 | 151 | /* USER CODE END SVCall_IRQn 1 */ 152 | } 153 | 154 | /** 155 | * @brief This function handles Debug monitor. 156 | */ 157 | void DebugMon_Handler(void) 158 | { 159 | /* USER CODE BEGIN DebugMonitor_IRQn 0 */ 160 | 161 | /* USER CODE END DebugMonitor_IRQn 0 */ 162 | /* USER CODE BEGIN DebugMonitor_IRQn 1 */ 163 | 164 | /* USER CODE END DebugMonitor_IRQn 1 */ 165 | } 166 | 167 | /** 168 | * @brief This function handles Pendable request for system service. 169 | */ 170 | void PendSV_Handler(void) 171 | { 172 | /* USER CODE BEGIN PendSV_IRQn 0 */ 173 | 174 | /* USER CODE END PendSV_IRQn 0 */ 175 | /* USER CODE BEGIN PendSV_IRQn 1 */ 176 | 177 | /* USER CODE END PendSV_IRQn 1 */ 178 | } 179 | 180 | /** 181 | * @brief This function handles System tick timer. 182 | */ 183 | void SysTick_Handler(void) 184 | { 185 | /* USER CODE BEGIN SysTick_IRQn 0 */ 186 | 187 | /* USER CODE END SysTick_IRQn 0 */ 188 | HAL_IncTick(); 189 | /* USER CODE BEGIN SysTick_IRQn 1 */ 190 | 191 | /* USER CODE END SysTick_IRQn 1 */ 192 | } 193 | 194 | /******************************************************************************/ 195 | /* STM32F1xx Peripheral Interrupt Handlers */ 196 | /* Add here the Interrupt Handlers for the used peripherals. */ 197 | /* For the available peripheral interrupt handler names, */ 198 | /* please refer to the startup file (startup_stm32f1xx.s). */ 199 | /******************************************************************************/ 200 | 201 | /* USER CODE BEGIN 1 */ 202 | 203 | /* USER CODE END 1 */ 204 | 205 | -------------------------------------------------------------------------------- /Firmware/For_V1.0.0_PCB/InkScreen2_13/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BUYITAO/My_E-Paper_Driver/d78ec6fbcef9611fbeb8ad80f2b692ac6e225ed6/Firmware/For_V1.0.0_PCB/InkScreen2_13/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h -------------------------------------------------------------------------------- /Firmware/For_V1.0.0_PCB/InkScreen2_13/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BUYITAO/My_E-Paper_Driver/d78ec6fbcef9611fbeb8ad80f2b692ac6e225ed6/Firmware/For_V1.0.0_PCB/InkScreen2_13/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h -------------------------------------------------------------------------------- /Firmware/For_V1.0.0_PCB/InkScreen2_13/Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file system_stm32f10x.h 4 | * @author MCD Application Team 5 | * @brief CMSIS Cortex-M3 Device Peripheral Access Layer System Header File. 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | *

© Copyright (c) 2017 STMicroelectronics. 10 | * All rights reserved.

11 | * 12 | * This software component is licensed by ST under BSD 3-Clause license, 13 | * the "License"; You may not use this file except in compliance with the 14 | * License. You may obtain a copy of the License at: 15 | * opensource.org/licenses/BSD-3-Clause 16 | * 17 | ****************************************************************************** 18 | */ 19 | 20 | /** @addtogroup CMSIS 21 | * @{ 22 | */ 23 | 24 | /** @addtogroup stm32f10x_system 25 | * @{ 26 | */ 27 | 28 | /** 29 | * @brief Define to prevent recursive inclusion 30 | */ 31 | #ifndef __SYSTEM_STM32F10X_H 32 | #define __SYSTEM_STM32F10X_H 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | /** @addtogroup STM32F10x_System_Includes 39 | * @{ 40 | */ 41 | 42 | /** 43 | * @} 44 | */ 45 | 46 | 47 | /** @addtogroup STM32F10x_System_Exported_types 48 | * @{ 49 | */ 50 | 51 | extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */ 52 | extern const uint8_t AHBPrescTable[16U]; /*!< AHB prescalers table values */ 53 | extern const uint8_t APBPrescTable[8U]; /*!< APB prescalers table values */ 54 | 55 | /** 56 | * @} 57 | */ 58 | 59 | /** @addtogroup STM32F10x_System_Exported_Constants 60 | * @{ 61 | */ 62 | 63 | /** 64 | * @} 65 | */ 66 | 67 | /** @addtogroup STM32F10x_System_Exported_Macros 68 | * @{ 69 | */ 70 | 71 | /** 72 | * @} 73 | */ 74 | 75 | /** @addtogroup STM32F10x_System_Exported_Functions 76 | * @{ 77 | */ 78 | 79 | extern void SystemInit(void); 80 | extern void SystemCoreClockUpdate(void); 81 | /** 82 | * @} 83 | */ 84 | 85 | #ifdef __cplusplus 86 | } 87 | #endif 88 | 89 | #endif /*__SYSTEM_STM32F10X_H */ 90 | 91 | /** 92 | * @} 93 | */ 94 | 95 | /** 96 | * @} 97 | */ 98 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 99 | -------------------------------------------------------------------------------- /Firmware/For_V1.0.0_PCB/InkScreen2_13/Drivers/CMSIS/Device/ST/STM32F1xx/License.md: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. 10 | 11 | "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. 12 | 13 | "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. 14 | 15 | "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. 16 | 17 | "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. 18 | 19 | "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. 20 | 21 | "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). 22 | 23 | "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. 24 | 25 | "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." 26 | 27 | "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 28 | 29 | 2. Grant of Copyright License. 30 | 31 | Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 32 | 33 | 3. Grant of Patent License. 34 | 35 | Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 36 | 37 | 4. Redistribution. 38 | 39 | You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: 40 | 1.You must give any other recipients of the Work or Derivative Works a copy of this License; and 41 | 2.You must cause any modified files to carry prominent notices stating that You changed the files; and 42 | 3.You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and 43 | 4.If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. 44 | 45 | You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 46 | 47 | 5. Submission of Contributions. 48 | 49 | Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 50 | 51 | 6. Trademarks. 52 | 53 | This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 54 | 55 | 7. Disclaimer of Warranty. 56 | 57 | Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 58 | 59 | 8. Limitation of Liability. 60 | 61 | In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 62 | 63 | 9. Accepting Warranty or Additional Liability. 64 | 65 | While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. 66 | 67 | END OF TERMS AND CONDITIONS 68 | 69 | APPENDIX: 70 | 71 | Copyright [2019] [STMicroelectronics] 72 | 73 | Licensed under the Apache License, Version 2.0 (the "License"); 74 | you may not use this file except in compliance with the License. 75 | You may obtain a copy of the License at 76 | 77 | http://www.apache.org/licenses/LICENSE-2.0 78 | 79 | Unless required by applicable law or agreed to in writing, software 80 | distributed under the License is distributed on an "AS IS" BASIS, 81 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 82 | See the License for the specific language governing permissions and 83 | limitations under the License. -------------------------------------------------------------------------------- /Firmware/For_V1.0.0_PCB/InkScreen2_13/Drivers/CMSIS/Include/cmsis_compiler.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************//** 2 | * @file cmsis_compiler.h 3 | * @brief CMSIS compiler generic header file 4 | * @version V5.0.4 5 | * @date 10. January 2018 6 | ******************************************************************************/ 7 | /* 8 | * Copyright (c) 2009-2018 Arm Limited. All rights reserved. 9 | * 10 | * SPDX-License-Identifier: Apache-2.0 11 | * 12 | * Licensed under the Apache License, Version 2.0 (the License); you may 13 | * not use this file except in compliance with the License. 14 | * You may obtain a copy of the License at 15 | * 16 | * www.apache.org/licenses/LICENSE-2.0 17 | * 18 | * Unless required by applicable law or agreed to in writing, software 19 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 20 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 21 | * See the License for the specific language governing permissions and 22 | * limitations under the License. 23 | */ 24 | 25 | #ifndef __CMSIS_COMPILER_H 26 | #define __CMSIS_COMPILER_H 27 | 28 | #include 29 | 30 | /* 31 | * Arm Compiler 4/5 32 | */ 33 | #if defined ( __CC_ARM ) 34 | #include "cmsis_armcc.h" 35 | 36 | 37 | /* 38 | * Arm Compiler 6 (armclang) 39 | */ 40 | #elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) 41 | #include "cmsis_armclang.h" 42 | 43 | 44 | /* 45 | * GNU Compiler 46 | */ 47 | #elif defined ( __GNUC__ ) 48 | #include "cmsis_gcc.h" 49 | 50 | 51 | /* 52 | * IAR Compiler 53 | */ 54 | #elif defined ( __ICCARM__ ) 55 | #include 56 | 57 | 58 | /* 59 | * TI Arm Compiler 60 | */ 61 | #elif defined ( __TI_ARM__ ) 62 | #include 63 | 64 | #ifndef __ASM 65 | #define __ASM __asm 66 | #endif 67 | #ifndef __INLINE 68 | #define __INLINE inline 69 | #endif 70 | #ifndef __STATIC_INLINE 71 | #define __STATIC_INLINE static inline 72 | #endif 73 | #ifndef __STATIC_FORCEINLINE 74 | #define __STATIC_FORCEINLINE __STATIC_INLINE 75 | #endif 76 | #ifndef __NO_RETURN 77 | #define __NO_RETURN __attribute__((noreturn)) 78 | #endif 79 | #ifndef __USED 80 | #define __USED __attribute__((used)) 81 | #endif 82 | #ifndef __WEAK 83 | #define __WEAK __attribute__((weak)) 84 | #endif 85 | #ifndef __PACKED 86 | #define __PACKED __attribute__((packed)) 87 | #endif 88 | #ifndef __PACKED_STRUCT 89 | #define __PACKED_STRUCT struct __attribute__((packed)) 90 | #endif 91 | #ifndef __PACKED_UNION 92 | #define __PACKED_UNION union __attribute__((packed)) 93 | #endif 94 | #ifndef __UNALIGNED_UINT32 /* deprecated */ 95 | struct __attribute__((packed)) T_UINT32 { uint32_t v; }; 96 | #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) 97 | #endif 98 | #ifndef __UNALIGNED_UINT16_WRITE 99 | __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; 100 | #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void*)(addr))->v) = (val)) 101 | #endif 102 | #ifndef __UNALIGNED_UINT16_READ 103 | __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; 104 | #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) 105 | #endif 106 | #ifndef __UNALIGNED_UINT32_WRITE 107 | __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; 108 | #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) 109 | #endif 110 | #ifndef __UNALIGNED_UINT32_READ 111 | __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; 112 | #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) 113 | #endif 114 | #ifndef __ALIGNED 115 | #define __ALIGNED(x) __attribute__((aligned(x))) 116 | #endif 117 | #ifndef __RESTRICT 118 | #warning No compiler specific solution for __RESTRICT. __RESTRICT is ignored. 119 | #define __RESTRICT 120 | #endif 121 | 122 | 123 | /* 124 | * TASKING Compiler 125 | */ 126 | #elif defined ( __TASKING__ ) 127 | /* 128 | * The CMSIS functions have been implemented as intrinsics in the compiler. 129 | * Please use "carm -?i" to get an up to date list of all intrinsics, 130 | * Including the CMSIS ones. 131 | */ 132 | 133 | #ifndef __ASM 134 | #define __ASM __asm 135 | #endif 136 | #ifndef __INLINE 137 | #define __INLINE inline 138 | #endif 139 | #ifndef __STATIC_INLINE 140 | #define __STATIC_INLINE static inline 141 | #endif 142 | #ifndef __STATIC_FORCEINLINE 143 | #define __STATIC_FORCEINLINE __STATIC_INLINE 144 | #endif 145 | #ifndef __NO_RETURN 146 | #define __NO_RETURN __attribute__((noreturn)) 147 | #endif 148 | #ifndef __USED 149 | #define __USED __attribute__((used)) 150 | #endif 151 | #ifndef __WEAK 152 | #define __WEAK __attribute__((weak)) 153 | #endif 154 | #ifndef __PACKED 155 | #define __PACKED __packed__ 156 | #endif 157 | #ifndef __PACKED_STRUCT 158 | #define __PACKED_STRUCT struct __packed__ 159 | #endif 160 | #ifndef __PACKED_UNION 161 | #define __PACKED_UNION union __packed__ 162 | #endif 163 | #ifndef __UNALIGNED_UINT32 /* deprecated */ 164 | struct __packed__ T_UINT32 { uint32_t v; }; 165 | #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) 166 | #endif 167 | #ifndef __UNALIGNED_UINT16_WRITE 168 | __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; 169 | #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val)) 170 | #endif 171 | #ifndef __UNALIGNED_UINT16_READ 172 | __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; 173 | #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) 174 | #endif 175 | #ifndef __UNALIGNED_UINT32_WRITE 176 | __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; 177 | #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) 178 | #endif 179 | #ifndef __UNALIGNED_UINT32_READ 180 | __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; 181 | #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) 182 | #endif 183 | #ifndef __ALIGNED 184 | #define __ALIGNED(x) __align(x) 185 | #endif 186 | #ifndef __RESTRICT 187 | #warning No compiler specific solution for __RESTRICT. __RESTRICT is ignored. 188 | #define __RESTRICT 189 | #endif 190 | 191 | 192 | /* 193 | * COSMIC Compiler 194 | */ 195 | #elif defined ( __CSMC__ ) 196 | #include 197 | 198 | #ifndef __ASM 199 | #define __ASM _asm 200 | #endif 201 | #ifndef __INLINE 202 | #define __INLINE inline 203 | #endif 204 | #ifndef __STATIC_INLINE 205 | #define __STATIC_INLINE static inline 206 | #endif 207 | #ifndef __STATIC_FORCEINLINE 208 | #define __STATIC_FORCEINLINE __STATIC_INLINE 209 | #endif 210 | #ifndef __NO_RETURN 211 | // NO RETURN is automatically detected hence no warning here 212 | #define __NO_RETURN 213 | #endif 214 | #ifndef __USED 215 | #warning No compiler specific solution for __USED. __USED is ignored. 216 | #define __USED 217 | #endif 218 | #ifndef __WEAK 219 | #define __WEAK __weak 220 | #endif 221 | #ifndef __PACKED 222 | #define __PACKED @packed 223 | #endif 224 | #ifndef __PACKED_STRUCT 225 | #define __PACKED_STRUCT @packed struct 226 | #endif 227 | #ifndef __PACKED_UNION 228 | #define __PACKED_UNION @packed union 229 | #endif 230 | #ifndef __UNALIGNED_UINT32 /* deprecated */ 231 | @packed struct T_UINT32 { uint32_t v; }; 232 | #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) 233 | #endif 234 | #ifndef __UNALIGNED_UINT16_WRITE 235 | __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; 236 | #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val)) 237 | #endif 238 | #ifndef __UNALIGNED_UINT16_READ 239 | __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; 240 | #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) 241 | #endif 242 | #ifndef __UNALIGNED_UINT32_WRITE 243 | __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; 244 | #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) 245 | #endif 246 | #ifndef __UNALIGNED_UINT32_READ 247 | __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; 248 | #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) 249 | #endif 250 | #ifndef __ALIGNED 251 | #warning No compiler specific solution for __ALIGNED. __ALIGNED is ignored. 252 | #define __ALIGNED(x) 253 | #endif 254 | #ifndef __RESTRICT 255 | #warning No compiler specific solution for __RESTRICT. __RESTRICT is ignored. 256 | #define __RESTRICT 257 | #endif 258 | 259 | 260 | #else 261 | #error Unknown compiler. 262 | #endif 263 | 264 | 265 | #endif /* __CMSIS_COMPILER_H */ 266 | 267 | -------------------------------------------------------------------------------- /Firmware/For_V1.0.0_PCB/InkScreen2_13/Drivers/CMSIS/Include/cmsis_version.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************//** 2 | * @file cmsis_version.h 3 | * @brief CMSIS Core(M) Version definitions 4 | * @version V5.0.2 5 | * @date 19. April 2017 6 | ******************************************************************************/ 7 | /* 8 | * Copyright (c) 2009-2017 ARM Limited. All rights reserved. 9 | * 10 | * SPDX-License-Identifier: Apache-2.0 11 | * 12 | * Licensed under the Apache License, Version 2.0 (the License); you may 13 | * not use this file except in compliance with the License. 14 | * You may obtain a copy of the License at 15 | * 16 | * www.apache.org/licenses/LICENSE-2.0 17 | * 18 | * Unless required by applicable law or agreed to in writing, software 19 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 20 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 21 | * See the License for the specific language governing permissions and 22 | * limitations under the License. 23 | */ 24 | 25 | #if defined ( __ICCARM__ ) 26 | #pragma system_include /* treat file as system include file for MISRA check */ 27 | #elif defined (__clang__) 28 | #pragma clang system_header /* treat file as system include file */ 29 | #endif 30 | 31 | #ifndef __CMSIS_VERSION_H 32 | #define __CMSIS_VERSION_H 33 | 34 | /* CMSIS Version definitions */ 35 | #define __CM_CMSIS_VERSION_MAIN ( 5U) /*!< [31:16] CMSIS Core(M) main version */ 36 | #define __CM_CMSIS_VERSION_SUB ( 1U) /*!< [15:0] CMSIS Core(M) sub version */ 37 | #define __CM_CMSIS_VERSION ((__CM_CMSIS_VERSION_MAIN << 16U) | \ 38 | __CM_CMSIS_VERSION_SUB ) /*!< CMSIS Core(M) version number */ 39 | #endif 40 | -------------------------------------------------------------------------------- /Firmware/For_V1.0.0_PCB/InkScreen2_13/Drivers/CMSIS/Include/tz_context.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * @file tz_context.h 3 | * @brief Context Management for Armv8-M TrustZone 4 | * @version V1.0.1 5 | * @date 10. January 2018 6 | ******************************************************************************/ 7 | /* 8 | * Copyright (c) 2017-2018 Arm Limited. All rights reserved. 9 | * 10 | * SPDX-License-Identifier: Apache-2.0 11 | * 12 | * Licensed under the Apache License, Version 2.0 (the License); you may 13 | * not use this file except in compliance with the License. 14 | * You may obtain a copy of the License at 15 | * 16 | * www.apache.org/licenses/LICENSE-2.0 17 | * 18 | * Unless required by applicable law or agreed to in writing, software 19 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 20 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 21 | * See the License for the specific language governing permissions and 22 | * limitations under the License. 23 | */ 24 | 25 | #if defined ( __ICCARM__ ) 26 | #pragma system_include /* treat file as system include file for MISRA check */ 27 | #elif defined (__clang__) 28 | #pragma clang system_header /* treat file as system include file */ 29 | #endif 30 | 31 | #ifndef TZ_CONTEXT_H 32 | #define TZ_CONTEXT_H 33 | 34 | #include 35 | 36 | #ifndef TZ_MODULEID_T 37 | #define TZ_MODULEID_T 38 | /// \details Data type that identifies secure software modules called by a process. 39 | typedef uint32_t TZ_ModuleId_t; 40 | #endif 41 | 42 | /// \details TZ Memory ID identifies an allocated memory slot. 43 | typedef uint32_t TZ_MemoryId_t; 44 | 45 | /// Initialize secure context memory system 46 | /// \return execution status (1: success, 0: error) 47 | uint32_t TZ_InitContextSystem_S (void); 48 | 49 | /// Allocate context memory for calling secure software modules in TrustZone 50 | /// \param[in] module identifies software modules called from non-secure mode 51 | /// \return value != 0 id TrustZone memory slot identifier 52 | /// \return value 0 no memory available or internal error 53 | TZ_MemoryId_t TZ_AllocModuleContext_S (TZ_ModuleId_t module); 54 | 55 | /// Free context memory that was previously allocated with \ref TZ_AllocModuleContext_S 56 | /// \param[in] id TrustZone memory slot identifier 57 | /// \return execution status (1: success, 0: error) 58 | uint32_t TZ_FreeModuleContext_S (TZ_MemoryId_t id); 59 | 60 | /// Load secure context (called on RTOS thread context switch) 61 | /// \param[in] id TrustZone memory slot identifier 62 | /// \return execution status (1: success, 0: error) 63 | uint32_t TZ_LoadContext_S (TZ_MemoryId_t id); 64 | 65 | /// Store secure context (called on RTOS thread context switch) 66 | /// \param[in] id TrustZone memory slot identifier 67 | /// \return execution status (1: success, 0: error) 68 | uint32_t TZ_StoreContext_S (TZ_MemoryId_t id); 69 | 70 | #endif // TZ_CONTEXT_H 71 | -------------------------------------------------------------------------------- /Firmware/For_V1.0.0_PCB/InkScreen2_13/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_def.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f1xx_hal_def.h 4 | * @author MCD Application Team 5 | * @brief This file contains HAL common defines, enumeration, macros and 6 | * structures definitions. 7 | ****************************************************************************** 8 | * @attention 9 | * 10 | *

© Copyright (c) 2017 STMicroelectronics. 11 | * All rights reserved.

12 | * 13 | * This software component is licensed by ST under BSD 3-Clause license, 14 | * the "License"; You may not use this file except in compliance with the 15 | * License. You may obtain a copy of the License at: 16 | * opensource.org/licenses/BSD-3-Clause 17 | * 18 | ****************************************************************************** 19 | */ 20 | 21 | /* Define to prevent recursive inclusion -------------------------------------*/ 22 | #ifndef __STM32F1xx_HAL_DEF 23 | #define __STM32F1xx_HAL_DEF 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | /* Includes ------------------------------------------------------------------*/ 30 | #include "stm32f1xx.h" 31 | #include "Legacy/stm32_hal_legacy.h" 32 | #include 33 | 34 | /* Exported types ------------------------------------------------------------*/ 35 | 36 | /** 37 | * @brief HAL Status structures definition 38 | */ 39 | typedef enum 40 | { 41 | HAL_OK = 0x00U, 42 | HAL_ERROR = 0x01U, 43 | HAL_BUSY = 0x02U, 44 | HAL_TIMEOUT = 0x03U 45 | } HAL_StatusTypeDef; 46 | 47 | /** 48 | * @brief HAL Lock structures definition 49 | */ 50 | typedef enum 51 | { 52 | HAL_UNLOCKED = 0x00U, 53 | HAL_LOCKED = 0x01U 54 | } HAL_LockTypeDef; 55 | 56 | /* Exported macro ------------------------------------------------------------*/ 57 | #define HAL_MAX_DELAY 0xFFFFFFFFU 58 | 59 | #define HAL_IS_BIT_SET(REG, BIT) (((REG) & (BIT)) != 0U) 60 | #define HAL_IS_BIT_CLR(REG, BIT) (((REG) & (BIT)) == 0U) 61 | 62 | #define __HAL_LINKDMA(__HANDLE__, __PPP_DMA_FIELD__, __DMA_HANDLE__) \ 63 | do{ \ 64 | (__HANDLE__)->__PPP_DMA_FIELD__ = &(__DMA_HANDLE__); \ 65 | (__DMA_HANDLE__).Parent = (__HANDLE__); \ 66 | } while(0U) 67 | 68 | #define UNUSED(X) (void)X /* To avoid gcc/g++ warnings */ 69 | 70 | /** @brief Reset the Handle's State field. 71 | * @param __HANDLE__ specifies the Peripheral Handle. 72 | * @note This macro can be used for the following purpose: 73 | * - When the Handle is declared as local variable; before passing it as parameter 74 | * to HAL_PPP_Init() for the first time, it is mandatory to use this macro 75 | * to set to 0 the Handle's "State" field. 76 | * Otherwise, "State" field may have any random value and the first time the function 77 | * HAL_PPP_Init() is called, the low level hardware initialization will be missed 78 | * (i.e. HAL_PPP_MspInit() will not be executed). 79 | * - When there is a need to reconfigure the low level hardware: instead of calling 80 | * HAL_PPP_DeInit() then HAL_PPP_Init(), user can make a call to this macro then HAL_PPP_Init(). 81 | * In this later function, when the Handle's "State" field is set to 0, it will execute the function 82 | * HAL_PPP_MspInit() which will reconfigure the low level hardware. 83 | * @retval None 84 | */ 85 | #define __HAL_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = 0U) 86 | 87 | #if (USE_RTOS == 1U) 88 | /* Reserved for future use */ 89 | #error "USE_RTOS should be 0 in the current HAL release" 90 | #else 91 | #define __HAL_LOCK(__HANDLE__) \ 92 | do{ \ 93 | if((__HANDLE__)->Lock == HAL_LOCKED) \ 94 | { \ 95 | return HAL_BUSY; \ 96 | } \ 97 | else \ 98 | { \ 99 | (__HANDLE__)->Lock = HAL_LOCKED; \ 100 | } \ 101 | }while (0U) 102 | 103 | #define __HAL_UNLOCK(__HANDLE__) \ 104 | do{ \ 105 | (__HANDLE__)->Lock = HAL_UNLOCKED; \ 106 | }while (0U) 107 | #endif /* USE_RTOS */ 108 | 109 | #if defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) /* ARM Compiler V6 */ 110 | #ifndef __weak 111 | #define __weak __attribute__((weak)) 112 | #endif 113 | #ifndef __packed 114 | #define __packed __attribute__((packed)) 115 | #endif 116 | #elif defined ( __GNUC__ ) && !defined (__CC_ARM) /* GNU Compiler */ 117 | #ifndef __weak 118 | #define __weak __attribute__((weak)) 119 | #endif /* __weak */ 120 | #ifndef __packed 121 | #define __packed __attribute__((__packed__)) 122 | #endif /* __packed */ 123 | #endif /* __GNUC__ */ 124 | 125 | 126 | /* Macro to get variable aligned on 4-bytes, for __ICCARM__ the directive "#pragma data_alignment=4" must be used instead */ 127 | #if defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) /* ARM Compiler V6 */ 128 | #ifndef __ALIGN_BEGIN 129 | #define __ALIGN_BEGIN 130 | #endif 131 | #ifndef __ALIGN_END 132 | #define __ALIGN_END __attribute__ ((aligned (4))) 133 | #endif 134 | #elif defined ( __GNUC__ ) && !defined (__CC_ARM) /* GNU Compiler */ 135 | #ifndef __ALIGN_END 136 | #define __ALIGN_END __attribute__ ((aligned (4))) 137 | #endif /* __ALIGN_END */ 138 | #ifndef __ALIGN_BEGIN 139 | #define __ALIGN_BEGIN 140 | #endif /* __ALIGN_BEGIN */ 141 | #else 142 | #ifndef __ALIGN_END 143 | #define __ALIGN_END 144 | #endif /* __ALIGN_END */ 145 | #ifndef __ALIGN_BEGIN 146 | #if defined (__CC_ARM) /* ARM Compiler V5*/ 147 | #define __ALIGN_BEGIN __align(4) 148 | #elif defined (__ICCARM__) /* IAR Compiler */ 149 | #define __ALIGN_BEGIN 150 | #endif /* __CC_ARM */ 151 | #endif /* __ALIGN_BEGIN */ 152 | #endif /* __GNUC__ */ 153 | 154 | 155 | /** 156 | * @brief __RAM_FUNC definition 157 | */ 158 | #if defined ( __CC_ARM ) || (defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) 159 | /* ARM Compiler V4/V5 and V6 160 | -------------------------- 161 | RAM functions are defined using the toolchain options. 162 | Functions that are executed in RAM should reside in a separate source module. 163 | Using the 'Options for File' dialog you can simply change the 'Code / Const' 164 | area of a module to a memory space in physical RAM. 165 | Available memory areas are declared in the 'Target' tab of the 'Options for Target' 166 | dialog. 167 | */ 168 | #define __RAM_FUNC 169 | 170 | #elif defined ( __ICCARM__ ) 171 | /* ICCARM Compiler 172 | --------------- 173 | RAM functions are defined using a specific toolchain keyword "__ramfunc". 174 | */ 175 | #define __RAM_FUNC __ramfunc 176 | 177 | #elif defined ( __GNUC__ ) 178 | /* GNU Compiler 179 | ------------ 180 | RAM functions are defined using a specific toolchain attribute 181 | "__attribute__((section(".RamFunc")))". 182 | */ 183 | #define __RAM_FUNC __attribute__((section(".RamFunc"))) 184 | 185 | #endif 186 | 187 | /** 188 | * @brief __NOINLINE definition 189 | */ 190 | #if defined ( __CC_ARM ) || (defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) || defined ( __GNUC__ ) 191 | /* ARM V4/V5 and V6 & GNU Compiler 192 | ------------------------------- 193 | */ 194 | #define __NOINLINE __attribute__ ( (noinline) ) 195 | 196 | #elif defined ( __ICCARM__ ) 197 | /* ICCARM Compiler 198 | --------------- 199 | */ 200 | #define __NOINLINE _Pragma("optimize = no_inline") 201 | 202 | #endif 203 | 204 | #ifdef __cplusplus 205 | } 206 | #endif 207 | 208 | #endif /* ___STM32F1xx_HAL_DEF */ 209 | 210 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 211 | -------------------------------------------------------------------------------- /Firmware/For_V1.0.0_PCB/InkScreen2_13/Drivers/STM32F1xx_HAL_Driver/License.md: -------------------------------------------------------------------------------- 1 | Copyright 2016(-2021) STMicroelectronics. 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, 5 | are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation and/or 12 | other materials provided with the distribution. 13 | 14 | 3. Neither the name of the copyright holder nor the names of its contributors 15 | may be used to endorse or promote products derived from this software without 16 | specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 22 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 25 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /Firmware/For_V1.0.0_PCB/InkScreen2_13/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f1xx_hal_gpio_ex.c 4 | * @author MCD Application Team 5 | * @brief GPIO Extension HAL module driver. 6 | * This file provides firmware functions to manage the following 7 | * functionalities of the General Purpose Input/Output (GPIO) extension peripheral. 8 | * + Extended features functions 9 | * 10 | @verbatim 11 | ============================================================================== 12 | ##### GPIO Peripheral extension features ##### 13 | ============================================================================== 14 | [..] GPIO module on STM32F1 family, manage also the AFIO register: 15 | (+) Possibility to use the EVENTOUT Cortex feature 16 | 17 | ##### How to use this driver ##### 18 | ============================================================================== 19 | [..] This driver provides functions to use EVENTOUT Cortex feature 20 | (#) Configure EVENTOUT Cortex feature using the function HAL_GPIOEx_ConfigEventout() 21 | (#) Activate EVENTOUT Cortex feature using the HAL_GPIOEx_EnableEventout() 22 | (#) Deactivate EVENTOUT Cortex feature using the HAL_GPIOEx_DisableEventout() 23 | 24 | @endverbatim 25 | ****************************************************************************** 26 | * @attention 27 | * 28 | *

© Copyright (c) 2016 STMicroelectronics. 29 | * All rights reserved.

30 | * 31 | * This software component is licensed by ST under BSD 3-Clause license, 32 | * the "License"; You may not use this file except in compliance with the 33 | * License. You may obtain a copy of the License at: 34 | * opensource.org/licenses/BSD-3-Clause 35 | * 36 | ****************************************************************************** 37 | */ 38 | 39 | /* Includes ------------------------------------------------------------------*/ 40 | #include "stm32f1xx_hal.h" 41 | 42 | /** @addtogroup STM32F1xx_HAL_Driver 43 | * @{ 44 | */ 45 | 46 | /** @defgroup GPIOEx GPIOEx 47 | * @brief GPIO HAL module driver 48 | * @{ 49 | */ 50 | 51 | #ifdef HAL_GPIO_MODULE_ENABLED 52 | 53 | /** @defgroup GPIOEx_Exported_Functions GPIOEx Exported Functions 54 | * @{ 55 | */ 56 | 57 | /** @defgroup GPIOEx_Exported_Functions_Group1 Extended features functions 58 | * @brief Extended features functions 59 | * 60 | @verbatim 61 | ============================================================================== 62 | ##### Extended features functions ##### 63 | ============================================================================== 64 | [..] This section provides functions allowing to: 65 | (+) Configure EVENTOUT Cortex feature using the function HAL_GPIOEx_ConfigEventout() 66 | (+) Activate EVENTOUT Cortex feature using the HAL_GPIOEx_EnableEventout() 67 | (+) Deactivate EVENTOUT Cortex feature using the HAL_GPIOEx_DisableEventout() 68 | 69 | @endverbatim 70 | * @{ 71 | */ 72 | 73 | /** 74 | * @brief Configures the port and pin on which the EVENTOUT Cortex signal will be connected. 75 | * @param GPIO_PortSource Select the port used to output the Cortex EVENTOUT signal. 76 | * This parameter can be a value of @ref GPIOEx_EVENTOUT_PORT. 77 | * @param GPIO_PinSource Select the pin used to output the Cortex EVENTOUT signal. 78 | * This parameter can be a value of @ref GPIOEx_EVENTOUT_PIN. 79 | * @retval None 80 | */ 81 | void HAL_GPIOEx_ConfigEventout(uint32_t GPIO_PortSource, uint32_t GPIO_PinSource) 82 | { 83 | /* Verify the parameters */ 84 | assert_param(IS_AFIO_EVENTOUT_PORT(GPIO_PortSource)); 85 | assert_param(IS_AFIO_EVENTOUT_PIN(GPIO_PinSource)); 86 | 87 | /* Apply the new configuration */ 88 | MODIFY_REG(AFIO->EVCR, (AFIO_EVCR_PORT) | (AFIO_EVCR_PIN), (GPIO_PortSource) | (GPIO_PinSource)); 89 | } 90 | 91 | /** 92 | * @brief Enables the Event Output. 93 | * @retval None 94 | */ 95 | void HAL_GPIOEx_EnableEventout(void) 96 | { 97 | SET_BIT(AFIO->EVCR, AFIO_EVCR_EVOE); 98 | } 99 | 100 | /** 101 | * @brief Disables the Event Output. 102 | * @retval None 103 | */ 104 | void HAL_GPIOEx_DisableEventout(void) 105 | { 106 | CLEAR_BIT(AFIO->EVCR, AFIO_EVCR_EVOE); 107 | } 108 | 109 | /** 110 | * @} 111 | */ 112 | 113 | /** 114 | * @} 115 | */ 116 | 117 | #endif /* HAL_GPIO_MODULE_ENABLED */ 118 | 119 | /** 120 | * @} 121 | */ 122 | 123 | /** 124 | * @} 125 | */ 126 | 127 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 128 | -------------------------------------------------------------------------------- /Firmware/For_V1.0.0_PCB/InkScreen2_13/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_exti.c: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f1xx_ll_exti.c 4 | * @author MCD Application Team 5 | * @brief EXTI LL module driver. 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | *

© Copyright (c) 2016 STMicroelectronics. 10 | * All rights reserved.

11 | * 12 | * This software component is licensed by ST under BSD 3-Clause license, 13 | * the "License"; You may not use this file except in compliance with the 14 | * License. You may obtain a copy of the License at: 15 | * opensource.org/licenses/BSD-3-Clause 16 | * 17 | ****************************************************************************** 18 | */ 19 | 20 | #if defined(USE_FULL_LL_DRIVER) 21 | 22 | /* Includes ------------------------------------------------------------------*/ 23 | #include "stm32f1xx_ll_exti.h" 24 | #ifdef USE_FULL_ASSERT 25 | #include "stm32_assert.h" 26 | #else 27 | #define assert_param(expr) ((void)0U) 28 | #endif 29 | 30 | /** @addtogroup STM32F1xx_LL_Driver 31 | * @{ 32 | */ 33 | 34 | #if defined (EXTI) 35 | 36 | /** @defgroup EXTI_LL EXTI 37 | * @{ 38 | */ 39 | 40 | /* Private types -------------------------------------------------------------*/ 41 | /* Private variables ---------------------------------------------------------*/ 42 | /* Private constants ---------------------------------------------------------*/ 43 | /* Private macros ------------------------------------------------------------*/ 44 | /** @addtogroup EXTI_LL_Private_Macros 45 | * @{ 46 | */ 47 | 48 | #define IS_LL_EXTI_LINE_0_31(__VALUE__) (((__VALUE__) & ~LL_EXTI_LINE_ALL_0_31) == 0x00000000U) 49 | 50 | #define IS_LL_EXTI_MODE(__VALUE__) (((__VALUE__) == LL_EXTI_MODE_IT) \ 51 | || ((__VALUE__) == LL_EXTI_MODE_EVENT) \ 52 | || ((__VALUE__) == LL_EXTI_MODE_IT_EVENT)) 53 | 54 | 55 | #define IS_LL_EXTI_TRIGGER(__VALUE__) (((__VALUE__) == LL_EXTI_TRIGGER_NONE) \ 56 | || ((__VALUE__) == LL_EXTI_TRIGGER_RISING) \ 57 | || ((__VALUE__) == LL_EXTI_TRIGGER_FALLING) \ 58 | || ((__VALUE__) == LL_EXTI_TRIGGER_RISING_FALLING)) 59 | 60 | /** 61 | * @} 62 | */ 63 | 64 | /* Private function prototypes -----------------------------------------------*/ 65 | 66 | /* Exported functions --------------------------------------------------------*/ 67 | /** @addtogroup EXTI_LL_Exported_Functions 68 | * @{ 69 | */ 70 | 71 | /** @addtogroup EXTI_LL_EF_Init 72 | * @{ 73 | */ 74 | 75 | /** 76 | * @brief De-initialize the EXTI registers to their default reset values. 77 | * @retval An ErrorStatus enumeration value: 78 | * - SUCCESS: EXTI registers are de-initialized 79 | * - ERROR: not applicable 80 | */ 81 | uint32_t LL_EXTI_DeInit(void) 82 | { 83 | /* Interrupt mask register set to default reset values */ 84 | LL_EXTI_WriteReg(IMR, 0x00000000U); 85 | /* Event mask register set to default reset values */ 86 | LL_EXTI_WriteReg(EMR, 0x00000000U); 87 | /* Rising Trigger selection register set to default reset values */ 88 | LL_EXTI_WriteReg(RTSR, 0x00000000U); 89 | /* Falling Trigger selection register set to default reset values */ 90 | LL_EXTI_WriteReg(FTSR, 0x00000000U); 91 | /* Software interrupt event register set to default reset values */ 92 | LL_EXTI_WriteReg(SWIER, 0x00000000U); 93 | /* Pending register clear */ 94 | LL_EXTI_WriteReg(PR, 0x000FFFFFU); 95 | 96 | return SUCCESS; 97 | } 98 | 99 | /** 100 | * @brief Initialize the EXTI registers according to the specified parameters in EXTI_InitStruct. 101 | * @param EXTI_InitStruct pointer to a @ref LL_EXTI_InitTypeDef structure. 102 | * @retval An ErrorStatus enumeration value: 103 | * - SUCCESS: EXTI registers are initialized 104 | * - ERROR: not applicable 105 | */ 106 | uint32_t LL_EXTI_Init(LL_EXTI_InitTypeDef *EXTI_InitStruct) 107 | { 108 | ErrorStatus status = SUCCESS; 109 | /* Check the parameters */ 110 | assert_param(IS_LL_EXTI_LINE_0_31(EXTI_InitStruct->Line_0_31)); 111 | assert_param(IS_FUNCTIONAL_STATE(EXTI_InitStruct->LineCommand)); 112 | assert_param(IS_LL_EXTI_MODE(EXTI_InitStruct->Mode)); 113 | 114 | /* ENABLE LineCommand */ 115 | if (EXTI_InitStruct->LineCommand != DISABLE) 116 | { 117 | assert_param(IS_LL_EXTI_TRIGGER(EXTI_InitStruct->Trigger)); 118 | 119 | /* Configure EXTI Lines in range from 0 to 31 */ 120 | if (EXTI_InitStruct->Line_0_31 != LL_EXTI_LINE_NONE) 121 | { 122 | switch (EXTI_InitStruct->Mode) 123 | { 124 | case LL_EXTI_MODE_IT: 125 | /* First Disable Event on provided Lines */ 126 | LL_EXTI_DisableEvent_0_31(EXTI_InitStruct->Line_0_31); 127 | /* Then Enable IT on provided Lines */ 128 | LL_EXTI_EnableIT_0_31(EXTI_InitStruct->Line_0_31); 129 | break; 130 | case LL_EXTI_MODE_EVENT: 131 | /* First Disable IT on provided Lines */ 132 | LL_EXTI_DisableIT_0_31(EXTI_InitStruct->Line_0_31); 133 | /* Then Enable Event on provided Lines */ 134 | LL_EXTI_EnableEvent_0_31(EXTI_InitStruct->Line_0_31); 135 | break; 136 | case LL_EXTI_MODE_IT_EVENT: 137 | /* Directly Enable IT & Event on provided Lines */ 138 | LL_EXTI_EnableIT_0_31(EXTI_InitStruct->Line_0_31); 139 | LL_EXTI_EnableEvent_0_31(EXTI_InitStruct->Line_0_31); 140 | break; 141 | default: 142 | status = ERROR; 143 | break; 144 | } 145 | if (EXTI_InitStruct->Trigger != LL_EXTI_TRIGGER_NONE) 146 | { 147 | switch (EXTI_InitStruct->Trigger) 148 | { 149 | case LL_EXTI_TRIGGER_RISING: 150 | /* First Disable Falling Trigger on provided Lines */ 151 | LL_EXTI_DisableFallingTrig_0_31(EXTI_InitStruct->Line_0_31); 152 | /* Then Enable Rising Trigger on provided Lines */ 153 | LL_EXTI_EnableRisingTrig_0_31(EXTI_InitStruct->Line_0_31); 154 | break; 155 | case LL_EXTI_TRIGGER_FALLING: 156 | /* First Disable Rising Trigger on provided Lines */ 157 | LL_EXTI_DisableRisingTrig_0_31(EXTI_InitStruct->Line_0_31); 158 | /* Then Enable Falling Trigger on provided Lines */ 159 | LL_EXTI_EnableFallingTrig_0_31(EXTI_InitStruct->Line_0_31); 160 | break; 161 | case LL_EXTI_TRIGGER_RISING_FALLING: 162 | LL_EXTI_EnableRisingTrig_0_31(EXTI_InitStruct->Line_0_31); 163 | LL_EXTI_EnableFallingTrig_0_31(EXTI_InitStruct->Line_0_31); 164 | break; 165 | default: 166 | status = ERROR; 167 | break; 168 | } 169 | } 170 | } 171 | } 172 | /* DISABLE LineCommand */ 173 | else 174 | { 175 | /* De-configure EXTI Lines in range from 0 to 31 */ 176 | LL_EXTI_DisableIT_0_31(EXTI_InitStruct->Line_0_31); 177 | LL_EXTI_DisableEvent_0_31(EXTI_InitStruct->Line_0_31); 178 | } 179 | return status; 180 | } 181 | 182 | /** 183 | * @brief Set each @ref LL_EXTI_InitTypeDef field to default value. 184 | * @param EXTI_InitStruct Pointer to a @ref LL_EXTI_InitTypeDef structure. 185 | * @retval None 186 | */ 187 | void LL_EXTI_StructInit(LL_EXTI_InitTypeDef *EXTI_InitStruct) 188 | { 189 | EXTI_InitStruct->Line_0_31 = LL_EXTI_LINE_NONE; 190 | EXTI_InitStruct->LineCommand = DISABLE; 191 | EXTI_InitStruct->Mode = LL_EXTI_MODE_IT; 192 | EXTI_InitStruct->Trigger = LL_EXTI_TRIGGER_FALLING; 193 | } 194 | 195 | /** 196 | * @} 197 | */ 198 | 199 | /** 200 | * @} 201 | */ 202 | 203 | /** 204 | * @} 205 | */ 206 | 207 | #endif /* defined (EXTI) */ 208 | 209 | /** 210 | * @} 211 | */ 212 | 213 | #endif /* USE_FULL_LL_DRIVER */ 214 | 215 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 216 | -------------------------------------------------------------------------------- /Firmware/For_V1.0.0_PCB/InkScreen2_13/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_gpio.c: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f1xx_ll_gpio.c 4 | * @author MCD Application Team 5 | * @brief GPIO LL module driver. 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | *

© Copyright (c) 2016 STMicroelectronics. 10 | * All rights reserved.

11 | * 12 | * This software component is licensed by ST under BSD 3-Clause license, 13 | * the "License"; You may not use this file except in compliance with the 14 | * License. You may obtain a copy of the License at: 15 | * opensource.org/licenses/BSD-3-Clause 16 | * 17 | ****************************************************************************** 18 | */ 19 | 20 | #if defined(USE_FULL_LL_DRIVER) 21 | 22 | /* Includes ------------------------------------------------------------------*/ 23 | #include "stm32f1xx_ll_gpio.h" 24 | #include "stm32f1xx_ll_bus.h" 25 | #ifdef USE_FULL_ASSERT 26 | #include "stm32_assert.h" 27 | #else 28 | #define assert_param(expr) ((void)0U) 29 | #endif 30 | 31 | /** @addtogroup STM32F1xx_LL_Driver 32 | * @{ 33 | */ 34 | 35 | #if defined (GPIOA) || defined (GPIOB) || defined (GPIOC) || defined (GPIOD) || defined (GPIOE) || defined (GPIOF) || defined (GPIOG) 36 | 37 | /** @addtogroup GPIO_LL 38 | * @{ 39 | */ 40 | 41 | /* Private types -------------------------------------------------------------*/ 42 | /* Private variables ---------------------------------------------------------*/ 43 | /* Private constants ---------------------------------------------------------*/ 44 | /* Private macros ------------------------------------------------------------*/ 45 | /** @addtogroup GPIO_LL_Private_Macros 46 | * @{ 47 | */ 48 | 49 | #define IS_LL_GPIO_PIN(__VALUE__) ((((__VALUE__) & LL_GPIO_PIN_ALL)!= 0u) &&\ 50 | (((__VALUE__) & (~LL_GPIO_PIN_ALL))== 0u)) 51 | 52 | #define IS_LL_GPIO_MODE(__VALUE__) (((__VALUE__) == LL_GPIO_MODE_ANALOG) ||\ 53 | ((__VALUE__) == LL_GPIO_MODE_FLOATING) ||\ 54 | ((__VALUE__) == LL_GPIO_MODE_INPUT) ||\ 55 | ((__VALUE__) == LL_GPIO_MODE_OUTPUT) ||\ 56 | ((__VALUE__) == LL_GPIO_MODE_ALTERNATE)) 57 | 58 | #define IS_LL_GPIO_SPEED(__VALUE__) (((__VALUE__) == LL_GPIO_SPEED_FREQ_LOW) ||\ 59 | ((__VALUE__) == LL_GPIO_SPEED_FREQ_MEDIUM) ||\ 60 | ((__VALUE__) == LL_GPIO_SPEED_FREQ_HIGH)) 61 | 62 | #define IS_LL_GPIO_OUTPUT_TYPE(__VALUE__) (((__VALUE__) == LL_GPIO_OUTPUT_PUSHPULL) ||\ 63 | ((__VALUE__) == LL_GPIO_OUTPUT_OPENDRAIN)) 64 | 65 | #define IS_LL_GPIO_PULL(__VALUE__) (((__VALUE__) == LL_GPIO_PULL_DOWN) ||\ 66 | ((__VALUE__) == LL_GPIO_PULL_UP)) 67 | 68 | /** 69 | * @} 70 | */ 71 | 72 | /* Private function prototypes -----------------------------------------------*/ 73 | 74 | /* Exported functions --------------------------------------------------------*/ 75 | /** @addtogroup GPIO_LL_Exported_Functions 76 | * @{ 77 | */ 78 | 79 | /** @addtogroup GPIO_LL_EF_Init 80 | * @{ 81 | */ 82 | 83 | /** 84 | * @brief De-initialize GPIO registers (Registers restored to their default values). 85 | * @param GPIOx GPIO Port 86 | * @retval An ErrorStatus enumeration value: 87 | * - SUCCESS: GPIO registers are de-initialized 88 | * - ERROR: Wrong GPIO Port 89 | */ 90 | ErrorStatus LL_GPIO_DeInit(GPIO_TypeDef *GPIOx) 91 | { 92 | ErrorStatus status = SUCCESS; 93 | 94 | /* Check the parameters */ 95 | assert_param(IS_GPIO_ALL_INSTANCE(GPIOx)); 96 | 97 | /* Force and Release reset on clock of GPIOx Port */ 98 | if (GPIOx == GPIOA) 99 | { 100 | LL_APB2_GRP1_ForceReset(LL_APB2_GRP1_PERIPH_GPIOA); 101 | LL_APB2_GRP1_ReleaseReset(LL_APB2_GRP1_PERIPH_GPIOA); 102 | } 103 | else if (GPIOx == GPIOB) 104 | { 105 | LL_APB2_GRP1_ForceReset(LL_APB2_GRP1_PERIPH_GPIOB); 106 | LL_APB2_GRP1_ReleaseReset(LL_APB2_GRP1_PERIPH_GPIOB); 107 | } 108 | else if (GPIOx == GPIOC) 109 | { 110 | LL_APB2_GRP1_ForceReset(LL_APB2_GRP1_PERIPH_GPIOC); 111 | LL_APB2_GRP1_ReleaseReset(LL_APB2_GRP1_PERIPH_GPIOC); 112 | } 113 | else if (GPIOx == GPIOD) 114 | { 115 | LL_APB2_GRP1_ForceReset(LL_APB2_GRP1_PERIPH_GPIOD); 116 | LL_APB2_GRP1_ReleaseReset(LL_APB2_GRP1_PERIPH_GPIOD); 117 | } 118 | #if defined(GPIOE) 119 | else if (GPIOx == GPIOE) 120 | { 121 | LL_APB2_GRP1_ForceReset(LL_APB2_GRP1_PERIPH_GPIOE); 122 | LL_APB2_GRP1_ReleaseReset(LL_APB2_GRP1_PERIPH_GPIOE); 123 | } 124 | #endif 125 | #if defined(GPIOF) 126 | else if (GPIOx == GPIOF) 127 | { 128 | LL_APB2_GRP1_ForceReset(LL_APB2_GRP1_PERIPH_GPIOF); 129 | LL_APB2_GRP1_ReleaseReset(LL_APB2_GRP1_PERIPH_GPIOF); 130 | } 131 | #endif 132 | #if defined(GPIOG) 133 | else if (GPIOx == GPIOG) 134 | { 135 | LL_APB2_GRP1_ForceReset(LL_APB2_GRP1_PERIPH_GPIOG); 136 | LL_APB2_GRP1_ReleaseReset(LL_APB2_GRP1_PERIPH_GPIOG); 137 | } 138 | #endif 139 | else 140 | { 141 | status = ERROR; 142 | } 143 | 144 | return (status); 145 | } 146 | 147 | /** 148 | * @brief Initialize GPIO registers according to the specified parameters in GPIO_InitStruct. 149 | * @param GPIOx GPIO Port 150 | * @param GPIO_InitStruct: pointer to a @ref LL_GPIO_InitTypeDef structure 151 | * that contains the configuration information for the specified GPIO peripheral. 152 | * @retval An ErrorStatus enumeration value: 153 | * - SUCCESS: GPIO registers are initialized according to GPIO_InitStruct content 154 | * - ERROR: Not applicable 155 | */ 156 | ErrorStatus LL_GPIO_Init(GPIO_TypeDef *GPIOx, LL_GPIO_InitTypeDef *GPIO_InitStruct) 157 | { 158 | uint32_t pinmask; 159 | uint32_t pinpos; 160 | uint32_t currentpin; 161 | 162 | /* Check the parameters */ 163 | assert_param(IS_GPIO_ALL_INSTANCE(GPIOx)); 164 | assert_param(IS_LL_GPIO_PIN(GPIO_InitStruct->Pin)); 165 | 166 | /* ------------------------- Configure the port pins ---------------- */ 167 | /* Initialize pinpos on first pin set */ 168 | 169 | pinmask = ((GPIO_InitStruct->Pin) << GPIO_PIN_MASK_POS) >> GPIO_PIN_NB; 170 | pinpos = POSITION_VAL(pinmask); 171 | 172 | /* Configure the port pins */ 173 | while ((pinmask >> pinpos) != 0u) 174 | { 175 | /* skip if bit is not set */ 176 | if ((pinmask & (1u << pinpos)) != 0u) 177 | { 178 | /* Get current io position */ 179 | if (pinpos < GPIO_PIN_MASK_POS) 180 | { 181 | currentpin = (0x00000101uL << pinpos); 182 | } 183 | else 184 | { 185 | currentpin = ((0x00010001u << (pinpos - GPIO_PIN_MASK_POS)) | 0x04000000u); 186 | } 187 | 188 | if (GPIO_InitStruct->Mode == LL_GPIO_MODE_INPUT) 189 | { 190 | /* Check The Pull parameter */ 191 | assert_param(IS_LL_GPIO_PULL(GPIO_InitStruct->Pull)); 192 | 193 | /* Pull-up Pull-down resistor configuration*/ 194 | LL_GPIO_SetPinPull(GPIOx, currentpin, GPIO_InitStruct->Pull); 195 | } 196 | 197 | /* Check Pin Mode parameters */ 198 | assert_param(IS_LL_GPIO_MODE(GPIO_InitStruct->Mode)); 199 | 200 | /* Pin Mode configuration */ 201 | LL_GPIO_SetPinMode(GPIOx, currentpin, GPIO_InitStruct->Mode); 202 | 203 | if ((GPIO_InitStruct->Mode == LL_GPIO_MODE_OUTPUT) || (GPIO_InitStruct->Mode == LL_GPIO_MODE_ALTERNATE)) 204 | { 205 | /* Check speed and Output mode parameters */ 206 | assert_param(IS_LL_GPIO_SPEED(GPIO_InitStruct->Speed)); 207 | assert_param(IS_LL_GPIO_OUTPUT_TYPE(GPIO_InitStruct->OutputType)); 208 | 209 | /* Speed mode configuration */ 210 | LL_GPIO_SetPinSpeed(GPIOx, currentpin, GPIO_InitStruct->Speed); 211 | 212 | /* Output mode configuration*/ 213 | LL_GPIO_SetPinOutputType(GPIOx, currentpin, GPIO_InitStruct->OutputType); 214 | } 215 | } 216 | pinpos++; 217 | } 218 | return (SUCCESS); 219 | } 220 | 221 | /** 222 | * @brief Set each @ref LL_GPIO_InitTypeDef field to default value. 223 | * @param GPIO_InitStruct: pointer to a @ref LL_GPIO_InitTypeDef structure 224 | * whose fields will be set to default values. 225 | * @retval None 226 | */ 227 | 228 | void LL_GPIO_StructInit(LL_GPIO_InitTypeDef *GPIO_InitStruct) 229 | { 230 | /* Reset GPIO init structure parameters values */ 231 | GPIO_InitStruct->Pin = LL_GPIO_PIN_ALL; 232 | GPIO_InitStruct->Mode = LL_GPIO_MODE_FLOATING; 233 | GPIO_InitStruct->Speed = LL_GPIO_SPEED_FREQ_LOW; 234 | GPIO_InitStruct->OutputType = LL_GPIO_OUTPUT_OPENDRAIN; 235 | GPIO_InitStruct->Pull = LL_GPIO_PULL_DOWN; 236 | } 237 | 238 | /** 239 | * @} 240 | */ 241 | 242 | /** 243 | * @} 244 | */ 245 | 246 | /** 247 | * @} 248 | */ 249 | 250 | #endif /* defined (GPIOA) || defined (GPIOB) || defined (GPIOC) || defined (GPIOD) || defined (GPIOE) || defined (GPIOF) || defined (GPIOG) */ 251 | 252 | /** 253 | * @} 254 | */ 255 | 256 | #endif /* USE_FULL_LL_DRIVER */ 257 | 258 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 259 | -------------------------------------------------------------------------------- /Firmware/For_V1.0.0_PCB/InkScreen2_13/InkScreen2_13.ioc: -------------------------------------------------------------------------------- 1 | #MicroXplorer Configuration settings - do not modify 2 | File.Version=6 3 | GPIO.groupedBy= 4 | KeepUserPlacement=false 5 | Mcu.Family=STM32F1 6 | Mcu.IP0=NVIC 7 | Mcu.IP1=RCC 8 | Mcu.IP2=SPI1 9 | Mcu.IP3=SYS 10 | Mcu.IPNb=4 11 | Mcu.Name=STM32F103C(8-B)Tx 12 | Mcu.Package=LQFP48 13 | Mcu.Pin0=PD0-OSC_IN 14 | Mcu.Pin1=PD1-OSC_OUT 15 | Mcu.Pin10=VP_SYS_VS_Systick 16 | Mcu.Pin2=PA1 17 | Mcu.Pin3=PA2 18 | Mcu.Pin4=PA3 19 | Mcu.Pin5=PA4 20 | Mcu.Pin6=PA5 21 | Mcu.Pin7=PA7 22 | Mcu.Pin8=PA13 23 | Mcu.Pin9=PA14 24 | Mcu.PinsNb=11 25 | Mcu.ThirdPartyNb=0 26 | Mcu.UserConstants= 27 | Mcu.UserName=STM32F103C8Tx 28 | MxCube.Version=6.4.0 29 | MxDb.Version=DB.6.0.40 30 | NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false 31 | NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false 32 | NVIC.ForceEnableDMAVector=true 33 | NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false 34 | NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false 35 | NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false 36 | NVIC.PendSV_IRQn=true\:0\:0\:false\:false\:true\:false\:false 37 | NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4 38 | NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:true\:false\:false 39 | NVIC.SysTick_IRQn=true\:15\:0\:false\:false\:true\:false\:true 40 | NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false 41 | PA1.GPIOParameters=GPIO_Label 42 | PA1.GPIO_Label=DI_SCREEN_BUSY 43 | PA1.Locked=true 44 | PA1.Signal=GPIO_Input 45 | PA13.Mode=Serial_Wire 46 | PA13.Signal=SYS_JTMS-SWDIO 47 | PA14.Mode=Serial_Wire 48 | PA14.Signal=SYS_JTCK-SWCLK 49 | PA2.GPIOParameters=GPIO_Label 50 | PA2.GPIO_Label=DO_SCREEN_DC 51 | PA2.Locked=true 52 | PA2.Signal=GPIO_Output 53 | PA3.GPIOParameters=GPIO_Label 54 | PA3.GPIO_Label=DO_SCREEN_RST 55 | PA3.Locked=true 56 | PA3.Signal=GPIO_Output 57 | PA4.GPIOParameters=PinState,GPIO_Label 58 | PA4.GPIO_Label=DO_SCREEN_CS 59 | PA4.Locked=true 60 | PA4.PinState=GPIO_PIN_SET 61 | PA4.Signal=GPIO_Output 62 | PA5.GPIOParameters=GPIO_Label 63 | PA5.GPIO_Label=DO_SCREEN_CLK 64 | PA5.Mode=TX_Only_Simplex_Unidirect_Master 65 | PA5.Signal=SPI1_SCK 66 | PA7.GPIOParameters=GPIO_Label 67 | PA7.GPIO_Label=MO_SCREEN_MOSI 68 | PA7.Mode=TX_Only_Simplex_Unidirect_Master 69 | PA7.Signal=SPI1_MOSI 70 | PD0-OSC_IN.Mode=HSE-External-Oscillator 71 | PD0-OSC_IN.Signal=RCC_OSC_IN 72 | PD1-OSC_OUT.Mode=HSE-External-Oscillator 73 | PD1-OSC_OUT.Signal=RCC_OSC_OUT 74 | PinOutPanel.RotationAngle=0 75 | ProjectManager.AskForMigrate=true 76 | ProjectManager.BackupPrevious=false 77 | ProjectManager.CompilerOptimize=6 78 | ProjectManager.ComputerToolchain=false 79 | ProjectManager.CoupleFile=true 80 | ProjectManager.CustomerFirmwarePackage= 81 | ProjectManager.DefaultFWLocation=true 82 | ProjectManager.DeletePrevious=true 83 | ProjectManager.DeviceId=STM32F103C8Tx 84 | ProjectManager.FirmwarePackage=STM32Cube FW_F1 V1.8.4 85 | ProjectManager.FreePins=true 86 | ProjectManager.HalAssertFull=false 87 | ProjectManager.HeapSize=0x200 88 | ProjectManager.KeepUserCode=true 89 | ProjectManager.LastFirmware=true 90 | ProjectManager.LibraryCopy=1 91 | ProjectManager.MainLocation=Core/Src 92 | ProjectManager.NoMain=false 93 | ProjectManager.PreviousToolchain= 94 | ProjectManager.ProjectBuild=false 95 | ProjectManager.ProjectFileName=InkScreen2_13.ioc 96 | ProjectManager.ProjectName=InkScreen2_13 97 | ProjectManager.RegisterCallBack= 98 | ProjectManager.StackSize=0x1500 99 | ProjectManager.TargetToolchain=MDK-ARM V5.27 100 | ProjectManager.ToolChainLocation= 101 | ProjectManager.UnderRoot=false 102 | ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-LL-true,2-SystemClock_Config-RCC-false-HAL-false,3-MX_SPI1_Init-SPI1-false-LL-true 103 | RCC.ADCFreqValue=32000000 104 | RCC.AHBFreq_Value=64000000 105 | RCC.APB1CLKDivider=RCC_HCLK_DIV2 106 | RCC.APB1Freq_Value=32000000 107 | RCC.APB1TimFreq_Value=64000000 108 | RCC.APB2Freq_Value=64000000 109 | RCC.APB2TimFreq_Value=64000000 110 | RCC.FCLKCortexFreq_Value=64000000 111 | RCC.FamilyName=M 112 | RCC.HCLKFreq_Value=64000000 113 | RCC.HSEDivPLL=RCC_HSE_PREDIV_DIV2 114 | RCC.IPParameters=ADCFreqValue,AHBFreq_Value,APB1CLKDivider,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,FCLKCortexFreq_Value,FamilyName,HCLKFreq_Value,HSEDivPLL,MCOFreq_Value,PLLCLKFreq_Value,PLLMCOFreq_Value,PLLMUL,PLLSourceVirtual,SYSCLKFreq_VALUE,SYSCLKSource,TimSysFreq_Value,USBFreq_Value,VCOOutput2Freq_Value 115 | RCC.MCOFreq_Value=64000000 116 | RCC.PLLCLKFreq_Value=64000000 117 | RCC.PLLMCOFreq_Value=32000000 118 | RCC.PLLMUL=RCC_PLL_MUL16 119 | RCC.PLLSourceVirtual=RCC_PLLSOURCE_HSE 120 | RCC.SYSCLKFreq_VALUE=64000000 121 | RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK 122 | RCC.TimSysFreq_Value=64000000 123 | RCC.USBFreq_Value=64000000 124 | RCC.VCOOutput2Freq_Value=4000000 125 | SPI1.BaudRatePrescaler=SPI_BAUDRATEPRESCALER_16 126 | SPI1.CalculateBaudRate=4.0 MBits/s 127 | SPI1.Direction=SPI_DIRECTION_2LINES 128 | SPI1.IPParameters=VirtualType,Mode,Direction,CalculateBaudRate,BaudRatePrescaler 129 | SPI1.Mode=SPI_MODE_MASTER 130 | SPI1.VirtualType=VM_MASTER 131 | VP_SYS_VS_Systick.Mode=SysTick 132 | VP_SYS_VS_Systick.Signal=SYS_VS_Systick 133 | board=custom 134 | -------------------------------------------------------------------------------- /Firmware/For_V1.0.0_PCB/InkScreen2_13/MDK-ARM/DebugConfig/InkScreen2_13_STM32F103C8_1.0.0.dbgconf: -------------------------------------------------------------------------------- 1 | // File: STM32F101_102_103_105_107.dbgconf 2 | // Version: 1.0.0 3 | // Note: refer to STM32F101xx STM32F102xx STM32F103xx STM32F105xx STM32F107xx Reference manual (RM0008) 4 | // STM32F101xx STM32F102xx STM32F103xx STM32F105xx STM32F107xx datasheets 5 | 6 | // <<< Use Configuration Wizard in Context Menu >>> 7 | 8 | // Debug MCU configuration register (DBGMCU_CR) 9 | // Reserved bits must be kept at reset value 10 | // DBG_TIM11_STOP TIM11 counter stopped when core is halted 11 | // DBG_TIM10_STOP TIM10 counter stopped when core is halted 12 | // DBG_TIM9_STOP TIM9 counter stopped when core is halted 13 | // DBG_TIM14_STOP TIM14 counter stopped when core is halted 14 | // DBG_TIM13_STOP TIM13 counter stopped when core is halted 15 | // DBG_TIM12_STOP TIM12 counter stopped when core is halted 16 | // DBG_CAN2_STOP Debug CAN2 stopped when core is halted 17 | // DBG_TIM7_STOP TIM7 counter stopped when core is halted 18 | // DBG_TIM6_STOP TIM6 counter stopped when core is halted 19 | // DBG_TIM5_STOP TIM5 counter stopped when core is halted 20 | // DBG_TIM8_STOP TIM8 counter stopped when core is halted 21 | // DBG_I2C2_SMBUS_TIMEOUT SMBUS timeout mode stopped when core is halted 22 | // DBG_I2C1_SMBUS_TIMEOUT SMBUS timeout mode stopped when core is halted 23 | // DBG_CAN1_STOP Debug CAN1 stopped when Core is halted 24 | // DBG_TIM4_STOP TIM4 counter stopped when core is halted 25 | // DBG_TIM3_STOP TIM3 counter stopped when core is halted 26 | // DBG_TIM2_STOP TIM2 counter stopped when core is halted 27 | // DBG_TIM1_STOP TIM1 counter stopped when core is halted 28 | // DBG_WWDG_STOP Debug window watchdog stopped when core is halted 29 | // DBG_IWDG_STOP Debug independent watchdog stopped when core is halted 30 | // DBG_STANDBY Debug standby mode 31 | // DBG_STOP Debug stop mode 32 | // DBG_SLEEP Debug sleep mode 33 | // 34 | DbgMCU_CR = 0x00000007; 35 | 36 | // <<< end of configuration section >>> 37 | -------------------------------------------------------------------------------- /Firmware/For_V1.0.0_PCB/InkScreen2_13/MDK-ARM/EventRecorderStub.scvd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Firmware/For_V1.0.0_PCB/InkScreen2_13/MDK-ARM/JLinkSettings.ini: -------------------------------------------------------------------------------- 1 | [BREAKPOINTS] 2 | ForceImpTypeAny = 0 3 | ShowInfoWin = 1 4 | EnableFlashBP = 2 5 | BPDuringExecution = 0 6 | [CFI] 7 | CFISize = 0x00 8 | CFIAddr = 0x00 9 | [CPU] 10 | MonModeVTableAddr = 0xFFFFFFFF 11 | MonModeDebug = 0 12 | MaxNumAPs = 0 13 | LowPowerHandlingMode = 0 14 | OverrideMemMap = 0 15 | AllowSimulation = 1 16 | ScriptFile="" 17 | [FLASH] 18 | EraseType = 0x00 19 | CacheExcludeSize = 0x00 20 | CacheExcludeAddr = 0x00 21 | MinNumBytesFlashDL = 0 22 | SkipProgOnCRCMatch = 1 23 | VerifyDownload = 1 24 | AllowCaching = 1 25 | EnableFlashDL = 2 26 | Override = 0 27 | Device="ARM7" 28 | [GENERAL] 29 | WorkRAMSize = 0x00 30 | WorkRAMAddr = 0x00 31 | RAMUsageLimit = 0x00 32 | [SWO] 33 | SWOLogFile="" 34 | [MEM] 35 | RdOverrideOrMask = 0x00 36 | RdOverrideAndMask = 0xFFFFFFFF 37 | RdOverrideAddr = 0xFFFFFFFF 38 | WrOverrideOrMask = 0x00 39 | WrOverrideAndMask = 0xFFFFFFFF 40 | WrOverrideAddr = 0xFFFFFFFF 41 | -------------------------------------------------------------------------------- /Firmware/For_V1.0.0_PCB/InkScreen2_13/MDK-ARM/RTE/_InkScreen2_13/RTE_Components.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Auto generated Run-Time-Environment Configuration File 4 | * *** Do not modify ! *** 5 | * 6 | * Project: 'InkScreen2_13' 7 | * Target: 'InkScreen2_13' 8 | */ 9 | 10 | #ifndef RTE_COMPONENTS_H 11 | #define RTE_COMPONENTS_H 12 | 13 | 14 | /* 15 | * Define the Device Header File: 16 | */ 17 | #define CMSIS_device_header "stm32f10x.h" 18 | 19 | 20 | 21 | #endif /* RTE_COMPONENTS_H */ 22 | -------------------------------------------------------------------------------- /Firmware/For_V1.0.0_PCB/InkScreen2_13/kill.bat: -------------------------------------------------------------------------------- 1 | del *.bak /s 2 | del *.ddk /s 3 | del *.edk /s 4 | del *.lst /s 5 | del *.lnp /s 6 | del *.mpf /s 7 | del *.mpj /s 8 | del *.obj /s 9 | del *.omf /s 10 | ::del *.opt /s ::不允许删除JTAG的设置 11 | del *.plg /s 12 | del *.rpt /s 13 | del *.tmp /s 14 | del *.__i /s 15 | del *.crf /s 16 | del *.o /s 17 | del *.d /s 18 | del *.axf /s 19 | del *.tra /s 20 | del *.dep /s 21 | del JLinkLog.txt /s 22 | 23 | del *.iex /s 24 | del *.htm /s 25 | del *.sct /s 26 | del *.map /s 27 | exit 28 | -------------------------------------------------------------------------------- /Firmware/For_V2.1.0_PCB/ExternalFlashresources_Bin/ASCII_FONT_16.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BUYITAO/My_E-Paper_Driver/d78ec6fbcef9611fbeb8ad80f2b692ac6e225ed6/Firmware/For_V2.1.0_PCB/ExternalFlashresources_Bin/ASCII_FONT_16.bin -------------------------------------------------------------------------------- /Firmware/For_V2.1.0_PCB/ExternalFlashresources_Bin/BMP.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BUYITAO/My_E-Paper_Driver/d78ec6fbcef9611fbeb8ad80f2b692ac6e225ed6/Firmware/For_V2.1.0_PCB/ExternalFlashresources_Bin/BMP.bin -------------------------------------------------------------------------------- /Firmware/For_V2.1.0_PCB/ExternalFlashresources_Bin/BMP.txt: -------------------------------------------------------------------------------- 1 | const unsigned char BmpImage[533] = { 2 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 3 | 0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x00,0x00, 4 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00, 5 | 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 6 | 0x00,0x01,0xC0,0x00,0x60,0x00,0x1C,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x01,0xF0, 7 | 0x00,0xE0,0x00,0x7C,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x00,0x7C,0x01,0xC0,0x00, 8 | 0x3C,0x00,0x00,0x80,0x78,0x00,0x01,0x80,0x00,0x1F,0x01,0x80,0x00,0x3C,0x00,0x03, 9 | 0xC0,0x78,0x00,0x03,0x80,0x00,0x07,0x83,0x80,0x00,0x3C,0x00,0x01,0xC0,0x78,0x00, 10 | 0x03,0x80,0x00,0x03,0xE7,0x00,0x08,0x3C,0x00,0x01,0xC0,0x7C,0x00,0x03,0x80,0x7F, 11 | 0xFF,0xFF,0xFF,0xFC,0x3C,0x00,0x01,0xC0,0x3C,0x00,0x03,0x80,0x60,0x00,0x00,0x00, 12 | 0x0C,0x3C,0x00,0x09,0xC0,0x3C,0x00,0x13,0x80,0x60,0x00,0x00,0x00,0x0C,0x1C,0x00, 13 | 0x2D,0xCB,0x3C,0x00,0x79,0x9E,0x67,0xFF,0xFF,0xFF,0xCC,0x1C,0x00,0x2D,0xCB,0x3C, 14 | 0x00,0x79,0x9E,0x6F,0xFF,0xFF,0xFF,0xCC,0x1C,0x00,0x3C,0xCB,0x3C,0x00,0x69,0xDE, 15 | 0x6C,0x00,0x00,0x00,0xCC,0x1E,0x00,0x3C,0xCB,0x3C,0x00,0x29,0xDE,0x6C,0x00,0x00, 16 | 0x00,0xCC,0x1E,0x00,0x00,0xC0,0x1C,0x00,0x01,0xC0,0x6C,0x00,0x00,0x00,0xCC,0x1E, 17 | 0x00,0x1C,0xC0,0x1C,0x00,0x39,0xC0,0x6C,0x00,0x01,0x80,0xCC,0x1E,0x00,0x1C,0xEF, 18 | 0x1C,0x00,0x3D,0xCE,0x6C,0x0E,0x01,0xE0,0xCC,0x0E,0x00,0x1C,0xEF,0x1C,0x00,0x3D, 19 | 0xCE,0x6C,0x7C,0x00,0xF0,0xCC,0x0F,0xE0,0x1E,0xEF,0x1F,0xC0,0x1C,0xCE,0x6C,0xF0, 20 | 0x00,0x3C,0xCC,0x0F,0xFE,0x1E,0xE7,0x1F,0xFE,0x1C,0xCE,0x6C,0xC0,0x00,0x0E,0xCC, 21 | 0x0F,0xFF,0x8E,0xE7,0x1F,0xFF,0x9C,0xCE,0x6C,0x00,0x00,0x00,0xCC,0x0F,0xBF,0xEE, 22 | 0x67,0x1F,0xBF,0xDC,0xCE,0x6C,0x02,0x10,0x80,0xCC,0x0F,0x87,0xEE,0x67,0x1F,0x8F, 23 | 0xDC,0xCE,0x6C,0x06,0x38,0xC0,0xCC,0x0F,0xC7,0xEE,0x67,0x0F,0x8F,0xCC,0xCE,0x6C, 24 | 0x07,0x39,0x80,0xCC,0x0F,0xCF,0xCE,0x67,0x0F,0x9F,0x8E,0xEE,0x6C,0x03,0xFF,0x80, 25 | 0xCC,0x0F,0xFF,0x86,0x67,0x0F,0xBF,0x0E,0x4E,0x6C,0x01,0xEF,0x00,0xCC,0x07,0xFE, 26 | 0x04,0x07,0x0F,0xFE,0x08,0x0E,0x6C,0x00,0x00,0x00,0xCC,0x07,0xF8,0x00,0x00,0x0F, 27 | 0xF0,0x00,0x00,0x6C,0x00,0x00,0x00,0xCC,0x04,0x00,0x00,0x00,0x08,0x00,0x00,0x00, 28 | 0x6F,0xFF,0xFF,0xFF,0xCC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x67,0xFF,0xFF, 29 | 0xFF,0xCC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x0C,0x00, 30 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0xFF,0xFF,0xFC,0x00,0x00,0x01,0x0A, 31 | 0x50,0xA8,0x00,0x00,0x7F,0xFF,0xFF,0xFF,0xFC,0x15,0x55,0x51,0xC2,0x1C,0x20,0x23, 32 | 0x14,0x06,0x60,0x00,0x0C,0xC0,0x15,0x55,0x51,0xAA,0x54,0xA8,0x54,0xAA,0x07,0xE0, 33 | 0x00,0x0F,0x80,0x0E,0x38,0xE1,0xAA,0x54,0xA8,0x44,0xAA,0x03,0xC0,0x00,0x07,0x80, 34 | 0x0A,0x28,0xA4,0xCA,0x5C,0xA9,0x73,0x2A,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 35 | 0x00,0x00,0x00,0x00,0x00, 36 | }; -------------------------------------------------------------------------------- /Firmware/For_V2.1.0_PCB/ExternalFlashresources_Bin/CH_GBK+ASCII+BMP+IMAGE.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BUYITAO/My_E-Paper_Driver/d78ec6fbcef9611fbeb8ad80f2b692ac6e225ed6/Firmware/For_V2.1.0_PCB/ExternalFlashresources_Bin/CH_GBK+ASCII+BMP+IMAGE.bin -------------------------------------------------------------------------------- /Firmware/For_V2.1.0_PCB/ExternalFlashresources_Bin/CH_GBK+ASCII+BMP+IMAGE.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BUYITAO/My_E-Paper_Driver/d78ec6fbcef9611fbeb8ad80f2b692ac6e225ed6/Firmware/For_V2.1.0_PCB/ExternalFlashresources_Bin/CH_GBK+ASCII+BMP+IMAGE.txt -------------------------------------------------------------------------------- /Firmware/For_V2.1.0_PCB/ExternalFlashresources_Bin/CH_GBK_FONT_16.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BUYITAO/My_E-Paper_Driver/d78ec6fbcef9611fbeb8ad80f2b692ac6e225ed6/Firmware/For_V2.1.0_PCB/ExternalFlashresources_Bin/CH_GBK_FONT_16.bin -------------------------------------------------------------------------------- /Firmware/For_V2.1.0_PCB/ExternalFlashresources_Bin/IMAGE.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BUYITAO/My_E-Paper_Driver/d78ec6fbcef9611fbeb8ad80f2b692ac6e225ed6/Firmware/For_V2.1.0_PCB/ExternalFlashresources_Bin/IMAGE.bin -------------------------------------------------------------------------------- /Firmware/For_V2.1.0_PCB/InkScreen2_13/.mxproject: -------------------------------------------------------------------------------- 1 | [PreviousLibFiles] 2 | LibFiles=Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_gpio.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_spi.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_dma.h;Drivers\STM32F1xx_HAL_Driver\Inc\Legacy\stm32_hal_legacy.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_def.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rcc.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rcc_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_gpio.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_gpio_ex.h;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio_ex.c;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_dma_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_dma.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_cortex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_pwr.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_flash.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_flash_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_exti.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_bus.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_cortex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_rcc.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_system.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_utils.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_exti.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_pwr.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_spi.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_tim.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_tim_ex.h;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_ll_gpio.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_ll_spi.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_ll_dma.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rcc.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rcc_ex.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_dma.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_cortex.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_pwr.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_flash.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_flash_ex.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_exti.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_ll_rcc.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_ll_utils.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_ll_exti.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_spi.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_tim.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_tim_ex.c;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_gpio.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_spi.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_dma.h;Drivers\STM32F1xx_HAL_Driver\Inc\Legacy\stm32_hal_legacy.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_def.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rcc.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rcc_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_gpio.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_gpio_ex.h;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio_ex.c;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_dma_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_dma.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_cortex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_pwr.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_flash.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_flash_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_exti.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_bus.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_cortex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_rcc.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_system.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_utils.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_exti.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_pwr.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_spi.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_tim.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_tim_ex.h;Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f103xb.h;Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f1xx.h;Drivers\CMSIS\Device\ST\STM32F1xx\Include\system_stm32f1xx.h;Drivers\CMSIS\Device\ST\STM32F1xx\Source\Templates\system_stm32f1xx.c;Drivers\CMSIS\Include\cmsis_armcc.h;Drivers\CMSIS\Include\cmsis_armclang.h;Drivers\CMSIS\Include\cmsis_compiler.h;Drivers\CMSIS\Include\cmsis_gcc.h;Drivers\CMSIS\Include\cmsis_iccarm.h;Drivers\CMSIS\Include\cmsis_version.h;Drivers\CMSIS\Include\core_armv8mbl.h;Drivers\CMSIS\Include\core_armv8mml.h;Drivers\CMSIS\Include\core_cm0.h;Drivers\CMSIS\Include\core_cm0plus.h;Drivers\CMSIS\Include\core_cm1.h;Drivers\CMSIS\Include\core_cm23.h;Drivers\CMSIS\Include\core_cm3.h;Drivers\CMSIS\Include\core_cm33.h;Drivers\CMSIS\Include\core_cm4.h;Drivers\CMSIS\Include\core_cm7.h;Drivers\CMSIS\Include\core_sc000.h;Drivers\CMSIS\Include\core_sc300.h;Drivers\CMSIS\Include\mpu_armv7.h;Drivers\CMSIS\Include\mpu_armv8.h;Drivers\CMSIS\Include\tz_context.h; 3 | 4 | [PreviousUsedKeilFiles] 5 | SourceFiles=..\Core\Src\main.c;..\Core\Src\gpio.c;..\Core\Src\spi.c;..\Core\Src\stm32f1xx_it.c;..\Core\Src\stm32f1xx_hal_msp.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_ll_gpio.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_ll_spi.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_ll_dma.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rcc.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rcc_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_dma.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_cortex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_pwr.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_flash.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_flash_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_exti.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_ll_rcc.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_ll_utils.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_ll_exti.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_spi.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_tim.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_tim_ex.c;..\Drivers\CMSIS\Device\ST\STM32F1xx\Source\Templates\system_stm32f1xx.c;..\Core\Src\system_stm32f1xx.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_ll_gpio.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_ll_spi.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_ll_dma.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rcc.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rcc_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_dma.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_cortex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_pwr.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_flash.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_flash_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_exti.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_ll_rcc.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_ll_utils.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_ll_exti.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_spi.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_tim.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_tim_ex.c;..\Drivers\CMSIS\Device\ST\STM32F1xx\Source\Templates\system_stm32f1xx.c;..\Core\Src\system_stm32f1xx.c;;; 6 | HeaderPath=..\Drivers\STM32F1xx_HAL_Driver\Inc;..\Drivers\STM32F1xx_HAL_Driver\Inc\Legacy;..\Drivers\CMSIS\Device\ST\STM32F1xx\Include;..\Drivers\CMSIS\Include;..\Core\Inc; 7 | CDefines=USE_FULL_LL_DRIVER;USE_HAL_DRIVER;STM32F103xB;USE_FULL_LL_DRIVER;USE_HAL_DRIVER;USE_HAL_DRIVER; 8 | 9 | [PreviousGenFiles] 10 | AdvancedFolderStructure=true 11 | HeaderFileListSize=6 12 | HeaderFiles#0=C:/Users/Administrator/Documents/My_E-Paper_Driver/Firmware/For_V2.1.0_PCB/InkScreen2_13/Core/Inc/gpio.h 13 | HeaderFiles#1=C:/Users/Administrator/Documents/My_E-Paper_Driver/Firmware/For_V2.1.0_PCB/InkScreen2_13/Core/Inc/spi.h 14 | HeaderFiles#2=C:/Users/Administrator/Documents/My_E-Paper_Driver/Firmware/For_V2.1.0_PCB/InkScreen2_13/Core/Inc/stm32f1xx_it.h 15 | HeaderFiles#3=C:/Users/Administrator/Documents/My_E-Paper_Driver/Firmware/For_V2.1.0_PCB/InkScreen2_13/Core/Inc/stm32_assert.h 16 | HeaderFiles#4=C:/Users/Administrator/Documents/My_E-Paper_Driver/Firmware/For_V2.1.0_PCB/InkScreen2_13/Core/Inc/stm32f1xx_hal_conf.h 17 | HeaderFiles#5=C:/Users/Administrator/Documents/My_E-Paper_Driver/Firmware/For_V2.1.0_PCB/InkScreen2_13/Core/Inc/main.h 18 | HeaderFolderListSize=1 19 | HeaderPath#0=C:/Users/Administrator/Documents/My_E-Paper_Driver/Firmware/For_V2.1.0_PCB/InkScreen2_13/Core/Inc 20 | HeaderFiles=; 21 | SourceFileListSize=5 22 | SourceFiles#0=C:/Users/Administrator/Documents/My_E-Paper_Driver/Firmware/For_V2.1.0_PCB/InkScreen2_13/Core/Src/gpio.c 23 | SourceFiles#1=C:/Users/Administrator/Documents/My_E-Paper_Driver/Firmware/For_V2.1.0_PCB/InkScreen2_13/Core/Src/spi.c 24 | SourceFiles#2=C:/Users/Administrator/Documents/My_E-Paper_Driver/Firmware/For_V2.1.0_PCB/InkScreen2_13/Core/Src/stm32f1xx_it.c 25 | SourceFiles#3=C:/Users/Administrator/Documents/My_E-Paper_Driver/Firmware/For_V2.1.0_PCB/InkScreen2_13/Core/Src/stm32f1xx_hal_msp.c 26 | SourceFiles#4=C:/Users/Administrator/Documents/My_E-Paper_Driver/Firmware/For_V2.1.0_PCB/InkScreen2_13/Core/Src/main.c 27 | SourceFolderListSize=1 28 | SourcePath#0=C:/Users/Administrator/Documents/My_E-Paper_Driver/Firmware/For_V2.1.0_PCB/InkScreen2_13/Core/Src 29 | SourceFiles=; 30 | 31 | -------------------------------------------------------------------------------- /Firmware/For_V2.1.0_PCB/InkScreen2_13/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.associations": { 3 | "image.h": "c", 4 | "spiflash.h": "c" 5 | } 6 | } -------------------------------------------------------------------------------- /Firmware/For_V2.1.0_PCB/InkScreen2_13/Application/HardDrivers/E2213JS0C1.h: -------------------------------------------------------------------------------- 1 | #ifndef __E2213JS0C1_H 2 | #define __E2213JS0C1_H 3 | 4 | #include "main.h" 5 | 6 | #define FIRMWARE_VERSION ("2.0.0") 7 | 8 | #define DISABLE 0 9 | #define ENABLE 1 10 | 11 | /* 是否有外部SPI flash硬件存在 */ 12 | #define EXTERNAL_SPI_FLASH_CONFIG (ENABLE) 13 | 14 | /*引脚定义*************************************************************************/ 15 | /* SPI号 */ 16 | #define E2213JS0C1_SPI (SPI1) 17 | /* CS */ 18 | #define E2213JS0C1_CS_ENABLE() \ 19 | LL_GPIO_ResetOutputPin(DO_SCREEN_CS_GPIO_Port, DO_SCREEN_CS_Pin) 20 | #define E2213JS0C1_CS_DISABLE() \ 21 | LL_GPIO_SetOutputPin(DO_SCREEN_CS_GPIO_Port, DO_SCREEN_CS_Pin) 22 | /* DC */ 23 | #define E2213JS0C1_DC_DATA() \ 24 | LL_GPIO_SetOutputPin(DO_SCREEN_DC_GPIO_Port, DO_SCREEN_DC_Pin) 25 | #define E2213JS0C1_DC_CMD() \ 26 | LL_GPIO_ResetOutputPin(DO_SCREEN_DC_GPIO_Port, DO_SCREEN_DC_Pin) 27 | /* RST */ 28 | #define E2213JS0C1_RST_ENABLE() \ 29 | LL_GPIO_SetOutputPin(DO_SCREEN_RST_GPIO_Port, DO_SCREEN_RST_Pin) 30 | #define E2213JS0C1_RST_DISABLE() \ 31 | LL_GPIO_ResetOutputPin(DO_SCREEN_RST_GPIO_Port, DO_SCREEN_RST_Pin) 32 | /* BUSY */ 33 | #define E2213JS0C1_BUSY_READ() \ 34 | LL_GPIO_IsInputPinSet(DI_SCREEN_BUSY_GPIO_Port,DI_SCREEN_BUSY_Pin) 35 | /*枚举*****************************************************************************/ 36 | /* 方向:水平/垂直 */ 37 | enum ENUM_ORIENTATION 38 | { 39 | HORIZONTAL, 40 | VERTICAL 41 | }; 42 | /* 填充:实心/空心 */ 43 | enum ENUM_FILL 44 | { 45 | SOLID, 46 | HOLLOW 47 | }; 48 | /*屏幕参数*************************************************************************/ 49 | //typedef struct 50 | //{ 51 | // uint8_t Orientation; /* 显示方向 */ 52 | // uint8_t Wide; /* 宽度(pix) */ 53 | // uint8_t High; /* 高度(pix) */ 54 | // uint8_t XPosMax; /* X轴最大值 */ 55 | // uint8_t YPosMax; /* Y轴最大值 */ 56 | //} E2213JS0C1_InfoTypedef; 57 | /* X轴坐标0~103;Y轴坐标0~211 */ 58 | #define E2213JS0C1_W 104 59 | #define E2213JS0C1_H 212 60 | #define E2213JS0C1_XPOS_MAX 103 61 | #define E2213JS0C1_YPOS_MAX 211 62 | #define E2213JS0C1_BUFFER_SIZE (E2213JS0C1_W * E2213JS0C1_H / 8) 63 | #define E2213JS0C1_BUFFER_WIDTH_SIZE (E2213JS0C1_W / 8) 64 | #define E2213JS0C1_BUFFER_HEIGHT_SIZE (E2213JS0C1_H) 65 | #if EXTERNAL_SPI_FLASH_CONFIG == ENABLE 66 | #define E2213JS0C1_FLASH_READ_BUFFER_SIZE (E2213JS0C1_H * 2) 67 | #endif 68 | /*颜色*****************************************************************************/ 69 | enum ENUM_COLOR 70 | { 71 | RED, 72 | WHITE, 73 | BLACK, 74 | GREY, 75 | DARKRED, 76 | LIGHTRED 77 | }; 78 | /* 01红,00白,10黑 */ 79 | #define RED_BUFFER1 0X00 80 | #define RED_BUFFER2 0XFF 81 | #define WHITE_BUFFER1 0x00 82 | #define WHITE_BUFFER2 0x00 83 | #define BLACK_BUFFER1 0xFF 84 | #define BLACK_BUFFER2 0x00 85 | /* 红白相间=浅红色,红黑相间=深红色,黑白相间=灰色 */ 86 | #define GREY_BUFFER1_SINGLE 0xAA 87 | #define GREY_BUFFER1_DOUBLE 0x55 88 | #define GREY_BUFFER2 0x00 89 | #define DARKRED_BUFFER1_SINGLE 0xAA 90 | #define DARKRED_BUFFER1_DOUBLE 0x55 91 | #define DARKRED_BUFFER2_SINGLE 0x55 92 | #define DARKRED_BUFFER2_DOUBLE 0xAA 93 | #define LIGHTRED_BUFFER1 0x00 94 | #define LIGHTRED_BUFFER2_SINGLE 0xAA 95 | #define LIGHTRED_BUFFER2_DOUBLE 0x55 96 | /* RGB565 */ 97 | #define RGB565_RED 0xF800 98 | #define RGB565_WHITE 0xFFFF 99 | #define RGB565_BLACK 0x0000 100 | /*字库*****************************************************************************/ 101 | #define FONT_1608 (0) 102 | #define FONT_1608_WIDTH (8) 103 | #define FONT_1608_HEIGHT (16) 104 | 105 | #if EXTERNAL_SPI_FLASH_CONFIG == ENABLE 106 | /***************************** Flash中各资源的起始地址 *********************************/ 107 | enum ENUM_FLASH_FONT 108 | { 109 | FONT_16, 110 | }; 111 | #define ADDR_GBK_FONT_16_START (0x00000000) 112 | #define OFFSET_GBK_FONT_16 (32) 113 | #define WIDTH_GBK_FONT_16 (16) 114 | #define HEIGHT_GBK_FONT_16 (16) 115 | #define ADDR_ASCII_FONT_16_START (0x000BB080) 116 | #define OFFSET_ASCII_FONT_16 (16) 117 | #define WIDTH_ASCII_FONT_16 (8) 118 | #define HEIGHT_ASCII_FONT_16 (16) 119 | 120 | #define ADDR_BMP_START (0x000BB670) 121 | #define WIDTH_BMP (104) 122 | #define HEIGHT_BMP (41) 123 | 124 | #define ADDR_IMAGE_START (0x000BB885) 125 | #define WIDTH_IMAGE (104) 126 | #define HEIGHT_IMAGE (212) 127 | 128 | #endif 129 | /*指令*****************************************************************************/ 130 | #define SOFT_RESET_CMD 0x00 131 | #define SOFT_RESET_DATA 0x0E 132 | #define SET_TEMP_CMD 0xE5 133 | #define SET_TEMP_25_DATA 0x19 134 | #define ACTIVE_TEMP_CMD 0xE0 135 | #define ACTIVE_TEMP_25_DATA 0x02 136 | //#define PANEL_SET_CMD 0x00 137 | //#define PANEL_SET_DATA_1 0xCF 138 | //#define PANEL_SET_DATA_2 0x89 139 | #define FIRST_FRAME_CMD 0x10 140 | #define SECOND_FRAME_CMD 0x13 141 | #define TURN_ON_DCDC_CMD 0x04 142 | #define TURN_OFF_DCDC_CMD 0x02 143 | #define DISPLAY_REFRESH_CMD 0x12 144 | /*位操作***************************************************************************/ 145 | /* 指定的某一位数置1 */ 146 | #define SetBit(x, y) (x |= (1<>y) & 1) 153 | /* 指定的某一位数置为指定的0或1 */ 154 | #define WriteBit(data, position, flag) (flag ? SetBit(data, position) : ClearBit(data, position)) 155 | /*函数*******************************************************************************/ 156 | void E2213JS0C1_Init(uint8_t Orientation); 157 | void E2213JS0C1_ClearFullScreen(enum ENUM_COLOR color); 158 | void E2213JS0C1_RefreshScreen(void); 159 | void E2213JS0C1_DrawPoint(uint8_t xPos, uint8_t yPos, enum ENUM_COLOR color); 160 | void E2213JS0C1_DrawLine(uint8_t xStart, uint8_t yStart, uint8_t length, 161 | enum ENUM_ORIENTATION orientation, enum ENUM_COLOR color); 162 | void E2213JS0C1_DrawRectangle(uint8_t xStart, uint8_t yStart, uint8_t width, 163 | uint8_t height, enum ENUM_FILL fill, enum ENUM_COLOR borderColor, 164 | enum ENUM_COLOR fillColor); 165 | uint8_t E2213JS0C1_ShowChar(uint8_t xStart, uint8_t yStart, enum ENUM_COLOR fontColor, 166 | enum ENUM_COLOR backgroundColor, uint8_t font, char chr); 167 | uint8_t E2213JS0C1_ShowCharStr(uint8_t xStart, uint8_t yStart, enum ENUM_COLOR fontColor, 168 | enum ENUM_COLOR backgroundColor, uint8_t font, char* str); 169 | void E2213JS0C1_DrawBmp(uint8_t xStart, uint8_t yStart, uint8_t bmpWidth, 170 | uint8_t bmpHeight, enum ENUM_COLOR fontColor, enum ENUM_COLOR backgroundColor, 171 | const unsigned char* pic); 172 | void E2213JS0C1_DrawImage(uint8_t xStart, uint8_t yStart, uint8_t imageWidth, 173 | uint8_t imageHeight, const unsigned char* pic); 174 | #if EXTERNAL_SPI_FLASH_CONFIG == ENABLE 175 | uint8_t E2213JS0C1_ShowGBKFontOrAsciiFromFlash(uint8_t startX, uint8_t startY, 176 | enum ENUM_COLOR fontColor, enum ENUM_COLOR backgroundColor, enum ENUM_FLASH_FONT flashFont, uint8_t *str); 177 | void E2213JS0C1_DrawImageFromFlash(uint8_t xStart, uint8_t yStart, uint8_t imageWidth, 178 | uint8_t imageHeight, uint32_t readAddr); 179 | void E2213JS0C1_DrawBmpFromFlash(uint8_t xStart, uint8_t yStart, uint8_t bmpWidth, 180 | uint8_t bmpHeight, enum ENUM_COLOR fontColor, enum ENUM_COLOR backgroundColor, uint32_t readAddr); 181 | 182 | #endif 183 | 184 | #endif 185 | -------------------------------------------------------------------------------- /Firmware/For_V2.1.0_PCB/InkScreen2_13/Application/HardDrivers/font.h: -------------------------------------------------------------------------------- 1 | #ifndef __FONT_H 2 | #define __FONT_H 3 | 4 | 5 | //常用ASCII表 6 | //偏移量32 7 | //ASCII字符集: !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ 8 | //PC2LCD2002取模方式设置:阴码+逐行式+顺向+C51格式 9 | 10 | //8*16 ASCII字符集点阵 11 | const unsigned char ACSII_1608[95][16]={ 12 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*" ",0*/ 13 | {0x00,0x00,0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x10,0x10,0x00,0x00},/*"!",1*/ 14 | {0x00,0x12,0x24,0x24,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*""",2*/ 15 | {0x00,0x00,0x00,0x12,0x12,0x12,0x7E,0x24,0x24,0x24,0x7E,0x24,0x24,0x24,0x00,0x00},/*"#",3*/ 16 | {0x00,0x00,0x08,0x3C,0x4A,0x4A,0x48,0x38,0x0C,0x0A,0x0A,0x4A,0x4A,0x3C,0x08,0x08},/*"$",4*/ 17 | {0x00,0x00,0x00,0x44,0xA4,0xA8,0xA8,0xB0,0x54,0x1A,0x2A,0x2A,0x4A,0x44,0x00,0x00},/*"%",5*/ 18 | {0x00,0x00,0x00,0x30,0x48,0x48,0x48,0x50,0x6E,0xA4,0x94,0x98,0x89,0x76,0x00,0x00},/*"&",6*/ 19 | {0x00,0x60,0x20,0x20,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"'",7*/ 20 | {0x00,0x02,0x04,0x08,0x08,0x10,0x10,0x10,0x10,0x10,0x10,0x08,0x08,0x04,0x02,0x00},/*"(",8*/ 21 | {0x00,0x40,0x20,0x10,0x10,0x08,0x08,0x08,0x08,0x08,0x08,0x10,0x10,0x20,0x40,0x00},/*")",9*/ 22 | {0x00,0x00,0x00,0x00,0x10,0x10,0xD6,0x38,0x38,0xD6,0x10,0x10,0x00,0x00,0x00,0x00},/*"*",10*/ 23 | {0x00,0x00,0x00,0x00,0x00,0x08,0x08,0x08,0x7F,0x08,0x08,0x08,0x00,0x00,0x00,0x00},/*"+",11*/ 24 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x20,0x20,0x40},/*",",12*/ 25 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"-",13*/ 26 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x60,0x00,0x00},/*".",14*/ 27 | {0x00,0x00,0x02,0x04,0x04,0x04,0x08,0x08,0x10,0x10,0x10,0x20,0x20,0x40,0x40,0x00},/*"/",15*/ 28 | {0x00,0x00,0x00,0x18,0x24,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x24,0x18,0x00,0x00},/*"0",16*/ 29 | {0x00,0x00,0x00,0x08,0x38,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x3E,0x00,0x00},/*"1",17*/ 30 | {0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x02,0x04,0x08,0x10,0x20,0x42,0x7E,0x00,0x00},/*"2",18*/ 31 | {0x00,0x00,0x00,0x3C,0x42,0x42,0x02,0x04,0x18,0x04,0x02,0x42,0x42,0x3C,0x00,0x00},/*"3",19*/ 32 | {0x00,0x00,0x00,0x04,0x0C,0x0C,0x14,0x24,0x24,0x44,0x7F,0x04,0x04,0x1F,0x00,0x00},/*"4",20*/ 33 | {0x00,0x00,0x00,0x7E,0x40,0x40,0x40,0x78,0x44,0x02,0x02,0x42,0x44,0x38,0x00,0x00},/*"5",21*/ 34 | {0x00,0x00,0x00,0x18,0x24,0x40,0x40,0x5C,0x62,0x42,0x42,0x42,0x22,0x1C,0x00,0x00},/*"6",22*/ 35 | {0x00,0x00,0x00,0x7E,0x42,0x04,0x04,0x08,0x08,0x10,0x10,0x10,0x10,0x10,0x00,0x00},/*"7",23*/ 36 | {0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x24,0x18,0x24,0x42,0x42,0x42,0x3C,0x00,0x00},/*"8",24*/ 37 | {0x00,0x00,0x00,0x38,0x44,0x42,0x42,0x42,0x46,0x3A,0x02,0x02,0x24,0x18,0x00,0x00},/*"9",25*/ 38 | {0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00},/*":",26*/ 39 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x10},/*";",27*/ 40 | {0x00,0x00,0x00,0x02,0x04,0x08,0x10,0x20,0x40,0x20,0x10,0x08,0x04,0x02,0x00,0x00},/*"<",28*/ 41 | {0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00},/*"=",29*/ 42 | {0x00,0x00,0x00,0x40,0x20,0x10,0x08,0x04,0x02,0x04,0x08,0x10,0x20,0x40,0x00,0x00},/*">",30*/ 43 | {0x00,0x00,0x00,0x3C,0x42,0x42,0x62,0x04,0x08,0x08,0x08,0x00,0x18,0x18,0x00,0x00},/*"?",31*/ 44 | {0x00,0x00,0x00,0x38,0x44,0x5A,0xAA,0xAA,0xAA,0xAA,0xAA,0x5C,0x42,0x3C,0x00,0x00},/*"@",32*/ 45 | {0x00,0x00,0x00,0x10,0x10,0x18,0x28,0x28,0x24,0x3C,0x44,0x42,0x42,0xE7,0x00,0x00},/*"A",33*/ 46 | {0x00,0x00,0x00,0xF8,0x44,0x44,0x44,0x78,0x44,0x42,0x42,0x42,0x44,0xF8,0x00,0x00},/*"B",34*/ 47 | {0x00,0x00,0x00,0x3E,0x42,0x42,0x80,0x80,0x80,0x80,0x80,0x42,0x44,0x38,0x00,0x00},/*"C",35*/ 48 | {0x00,0x00,0x00,0xF8,0x44,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x44,0xF8,0x00,0x00},/*"D",36*/ 49 | {0x00,0x00,0x00,0xFC,0x42,0x48,0x48,0x78,0x48,0x48,0x40,0x42,0x42,0xFC,0x00,0x00},/*"E",37*/ 50 | {0x00,0x00,0x00,0xFC,0x42,0x48,0x48,0x78,0x48,0x48,0x40,0x40,0x40,0xE0,0x00,0x00},/*"F",38*/ 51 | {0x00,0x00,0x00,0x3C,0x44,0x44,0x80,0x80,0x80,0x8E,0x84,0x44,0x44,0x38,0x00,0x00},/*"G",39*/ 52 | {0x00,0x00,0x00,0xE7,0x42,0x42,0x42,0x42,0x7E,0x42,0x42,0x42,0x42,0xE7,0x00,0x00},/*"H",40*/ 53 | {0x00,0x00,0x00,0x7C,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x7C,0x00,0x00},/*"I",41*/ 54 | {0x00,0x00,0x00,0x3E,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x88,0xF0},/*"J",42*/ 55 | {0x00,0x00,0x00,0xEE,0x44,0x48,0x50,0x70,0x50,0x48,0x48,0x44,0x44,0xEE,0x00,0x00},/*"K",43*/ 56 | {0x00,0x00,0x00,0xE0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x42,0xFE,0x00,0x00},/*"L",44*/ 57 | {0x00,0x00,0x00,0xEE,0x6C,0x6C,0x6C,0x6C,0x6C,0x54,0x54,0x54,0x54,0xD6,0x00,0x00},/*"M",45*/ 58 | {0x00,0x00,0x00,0xC7,0x62,0x62,0x52,0x52,0x4A,0x4A,0x4A,0x46,0x46,0xE2,0x00,0x00},/*"N",46*/ 59 | {0x00,0x00,0x00,0x38,0x44,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x44,0x38,0x00,0x00},/*"O",47*/ 60 | {0x00,0x00,0x00,0xFC,0x42,0x42,0x42,0x42,0x7C,0x40,0x40,0x40,0x40,0xE0,0x00,0x00},/*"P",48*/ 61 | {0x00,0x00,0x00,0x38,0x44,0x82,0x82,0x82,0x82,0x82,0x82,0xB2,0x4C,0x38,0x06,0x00},/*"Q",49*/ 62 | {0x00,0x00,0x00,0xFC,0x42,0x42,0x42,0x7C,0x48,0x48,0x44,0x44,0x42,0xE3,0x00,0x00},/*"R",50*/ 63 | {0x00,0x00,0x00,0x3E,0x42,0x42,0x40,0x20,0x18,0x04,0x02,0x42,0x42,0x7C,0x00,0x00},/*"S",51*/ 64 | {0x00,0x00,0x00,0xFE,0x92,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x38,0x00,0x00},/*"T",52*/ 65 | {0x00,0x00,0x00,0xE7,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00},/*"U",53*/ 66 | {0x00,0x00,0x00,0xE7,0x42,0x42,0x44,0x24,0x24,0x28,0x28,0x18,0x10,0x10,0x00,0x00},/*"V",54*/ 67 | {0x00,0x00,0x00,0xD6,0x54,0x54,0x54,0x54,0x54,0x6C,0x28,0x28,0x28,0x28,0x00,0x00},/*"W",55*/ 68 | {0x00,0x00,0x00,0xE7,0x42,0x24,0x24,0x18,0x18,0x18,0x24,0x24,0x42,0xE7,0x00,0x00},/*"X",56*/ 69 | {0x00,0x00,0x00,0xEE,0x44,0x44,0x28,0x28,0x10,0x10,0x10,0x10,0x10,0x38,0x00,0x00},/*"Y",57*/ 70 | {0x00,0x00,0x00,0x7E,0x84,0x04,0x08,0x08,0x10,0x20,0x20,0x42,0x42,0xFC,0x00,0x00},/*"Z",58*/ 71 | {0x00,0x1E,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x1E,0x00},/*"[",59*/ 72 | {0x00,0x00,0x40,0x20,0x20,0x20,0x10,0x10,0x10,0x08,0x08,0x04,0x04,0x04,0x02,0x02},/*"\",60*/ 73 | {0x00,0x78,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x78,0x00},/*"]",61*/ 74 | {0x00,0x18,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"^",62*/ 75 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF},/*"_",63*/ 76 | {0x00,0x60,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"`",64*/ 77 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x44,0x0C,0x34,0x44,0x4C,0x36,0x00,0x00},/*"a",65*/ 78 | {0x00,0x00,0x00,0x00,0xC0,0x40,0x40,0x58,0x64,0x42,0x42,0x42,0x64,0x58,0x00,0x00},/*"b",66*/ 79 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x22,0x40,0x40,0x40,0x22,0x1C,0x00,0x00},/*"c",67*/ 80 | {0x00,0x00,0x00,0x00,0x06,0x02,0x02,0x3E,0x42,0x42,0x42,0x42,0x46,0x3B,0x00,0x00},/*"d",68*/ 81 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x42,0x7E,0x40,0x42,0x3C,0x00,0x00},/*"e",69*/ 82 | {0x00,0x00,0x00,0x00,0x0C,0x12,0x10,0x7C,0x10,0x10,0x10,0x10,0x10,0x7C,0x00,0x00},/*"f",70*/ 83 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x44,0x44,0x38,0x40,0x3C,0x42,0x42,0x3C},/*"g",71*/ 84 | {0x00,0x00,0x00,0x00,0xC0,0x40,0x40,0x5C,0x62,0x42,0x42,0x42,0x42,0xE7,0x00,0x00},/*"h",72*/ 85 | {0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x70,0x10,0x10,0x10,0x10,0x10,0x7C,0x00,0x00},/*"i",73*/ 86 | {0x00,0x00,0x00,0x0C,0x0C,0x00,0x00,0x1C,0x04,0x04,0x04,0x04,0x04,0x04,0x44,0x78},/*"j",74*/ 87 | {0x00,0x00,0x00,0x00,0xC0,0x40,0x40,0x4E,0x48,0x50,0x70,0x48,0x44,0xEE,0x00,0x00},/*"k",75*/ 88 | {0x00,0x00,0x00,0x10,0x70,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x7C,0x00,0x00},/*"l",76*/ 89 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x49,0x49,0x49,0x49,0x49,0xED,0x00,0x00},/*"m",77*/ 90 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDC,0x62,0x42,0x42,0x42,0x42,0xE7,0x00,0x00},/*"n",78*/ 91 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00},/*"o",79*/ 92 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD8,0x64,0x42,0x42,0x42,0x64,0x58,0x40,0xE0},/*"p",80*/ 93 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1A,0x26,0x42,0x42,0x42,0x26,0x1A,0x02,0x07},/*"q",81*/ 94 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xEE,0x32,0x20,0x20,0x20,0x20,0xF8,0x00,0x00},/*"r",82*/ 95 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x42,0x40,0x3C,0x02,0x42,0x7C,0x00,0x00},/*"s",83*/ 96 | {0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x7C,0x10,0x10,0x10,0x10,0x12,0x0C,0x00,0x00},/*"t",84*/ 97 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC6,0x42,0x42,0x42,0x42,0x46,0x3B,0x00,0x00},/*"u",85*/ 98 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xEE,0x44,0x44,0x28,0x28,0x10,0x10,0x00,0x00},/*"v",86*/ 99 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDB,0x89,0x4A,0x5A,0x54,0x24,0x24,0x00,0x00},/*"w",87*/ 100 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x76,0x24,0x18,0x18,0x18,0x24,0x6E,0x00,0x00},/*"x",88*/ 101 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE7,0x42,0x24,0x24,0x18,0x18,0x10,0x10,0x60},/*"y",89*/ 102 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x44,0x08,0x10,0x10,0x22,0x7E,0x00,0x00},/*"z",90*/ 103 | {0x00,0x03,0x04,0x04,0x04,0x04,0x04,0x04,0x08,0x04,0x04,0x04,0x04,0x04,0x03,0x00},/*"{",91*/ 104 | {0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08},/*"|",92*/ 105 | {0x00,0xC0,0x20,0x20,0x20,0x20,0x20,0x20,0x10,0x20,0x20,0x20,0x20,0x20,0xC0,0x00},/*"}",93*/ 106 | {0x20,0x5A,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"~",94*/ 107 | }; 108 | 109 | 110 | 111 | 112 | #endif 113 | 114 | -------------------------------------------------------------------------------- /Firmware/For_V2.1.0_PCB/InkScreen2_13/Application/HardDrivers/spiFlash.c: -------------------------------------------------------------------------------- 1 | #include "spiFlash.h" 2 | 3 | /* 4 | 注意!!!!这里把Flash睡眠、唤醒部分的代码注释掉了, 5 | 如果为了低功耗可以考虑把Flash睡眠、唤醒部分代码恢复。 6 | 但是!!!!睡眠唤醒部分代码没有经过调试,可能会有问题 7 | */ 8 | 9 | /* 10 | 注意!因为这里的Flash只用来储存字库、图片、字符等数据, 11 | 所以没有擦除、写入的函数,防止误操作。 12 | 如有需要可以自行添加,这个网上一大堆,肯定能找到合适的。 13 | */ 14 | 15 | static uint8_t SPI_FLASH_SendReadByte(uint8_t byte); 16 | //static void SPI_Flash_WakeUp(void); 17 | //static void SPI_Flash_PowerDown(void); 18 | 19 | 20 | /** 21 | * @brief : spiFlash初始化 22 | * @param : none 23 | * @retval: none 24 | */ 25 | void SPI_FLASH_Init(void) 26 | { 27 | /* 开启SPI */ 28 | LL_SPI_Enable(SPI_FLASH_SPI); 29 | /* CS脚拉高 */ 30 | SPI_FLASH_CS_DISABLE(); 31 | // /* 先唤醒芯片,再让芯片休眠 */ 32 | // SPI_Flash_WakeUp(); 33 | // SPI_Flash_PowerDown(); 34 | } 35 | 36 | /** 37 | * @brief 读取FLASH数据 38 | * @param pBuffer,存储读出数据的指针 39 | * @param ReadAddr,读取地址 40 | * @param NumByteToRead,读取数据长度 41 | * @retval 无 42 | */ 43 | void SPI_FLASH_BufferRead(uint8_t* pBuffer, uint32_t ReadAddr, uint16_t NumByteToRead) 44 | { 45 | // SPI_Flash_WakeUp(); 46 | /* 选择FLASH: CS低电平 */ 47 | SPI_FLASH_CS_ENABLE(); 48 | 49 | /* 发送 读 指令 */ 50 | SPI_FLASH_SendReadByte(W25_CMD_READ_DATA); 51 | 52 | /* 发送 读 地址高位 */ 53 | SPI_FLASH_SendReadByte((ReadAddr & 0xFF0000) >> 16); 54 | SPI_FLASH_SendReadByte((ReadAddr& 0xFF00) >> 8); 55 | SPI_FLASH_SendReadByte(ReadAddr & 0xFF); 56 | 57 | /* 读取数据 */ 58 | while (NumByteToRead--) /* while there is data to be read */ 59 | { 60 | /* 读取一个字节*/ 61 | *pBuffer = SPI_FLASH_SendReadByte(Dummy_Byte); 62 | /* 指向下一个字节缓冲区 */ 63 | pBuffer++; 64 | } 65 | 66 | /* 停止信号 FLASH: CS 高电平 */ 67 | SPI_FLASH_CS_DISABLE(); 68 | 69 | // SPI_Flash_PowerDown(); 70 | } 71 | 72 | /** 73 | * @brief 读取FLASH ID 74 | * @param 无 75 | * @retval FLASH ID 76 | */ 77 | uint32_t SPI_FLASH_ReadID(void) 78 | { 79 | uint32_t Temp = 0, Temp0 = 0, Temp1 = 0, Temp2 = 0; 80 | 81 | // SPI_Flash_WakeUp(); 82 | /* 开始通讯:CS低电平 */ 83 | SPI_FLASH_CS_ENABLE(); 84 | 85 | /* 发送JEDEC指令,读取ID */ 86 | SPI_FLASH_SendReadByte(W25_CMD_JEDEC_DEVICE_ID); 87 | /* 读取一个字节数据 */ 88 | Temp0 = SPI_FLASH_SendReadByte(Dummy_Byte); 89 | Temp1 = SPI_FLASH_SendReadByte(Dummy_Byte); 90 | Temp2 = SPI_FLASH_SendReadByte(Dummy_Byte); 91 | 92 | /* 停止通讯:CS高电平 */ 93 | SPI_FLASH_CS_DISABLE(); 94 | 95 | /*把数据组合起来,作为函数的返回值*/ 96 | Temp = (Temp0 << 16) | (Temp1 << 8) | Temp2; 97 | 98 | // SPI_Flash_PowerDown(); 99 | return Temp; 100 | } 101 | 102 | /** 103 | * @brief 使用SPI发送一个字节的数据 104 | * @param byte:要发送的数据 105 | * @retval 返回接收到的数据 106 | */ 107 | static uint8_t SPI_FLASH_SendReadByte(uint8_t byte) 108 | { 109 | while (!LL_SPI_IsActiveFlag_TXE(SPI_FLASH_SPI)); 110 | LL_SPI_TransmitData8(SPI_FLASH_SPI, byte); 111 | 112 | while (!LL_SPI_IsActiveFlag_RXNE(SPI_FLASH_SPI)); 113 | return LL_SPI_ReceiveData8(SPI_FLASH_SPI); 114 | } 115 | 116 | ///** 117 | // * @brief 唤醒flash 118 | // * @param none 119 | // * @retval none 120 | // */ 121 | //static void SPI_Flash_WakeUp(void) 122 | //{ 123 | // /*选择 FLASH: CS 低 */ 124 | // SPI_FLASH_CS_ENABLE(); 125 | // /* 发送 上电 命令 */ 126 | // SPI_FLASH_SendReadByte(W25_CMD_RELEASE_POWER_DOWN); 127 | // /* 停止信号 FLASH: CS 高 */ 128 | // SPI_FLASH_CS_DISABLE(); 129 | // /* 唤醒后需要等待tRES1(3us)才能正常工作 */ 130 | // __NOP(); 131 | // __NOP(); 132 | // __NOP(); 133 | //} 134 | 135 | ///** 136 | // * @brief 进入掉电模式(睡眠) 137 | // * @param none 138 | // * @retval none 139 | // */ 140 | //static void SPI_Flash_PowerDown(void) 141 | //{ 142 | // /* 通讯开始:CS低 */ 143 | // SPI_FLASH_CS_ENABLE(); 144 | // /* 发送 掉电 命令 */ 145 | // SPI_FLASH_SendReadByte(W25_CMD_POWER_DOWN); 146 | // /*通讯结束:CS高 */ 147 | // SPI_FLASH_CS_DISABLE(); 148 | //} 149 | -------------------------------------------------------------------------------- /Firmware/For_V2.1.0_PCB/InkScreen2_13/Application/HardDrivers/spiFlash.h: -------------------------------------------------------------------------------- 1 | #ifndef __SPI_FLASH_H 2 | #define __SPI_FLASH_H 3 | 4 | /***************************** 头文件 ******************************************/ 5 | #include "main.h" 6 | /***************************** SPI序号、引脚 ***********************************/ 7 | /* SPI号 */ 8 | #define SPI_FLASH_SPI (SPI2) 9 | /* CS */ 10 | #define SPI_FLASH_CS_ENABLE() \ 11 | LL_GPIO_ResetOutputPin(DO_FLASH_CS_GPIO_Port, DO_FLASH_CS_Pin) 12 | #define SPI_FLASH_CS_DISABLE() \ 13 | LL_GPIO_SetOutputPin(DO_FLASH_CS_GPIO_Port, DO_FLASH_CS_Pin) 14 | /***************************** Flash的一些参数 *********************************/ 15 | /* W25QXX ID */ 16 | //#define SPI_FLASH_ID_W25Q16 (0xEF4015) 17 | #define SPI_FLASH_ID_W25Q64 (0XEF4017) 18 | //#define SPI_FLASH_ID_W25Q128 (0XEF4018) 19 | 20 | /* 选择的Flash芯片型号 */ 21 | #define SPI_FLASH_ID (SPI_FLASH_ID_W25Q64) 22 | 23 | //#define SPI_FLASH_SECTOR_SIZE_BYTES (4096u) /* 每个扇区大小 */ 24 | //#define SPI_FLASH_SECTOR_COUNT (2048u) /* 总扇区数 */ 25 | //#define SPI_FLASH_PAGE_SIZE (256u) /* 每页大小 */ 26 | 27 | /********************************* 命令 ***************************************/ 28 | #define W25_CMD_WRITE_ENABLE (0x06) 29 | #define W25_CMD_WRITE_DISABLE (0x04) 30 | #define W25_CMD_READ_STATUS_REG (0x05) 31 | //#define W25_CMD_WRITE_STATUS_REG (0x01) 32 | #define W25_CMD_READ_DATA (0x03) 33 | //#define W25_CMD_FAST_READ_DATA (0x0B) 34 | //#define W25_CMD_FAST_READ_DUAL (0x3B) 35 | #define W25_CMD_PAGE_PROGRAM (0x02) 36 | //#define W25_CMD_BLOCK_ERASE (0xD8) 37 | #define W25_CMD_SECTOR_ERASE (0x20) 38 | //#define W25_CMD_CHIP_ERASE (0xC7) 39 | //#define W25_CMD_POWER_DOWN (0xB9) 40 | #define W25_CMD_RELEASE_POWER_DOWN (0xAB) 41 | #define W25_CMD_DEVICE_ID (0xAB) 42 | //#define W25_CMD_MANUFACT_DEVICE_ID (0x90) 43 | #define W25_CMD_JEDEC_DEVICE_ID (0x9F) 44 | 45 | #define Dummy_Byte (0xFF) 46 | 47 | // #define WIP_Flag (0x01)/* WIP(busy)标志,FLASH内部正在写入 */ 48 | 49 | /*********************** 函数 *************************************************/ 50 | void SPI_FLASH_Init(void); 51 | void SPI_FLASH_BufferRead(uint8_t* pBuffer, uint32_t ReadAddr, uint16_t NumByteToRead); 52 | uint32_t SPI_FLASH_ReadID(void); 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /Firmware/For_V2.1.0_PCB/InkScreen2_13/Core/Inc/gpio.h: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file gpio.h 5 | * @brief This file contains all the function prototypes for 6 | * the gpio.c file 7 | ****************************************************************************** 8 | * @attention 9 | * 10 | * Copyright (c) 2022 STMicroelectronics. 11 | * All rights reserved. 12 | * 13 | * This software is licensed under terms that can be found in the LICENSE file 14 | * in the root directory of this software component. 15 | * If no LICENSE file comes with this software, it is provided AS-IS. 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* USER CODE END Header */ 20 | /* Define to prevent recursive inclusion -------------------------------------*/ 21 | #ifndef __GPIO_H__ 22 | #define __GPIO_H__ 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /* Includes ------------------------------------------------------------------*/ 29 | #include "main.h" 30 | 31 | /* USER CODE BEGIN Includes */ 32 | 33 | /* USER CODE END Includes */ 34 | 35 | /* USER CODE BEGIN Private defines */ 36 | 37 | /* USER CODE END Private defines */ 38 | 39 | void MX_GPIO_Init(void); 40 | 41 | /* USER CODE BEGIN Prototypes */ 42 | 43 | /* USER CODE END Prototypes */ 44 | 45 | #ifdef __cplusplus 46 | } 47 | #endif 48 | #endif /*__ GPIO_H__ */ 49 | 50 | -------------------------------------------------------------------------------- /Firmware/For_V2.1.0_PCB/InkScreen2_13/Core/Inc/main.h: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file : main.h 5 | * @brief : Header for main.c file. 6 | * This file contains the common defines of the application. 7 | ****************************************************************************** 8 | * @attention 9 | * 10 | * Copyright (c) 2022 STMicroelectronics. 11 | * All rights reserved. 12 | * 13 | * This software is licensed under terms that can be found in the LICENSE file 14 | * in the root directory of this software component. 15 | * If no LICENSE file comes with this software, it is provided AS-IS. 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* USER CODE END Header */ 20 | 21 | /* Define to prevent recursive inclusion -------------------------------------*/ 22 | #ifndef __MAIN_H 23 | #define __MAIN_H 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | /* Includes ------------------------------------------------------------------*/ 30 | #include "stm32f1xx_hal.h" 31 | 32 | #include "stm32f1xx_ll_spi.h" 33 | #include "stm32f1xx_ll_system.h" 34 | #include "stm32f1xx_ll_gpio.h" 35 | #include "stm32f1xx_ll_exti.h" 36 | #include "stm32f1xx_ll_bus.h" 37 | #include "stm32f1xx_ll_cortex.h" 38 | #include "stm32f1xx_ll_rcc.h" 39 | #include "stm32f1xx_ll_utils.h" 40 | #include "stm32f1xx_ll_pwr.h" 41 | #include "stm32f1xx_ll_dma.h" 42 | 43 | /* Private includes ----------------------------------------------------------*/ 44 | /* USER CODE BEGIN Includes */ 45 | 46 | /* USER CODE END Includes */ 47 | 48 | /* Exported types ------------------------------------------------------------*/ 49 | /* USER CODE BEGIN ET */ 50 | 51 | /* USER CODE END ET */ 52 | 53 | /* Exported constants --------------------------------------------------------*/ 54 | /* USER CODE BEGIN EC */ 55 | 56 | /* USER CODE END EC */ 57 | 58 | /* Exported macro ------------------------------------------------------------*/ 59 | /* USER CODE BEGIN EM */ 60 | 61 | /* USER CODE END EM */ 62 | 63 | /* Exported functions prototypes ---------------------------------------------*/ 64 | void Error_Handler(void); 65 | 66 | /* USER CODE BEGIN EFP */ 67 | 68 | /* USER CODE END EFP */ 69 | 70 | /* Private defines -----------------------------------------------------------*/ 71 | #define DI_SCREEN_BUSY_Pin LL_GPIO_PIN_1 72 | #define DI_SCREEN_BUSY_GPIO_Port GPIOA 73 | #define DO_SCREEN_DC_Pin LL_GPIO_PIN_2 74 | #define DO_SCREEN_DC_GPIO_Port GPIOA 75 | #define DO_SCREEN_RST_Pin LL_GPIO_PIN_3 76 | #define DO_SCREEN_RST_GPIO_Port GPIOA 77 | #define DO_SCREEN_CS_Pin LL_GPIO_PIN_4 78 | #define DO_SCREEN_CS_GPIO_Port GPIOA 79 | #define DO_SCREEN_CLK_Pin LL_GPIO_PIN_5 80 | #define DO_SCREEN_CLK_GPIO_Port GPIOA 81 | #define MO_SCREEN_MOSI_Pin LL_GPIO_PIN_7 82 | #define MO_SCREEN_MOSI_GPIO_Port GPIOA 83 | #define DO_FLASH_CS_Pin LL_GPIO_PIN_12 84 | #define DO_FLASH_CS_GPIO_Port GPIOB 85 | #define DO_FLASH_CLK_Pin LL_GPIO_PIN_13 86 | #define DO_FLASH_CLK_GPIO_Port GPIOB 87 | #define MO_FLASH_MISO_Pin LL_GPIO_PIN_14 88 | #define MO_FLASH_MISO_GPIO_Port GPIOB 89 | #define MO_FLASH_MOSI_Pin LL_GPIO_PIN_15 90 | #define MO_FLASH_MOSI_GPIO_Port GPIOB 91 | /* USER CODE BEGIN Private defines */ 92 | 93 | /* USER CODE END Private defines */ 94 | 95 | #ifdef __cplusplus 96 | } 97 | #endif 98 | 99 | #endif /* __MAIN_H */ 100 | -------------------------------------------------------------------------------- /Firmware/For_V2.1.0_PCB/InkScreen2_13/Core/Inc/spi.h: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file spi.h 5 | * @brief This file contains all the function prototypes for 6 | * the spi.c file 7 | ****************************************************************************** 8 | * @attention 9 | * 10 | * Copyright (c) 2022 STMicroelectronics. 11 | * All rights reserved. 12 | * 13 | * This software is licensed under terms that can be found in the LICENSE file 14 | * in the root directory of this software component. 15 | * If no LICENSE file comes with this software, it is provided AS-IS. 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* USER CODE END Header */ 20 | /* Define to prevent recursive inclusion -------------------------------------*/ 21 | #ifndef __SPI_H__ 22 | #define __SPI_H__ 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /* Includes ------------------------------------------------------------------*/ 29 | #include "main.h" 30 | 31 | /* USER CODE BEGIN Includes */ 32 | 33 | /* USER CODE END Includes */ 34 | 35 | extern SPI_HandleTypeDef hspi2; 36 | 37 | /* USER CODE BEGIN Private defines */ 38 | 39 | /* USER CODE END Private defines */ 40 | 41 | void MX_SPI1_Init(void); 42 | void MX_SPI2_Init(void); 43 | 44 | /* USER CODE BEGIN Prototypes */ 45 | 46 | /* USER CODE END Prototypes */ 47 | 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | 52 | #endif /* __SPI_H__ */ 53 | 54 | -------------------------------------------------------------------------------- /Firmware/For_V2.1.0_PCB/InkScreen2_13/Core/Inc/stm32_assert.h: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file stm32_assert.h 5 | * @brief STM32 assert file. 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | * Copyright (c) 2018 STMicroelectronics. 10 | * All rights reserved. 11 | * 12 | * This software is licensed under terms that can be found in the LICENSE file 13 | * in the root directory of this software component. 14 | * If no LICENSE file comes with this software, it is provided AS-IS. 15 | * 16 | ****************************************************************************** 17 | */ 18 | /* USER CODE END Header */ 19 | 20 | /* Define to prevent recursive inclusion -------------------------------------*/ 21 | #ifndef __STM32_ASSERT_H 22 | #define __STM32_ASSERT_H 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /* Exported types ------------------------------------------------------------*/ 29 | /* Exported constants --------------------------------------------------------*/ 30 | /* Includes ------------------------------------------------------------------*/ 31 | /* Exported macro ------------------------------------------------------------*/ 32 | #ifdef USE_FULL_ASSERT 33 | /** 34 | * @brief The assert_param macro is used for function's parameters check. 35 | * @param expr: If expr is false, it calls assert_failed function 36 | * which reports the name of the source file and the source 37 | * line number of the call that failed. 38 | * If expr is true, it returns no value. 39 | * @retval None 40 | */ 41 | #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) 42 | /* Exported functions ------------------------------------------------------- */ 43 | void assert_failed(uint8_t* file, uint32_t line); 44 | #else 45 | #define assert_param(expr) ((void)0U) 46 | #endif /* USE_FULL_ASSERT */ 47 | 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | 52 | #endif /* __STM32_ASSERT_H */ 53 | 54 | -------------------------------------------------------------------------------- /Firmware/For_V2.1.0_PCB/InkScreen2_13/Core/Inc/stm32f1xx_it.h: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file stm32f1xx_it.h 5 | * @brief This file contains the headers of the interrupt handlers. 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | * Copyright (c) 2022 STMicroelectronics. 10 | * All rights reserved. 11 | * 12 | * This software is licensed under terms that can be found in the LICENSE file 13 | * in the root directory of this software component. 14 | * If no LICENSE file comes with this software, it is provided AS-IS. 15 | * 16 | ****************************************************************************** 17 | */ 18 | /* USER CODE END Header */ 19 | 20 | /* Define to prevent recursive inclusion -------------------------------------*/ 21 | #ifndef __STM32F1xx_IT_H 22 | #define __STM32F1xx_IT_H 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /* Private includes ----------------------------------------------------------*/ 29 | /* USER CODE BEGIN Includes */ 30 | 31 | /* USER CODE END Includes */ 32 | 33 | /* Exported types ------------------------------------------------------------*/ 34 | /* USER CODE BEGIN ET */ 35 | 36 | /* USER CODE END ET */ 37 | 38 | /* Exported constants --------------------------------------------------------*/ 39 | /* USER CODE BEGIN EC */ 40 | 41 | /* USER CODE END EC */ 42 | 43 | /* Exported macro ------------------------------------------------------------*/ 44 | /* USER CODE BEGIN EM */ 45 | 46 | /* USER CODE END EM */ 47 | 48 | /* Exported functions prototypes ---------------------------------------------*/ 49 | void NMI_Handler(void); 50 | void HardFault_Handler(void); 51 | void MemManage_Handler(void); 52 | void BusFault_Handler(void); 53 | void UsageFault_Handler(void); 54 | void SVC_Handler(void); 55 | void DebugMon_Handler(void); 56 | void PendSV_Handler(void); 57 | void SysTick_Handler(void); 58 | /* USER CODE BEGIN EFP */ 59 | 60 | /* USER CODE END EFP */ 61 | 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | 66 | #endif /* __STM32F1xx_IT_H */ 67 | -------------------------------------------------------------------------------- /Firmware/For_V2.1.0_PCB/InkScreen2_13/Core/Src/gpio.c: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file gpio.c 5 | * @brief This file provides code for the configuration 6 | * of all used GPIO pins. 7 | ****************************************************************************** 8 | * @attention 9 | * 10 | * Copyright (c) 2022 STMicroelectronics. 11 | * All rights reserved. 12 | * 13 | * This software is licensed under terms that can be found in the LICENSE file 14 | * in the root directory of this software component. 15 | * If no LICENSE file comes with this software, it is provided AS-IS. 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* USER CODE END Header */ 20 | 21 | /* Includes ------------------------------------------------------------------*/ 22 | #include "gpio.h" 23 | 24 | /* USER CODE BEGIN 0 */ 25 | 26 | /* USER CODE END 0 */ 27 | 28 | /*----------------------------------------------------------------------------*/ 29 | /* Configure GPIO */ 30 | /*----------------------------------------------------------------------------*/ 31 | /* USER CODE BEGIN 1 */ 32 | 33 | /* USER CODE END 1 */ 34 | 35 | /** Configure pins as 36 | * Analog 37 | * Input 38 | * Output 39 | * EVENT_OUT 40 | * EXTI 41 | * Free pins are configured automatically as Analog (this feature is enabled through 42 | * the Code Generation settings) 43 | */ 44 | void MX_GPIO_Init(void) 45 | { 46 | 47 | LL_GPIO_InitTypeDef GPIO_InitStruct = {0}; 48 | 49 | /* GPIO Ports Clock Enable */ 50 | LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_GPIOC); 51 | LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_GPIOD); 52 | LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_GPIOA); 53 | LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_GPIOB); 54 | 55 | /**/ 56 | LL_GPIO_ResetOutputPin(GPIOA, DO_SCREEN_DC_Pin|DO_SCREEN_RST_Pin); 57 | 58 | /**/ 59 | LL_GPIO_SetOutputPin(DO_SCREEN_CS_GPIO_Port, DO_SCREEN_CS_Pin); 60 | 61 | /**/ 62 | LL_GPIO_SetOutputPin(DO_FLASH_CS_GPIO_Port, DO_FLASH_CS_Pin); 63 | 64 | /**/ 65 | GPIO_InitStruct.Pin = LL_GPIO_PIN_13|LL_GPIO_PIN_14|LL_GPIO_PIN_15; 66 | GPIO_InitStruct.Mode = LL_GPIO_MODE_ANALOG; 67 | LL_GPIO_Init(GPIOC, &GPIO_InitStruct); 68 | 69 | /**/ 70 | GPIO_InitStruct.Pin = LL_GPIO_PIN_0|LL_GPIO_PIN_6|LL_GPIO_PIN_8|LL_GPIO_PIN_9 71 | |LL_GPIO_PIN_10|LL_GPIO_PIN_11|LL_GPIO_PIN_12|LL_GPIO_PIN_15; 72 | GPIO_InitStruct.Mode = LL_GPIO_MODE_ANALOG; 73 | LL_GPIO_Init(GPIOA, &GPIO_InitStruct); 74 | 75 | /**/ 76 | GPIO_InitStruct.Pin = DI_SCREEN_BUSY_Pin; 77 | GPIO_InitStruct.Mode = LL_GPIO_MODE_FLOATING; 78 | LL_GPIO_Init(DI_SCREEN_BUSY_GPIO_Port, &GPIO_InitStruct); 79 | 80 | /**/ 81 | GPIO_InitStruct.Pin = DO_SCREEN_DC_Pin|DO_SCREEN_RST_Pin|DO_SCREEN_CS_Pin; 82 | GPIO_InitStruct.Mode = LL_GPIO_MODE_OUTPUT; 83 | GPIO_InitStruct.Speed = LL_GPIO_SPEED_FREQ_LOW; 84 | GPIO_InitStruct.OutputType = LL_GPIO_OUTPUT_PUSHPULL; 85 | LL_GPIO_Init(GPIOA, &GPIO_InitStruct); 86 | 87 | /**/ 88 | GPIO_InitStruct.Pin = LL_GPIO_PIN_0|LL_GPIO_PIN_1|LL_GPIO_PIN_2|LL_GPIO_PIN_10 89 | |LL_GPIO_PIN_11|LL_GPIO_PIN_3|LL_GPIO_PIN_4|LL_GPIO_PIN_5 90 | |LL_GPIO_PIN_6|LL_GPIO_PIN_7|LL_GPIO_PIN_8|LL_GPIO_PIN_9; 91 | GPIO_InitStruct.Mode = LL_GPIO_MODE_ANALOG; 92 | LL_GPIO_Init(GPIOB, &GPIO_InitStruct); 93 | 94 | /**/ 95 | GPIO_InitStruct.Pin = DO_FLASH_CS_Pin; 96 | GPIO_InitStruct.Mode = LL_GPIO_MODE_OUTPUT; 97 | GPIO_InitStruct.Speed = LL_GPIO_SPEED_FREQ_LOW; 98 | GPIO_InitStruct.OutputType = LL_GPIO_OUTPUT_PUSHPULL; 99 | LL_GPIO_Init(DO_FLASH_CS_GPIO_Port, &GPIO_InitStruct); 100 | 101 | } 102 | 103 | /* USER CODE BEGIN 2 */ 104 | 105 | /* USER CODE END 2 */ 106 | -------------------------------------------------------------------------------- /Firmware/For_V2.1.0_PCB/InkScreen2_13/Core/Src/main.c: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file : main.c 5 | * @brief : Main program body 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | * Copyright (c) 2022 STMicroelectronics. 10 | * All rights reserved. 11 | * 12 | * This software is licensed under terms that can be found in the LICENSE file 13 | * in the root directory of this software component. 14 | * If no LICENSE file comes with this software, it is provided AS-IS. 15 | * 16 | ****************************************************************************** 17 | */ 18 | /* USER CODE END Header */ 19 | /* Includes ------------------------------------------------------------------*/ 20 | #include "main.h" 21 | #include "spi.h" 22 | #include "gpio.h" 23 | 24 | /* Private includes ----------------------------------------------------------*/ 25 | /* USER CODE BEGIN Includes */ 26 | #include "E2213JS0C1.h" 27 | #include "spiFlash.h" 28 | #include "image.h" 29 | 30 | #include 31 | /* USER CODE END Includes */ 32 | 33 | /* Private typedef -----------------------------------------------------------*/ 34 | /* USER CODE BEGIN PTD */ 35 | 36 | /* USER CODE END PTD */ 37 | 38 | /* Private define ------------------------------------------------------------*/ 39 | /* USER CODE BEGIN PD */ 40 | /* USER CODE END PD */ 41 | 42 | /* Private macro -------------------------------------------------------------*/ 43 | /* USER CODE BEGIN PM */ 44 | 45 | /* USER CODE END PM */ 46 | 47 | /* Private variables ---------------------------------------------------------*/ 48 | 49 | /* USER CODE BEGIN PV */ 50 | 51 | /* USER CODE END PV */ 52 | 53 | /* Private function prototypes -----------------------------------------------*/ 54 | void SystemClock_Config(void); 55 | /* USER CODE BEGIN PFP */ 56 | 57 | /* USER CODE END PFP */ 58 | 59 | /* Private user code ---------------------------------------------------------*/ 60 | /* USER CODE BEGIN 0 */ 61 | 62 | /* USER CODE END 0 */ 63 | 64 | /** 65 | * @brief The application entry point. 66 | * @retval int 67 | */ 68 | int main(void) 69 | { 70 | /* USER CODE BEGIN 1 */ 71 | 72 | /* USER CODE END 1 */ 73 | 74 | /* MCU Configuration--------------------------------------------------------*/ 75 | 76 | /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ 77 | HAL_Init(); 78 | 79 | /* USER CODE BEGIN Init */ 80 | 81 | /* USER CODE END Init */ 82 | 83 | /* Configure the system clock */ 84 | SystemClock_Config(); 85 | 86 | /* USER CODE BEGIN SysInit */ 87 | 88 | /* USER CODE END SysInit */ 89 | 90 | /* Initialize all configured peripherals */ 91 | MX_GPIO_Init(); 92 | MX_SPI1_Init(); 93 | MX_SPI2_Init(); 94 | /* USER CODE BEGIN 2 */ 95 | /* 初始化墨水屏 */ 96 | E2213JS0C1_Init(0); 97 | /* 显示图片测试 */ 98 | E2213JS0C1_DrawImage(0, 0, 104, 212, gImage_1); 99 | E2213JS0C1_RefreshScreen(); 100 | HAL_Delay(3000); 101 | /* 显示点、线、矩形、ASCII字符、bpm图片测试 */ 102 | E2213JS0C1_ClearFullScreen(WHITE); 103 | E2213JS0C1_DrawPoint(0, 0, RED); 104 | E2213JS0C1_DrawLine(0, 2, 10, HORIZONTAL, BLACK); 105 | E2213JS0C1_DrawLine(0, 4, 10, VERTICAL, BLACK); 106 | E2213JS0C1_DrawRectangle(0, 16, 10, 10, SOLID, BLACK, RED); 107 | E2213JS0C1_DrawRectangle(20, 16, 10, 10, HOLLOW, BLACK, RED); 108 | E2213JS0C1_ShowCharStr(0, 30, BLACK, WHITE, FONT_1608, "FONT TEST"); 109 | E2213JS0C1_DrawBmp(0, 50, 104, 41, BLACK, WHITE, BmpImage); 110 | E2213JS0C1_ShowCharStr(0, 100, BLACK, WHITE, FONT_1608, "UID:112222162"); 111 | E2213JS0C1_ShowCharStr(20, 116, BLACK, WHITE, FONT_1608, "Designed"); 112 | E2213JS0C1_ShowCharStr(44, 132, BLACK, WHITE, FONT_1608, "By"); 113 | E2213JS0C1_ShowCharStr(40, 148, BLACK, WHITE, FONT_1608, "BYT"); 114 | /* 固件版本 */ 115 | E2213JS0C1_ShowCharStr(0, 195, BLACK, WHITE, FONT_1608, "FV:"); 116 | E2213JS0C1_ShowCharStr(25, 195, BLACK, WHITE, FONT_1608, FIRMWARE_VERSION); 117 | E2213JS0C1_RefreshScreen(); 118 | #if EXTERNAL_SPI_FLASH_CONFIG == ENABLE 119 | /* 初始化Flash */ 120 | SPI_FLASH_Init(); 121 | /* 读取Flash ID,用于确认Flash是否存在,如果检测不到Flash就会卡死不显示 */ 122 | uint32_t id = SPI_FLASH_ReadID(); 123 | /* Flash型号正确 */ 124 | if (id == SPI_FLASH_ID) 125 | { 126 | /* 之前的画面停留3S */ 127 | HAL_Delay(3000); 128 | 129 | /* Flash中的三色图显示测试 */ 130 | E2213JS0C1_DrawImageFromFlash(0, 0, WIDTH_IMAGE, HEIGHT_IMAGE, ADDR_IMAGE_START); 131 | E2213JS0C1_RefreshScreen(); 132 | HAL_Delay(3000); 133 | 134 | E2213JS0C1_ClearFullScreen(WHITE); 135 | /* Flash中的bmp图片显示测试 */ 136 | E2213JS0C1_DrawBmpFromFlash(0, 20, WIDTH_BMP, HEIGHT_BMP, RED, WHITE, ADDR_BMP_START); 137 | /* Flash中的中文、ASCII字符显示测试 */ 138 | uint8_t chinese[] = {0xB2, 0xBB, 0xB0, 0xAE, 0xBA, 0xFA, 0xC2, 0xDC, 0xB2, 0xB7, 0xB5, 0xC4, 0x00}; 139 | uint8_t chinese2[] ={0xB2, 0xD6, 0xCA, 0xF3, 0x00}; 140 | E2213JS0C1_ShowGBKFontOrAsciiFromFlash(5, 90, BLACK, WHITE, FONT_16, chinese); 141 | E2213JS0C1_ShowGBKFontOrAsciiFromFlash(37, 110, BLACK, WHITE, FONT_16, chinese2); 142 | uint8_t ascii[] = {0x55, 0x49, 0x44, 0x3A, 0x31, 0x31, 0x32, 0x32, 0x32, 0x32, 0x31, 0x36, 0x32, 0x00}; 143 | E2213JS0C1_ShowGBKFontOrAsciiFromFlash(5, 140, BLACK, WHITE, FONT_16, ascii); 144 | 145 | 146 | /* 固件版本 */ 147 | uint8_t xPos = E2213JS0C1_ShowGBKFontOrAsciiFromFlash(0,195,BLACK,WHITE, FONT_16,"FV:"); 148 | E2213JS0C1_ShowGBKFontOrAsciiFromFlash(xPos,195,BLACK,WHITE, FONT_16,FIRMWARE_VERSION); 149 | 150 | E2213JS0C1_RefreshScreen(); 151 | } 152 | /* Flash型号不对 */ 153 | else 154 | { 155 | E2213JS0C1_ClearFullScreen(WHITE); 156 | E2213JS0C1_ShowCharStr(0,80,BLACK,WHITE,FONT_1608,"Incorrect "); 157 | E2213JS0C1_ShowCharStr(0,100,BLACK,WHITE,FONT_1608,"Flash"); 158 | E2213JS0C1_ShowCharStr(0,120,BLACK,WHITE,FONT_1608,"model"); 159 | E2213JS0C1_RefreshScreen(); 160 | } 161 | #endif 162 | /* USER CODE END 2 */ 163 | 164 | /* Infinite loop */ 165 | /* USER CODE BEGIN WHILE */ 166 | while (1) 167 | { 168 | /* USER CODE END WHILE */ 169 | 170 | /* USER CODE BEGIN 3 */ 171 | } 172 | /* USER CODE END 3 */ 173 | } 174 | 175 | /** 176 | * @brief System Clock Configuration 177 | * @retval None 178 | */ 179 | void SystemClock_Config(void) 180 | { 181 | RCC_OscInitTypeDef RCC_OscInitStruct = {0}; 182 | RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; 183 | 184 | /** Initializes the RCC Oscillators according to the specified parameters 185 | * in the RCC_OscInitTypeDef structure. 186 | */ 187 | RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; 188 | RCC_OscInitStruct.HSEState = RCC_HSE_ON; 189 | RCC_OscInitStruct.HSEPredivValue = RCC_HSE_PREDIV_DIV2; 190 | RCC_OscInitStruct.HSIState = RCC_HSI_ON; 191 | RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; 192 | RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; 193 | RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL16; 194 | if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) 195 | { 196 | Error_Handler(); 197 | } 198 | 199 | /** Initializes the CPU, AHB and APB buses clocks 200 | */ 201 | RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK 202 | |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2; 203 | RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; 204 | RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; 205 | RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2; 206 | RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; 207 | 208 | if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK) 209 | { 210 | Error_Handler(); 211 | } 212 | } 213 | 214 | /* USER CODE BEGIN 4 */ 215 | 216 | /* USER CODE END 4 */ 217 | 218 | /** 219 | * @brief This function is executed in case of error occurrence. 220 | * @retval None 221 | */ 222 | void Error_Handler(void) 223 | { 224 | /* USER CODE BEGIN Error_Handler_Debug */ 225 | /* User can add his own implementation to report the HAL error return state */ 226 | __disable_irq(); 227 | while (1) 228 | { 229 | } 230 | /* USER CODE END Error_Handler_Debug */ 231 | } 232 | 233 | #ifdef USE_FULL_ASSERT 234 | /** 235 | * @brief Reports the name of the source file and the source line number 236 | * where the assert_param error has occurred. 237 | * @param file: pointer to the source file name 238 | * @param line: assert_param error line source number 239 | * @retval None 240 | */ 241 | void assert_failed(uint8_t *file, uint32_t line) 242 | { 243 | /* USER CODE BEGIN 6 */ 244 | /* User can add his own implementation to report the file name and line number, 245 | ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ 246 | /* USER CODE END 6 */ 247 | } 248 | #endif /* USE_FULL_ASSERT */ 249 | -------------------------------------------------------------------------------- /Firmware/For_V2.1.0_PCB/InkScreen2_13/Core/Src/spi.c: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file spi.c 5 | * @brief This file provides code for the configuration 6 | * of the SPI instances. 7 | ****************************************************************************** 8 | * @attention 9 | * 10 | * Copyright (c) 2022 STMicroelectronics. 11 | * All rights reserved. 12 | * 13 | * This software is licensed under terms that can be found in the LICENSE file 14 | * in the root directory of this software component. 15 | * If no LICENSE file comes with this software, it is provided AS-IS. 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* USER CODE END Header */ 20 | /* Includes ------------------------------------------------------------------*/ 21 | #include "spi.h" 22 | 23 | /* USER CODE BEGIN 0 */ 24 | 25 | /* USER CODE END 0 */ 26 | 27 | SPI_HandleTypeDef hspi2; 28 | 29 | /* SPI1 init function */ 30 | void MX_SPI1_Init(void) 31 | { 32 | 33 | /* USER CODE BEGIN SPI1_Init 0 */ 34 | 35 | /* USER CODE END SPI1_Init 0 */ 36 | 37 | LL_SPI_InitTypeDef SPI_InitStruct = {0}; 38 | 39 | LL_GPIO_InitTypeDef GPIO_InitStruct = {0}; 40 | 41 | /* Peripheral clock enable */ 42 | LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_SPI1); 43 | 44 | LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_GPIOA); 45 | /**SPI1 GPIO Configuration 46 | PA5 ------> SPI1_SCK 47 | PA7 ------> SPI1_MOSI 48 | */ 49 | GPIO_InitStruct.Pin = DO_SCREEN_CLK_Pin|MO_SCREEN_MOSI_Pin; 50 | GPIO_InitStruct.Mode = LL_GPIO_MODE_ALTERNATE; 51 | GPIO_InitStruct.Speed = LL_GPIO_SPEED_FREQ_HIGH; 52 | GPIO_InitStruct.OutputType = LL_GPIO_OUTPUT_PUSHPULL; 53 | LL_GPIO_Init(GPIOA, &GPIO_InitStruct); 54 | 55 | /* USER CODE BEGIN SPI1_Init 1 */ 56 | 57 | /* USER CODE END SPI1_Init 1 */ 58 | SPI_InitStruct.TransferDirection = LL_SPI_FULL_DUPLEX; 59 | SPI_InitStruct.Mode = LL_SPI_MODE_MASTER; 60 | SPI_InitStruct.DataWidth = LL_SPI_DATAWIDTH_8BIT; 61 | SPI_InitStruct.ClockPolarity = LL_SPI_POLARITY_LOW; 62 | SPI_InitStruct.ClockPhase = LL_SPI_PHASE_1EDGE; 63 | SPI_InitStruct.NSS = LL_SPI_NSS_SOFT; 64 | SPI_InitStruct.BaudRate = LL_SPI_BAUDRATEPRESCALER_DIV32; 65 | SPI_InitStruct.BitOrder = LL_SPI_MSB_FIRST; 66 | SPI_InitStruct.CRCCalculation = LL_SPI_CRCCALCULATION_DISABLE; 67 | SPI_InitStruct.CRCPoly = 10; 68 | LL_SPI_Init(SPI1, &SPI_InitStruct); 69 | /* USER CODE BEGIN SPI1_Init 2 */ 70 | 71 | /* USER CODE END SPI1_Init 2 */ 72 | 73 | } 74 | /* SPI2 init function */ 75 | void MX_SPI2_Init(void) 76 | { 77 | 78 | /* USER CODE BEGIN SPI2_Init 0 */ 79 | 80 | /* USER CODE END SPI2_Init 0 */ 81 | 82 | /* USER CODE BEGIN SPI2_Init 1 */ 83 | 84 | /* USER CODE END SPI2_Init 1 */ 85 | hspi2.Instance = SPI2; 86 | hspi2.Init.Mode = SPI_MODE_MASTER; 87 | hspi2.Init.Direction = SPI_DIRECTION_2LINES; 88 | hspi2.Init.DataSize = SPI_DATASIZE_8BIT; 89 | hspi2.Init.CLKPolarity = SPI_POLARITY_HIGH; 90 | hspi2.Init.CLKPhase = SPI_PHASE_2EDGE; 91 | hspi2.Init.NSS = SPI_NSS_SOFT; 92 | hspi2.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_4; 93 | hspi2.Init.FirstBit = SPI_FIRSTBIT_MSB; 94 | hspi2.Init.TIMode = SPI_TIMODE_DISABLE; 95 | hspi2.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE; 96 | hspi2.Init.CRCPolynomial = 10; 97 | if (HAL_SPI_Init(&hspi2) != HAL_OK) 98 | { 99 | Error_Handler(); 100 | } 101 | /* USER CODE BEGIN SPI2_Init 2 */ 102 | 103 | /* USER CODE END SPI2_Init 2 */ 104 | 105 | } 106 | 107 | void HAL_SPI_MspInit(SPI_HandleTypeDef* spiHandle) 108 | { 109 | 110 | GPIO_InitTypeDef GPIO_InitStruct = {0}; 111 | if(spiHandle->Instance==SPI2) 112 | { 113 | /* USER CODE BEGIN SPI2_MspInit 0 */ 114 | 115 | /* USER CODE END SPI2_MspInit 0 */ 116 | /* SPI2 clock enable */ 117 | __HAL_RCC_SPI2_CLK_ENABLE(); 118 | 119 | __HAL_RCC_GPIOB_CLK_ENABLE(); 120 | /**SPI2 GPIO Configuration 121 | PB13 ------> SPI2_SCK 122 | PB14 ------> SPI2_MISO 123 | PB15 ------> SPI2_MOSI 124 | */ 125 | GPIO_InitStruct.Pin = GPIO_PIN_13|GPIO_PIN_15; 126 | GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; 127 | GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; 128 | HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); 129 | 130 | GPIO_InitStruct.Pin = GPIO_PIN_14; 131 | GPIO_InitStruct.Mode = GPIO_MODE_INPUT; 132 | GPIO_InitStruct.Pull = GPIO_NOPULL; 133 | HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); 134 | 135 | /* USER CODE BEGIN SPI2_MspInit 1 */ 136 | 137 | /* USER CODE END SPI2_MspInit 1 */ 138 | } 139 | } 140 | 141 | void HAL_SPI_MspDeInit(SPI_HandleTypeDef* spiHandle) 142 | { 143 | 144 | if(spiHandle->Instance==SPI2) 145 | { 146 | /* USER CODE BEGIN SPI2_MspDeInit 0 */ 147 | 148 | /* USER CODE END SPI2_MspDeInit 0 */ 149 | /* Peripheral clock disable */ 150 | __HAL_RCC_SPI2_CLK_DISABLE(); 151 | 152 | /**SPI2 GPIO Configuration 153 | PB13 ------> SPI2_SCK 154 | PB14 ------> SPI2_MISO 155 | PB15 ------> SPI2_MOSI 156 | */ 157 | HAL_GPIO_DeInit(GPIOB, GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_15); 158 | 159 | /* USER CODE BEGIN SPI2_MspDeInit 1 */ 160 | 161 | /* USER CODE END SPI2_MspDeInit 1 */ 162 | } 163 | } 164 | 165 | /* USER CODE BEGIN 1 */ 166 | 167 | /* USER CODE END 1 */ 168 | -------------------------------------------------------------------------------- /Firmware/For_V2.1.0_PCB/InkScreen2_13/Core/Src/stm32f1xx_hal_msp.c: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file stm32f1xx_hal_msp.c 5 | * @brief This file provides code for the MSP Initialization 6 | * and de-Initialization codes. 7 | ****************************************************************************** 8 | * @attention 9 | * 10 | * Copyright (c) 2022 STMicroelectronics. 11 | * All rights reserved. 12 | * 13 | * This software is licensed under terms that can be found in the LICENSE file 14 | * in the root directory of this software component. 15 | * If no LICENSE file comes with this software, it is provided AS-IS. 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* USER CODE END Header */ 20 | 21 | /* Includes ------------------------------------------------------------------*/ 22 | #include "main.h" 23 | /* USER CODE BEGIN Includes */ 24 | 25 | /* USER CODE END Includes */ 26 | 27 | /* Private typedef -----------------------------------------------------------*/ 28 | /* USER CODE BEGIN TD */ 29 | 30 | /* USER CODE END TD */ 31 | 32 | /* Private define ------------------------------------------------------------*/ 33 | /* USER CODE BEGIN Define */ 34 | 35 | /* USER CODE END Define */ 36 | 37 | /* Private macro -------------------------------------------------------------*/ 38 | /* USER CODE BEGIN Macro */ 39 | 40 | /* USER CODE END Macro */ 41 | 42 | /* Private variables ---------------------------------------------------------*/ 43 | /* USER CODE BEGIN PV */ 44 | 45 | /* USER CODE END PV */ 46 | 47 | /* Private function prototypes -----------------------------------------------*/ 48 | /* USER CODE BEGIN PFP */ 49 | 50 | /* USER CODE END PFP */ 51 | 52 | /* External functions --------------------------------------------------------*/ 53 | /* USER CODE BEGIN ExternalFunctions */ 54 | 55 | /* USER CODE END ExternalFunctions */ 56 | 57 | /* USER CODE BEGIN 0 */ 58 | 59 | /* USER CODE END 0 */ 60 | /** 61 | * Initializes the Global MSP. 62 | */ 63 | void HAL_MspInit(void) 64 | { 65 | /* USER CODE BEGIN MspInit 0 */ 66 | 67 | /* USER CODE END MspInit 0 */ 68 | 69 | __HAL_RCC_AFIO_CLK_ENABLE(); 70 | __HAL_RCC_PWR_CLK_ENABLE(); 71 | 72 | /* System interrupt init*/ 73 | 74 | /** NOJTAG: JTAG-DP Disabled and SW-DP Enabled 75 | */ 76 | __HAL_AFIO_REMAP_SWJ_NOJTAG(); 77 | 78 | /* USER CODE BEGIN MspInit 1 */ 79 | 80 | /* USER CODE END MspInit 1 */ 81 | } 82 | 83 | /* USER CODE BEGIN 1 */ 84 | 85 | /* USER CODE END 1 */ 86 | -------------------------------------------------------------------------------- /Firmware/For_V2.1.0_PCB/InkScreen2_13/Core/Src/stm32f1xx_it.c: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file stm32f1xx_it.c 5 | * @brief Interrupt Service Routines. 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | * Copyright (c) 2022 STMicroelectronics. 10 | * All rights reserved. 11 | * 12 | * This software is licensed under terms that can be found in the LICENSE file 13 | * in the root directory of this software component. 14 | * If no LICENSE file comes with this software, it is provided AS-IS. 15 | * 16 | ****************************************************************************** 17 | */ 18 | /* USER CODE END Header */ 19 | 20 | /* Includes ------------------------------------------------------------------*/ 21 | #include "main.h" 22 | #include "stm32f1xx_it.h" 23 | /* Private includes ----------------------------------------------------------*/ 24 | /* USER CODE BEGIN Includes */ 25 | /* USER CODE END Includes */ 26 | 27 | /* Private typedef -----------------------------------------------------------*/ 28 | /* USER CODE BEGIN TD */ 29 | 30 | /* USER CODE END TD */ 31 | 32 | /* Private define ------------------------------------------------------------*/ 33 | /* USER CODE BEGIN PD */ 34 | 35 | /* USER CODE END PD */ 36 | 37 | /* Private macro -------------------------------------------------------------*/ 38 | /* USER CODE BEGIN PM */ 39 | 40 | /* USER CODE END PM */ 41 | 42 | /* Private variables ---------------------------------------------------------*/ 43 | /* USER CODE BEGIN PV */ 44 | 45 | /* USER CODE END PV */ 46 | 47 | /* Private function prototypes -----------------------------------------------*/ 48 | /* USER CODE BEGIN PFP */ 49 | 50 | /* USER CODE END PFP */ 51 | 52 | /* Private user code ---------------------------------------------------------*/ 53 | /* USER CODE BEGIN 0 */ 54 | 55 | /* USER CODE END 0 */ 56 | 57 | /* External variables --------------------------------------------------------*/ 58 | 59 | /* USER CODE BEGIN EV */ 60 | 61 | /* USER CODE END EV */ 62 | 63 | /******************************************************************************/ 64 | /* Cortex-M3 Processor Interruption and Exception Handlers */ 65 | /******************************************************************************/ 66 | /** 67 | * @brief This function handles Non maskable interrupt. 68 | */ 69 | void NMI_Handler(void) 70 | { 71 | /* USER CODE BEGIN NonMaskableInt_IRQn 0 */ 72 | 73 | /* USER CODE END NonMaskableInt_IRQn 0 */ 74 | /* USER CODE BEGIN NonMaskableInt_IRQn 1 */ 75 | while (1) 76 | { 77 | } 78 | /* USER CODE END NonMaskableInt_IRQn 1 */ 79 | } 80 | 81 | /** 82 | * @brief This function handles Hard fault interrupt. 83 | */ 84 | void HardFault_Handler(void) 85 | { 86 | /* USER CODE BEGIN HardFault_IRQn 0 */ 87 | 88 | /* USER CODE END HardFault_IRQn 0 */ 89 | while (1) 90 | { 91 | /* USER CODE BEGIN W1_HardFault_IRQn 0 */ 92 | /* USER CODE END W1_HardFault_IRQn 0 */ 93 | } 94 | } 95 | 96 | /** 97 | * @brief This function handles Memory management fault. 98 | */ 99 | void MemManage_Handler(void) 100 | { 101 | /* USER CODE BEGIN MemoryManagement_IRQn 0 */ 102 | 103 | /* USER CODE END MemoryManagement_IRQn 0 */ 104 | while (1) 105 | { 106 | /* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */ 107 | /* USER CODE END W1_MemoryManagement_IRQn 0 */ 108 | } 109 | } 110 | 111 | /** 112 | * @brief This function handles Prefetch fault, memory access fault. 113 | */ 114 | void BusFault_Handler(void) 115 | { 116 | /* USER CODE BEGIN BusFault_IRQn 0 */ 117 | 118 | /* USER CODE END BusFault_IRQn 0 */ 119 | while (1) 120 | { 121 | /* USER CODE BEGIN W1_BusFault_IRQn 0 */ 122 | /* USER CODE END W1_BusFault_IRQn 0 */ 123 | } 124 | } 125 | 126 | /** 127 | * @brief This function handles Undefined instruction or illegal state. 128 | */ 129 | void UsageFault_Handler(void) 130 | { 131 | /* USER CODE BEGIN UsageFault_IRQn 0 */ 132 | 133 | /* USER CODE END UsageFault_IRQn 0 */ 134 | while (1) 135 | { 136 | /* USER CODE BEGIN W1_UsageFault_IRQn 0 */ 137 | /* USER CODE END W1_UsageFault_IRQn 0 */ 138 | } 139 | } 140 | 141 | /** 142 | * @brief This function handles System service call via SWI instruction. 143 | */ 144 | void SVC_Handler(void) 145 | { 146 | /* USER CODE BEGIN SVCall_IRQn 0 */ 147 | 148 | /* USER CODE END SVCall_IRQn 0 */ 149 | /* USER CODE BEGIN SVCall_IRQn 1 */ 150 | 151 | /* USER CODE END SVCall_IRQn 1 */ 152 | } 153 | 154 | /** 155 | * @brief This function handles Debug monitor. 156 | */ 157 | void DebugMon_Handler(void) 158 | { 159 | /* USER CODE BEGIN DebugMonitor_IRQn 0 */ 160 | 161 | /* USER CODE END DebugMonitor_IRQn 0 */ 162 | /* USER CODE BEGIN DebugMonitor_IRQn 1 */ 163 | 164 | /* USER CODE END DebugMonitor_IRQn 1 */ 165 | } 166 | 167 | /** 168 | * @brief This function handles Pendable request for system service. 169 | */ 170 | void PendSV_Handler(void) 171 | { 172 | /* USER CODE BEGIN PendSV_IRQn 0 */ 173 | 174 | /* USER CODE END PendSV_IRQn 0 */ 175 | /* USER CODE BEGIN PendSV_IRQn 1 */ 176 | 177 | /* USER CODE END PendSV_IRQn 1 */ 178 | } 179 | 180 | /** 181 | * @brief This function handles System tick timer. 182 | */ 183 | void SysTick_Handler(void) 184 | { 185 | /* USER CODE BEGIN SysTick_IRQn 0 */ 186 | 187 | /* USER CODE END SysTick_IRQn 0 */ 188 | HAL_IncTick(); 189 | /* USER CODE BEGIN SysTick_IRQn 1 */ 190 | 191 | /* USER CODE END SysTick_IRQn 1 */ 192 | } 193 | 194 | /******************************************************************************/ 195 | /* STM32F1xx Peripheral Interrupt Handlers */ 196 | /* Add here the Interrupt Handlers for the used peripherals. */ 197 | /* For the available peripheral interrupt handler names, */ 198 | /* please refer to the startup file (startup_stm32f1xx.s). */ 199 | /******************************************************************************/ 200 | 201 | /* USER CODE BEGIN 1 */ 202 | 203 | /* USER CODE END 1 */ 204 | -------------------------------------------------------------------------------- /Firmware/For_V2.1.0_PCB/InkScreen2_13/Drivers.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BUYITAO/My_E-Paper_Driver/d78ec6fbcef9611fbeb8ad80f2b692ac6e225ed6/Firmware/For_V2.1.0_PCB/InkScreen2_13/Drivers.rar -------------------------------------------------------------------------------- /Firmware/For_V2.1.0_PCB/InkScreen2_13/InkScreen2_13.ioc: -------------------------------------------------------------------------------- 1 | #MicroXplorer Configuration settings - do not modify 2 | File.Version=6 3 | GPIO.groupedBy= 4 | KeepUserPlacement=false 5 | Mcu.CPN=STM32F103C8T6 6 | Mcu.Family=STM32F1 7 | Mcu.IP0=NVIC 8 | Mcu.IP1=RCC 9 | Mcu.IP2=SPI1 10 | Mcu.IP3=SPI2 11 | Mcu.IP4=SYS 12 | Mcu.IPNb=5 13 | Mcu.Name=STM32F103C(8-B)Tx 14 | Mcu.Package=LQFP48 15 | Mcu.Pin0=PD0-OSC_IN 16 | Mcu.Pin1=PD1-OSC_OUT 17 | Mcu.Pin10=PB14 18 | Mcu.Pin11=PB15 19 | Mcu.Pin12=PA13 20 | Mcu.Pin13=PA14 21 | Mcu.Pin14=VP_SYS_VS_Systick 22 | Mcu.Pin2=PA1 23 | Mcu.Pin3=PA2 24 | Mcu.Pin4=PA3 25 | Mcu.Pin5=PA4 26 | Mcu.Pin6=PA5 27 | Mcu.Pin7=PA7 28 | Mcu.Pin8=PB12 29 | Mcu.Pin9=PB13 30 | Mcu.PinsNb=15 31 | Mcu.ThirdPartyNb=0 32 | Mcu.UserConstants= 33 | Mcu.UserName=STM32F103C8Tx 34 | MxCube.Version=6.5.0 35 | MxDb.Version=DB.6.0.50 36 | NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:true 37 | NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:true 38 | NVIC.ForceEnableDMAVector=true 39 | NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:true 40 | NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:true 41 | NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:true 42 | NVIC.PendSV_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:true 43 | NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4 44 | NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:true 45 | NVIC.SysTick_IRQn=true\:15\:0\:false\:false\:true\:false\:true\:true 46 | NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:true 47 | PA1.GPIOParameters=GPIO_Label 48 | PA1.GPIO_Label=DI_SCREEN_BUSY 49 | PA1.Locked=true 50 | PA1.Signal=GPIO_Input 51 | PA13.Mode=Serial_Wire 52 | PA13.Signal=SYS_JTMS-SWDIO 53 | PA14.Mode=Serial_Wire 54 | PA14.Signal=SYS_JTCK-SWCLK 55 | PA2.GPIOParameters=GPIO_Label 56 | PA2.GPIO_Label=DO_SCREEN_DC 57 | PA2.Locked=true 58 | PA2.Signal=GPIO_Output 59 | PA3.GPIOParameters=GPIO_Label 60 | PA3.GPIO_Label=DO_SCREEN_RST 61 | PA3.Locked=true 62 | PA3.Signal=GPIO_Output 63 | PA4.GPIOParameters=PinState,GPIO_Label 64 | PA4.GPIO_Label=DO_SCREEN_CS 65 | PA4.Locked=true 66 | PA4.PinState=GPIO_PIN_SET 67 | PA4.Signal=GPIO_Output 68 | PA5.GPIOParameters=GPIO_Label 69 | PA5.GPIO_Label=DO_SCREEN_CLK 70 | PA5.Mode=TX_Only_Simplex_Unidirect_Master 71 | PA5.Signal=SPI1_SCK 72 | PA7.GPIOParameters=GPIO_Label 73 | PA7.GPIO_Label=MO_SCREEN_MOSI 74 | PA7.Mode=TX_Only_Simplex_Unidirect_Master 75 | PA7.Signal=SPI1_MOSI 76 | PB12.GPIOParameters=PinState,GPIO_Label 77 | PB12.GPIO_Label=DO_FLASH_CS 78 | PB12.Locked=true 79 | PB12.PinState=GPIO_PIN_SET 80 | PB12.Signal=GPIO_Output 81 | PB13.GPIOParameters=GPIO_Label 82 | PB13.GPIO_Label=DO_FLASH_CLK 83 | PB13.Mode=Full_Duplex_Master 84 | PB13.Signal=SPI2_SCK 85 | PB14.GPIOParameters=GPIO_Label 86 | PB14.GPIO_Label=MO_FLASH_MISO 87 | PB14.Mode=Full_Duplex_Master 88 | PB14.Signal=SPI2_MISO 89 | PB15.GPIOParameters=GPIO_Label 90 | PB15.GPIO_Label=MO_FLASH_MOSI 91 | PB15.Mode=Full_Duplex_Master 92 | PB15.Signal=SPI2_MOSI 93 | PD0-OSC_IN.Mode=HSE-External-Oscillator 94 | PD0-OSC_IN.Signal=RCC_OSC_IN 95 | PD1-OSC_OUT.Mode=HSE-External-Oscillator 96 | PD1-OSC_OUT.Signal=RCC_OSC_OUT 97 | PinOutPanel.RotationAngle=0 98 | ProjectManager.AskForMigrate=true 99 | ProjectManager.BackupPrevious=false 100 | ProjectManager.CompilerOptimize=6 101 | ProjectManager.ComputerToolchain=false 102 | ProjectManager.CoupleFile=true 103 | ProjectManager.CustomerFirmwarePackage= 104 | ProjectManager.DefaultFWLocation=true 105 | ProjectManager.DeletePrevious=true 106 | ProjectManager.DeviceId=STM32F103C8Tx 107 | ProjectManager.FirmwarePackage=STM32Cube FW_F1 V1.8.4 108 | ProjectManager.FreePins=true 109 | ProjectManager.HalAssertFull=false 110 | ProjectManager.HeapSize=0x200 111 | ProjectManager.KeepUserCode=true 112 | ProjectManager.LastFirmware=true 113 | ProjectManager.LibraryCopy=1 114 | ProjectManager.MainLocation=Core/Src 115 | ProjectManager.NoMain=false 116 | ProjectManager.PreviousToolchain= 117 | ProjectManager.ProjectBuild=false 118 | ProjectManager.ProjectFileName=InkScreen2_13.ioc 119 | ProjectManager.ProjectName=InkScreen2_13 120 | ProjectManager.RegisterCallBack= 121 | ProjectManager.StackSize=0x1500 122 | ProjectManager.TargetToolchain=MDK-ARM V5.27 123 | ProjectManager.ToolChainLocation= 124 | ProjectManager.UnderRoot=false 125 | ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-LL-true,2-SystemClock_Config-RCC-false-HAL-false,3-MX_SPI1_Init-SPI1-false-LL-true,4-MX_SPI2_Init-SPI2-false-HAL-true 126 | RCC.ADCFreqValue=32000000 127 | RCC.AHBFreq_Value=64000000 128 | RCC.APB1CLKDivider=RCC_HCLK_DIV2 129 | RCC.APB1Freq_Value=32000000 130 | RCC.APB1TimFreq_Value=64000000 131 | RCC.APB2Freq_Value=64000000 132 | RCC.APB2TimFreq_Value=64000000 133 | RCC.FCLKCortexFreq_Value=64000000 134 | RCC.FamilyName=M 135 | RCC.HCLKFreq_Value=64000000 136 | RCC.HSEDivPLL=RCC_HSE_PREDIV_DIV2 137 | RCC.IPParameters=ADCFreqValue,AHBFreq_Value,APB1CLKDivider,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,FCLKCortexFreq_Value,FamilyName,HCLKFreq_Value,HSEDivPLL,MCOFreq_Value,PLLCLKFreq_Value,PLLMCOFreq_Value,PLLMUL,PLLSourceVirtual,SYSCLKFreq_VALUE,SYSCLKSource,TimSysFreq_Value,USBFreq_Value,VCOOutput2Freq_Value 138 | RCC.MCOFreq_Value=64000000 139 | RCC.PLLCLKFreq_Value=64000000 140 | RCC.PLLMCOFreq_Value=32000000 141 | RCC.PLLMUL=RCC_PLL_MUL16 142 | RCC.PLLSourceVirtual=RCC_PLLSOURCE_HSE 143 | RCC.SYSCLKFreq_VALUE=64000000 144 | RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK 145 | RCC.TimSysFreq_Value=64000000 146 | RCC.USBFreq_Value=64000000 147 | RCC.VCOOutput2Freq_Value=4000000 148 | SPI1.BaudRatePrescaler=SPI_BAUDRATEPRESCALER_32 149 | SPI1.CalculateBaudRate=2.0 MBits/s 150 | SPI1.Direction=SPI_DIRECTION_2LINES 151 | SPI1.IPParameters=VirtualType,Mode,Direction,CalculateBaudRate,BaudRatePrescaler 152 | SPI1.Mode=SPI_MODE_MASTER 153 | SPI1.VirtualType=VM_MASTER 154 | SPI2.BaudRatePrescaler=SPI_BAUDRATEPRESCALER_4 155 | SPI2.CLKPhase=SPI_PHASE_2EDGE 156 | SPI2.CLKPolarity=SPI_POLARITY_HIGH 157 | SPI2.CalculateBaudRate=8.0 MBits/s 158 | SPI2.Direction=SPI_DIRECTION_2LINES 159 | SPI2.IPParameters=VirtualType,Mode,Direction,CalculateBaudRate,CLKPolarity,CLKPhase,BaudRatePrescaler 160 | SPI2.Mode=SPI_MODE_MASTER 161 | SPI2.VirtualType=VM_MASTER 162 | VP_SYS_VS_Systick.Mode=SysTick 163 | VP_SYS_VS_Systick.Signal=SYS_VS_Systick 164 | board=custom 165 | -------------------------------------------------------------------------------- /Firmware/For_V2.1.0_PCB/InkScreen2_13/MDK-ARM.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BUYITAO/My_E-Paper_Driver/d78ec6fbcef9611fbeb8ad80f2b692ac6e225ed6/Firmware/For_V2.1.0_PCB/InkScreen2_13/MDK-ARM.rar -------------------------------------------------------------------------------- /Firmware/For_V2.1.0_PCB/InkScreen2_13/kill.bat: -------------------------------------------------------------------------------- 1 | del *.bak /s 2 | del *.ddk /s 3 | del *.edk /s 4 | del *.lst /s 5 | del *.lnp /s 6 | del *.mpf /s 7 | del *.mpj /s 8 | del *.obj /s 9 | del *.omf /s 10 | ::del *.opt /s ::不允许删除JTAG的设置 11 | del *.plg /s 12 | del *.rpt /s 13 | del *.tmp /s 14 | del *.__i /s 15 | del *.crf /s 16 | del *.o /s 17 | del *.d /s 18 | del *.axf /s 19 | del *.tra /s 20 | del *.dep /s 21 | del JLinkLog.txt /s 22 | 23 | del *.iex /s 24 | del *.htm /s 25 | del *.sct /s 26 | del *.map /s 27 | exit 28 | -------------------------------------------------------------------------------- /Hardware/V1.0.0/My_E-Paper_Driver_V1.0.0(Gerber).rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BUYITAO/My_E-Paper_Driver/d78ec6fbcef9611fbeb8ad80f2b692ac6e225ed6/Hardware/V1.0.0/My_E-Paper_Driver_V1.0.0(Gerber).rar -------------------------------------------------------------------------------- /Hardware/V1.0.0/My_E-Paper_Driver_V1.0.0.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BUYITAO/My_E-Paper_Driver/d78ec6fbcef9611fbeb8ad80f2b692ac6e225ed6/Hardware/V1.0.0/My_E-Paper_Driver_V1.0.0.pdf -------------------------------------------------------------------------------- /Hardware/V1.0.0/My_E-Paper_Driver_V1.0.0.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BUYITAO/My_E-Paper_Driver/d78ec6fbcef9611fbeb8ad80f2b692ac6e225ed6/Hardware/V1.0.0/My_E-Paper_Driver_V1.0.0.rar -------------------------------------------------------------------------------- /Hardware/V1.0.0/更新说明.txt: -------------------------------------------------------------------------------- 1 | V1.0.0 2 | 最初版本 -------------------------------------------------------------------------------- /Hardware/V2.0.0/My_E-Paper_Driver_V2.0.0(Gerber).rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BUYITAO/My_E-Paper_Driver/d78ec6fbcef9611fbeb8ad80f2b692ac6e225ed6/Hardware/V2.0.0/My_E-Paper_Driver_V2.0.0(Gerber).rar -------------------------------------------------------------------------------- /Hardware/V2.0.0/My_E-Paper_Driver_V2.0.0.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BUYITAO/My_E-Paper_Driver/d78ec6fbcef9611fbeb8ad80f2b692ac6e225ed6/Hardware/V2.0.0/My_E-Paper_Driver_V2.0.0.pdf -------------------------------------------------------------------------------- /Hardware/V2.0.0/My_E-Paper_Driver_V2.0.0.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BUYITAO/My_E-Paper_Driver/d78ec6fbcef9611fbeb8ad80f2b692ac6e225ed6/Hardware/V2.0.0/My_E-Paper_Driver_V2.0.0.rar -------------------------------------------------------------------------------- /Hardware/V2.0.0/更新说明.txt: -------------------------------------------------------------------------------- 1 | V1.0.0 2 | 最初版本 3 | ********************************* 4 | V2.0.0 5 | 1.增加flash,用于存储字库、图片等资源 6 | 2.墨水屏的CS增加上拉电阻 -------------------------------------------------------------------------------- /Hardware/V2.1.0/My_E-Paper_Driver_V2.1.0(Gerber).rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BUYITAO/My_E-Paper_Driver/d78ec6fbcef9611fbeb8ad80f2b692ac6e225ed6/Hardware/V2.1.0/My_E-Paper_Driver_V2.1.0(Gerber).rar -------------------------------------------------------------------------------- /Hardware/V2.1.0/My_E-Paper_Driver_V2.1.0.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BUYITAO/My_E-Paper_Driver/d78ec6fbcef9611fbeb8ad80f2b692ac6e225ed6/Hardware/V2.1.0/My_E-Paper_Driver_V2.1.0.pdf -------------------------------------------------------------------------------- /Hardware/V2.1.0/My_E-Paper_Driver_V2.1.0.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BUYITAO/My_E-Paper_Driver/d78ec6fbcef9611fbeb8ad80f2b692ac6e225ed6/Hardware/V2.1.0/My_E-Paper_Driver_V2.1.0.rar -------------------------------------------------------------------------------- /Hardware/V2.1.0/更新说明.txt: -------------------------------------------------------------------------------- 1 | V1.0.0 2 | 最初版本 3 | ********************************* 4 | V2.0.0 5 | 1.增加flash,用于存储字库、图片等资源 6 | 2.墨水屏的CS增加上拉电阻 7 | ********************************* 8 | V2.1.0 9 | 1.Flash与屏无法共用SPI,可能是因为他们模式不同,对应的CLK电平不同,导致错误。 10 | 把flash共用的CLK和MOSI独立出来。 -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # My_E-Paper_Driver 2 | 3 | [TOC] 4 | 5 | 6 | 7 | # 更新说明 8 | 9 | ## 2022.07.09 10 | 11 | ​ 更新V2版本的PCB和程序。HW:V2.1.0;FW:V2.0.0 12 | 13 | ​ PCB在V1的基础上增加一个SPI Flash,用于储存中文字库、ASCII字库、图片等数据。 14 | 15 | ​ 程序以V1为基础,增加了从SPI Flash读取数据显示中文、ASCII字符、BMP图、三色图的相关函数。 16 | 17 | # 一.项目起源 18 | 19 | ​ 想不看文字听我讲故事的,可以移步“https://www.bilibili.com/video/BV1aL4y137BQ/?vd_source=b5472a9f9c8c4560fd993637d3d9cb0f”观看视频。 20 | 21 | ​ 这个事儿吧,还得从几个月前立创商城搞活动,弄了海外代购51-50的优惠券,我白嫖了好几块电子墨水屏,型号为“E2213JS0C1”。 22 | 23 | ![](Readme_Image/order.png) 24 | 25 | ​ 然后白嫖到手后发现我还需要配套的驱动板,好家伙,只有得捷电子、贸泽电子有卖,价格还这么贵?告辞。 26 | 27 | ![](Readme_Image/OfficialDriveBoard.png) 28 | 29 | ​ 随后我又去找驱动程序,发现官网有基于Arduino做的库,我想把它移植出来,使得它可以在包括但不限于STM32的平台上跑,但是它是基于C++的,我太菜了,不会(大哭)。 30 | 31 | ![](Readme_Image/OfficialLibrary.png) 32 | 33 | ​ 驱动板买不起,驱动程序不会移植,那干脆一不做二不休,自己从零开始做,还好官方的技术文档里有推荐的外围电路和驱动流程。 34 | 35 | # 二.项目文件框架说明 36 | 37 | ​ 整个项目中有4个文件夹:Hardware、Firmware、Tool、Readme_Image。下面我会详细解释各个文件夹的作用及其中文件的使用注意点。 38 | 39 | ## 2.1 Hardware文件夹 40 | 41 | ​ 这里存放的是PCB工程,每个版本的文件夹下有: 42 | 43 | ①AD的工程文件(名称为“My_E-Paper_Driver_VX.X.X.rar”)。 44 | 45 | ②直接可以发去PCB厂家打样的Gerber文件(名称为“My_E-Paper_Driver_VX.X.X(Gerber).rar”)。 46 | 47 | ③导出成PDF的原理图(名称为“My_E-Paper_Driver_VX.X.X.pdf”)。 48 | 49 | ④更新说明。 50 | 51 | ### 2.1.1 V1.0.0 52 | 53 | ​ 这是第一版,只有单纯的驱动电路,如果你只需要驱动电子墨水屏,可以使用这个PCB工程。 54 | 55 | ### 2.1.2 V2.0.0 56 | 57 | ​ 在V1.0.0的基础上增加了一个SPI Flash,用于存放中文字符、ASCII字符、BMP图、三色图数据,并且和电子墨水屏共用一个SPI,但是不知道为什么,程序就是调不出来,暂时放弃,期待一位大佬来看看,所以我依然保留了这一版的PCB工程。这个版本不建议使用。 58 | 59 | ### 2.1.3 V2.1.0 60 | 61 | ​ 把V2.0.0的SPI Flash的SPI数据线单独拆了出来,让二者各自使用自己的SPI。**这是最新版可用的PCB,建议使用这个版本的PCB。** 62 | 63 | ## 2.2 Firmware文件夹 64 | 65 | ​ 这里存放的是各个版本的驱动程序。每个版本的文件夹下有: 66 | 67 | ①“InkScreen2_13”文件夹中是Keil工程文件。 68 | 69 | ②“Release_HEX”文件夹中存放了编译好的烧录到STM32上的HEX文件,可以直接烧录,不需要打开keil编译,可以用于焊接好硬件后的首次验证。 70 | 71 | ③“ExternalFlashresources_Bin”文件夹中存放了需要烧录到外置Flash中所需要的资源文件(这个只有在For_V2.1.0_PCB中有)。 72 | 73 | ### 2.2.1 For_V1.0.0_PCB 74 | 75 | ​ 可以在“V1.0.0”、“V2.1.0”的PCB上跑(“V2.1.0”只要不接SPI Flash的数据线就好),但是**请不要再使用这个工程**。因为**本工程不再维护**,会缺少一些新功能,也不修复BUG,你可以使用新的“For_V2.1.0_PCB”工程,它可以兼容老的板子。 76 | 77 | ### 2.2.2 For_V2.1.0_PCB 78 | 79 | ​ 可以在“V1.0.0”、“V2.1.0”的PCB上跑,默认是在“V2.1.0”的PCB上跑的,如果你手上有“V1.0.0”的PCB,可以通过配置宏定义来关闭SPI Flash相关的代码,实现向下兼容,这点可以见“[四.V2版的程序如何兼容V1.0.0的PCB](#四.V2版的程序如何兼容V1.0.0的PCB)” 80 | 81 | ​ 还有一点需要注意的是,由于每修改工程配置/编译一次,Drivers、MDK-ARM这两个文件夹就会产生很多新的文件/改变文件,但是这些文件不需要被Git管理,所以我把他们ignore了,我会在将开发分支合并到master分支前的最后一次提交时,把他们打进压缩包里,你到手使用时需要解压出来。 82 | 83 | ## 2.3 Tool文件夹 84 | 85 | ​ 这里存放的是本项目会使用到的一些工具。 86 | 87 | ## 2.4 Readme_Image文件夹 88 | 89 | ​ readme所需要用的图片文件,无需关注。 90 | 91 | # 三.如何跑Demo 92 | 93 | ​ 这里以V2.1.0版PCB、For_V2.1.0_PCB中的驱动程序(FW:2.0.0)为例。 94 | 95 | ## 3.1 硬件准备 96 | 97 | ①STM32F103C8T6最小系统板 98 | 99 | ②杜邦线若干(请务必注意杜邦线的长度,尽可能的短,并且注意杜邦线的质量,现在网购的杜邦线太便宜的品质都不太妙) 100 | 101 | ③电子墨水屏,型号为“E2213JS0C1” 102 | 103 | ④驱动板 104 | 105 | ⑤MicorUSB供电线 106 | 107 | ⑥烧录器(J-link、ST-Link、串口等均可) 108 | 109 | ## 3.2 接线 110 | 111 | 驱动板 单片机 112 | 113 | GND ----> GND 114 | 115 | 3.3V ----> 3.3V 116 | 117 | MOSI ----> PA7 118 | 119 | CS ----> PA4 120 | 121 | RST ----> PA3 122 | 123 | CLK ----> PA5 124 | 125 | DC ----> PA2 126 | 127 | BUSY ----> PA1 128 | 129 | FLASH_MISO ----> PB14 130 | 131 | FLASH_CS ----> PB12 132 | 133 | FLASH_MOSI ----> PB15 134 | 135 | FLASH_CLK -----> PB13 136 | 137 | ## 3.3 烧录 138 | 139 | ### 3.3.1 STM32的烧录 140 | 141 | ​ 这部分略,可以使用你习惯的烧录方式烧录程序(J-Link、ST-Link、串口等都行),HEX文件在“Firmware”-“For_V2.1.0_PCB”-“Release_HEX”中(如果你愿意打开Keil自己编译烧录也行) 142 | 143 | ### 3.3.2 外置Flash的烧录 144 | 145 | ​ 外置Flash的烧录也有很多方案,但是目前也没有找到又便宜又方便的方案(毕竟还要考虑后续移植到别的平台)。可以看一下我的视频,里面是我的解决方案“https://www.bilibili.com/video/BV1Du411r7ow/?vd_source=b5472a9f9c8c4560fd993637d3d9cb0f”,但是这个方法只能说是在我用手上的资源最快能实现我要求的方案,但是它的局限性太多了。 146 | 147 | ​ 外置Flash烧录所需的bin文件路径为“Firmware”->"For_V2.1.0_PCB"->"ExternalFlashresources_Bin"->"CH_GBK+ASCII+BMP+IMAGE.bin"。 148 | 149 | ![](Readme_Image/ExternalFlashResources_Bin.png) 150 | 151 | ## 3.4 效果 152 | 153 | ​ 上电后屏幕会刷新4次,每次刷新完成后会停留3S。 154 | 155 | ​ 第一次调用显示三色图的函数,图片数据来源为片内Flash。 156 | 157 | 158 | 159 | ​ 第二次调用画点、画线、画矩形、显示ASCII字符(串)、显示BMP图片的函数,BMP图片数据来源为片内Flash。 160 | 161 | 162 | 163 | ​ 第三次调用显示三色图的函数,图片数据来源为片外Flash。 164 | 165 | 166 | 167 | ​ 第四次调用显示BMP图片、显示中文字符、显示ASCII字符(串)的函数,BMP图片数据、中文字符数据、ASCII字符数来源均为片外Flash。 168 | 169 | 170 | 171 | # 四.V2版的程序如何兼容V1.0.0的PCB 172 | 173 | ​ 因为“For_V1.0.0_PCB”中的程序不再维护,这意味着新的功能、BUG修复也不再会有了,那么如果你手上有V1.0.0的PCB或者你就只想用V1.0.0的PCB,你可以通过修改程序,来屏蔽掉与SPI Flash有关的代码。 174 | 175 | ​ 修改方法很简单,打开“For_V2.1.0_PCB”-“InkScreen2_13”-“Application”-“HardDrivers”-“E2213JS0C1.h”,在文件的最开始有一个名字叫“EXTERNAL_SPI_FLASH_CONFIG”的宏定义,把他从“ENABLE”改成“DISABLE”,然后重新编译工程即可。 176 | 177 | ![](Readme_Image/EXTERNAL_SPI_FLASH_CONFIG.png) 178 | 179 | # 五.如何添加自定义的字库、图片? 180 | 181 | ​ Demo片内Flash默认自带一张三色图、一张BMP图、ASCII字库(8X16像素)。 182 | 183 | ​ Demo外部Flashg默认自带一张三色图、一张BMP图、ASCII字库(8X16像素)、中文字库(GBK编码,16X16像素)。 184 | 185 | ​ 但是默认自带的肯定不能满足大家的需求,所以我会在这一章节讲述如何添加自定义的字库、图片。 186 | 187 | ## 5.1 如何添加自定义ASCII字库到片内Flash 188 | 189 | ​ 如何制作ASCII字符字库懒得打字了,请移步“https://www.bilibili.com/video/BV1jZ4y1e7y3/?vd_source=b5472a9f9c8c4560fd993637d3d9cb0f”观看视频。所需软件在“Tool”->"PCtoLCD2002完美版"中。 190 | 191 | ​ 取模好的数据我们需要保存到“font.h”中,格式如下所示 192 | 193 | ```c 194 | const unsigned char AAA[95][BBB] = { 195 | CCC 196 | }; 197 | ``` 198 | 199 | AAA表示数组名称,可自定义,推荐命名方法ASCII_XXXX。 200 | 201 | BBB表示单个ASCII字符取模结果字节数,例如8*16的ASCII一个字符取模结果就是16字节。 202 | 203 | CCC表示取模结果,把取模结果粘贴到此处。 204 | 205 | ​ 然后在"E2213JS0C1.h"中100行的“字库”下方行添加对应的宏定义,定义格式可以参考在那边写的1608。 206 | 207 | 例如你添加的字库是3216的 208 | 209 | ```c 210 | #define FONT_3216 (1) 211 | #define FONT_3216_WIDTH (16) 212 | #define FONT_3216_HEIGHT (32) 213 | ``` 214 | 215 | ​ 下一步你需要完成“E2213JS0C1_ShowChar”这个函数,因为在这个函数中我使用了switch,你需要完成对应的case。 216 | 217 | ## 5.2 如何添加自定义BMP图到片内Flash 218 | 219 | ​ 如何将图片转成BMP并取模懒得打字了,请移步“https://www.bilibili.com/video/BV1bB4y1W7c3/?vd_source=b5472a9f9c8c4560fd993637d3d9cb0f”观看视频。所需软件在“Tool”->"PCtoLCD2002完美版"中。 220 | 221 | ​ 取模好的数据我们需要保存到“image.h”中,格式如下所示 222 | 223 | ```c 224 | const unsigned char AAA[BBB] = { 225 | CCC 226 | }; 227 | ``` 228 | 229 | AAA表示数组名称,可自定义。 230 | 231 | BBB表示取模结果的总字数。 232 | 233 | CCC表示取模结果,把取模结果粘贴到此处。 234 | 235 | ​ BMP图片不需要做其他操作,如果你愿意,可以在"E2213JS0C1.h"中找个地方做一下BMP图片宽高的宏定义。 236 | 237 | ## 5.3 如何添加自定义三色图到片内Flash 238 | 239 | ​ 这里需要注意的是,因为这个墨水屏只能显示黑白红三色,所以在选取图片是尽量选择接近这三个颜色的,不然显示出来很丑。 240 | 241 | ​ 首先我们需要把普通图片转成三色图,因为普通的图片不是绝对的黑白红三色的,如何转换可以看一下这个教程“https://www.waveshare.net/wiki/E-Paper-Floyd-Steinberg” 242 | 243 | ​ 然后我们打开“Tool”->“Image2Lcd 2.9(破解版)”->“Img2Lcd.exe”,参数设置如下图所示: 244 | 245 | ![](Readme_Image/Image2LcdParamSet.png) 246 | 247 | 点击左上角的“打开”,选择你要取模的图片,然后再点击“保存”,选择路径和文件名,.c或.h格式都行,之后会自动动记事本打开文件,里面是一个数组,将数组整个复制出来,后续操作就和“[5.2 如何添加自定义BMP图到片内Flash](#5.2 如何添加自定义BMP图到片内Flash)”一样 248 | 249 | ## 5.4 如何制作中文字库 250 | 251 | ​ 如何制作中文字库懒得打字了,请移步“https://www.bilibili.com/video/BV1QW4y167AV/?vd_source=b5472a9f9c8c4560fd993637d3d9cb0f”观看视频。所需的工具在“Tool”->"字库制作软件"。 252 | 253 | ​ 制作好的中文字库bin文件如何放到外部Flash,会在“[5.7 如何添加中文字库、ASCII字库、BMP图、三色图到片外Flash](#5.7 如何添加中文字库、ASCII字库、BMP图、三色图到片外Flash)”中讲解 254 | 255 | ## 5.5 如何将ASCII字库、 BMP图、三色图数据转成bin文件 256 | 257 | ​ 我们之前取模时,最终结果都是变成一个数组,这里我会讲解如何把数组转换成一个bin文件。需要用到的工具就是“C2B V2.0.exe”,在“Tool”->"C2B V2.0"。 258 | 259 | ​ 首先我们需要把数组复制出来,新建一个.txt/.c/.h文件,将一个数组放进去。然后我们打开“C2B V2.0.exe”这个软件,其中参数都选择默认,即“小端模式”、“16位”。然后点击“打开文件”,选择刚才新建的.txt/.c/.h文件,再点“转换”,即可在.txt/.c/.h文件路径下找到生成的.bin文件。 260 | 261 | ## 5.6 如何把多个bin文件合并成一个bin文件 262 | 263 | ​ 至此我们已经完成了GBK中文字库、ASCII字符字库的取模、BMP图取模、三色图取模,最终产生了四个bin文件,这里我会讲解如何将这四个bin文件合并成一个bin文件,然后在“[5.7 如何添加中文字库、ASCII字库、BMP图、三色图到片外Flash](#5.7 如何添加中文字库、ASCII字库、BMP图、三色图到片外Flash)”中烧录使用。 264 | 265 | ​ !需要注意的是,这一步并不是必要的,你也可以一个一个bin文件单独烧录,效果也是一样的,就是麻烦。 266 | 267 | ​ 这里我们要用到的是“二进制文件合并工具.exe”,在“Tool”->"UBIN"中。 268 | 269 | ​ 首先需要点击“目标文件”右边的“浏览” 270 | 271 | ![](Readme_Image/UBIN_1.JPG) 272 | 273 | 选择一个路径、填写文件名,这一步是用于设置合并好的bin文件名称和保存路径。 274 | 275 | ​ 然后我们来添加需要被合并的bin文件,点击“源文件”右边的“浏览”选择需要被合并的bin文件,然后“偏移量”默认0x00000000,再点击“添加”,就可以在上面看到本次添加的bin文件。 276 | 277 | ![](Readme_Image/UBIN_2.JPG) 278 | 279 | ​ 然后重复上述步骤,添加其他的bin文件。所有的bin文件添加好后,点击“合并”。就可以在之前设置的路径中找到合并好的bin文件,以及一个txt文件,里面记录了合并的相关信息。 280 | 281 | ​ !上述操作是把所有bin文件首尾相连,像排队那样的合并起来。每个bin文件的起始地址就是上一个bin文件结束地址+1。如果你想让每个bin文件有自定义的起始地址(例如第一个bin文件起始地址0x00000000,第二个起始地址0x10000000,第三个......),可以研究一下“偏移量”和“插入”的使用,这里我就不赘述了。 282 | 283 | ## 5.7 如何添加中文字库、ASCII字库、BMP图、三色图到片外Flash 284 | 285 | ​ 这边有两个步骤: 286 | 287 | ①:将合并好的bin文件烧录到外部Flash,可以看“[3.3.2 外置Flash的烧录](#3.3.2 外置Flash的烧录)”。 288 | 289 | ②:程序中的适配,这也是我这边要进行讲解的。 290 | 291 | ​ 我们需要用到“[5.6 如何把多个bin文件合并成一个bin文件](#5.6 如何把多个bin文件合并成一个bin文件)”中生成的txt文件,这里有我们需要的各个资源的起始地址。 292 | 293 | ​ 我们需要修改"E2213JS0C1.h",在如图下图中106-128行区域中添加新的资源的相关参数。 294 | 295 | ​ 下图是如何使用txt文件中的数据的示例,如果你的各个资源不是连续的,是自定义起始地址的,就可用这个txt文件。 296 | 297 | ![](Readme_Image/5.7_1.JPG) 298 | 299 | ​ 如果你新增了BMP图或三色图,只需要添加首地址、图片的长宽像素数即可,可以参照图中120-122或124-126的格式。 300 | 301 | ​ 如果你增加的是中文字库和ASCII字库(强烈建议同一尺寸的中文字库和ASCII字符同时取模,配套使用)。你需要在107行的枚举中增加新的枚举。并且添加中文字库和ASCII字符的首地址、单个字符取模结果的字节数、宽度/高度像素数。随后你需要在E2213JS0C1_ShowGBKFontOrAsciiFromFlash这个函数中的switch下增加新字库的相关参数。 302 | 303 | # 六.后续更新的想法 304 | 305 | ​ 1.实现屏幕显示方向的设置,因为屏幕没有办法直接设置显示方向,这个只能由驱动程序来做。 306 | 307 | ​ 2.使用中文字库时还需要手动在数组中输入GBK编码,太麻烦,后续看看能不能加入UTF-8编码转GBK编码。这样就可以直接在Keil中输入中文了。 308 | 309 | # 七.Q&A 310 | 311 | ​ 因为文档总有写的不详细的地方,大家在使用时遇到问题,我会把经典的问题和解答放在这里。 312 | 313 | # 八.絮絮叨叨 314 | 315 | ​ 首先我得吐槽一下这个破屏幕,我现在的想法就是一个字,后悔(大哭)。当时白嫖时看双色和三色屏幕价格差不多,加量不加价,那我肯定买三色啊,妹想到哇,这破玩意儿只能全刷,不能局刷。本来还想拿来做个桌面小闹钟啥的,这下好了,直接反向升级,只能做日历了。 316 | 317 | ​ 另外我这写代码的能力也不咋地,如果有看不懂的地方,或者发现了BUG,或者你有什么新的想法希望我实现的,欢迎在B站给我留私信,不出意外的话我会在当天回复。 318 | 319 | ​ 最后非常感谢大家使用我设计的PCB和驱动程序,距离V1发布到现在已经过去好几个月了,理论上我应该很快就完成V2的,但是我太懒了,所以欢迎催更。 -------------------------------------------------------------------------------- /Readme_Image/5.7_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BUYITAO/My_E-Paper_Driver/d78ec6fbcef9611fbeb8ad80f2b692ac6e225ed6/Readme_Image/5.7_1.jpg -------------------------------------------------------------------------------- /Readme_Image/EXTERNAL_SPI_FLASH_CONFIG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BUYITAO/My_E-Paper_Driver/d78ec6fbcef9611fbeb8ad80f2b692ac6e225ed6/Readme_Image/EXTERNAL_SPI_FLASH_CONFIG.png -------------------------------------------------------------------------------- /Readme_Image/ExternalFlashResources_Bin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BUYITAO/My_E-Paper_Driver/d78ec6fbcef9611fbeb8ad80f2b692ac6e225ed6/Readme_Image/ExternalFlashResources_Bin.png -------------------------------------------------------------------------------- /Readme_Image/Image2LcdParamSet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BUYITAO/My_E-Paper_Driver/d78ec6fbcef9611fbeb8ad80f2b692ac6e225ed6/Readme_Image/Image2LcdParamSet.png -------------------------------------------------------------------------------- /Readme_Image/OfficialDriveBoard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BUYITAO/My_E-Paper_Driver/d78ec6fbcef9611fbeb8ad80f2b692ac6e225ed6/Readme_Image/OfficialDriveBoard.png -------------------------------------------------------------------------------- /Readme_Image/OfficialLibrary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BUYITAO/My_E-Paper_Driver/d78ec6fbcef9611fbeb8ad80f2b692ac6e225ed6/Readme_Image/OfficialLibrary.png -------------------------------------------------------------------------------- /Readme_Image/ShowScreen_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BUYITAO/My_E-Paper_Driver/d78ec6fbcef9611fbeb8ad80f2b692ac6e225ed6/Readme_Image/ShowScreen_1.jpg -------------------------------------------------------------------------------- /Readme_Image/ShowScreen_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BUYITAO/My_E-Paper_Driver/d78ec6fbcef9611fbeb8ad80f2b692ac6e225ed6/Readme_Image/ShowScreen_2.jpg -------------------------------------------------------------------------------- /Readme_Image/ShowScreen_3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BUYITAO/My_E-Paper_Driver/d78ec6fbcef9611fbeb8ad80f2b692ac6e225ed6/Readme_Image/ShowScreen_3.jpg -------------------------------------------------------------------------------- /Readme_Image/UBIN_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BUYITAO/My_E-Paper_Driver/d78ec6fbcef9611fbeb8ad80f2b692ac6e225ed6/Readme_Image/UBIN_1.jpg -------------------------------------------------------------------------------- /Readme_Image/UBIN_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BUYITAO/My_E-Paper_Driver/d78ec6fbcef9611fbeb8ad80f2b692ac6e225ed6/Readme_Image/UBIN_2.jpg -------------------------------------------------------------------------------- /Readme_Image/order.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BUYITAO/My_E-Paper_Driver/d78ec6fbcef9611fbeb8ad80f2b692ac6e225ed6/Readme_Image/order.png -------------------------------------------------------------------------------- /Tool/ASCII.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BUYITAO/My_E-Paper_Driver/d78ec6fbcef9611fbeb8ad80f2b692ac6e225ed6/Tool/ASCII.rar -------------------------------------------------------------------------------- /Tool/C2B V2.0.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BUYITAO/My_E-Paper_Driver/d78ec6fbcef9611fbeb8ad80f2b692ac6e225ed6/Tool/C2B V2.0.rar -------------------------------------------------------------------------------- /Tool/Image2Lcd 2.9(破解版).rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BUYITAO/My_E-Paper_Driver/d78ec6fbcef9611fbeb8ad80f2b692ac6e225ed6/Tool/Image2Lcd 2.9(破解版).rar -------------------------------------------------------------------------------- /Tool/PCtoLCD2002完美版.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BUYITAO/My_E-Paper_Driver/d78ec6fbcef9611fbeb8ad80f2b692ac6e225ed6/Tool/PCtoLCD2002完美版.rar -------------------------------------------------------------------------------- /Tool/UBIN.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BUYITAO/My_E-Paper_Driver/d78ec6fbcef9611fbeb8ad80f2b692ac6e225ed6/Tool/UBIN.rar -------------------------------------------------------------------------------- /Tool/字库制作软件.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BUYITAO/My_E-Paper_Driver/d78ec6fbcef9611fbeb8ad80f2b692ac6e225ed6/Tool/字库制作软件.rar --------------------------------------------------------------------------------