mirror of
https://github.com/armink/FreeModbus_Slave-Master-RTT-STM32.git
synced 2024-09-01 08:09:25 +08:00
de7bad9245
2、【创建】Eclipse工程,并支持IAR插件调试 3、【创建】Keil工程,位于/RVMDK目录下 4、【创建】IAR工程,位于/EWARM目录下 5、【添加】RT-Thread1.1.1操作系统支持 6、【添加】LED1、LED2系统运行指示灯 7、【修改】Readdme.md文件 Signed-off-by: armink <armink.ztl@gmail.com>
116 lines
4.2 KiB
C
116 lines
4.2 KiB
C
|
||
#ifndef BSP_PRESENT
|
||
#define BSP_PRESENT
|
||
|
||
/*
|
||
*********************************************************************************************************
|
||
* EXTERNS
|
||
*********************************************************************************************************
|
||
*/
|
||
|
||
|
||
/*
|
||
*********************************************************************************************************
|
||
* INCLUDE FILES
|
||
*********************************************************************************************************
|
||
*/
|
||
|
||
|
||
|
||
#include <stm32f10x_conf.h>
|
||
|
||
/*
|
||
*********************************************************************************************************
|
||
* DEFINES
|
||
*********************************************************************************************************
|
||
*/
|
||
/* board configuration */
|
||
// <o> SDCard Driver <1=>SDIO sdcard <0=>SPI MMC card
|
||
// <i>Default: 1
|
||
#define STM32_USE_SDIO 0
|
||
|
||
/* whether use board external SRAM memory */
|
||
// <e>Use external SRAM memory on the board
|
||
// <i>Enable External SRAM memory
|
||
#define STM32_EXT_SRAM 0
|
||
// <o>Begin Address of External SRAM
|
||
// <i>Default: 0x68000000
|
||
#define STM32_EXT_SRAM_BEGIN 0x68000000 /* the begining address of external SRAM */
|
||
// <o>End Address of External SRAM
|
||
// <i>Default: 0x68080000
|
||
#define STM32_EXT_SRAM_END 0x68080000 /* the end address of external SRAM */
|
||
// </e>
|
||
|
||
// <o> Internal SRAM memory size[Kbytes] <8-64>
|
||
// <i>Default: 64
|
||
#define STM32_SRAM_SIZE 64
|
||
#define STM32_SRAM_END (0x20000000 + STM32_SRAM_SIZE * 1024)
|
||
|
||
|
||
#define LED_LED1_ON GPIO_SetBits (GPIOA,GPIO_Pin_11) //LED1
|
||
#define LED_LED1_OFF GPIO_ResetBits(GPIOA,GPIO_Pin_11) //LED1
|
||
|
||
#define LED_LED2_ON GPIO_SetBits (GPIOA,GPIO_Pin_12) //LED1
|
||
#define LED_LED2_OFF GPIO_ResetBits(GPIOA,GPIO_Pin_12) //LED2
|
||
|
||
|
||
void rt_hw_board_init(void);
|
||
|
||
void IWDG_Configuration(void);
|
||
void IWDG_Feed(void);
|
||
|
||
|
||
|
||
|
||
/*********************************************************************************************************/
|
||
/** MACRO'S */
|
||
/***********************************************************************************************************/
|
||
|
||
|
||
//<2F><><EFBFBD><EFBFBD>Ӳ<EFBFBD><D3B2><EFBFBD>汾<EFBFBD>Ŷ<EFBFBD><C5B6><EFBFBD>
|
||
#define VERSION_SOFTWARE_MAJOR 1
|
||
#define VERSION_SOFTWARE_MINOR 0
|
||
#define VERSION_HARDWARE_MAJOR 1
|
||
#define VERSION_HARDWARE_MINOR 0
|
||
|
||
/***********************************************************************************************************/
|
||
/* DATA TYPES */
|
||
/***********************************************************************************************************/
|
||
|
||
|
||
/**********************************************************************************************************
|
||
* GLOBAL VARIABLES
|
||
**********************************************************************************************************/
|
||
|
||
|
||
|
||
|
||
/*
|
||
*********************************************************************************************************
|
||
* FUNCTION PROTOTYPES
|
||
*********************************************************************************************************
|
||
*/
|
||
|
||
void BSP_Init(void);
|
||
|
||
void rt_hw_board_init(void);
|
||
static void RCC_Configuration(void);
|
||
static void NVIC_Configuration(void);
|
||
static void GPIO_Configuration(void);
|
||
static void USART1_Configuration(void);
|
||
static void IWDG_Configuration(void);
|
||
void IWDG_Feed(void);
|
||
static void SysTick_Configuration(void);
|
||
void rt_hw_timer_handler(void);
|
||
|
||
uint8_t AvoidTimeout(uint32_t TimeOfTimeout,uint32_t Period,uint8_t (*DetectCondition)(),uint8_t ConditionValue);
|
||
void Delay(vu32 nCount);
|
||
/*
|
||
*********************************************************************************************************
|
||
* INTERRUPT SERVICES
|
||
*********************************************************************************************************
|
||
*/
|
||
|
||
|
||
#endif /* End of module include. */
|