[STM32F4] 为什么STM32F429的库函数里没有控制SYSTICK寄存器的函数

[复制链接]
3358|5
 楼主| wyjben 发表于 2014-3-3 12:32 | 显示全部楼层 |阅读模式
什么STM32F429的库函数里没有控制SYSTICK寄存器的函数?是要自己写的吗?
Ketose 发表于 2014-3-3 14:46 | 显示全部楼层
SYSTICK操作简单,不需要使用函数库。
ilovezeno 发表于 2014-3-3 15:06 | 显示全部楼层
因为那是CMSIS函数库的管理范围啊。。。。
ilovezeno 发表于 2014-3-3 15:06 | 显示全部楼层
Ketose 发表于 2014-3-3 14:46
SYSTICK操作简单,不需要使用函数库。

请不要张嘴就胡说
judejie83 发表于 2014-3-8 13:42 | 显示全部楼层
这个在启动代码中已经导入:
IMPORT  SystemInit
        IMPORT  __main
grant_jx 发表于 2014-3-8 19:05 | 显示全部楼层
ilovezeno 发表于 2014-3-3 15:06
因为那是CMSIS函数库的管理范围啊。。。。

对的,因为ARM将Systick放到了CMSIS里面,需要可以去看ARM的CMSIS,
打开库的话,在STM32F4xx\lib\CMSIS\Include\core_cm4.h可以找到原型

  1. /* ##################################    SysTick function  ############################################ */
  2. /** \ingroup  CMSIS_Core_FunctionInterface
  3.     \defgroup CMSIS_Core_SysTickFunctions CMSIS Core SysTick Functions
  4.   @{
  5. */

  6. #if (__Vendor_SysTickConfig == 0)

  7. /** \brief  System Tick Configuration

  8.     This function initialises the system tick timer and its interrupt and start the system tick timer.
  9.     Counter is in free running mode to generate periodical interrupts.

  10.     \param [in]  ticks  Number of ticks between two interrupts
  11.     \return          0  Function succeeded
  12.     \return          1  Function failed
  13. */
  14. static __INLINE uint32_t SysTick_Config(uint32_t ticks)
  15. {
  16.   if (ticks > SysTick_LOAD_RELOAD_Msk)  return (1);            /* Reload value impossible */

  17.   SysTick->LOAD  = (ticks & SysTick_LOAD_RELOAD_Msk) - 1;      /* set reload register */
  18.   NVIC_SetPriority (SysTick_IRQn, (1<<__NVIC_PRIO_BITS) - 1);  /* set Priority for Cortex-M0 System Interrupts */
  19.   SysTick->VAL   = 0;                                          /* Load the SysTick Counter Value */
  20.   SysTick->CTRL  = SysTick_CTRL_CLKSOURCE_Msk |
  21.                    SysTick_CTRL_TICKINT_Msk   |
  22.                    SysTick_CTRL_ENABLE_Msk;                    /* Enable SysTick IRQ and SysTick Timer */
  23.   return (0);                                                  /* Function successful */
  24. }

  25. #endif




您需要登录后才可以回帖 登录 | 注册

本版积分规则

24

主题

99

帖子

1

粉丝
快速回复 在线客服 返回列表 返回顶部