A bundled STM32F10x Std Periph and CMSIS library
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

stm32f10x_systick.h 1.9 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*
  2. * \file stm32f10x_systick.h
  3. * \brief Provides systick timer functionality.
  4. *
  5. * Copyright (C) 2013 Houtouridis Christos <houtouridis.ch@gmail.com>
  6. * All Rights Reserved.
  7. *
  8. * NOTICE: All information contained herein is, and remains
  9. * the property of Houtouridis Christos. The intellectual
  10. * and technical concepts contained herein are proprietary to
  11. * Houtouridis Christos and are protected by copyright law.
  12. * Dissemination of this information or reproduction of this material
  13. * is strictly forbidden unless prior written permission is obtained
  14. * from Houtouridis Christos.
  15. *
  16. * Author: Houtouridis Christos <houtouridis.ch@gmail.com>
  17. * Date: 11/2013
  18. * Version: 0.2
  19. */
  20. #ifndef __stm32f10x_systick_h__
  21. #define __stm32f10x_systick_h__
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25. #include <stm32f10x.h>
  26. #include <stm32f10x_clock.h>
  27. #include <sys/types.h>
  28. #define ST_MAX_CRONTAB_ENTRIES (10)
  29. #ifndef __weak
  30. #define __weak __attribute__ ((weak))
  31. #endif
  32. /*
  33. * Also defined in types.h
  34. */
  35. #ifndef _CLOCK_T_
  36. #define _CLOCK_T_ unsigned long /* clock() */
  37. typedef _CLOCK_T_ clock_t; /*!< CPU time type */
  38. #endif
  39. #ifndef _TIME_T_
  40. #define _TIME_T_ long /* time() */
  41. typedef _TIME_T_ time_t; /*!< date/time in unix secs past 1-Jan-70 type for 68 years*/
  42. #endif
  43. typedef void (*cronfun_t) (void); /*!< Pointer to void function (void) to use with cron */
  44. /*!
  45. * Cron Table data type
  46. */
  47. typedef struct
  48. {
  49. cronfun_t fun;
  50. clock_t tic;
  51. }CronTab_t;
  52. /* ======== Core Functionalities ============ */
  53. extern void SysTick_Callback (void);
  54. void SysTick_DeInit (void);
  55. void SysTick_Init (clock_t sf);
  56. /* ======== OS like Functionalities ============ */
  57. clock_t get_freq (void);
  58. int set_freq (clock_t f);
  59. #ifdef __cplusplus
  60. }
  61. #endif
  62. #endif //#ifndef __stm32f10x_systick_h__