arch/arm/stm32/: Added enable/disable to timer low level ops.

This commit is contained in:
Daniel P. Carvalho 2025-01-03 09:57:21 -03:00 committed by Xiang Xiao
parent e5ac1c620e
commit 3f3e6dd9b8
14 changed files with 56 additions and 0 deletions

View file

@ -360,6 +360,8 @@ static int stm32_tim_checkint(struct stm32_tim_dev_s *dev, int source);
static const struct stm32_tim_ops_s stm32_tim_ops =
{
.enable = stm32_tim_enable,
.disable = stm32_tim_disable,
.setmode = stm32_tim_setmode,
.setclock = stm32_tim_setclock,
.setperiod = stm32_tim_setperiod,

View file

@ -54,6 +54,8 @@
#define STM32_TIM_DISABLEINT(d,s) ((d)->ops->disableint(d,s))
#define STM32_TIM_ACKINT(d,s) ((d)->ops->ackint(d,s))
#define STM32_TIM_CHECKINT(d,s) ((d)->ops->checkint(d,s))
#define STM32_TIM_ENABLE(d) ((d)->ops->enable(d))
#define STM32_TIM_DISABLE(d) ((d)->ops->disable(d))
/****************************************************************************
* Public Types
@ -153,6 +155,8 @@ struct stm32_tim_ops_s
{
/* Basic Timers */
void (*enable)(struct stm32_tim_dev_s *dev);
void (*disable)(struct stm32_tim_dev_s *dev);
int (*setmode)(struct stm32_tim_dev_s *dev, stm32_tim_mode_t mode);
int (*setclock)(struct stm32_tim_dev_s *dev, uint32_t freq);
void (*setperiod)(struct stm32_tim_dev_s *dev, uint32_t period);

View file

@ -266,6 +266,13 @@ struct stm32_tim_priv_s
* Private Function prototypes
****************************************************************************/
/* Timer helpers */
static void stm32_tim_reload_counter(struct stm32_tim_dev_s *dev);
static void stm32_tim_enable(struct stm32_tim_dev_s *dev);
static void stm32_tim_disable(struct stm32_tim_dev_s *dev);
static void stm32_tim_reset(struct stm32_tim_dev_s *dev);
/* Timer methods */
static int stm32_tim_setmode(struct stm32_tim_dev_s *dev,
@ -298,6 +305,8 @@ static void stm32_tim_ackint(struct stm32_tim_dev_s *dev, int source);
static const struct stm32_tim_ops_s stm32_tim_ops =
{
.enable = &stm32_tim_enable,
.disable = &stm32_tim_disable,
.setmode = &stm32_tim_setmode,
.setclock = &stm32_tim_setclock,
.getclock = &stm32_tim_getclock,

View file

@ -65,6 +65,8 @@
#define STM32_TIM_ENABLEINT(d,s) ((d)->ops->enableint(d,s))
#define STM32_TIM_DISABLEINT(d,s) ((d)->ops->disableint(d,s))
#define STM32_TIM_ACKINT(d,s) ((d)->ops->ackint(d,s))
#define STM32_TIM_ENABLE(d) ((d)->ops->enable(d))
#define STM32_TIM_DISABLE(d) ((d)->ops->disable(d))
/****************************************************************************
* Public Types
@ -160,6 +162,8 @@ struct stm32_tim_ops_s
{
/* Basic Timers */
void (*enable)(struct stm32_tim_dev_s *dev);
void (*disable)(struct stm32_tim_dev_s *dev);
int (*setmode)(struct stm32_tim_dev_s *dev, stm32_tim_mode_t mode);
int (*setclock)(struct stm32_tim_dev_s *dev, uint32_t freq);
uint32_t (*getclock)(struct stm32_tim_dev_s *dev);

View file

@ -1222,6 +1222,8 @@ static int stm32_tim_getcapture(struct stm32_tim_dev_s *dev,
struct stm32_tim_ops_s stm32_tim_ops =
{
.enable = stm32_tim_enable,
.disable = stm32_tim_disable,
.setmode = stm32_tim_setmode,
.setclock = stm32_tim_setclock,
.setperiod = stm32_tim_setperiod,

View file

@ -52,6 +52,8 @@
#define STM32_TIM_DISABLEINT(d,s) ((d)->ops->disableint(d,s))
#define STM32_TIM_ACKINT(d,s) ((d)->ops->ackint(d,s))
#define STM32_TIM_CHECKINT(d,s) ((d)->ops->checkint(d,s))
#define STM32_TIM_ENABLE(d) ((d)->ops->enable(d))
#define STM32_TIM_DISABLE(d) ((d)->ops->disable(d))
/****************************************************************************
* Public Types
@ -149,6 +151,8 @@ struct stm32_tim_ops_s
{
/* Basic Timers */
void (*enable)(struct stm32_tim_dev_s *dev);
void (*disable)(struct stm32_tim_dev_s *dev);
int (*setmode)(struct stm32_tim_dev_s *dev, stm32_tim_mode_t mode);
int (*setclock)(struct stm32_tim_dev_s *dev, uint32_t freq);
void (*setperiod)(struct stm32_tim_dev_s *dev, uint32_t period);

View file

@ -251,6 +251,13 @@ struct stm32_tim_priv_s
* Private Function prototypes
****************************************************************************/
/* Timer helpers */
static void stm32_tim_reload_counter(struct stm32_tim_dev_s *dev);
static void stm32_tim_enable(struct stm32_tim_dev_s *dev);
static void stm32_tim_disable(struct stm32_tim_dev_s *dev);
static void stm32_tim_reset(struct stm32_tim_dev_s *dev);
/* Timer methods */
static int stm32_tim_setmode(struct stm32_tim_dev_s *dev,
@ -287,6 +294,8 @@ static int stm32_tim_checkint(struct stm32_tim_dev_s *dev,
static const struct stm32_tim_ops_s stm32_tim_ops =
{
.enable = &stm32_tim_enable,
.disable = &stm32_tim_disable,
.setmode = &stm32_tim_setmode,
.setclock = &stm32_tim_setclock,
.setperiod = &stm32_tim_setperiod,

View file

@ -52,6 +52,8 @@
#define STM32_TIM_DISABLEINT(d,s) ((d)->ops->disableint(d,s))
#define STM32_TIM_ACKINT(d,s) ((d)->ops->ackint(d,s))
#define STM32_TIM_CHECKINT(d,s) ((d)->ops->checkint(d,s))
#define STM32_TIM_ENABLE(d) ((d)->ops->enable(d))
#define STM32_TIM_DISABLE(d) ((d)->ops->disable(d))
/****************************************************************************
* Public Types
@ -151,6 +153,8 @@ struct stm32_tim_ops_s
{
/* Basic Timers */
void (*enable)(struct stm32_tim_dev_s *dev);
void (*disable)(struct stm32_tim_dev_s *dev);
int (*setmode)(struct stm32_tim_dev_s *dev, stm32_tim_mode_t mode);
int (*setclock)(struct stm32_tim_dev_s *dev, uint32_t freq);
void (*setperiod)(struct stm32_tim_dev_s *dev, uint32_t period);

View file

@ -283,6 +283,8 @@ static int stm32l5_tim_checkint(struct stm32l5_tim_dev_s *dev,
static const struct stm32l5_tim_ops_s stm32l5_tim_ops =
{
.enable = stm32l5_tim_enable,
.disable = stm32l5_tim_disable,
.setmode = stm32l5_tim_setmode,
.setclock = stm32l5_tim_setclock,
.getclock = stm32l5_tim_getclock,

View file

@ -52,6 +52,8 @@
#define STM32L5_TIM_DISABLEINT(d,s) ((d)->ops->disableint(d,s))
#define STM32L5_TIM_ACKINT(d,s) ((d)->ops->ackint(d,s))
#define STM32L5_TIM_CHECKINT(d,s) ((d)->ops->checkint(d,s))
#define STM32_TIM_ENABLE(d) ((d)->ops->enable(d))
#define STM32_TIM_DISABLE(d) ((d)->ops->disable(d))
/****************************************************************************
* Public Types
@ -149,6 +151,8 @@ struct stm32l5_tim_ops_s
{
/* Basic Timers */
void (*enable)(struct stm32l5_tim_dev_s *dev);
void (*disable)(struct stm32l5_tim_dev_s *dev);
int (*setmode)(struct stm32l5_tim_dev_s *dev,
enum stm32l5_tim_mode_e mode);
int (*setclock)(struct stm32l5_tim_dev_s *dev, uint32_t freq);

View file

@ -283,6 +283,8 @@ static int stm32_tim_checkint(struct stm32_tim_dev_s *dev,
static const struct stm32_tim_ops_s stm32_tim_ops =
{
.enable = stm32_tim_enable,
.disable = stm32_tim_disable,
.setmode = stm32_tim_setmode,
.setclock = stm32_tim_setclock,
.getclock = stm32_tim_getclock,

View file

@ -52,6 +52,8 @@
#define STM32U5_TIM_DISABLEINT(d,s) ((d)->ops->disableint(d,s))
#define STM32U5_TIM_ACKINT(d,s) ((d)->ops->ackint(d,s))
#define STM32U5_TIM_CHECKINT(d,s) ((d)->ops->checkint(d,s))
#define STM32_TIM_ENABLE(d) ((d)->ops->enable(d))
#define STM32_TIM_DISABLE(d) ((d)->ops->disable(d))
/****************************************************************************
* Public Types
@ -143,6 +145,8 @@ struct stm32_tim_ops_s
{
/* Basic Timers */
void (*enable)(struct stm32_tim_dev_s *dev);
void (*disable)(struct stm32_tim_dev_s *dev);
int (*setmode)(struct stm32_tim_dev_s *dev,
enum stm32_tim_mode_e mode);
int (*setclock)(struct stm32_tim_dev_s *dev, uint32_t freq);

View file

@ -285,6 +285,8 @@ static int stm32wl5_tim_checkint(struct stm32wl5_tim_dev_s *dev,
static const struct stm32wl5_tim_ops_s stm32wl5_tim_ops =
{
.enable = stm32wl5_tim_enable,
.disable = stm32wl5_tim_disable,
.setmode = stm32wl5_tim_setmode,
.setclock = stm32wl5_tim_setclock,
.getclock = stm32wl5_tim_getclock,

View file

@ -52,6 +52,8 @@
#define STM32WL5_TIM_DISABLEINT(d,s) ((d)->ops->disableint(d,s))
#define STM32WL5_TIM_ACKINT(d,s) ((d)->ops->ackint(d,s))
#define STM32WL5_TIM_CHECKINT(d,s) ((d)->ops->checkint(d,s))
#define STM32_TIM_ENABLE(d) ((d)->ops->enable(d))
#define STM32_TIM_DISABLE(d) ((d)->ops->disable(d))
/****************************************************************************
* Public Types
@ -141,6 +143,8 @@ struct stm32wl5_tim_ops_s
{
/* Basic Timers */
void (*enable)(struct stm32wl5_tim_dev_s *dev);
void (*disable)(struct stm32wl5_tim_dev_s *dev);
int (*setmode)(struct stm32wl5_tim_dev_s *dev,
enum stm32wl5_tim_mode_e mode);
int (*setclock)(struct stm32wl5_tim_dev_s *dev, uint32_t freq);