-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
cmake_minimum_required(VERSION 3.4) | ||
project(Test1) | ||
|
||
SET(PERIPH_LIB /home/fagci/libraries/STM32F10x_StdPeriph_Lib_V3.5.0/) | ||
INCLUDE_DIRECTORIES( | ||
${PERIPH_LIB}/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x/ | ||
${PERIPH_LIB}/Libraries/CMSIS/CM3/CoreSupport/ | ||
${PERIPH_LIB}/Libraries/STM32F10x_StdPeriph_Driver/inc/ | ||
${PERIPH_LIB}/Project/STM32F10x_StdPeriph_Template | ||
) | ||
SET(PERIPH_LIB_SRC ${PERIPH_LIB}/Libraries/STM32F10x_StdPeriph_Driver/src/) | ||
|
||
SET(CMAKE_C_COMPILER "arm-none-eabi-gcc") | ||
SET(CMAKE_LINKER "arm-none-eabi-ld") | ||
SET(CMAKE_OBJCOPY "arm-none-eabi-objcopy") | ||
|
||
SET(LINK_SCRIPT /home/fagci/ClionProjects/Test2/stm32f10x.ld) | ||
|
||
SET(STARTUP system_stm32f10x.c startup_stm32f10x.c) | ||
SET(STARTUP ${STARTUP} | ||
${PERIPH_LIB_SRC}/stm32f10x_spi.c | ||
${PERIPH_LIB_SRC}/stm32f10x_rcc.c | ||
${PERIPH_LIB_SRC}/stm32f10x_gpio.c | ||
${PERIPH_LIB_SRC}/stm32f10x_dma.c | ||
${PERIPH_LIB_SRC}/misc.c | ||
lib/FONT/font_16pts.c | ||
lib/FONT/correct_ANSI.c | ||
lib/delay.c | ||
lib/spi_init.c | ||
lib/ILI9341_core.c | ||
) | ||
|
||
#SET(DEBUG_FLAGS "-O3") | ||
SET(DEBUG_FLAGS "-O0 -g") | ||
|
||
SET(MCU_FLAGS "-march=armv7-m -mcpu=cortex-m3 -mthumb") | ||
SET(CMAKE_C_FLAGS "${MCU_FLAGS} -fno-common -fno-builtin -ffreestanding -Wall ${DEBUG_FLAGS}") | ||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") | ||
add_definitions(-DHSE_VALUE=8000000 -DSTM32F103C8 -DSTM32F10X_MD -DUSE_STDPERIPH_DRIVER) | ||
SET(CMAKE_EXE_LINKER_FLAGS "${DEBUG_FLAGS} -nostartfiles -T${LINK_SCRIPT}") | ||
SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") | ||
|
||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) | ||
|
||
cmake_policy(SET CMP0015 OLD) | ||
ADD_EXECUTABLE(${PROJECT_NAME}.elf main.c ${STARTUP}) | ||
|
||
add_custom_command(DEPENDS ${PROJECT_NAME}.elf OUTPUT ${PROJECT_NAME}.hex COMMAND ${CMAKE_OBJCOPY} -Oihex ${PROJECT_NAME}.elf ${PROJECT_NAME}.hex) | ||
add_custom_command(DEPENDS ${PROJECT_NAME}.elf OUTPUT ${PROJECT_NAME}.bin COMMAND ${CMAKE_OBJCOPY} -Obinary ${PROJECT_NAME}.elf ${PROJECT_NAME}.bin) | ||
|
||
add_custom_target(generate_bin ALL DEPENDS ${PROJECT_NAME}.bin) | ||
add_custom_target(generate_hex ALL DEPENDS ${PROJECT_NAME}.hex) | ||
|
||
add_custom_target(write stm32flash -w ${PROJECT_NAME}.bin -v -g 0x0 /dev/ttyUSB0 DEPENDS ${PROJECT_NAME}.bin) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#include "stm32f10x.h" | ||
#include "font.h" | ||
#include "correct_ANSI.h" | ||
|
||
unsigned char corr_ANSI(unsigned char *s, unsigned char z) { | ||
switch (s[z]) { | ||
case 134: | ||
return 95; | ||
case 150: | ||
return 96; | ||
case 151: | ||
return 97; | ||
case 168: | ||
return 98; | ||
case 169: | ||
return 99; | ||
case 174: | ||
return 100; | ||
case 176: | ||
return 101; | ||
case 184: | ||
return 102; | ||
case 185: | ||
return 103; | ||
default: | ||
return 32; | ||
} | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#ifndef CORRECT_ASCII_H | ||
#define CORRECT_ASCII_H | ||
#include "stm32f10x.h" | ||
|
||
extern unsigned char corr_ANSI (unsigned char *s, unsigned char z); | ||
|
||
|
||
|
||
|
||
#endif /*CORRECT_ASCII_H*/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#ifndef FONT_18_PTC_H | ||
#define FONT_18_PTC_H | ||
#include "stm32f10x.h" | ||
|
||
//#define FONT cousine_18ptcBitmaps // ïðîïèñàòü íóæíûé øðèôò | ||
//#define FONT_info cousine_18ptcFontInfo // îïèñàíèå øðèôòà, ðàçìåð è ò.ä. | ||
|
||
#define FONT cousine_16ptcBitmaps // ïðîïèñàòü íóæíûé øðèôò | ||
#define FONT_info cousine_16ptcFontInfo // îïèñàíèå øðèôòà, ðàçìåð è ò.ä. ñì.â êîíöå ôàéëà øðèôòà | ||
#define indent 5 // òî÷åê (px) // ñêîëüêî òî÷åê îñòàåòñÿ ïîëå ïîñëå ñèìâîëà (îòñòóï ñïðàâà îò ñèìâîëà äî ñëåäóþùåãî ñèìâîëà) | ||
|
||
//extern const u8 cousine_18ptcBitmaps[]; | ||
//extern const u8 cousine_18ptcFontInfo[]; | ||
|
||
extern const u8 cousine_16ptcBitmaps[]; | ||
extern const u8 cousine_16ptcFontInfo[]; | ||
|
||
|
||
|
||
/* | ||
// wi øèðèíà ñèìâîëà, áèò */ | ||
// he êîëè÷åñòâî ñòðîê */ | ||
// skip ïðîïóñê êîëè÷åñòâà ñèìâ., ìåæäó 127-ì è 192-ì ïî ANSI */ | ||
|
||
|
||
#endif /* FONT_18_PTC_H */ | ||
|