Renames stm32_ -> stm32l4_ on old files and rtcc/basic timers
This commit is contained in:
parent
8a7dd94cfc
commit
34a7b0ea8e
@ -1,5 +1,5 @@
|
||||
/************************************************************************************
|
||||
* arch/arm/src/stm32l4/chip/stm32_pinmap.h
|
||||
* arch/arm/src/stm32l4/chip/stm32l4_pinmap.h
|
||||
*
|
||||
* Copyright (C) 2015 Sebastien Lorquet. All rights reserved.
|
||||
* Author: Sebastien Lorquet <sebastien@lorquet.fr>
|
||||
|
@ -57,7 +57,7 @@
|
||||
|
||||
#include "chip.h"
|
||||
#include "stm32l4_adc.h"
|
||||
//#include "stm32_bkp.h"
|
||||
//#include "stm32l4_bkp.h"
|
||||
#include "stm32l4_can.h"
|
||||
#include "stm32l4_dbgmcu.h"
|
||||
#include "stm32l4_dma.h"
|
||||
|
@ -1,4 +1,4 @@
|
||||
/****************************************************************************
|
||||
s/****************************************************************************
|
||||
* arch/arm/src/stm32l4/stm32l4_freerun.c
|
||||
*
|
||||
* Copyright (C) 2016 Gregory Nutt. All rights reserved.
|
||||
@ -64,7 +64,7 @@ static struct stm32l4_freerun_s *g_freerun;
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stm32_freerun_handler
|
||||
* Name: stm32l4_freerun_handler
|
||||
*
|
||||
* Description:
|
||||
* Timer interrupt callback. When the freerun timer counter overflows,
|
||||
@ -81,7 +81,7 @@ static struct stm32l4_freerun_s *g_freerun;
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int stm32_freerun_handler(int irq, void *context)
|
||||
static int stm32l4_freerun_handler(int irq, void *context)
|
||||
{
|
||||
struct stm32l4_freerun_s *freerun = g_freerun;
|
||||
|
||||
@ -149,7 +149,7 @@ int stm32l4_freerun_initialize(struct stm32l4_freerun_s *freerun, int chan,
|
||||
|
||||
/* Set up to receive the callback when the counter overflow occurs */
|
||||
|
||||
STM32L4_TIM_SETISR(freerun->tch, stm32_freerun_handler, 0);
|
||||
STM32L4_TIM_SETISR(freerun->tch, stm32l4_freerun_handler, 0);
|
||||
|
||||
/* Set timer period */
|
||||
|
||||
@ -173,7 +173,7 @@ int stm32l4_freerun_initialize(struct stm32l4_freerun_s *freerun, int chan,
|
||||
* Input Parameters:
|
||||
* freerun Caller allocated instance of the freerun state structure. This
|
||||
* structure must have been previously initialized via a call to
|
||||
* stm32_freerun_initialize();
|
||||
* stm32l4_freerun_initialize();
|
||||
* ts The location in which to return the time from the free-running
|
||||
* timer.
|
||||
*
|
||||
@ -197,7 +197,7 @@ int stm32l4_freerun_counter(struct stm32l4_freerun_s *freerun,
|
||||
DEBUGASSERT(freerun && freerun->tch && ts);
|
||||
|
||||
/* Temporarily disable the overflow counter. NOTE that we have to be
|
||||
* careful here because stm32_tc_getpending() will reset the pending
|
||||
* careful here because stm32l4_tc_getpending() will reset the pending
|
||||
* interrupt status. If we do not handle the overflow here then, it will
|
||||
* be lost.
|
||||
*/
|
||||
@ -267,7 +267,7 @@ int stm32l4_freerun_counter(struct stm32l4_freerun_s *freerun,
|
||||
* Input Parameters:
|
||||
* freerun Caller allocated instance of the freerun state structure. This
|
||||
* structure must have been previously initialized via a call to
|
||||
* stm32_freerun_initialize();
|
||||
* stm32l4_freerun_initialize();
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) is returned on success; a negated errno value is returned
|
||||
|
@ -56,7 +56,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
/* The freerun client must allocate an instance of this structure and called
|
||||
* stm32_freerun_initialize() before using the freerun facilities. The client
|
||||
* stm32l4_freerun_initialize() before using the freerun facilities. The client
|
||||
* should not access the contents of this structure directly since the
|
||||
* contents are subject to change.
|
||||
*/
|
||||
@ -118,7 +118,7 @@ int stm32l4_freerun_initialize(struct stm32l4_freerun_s *freerun, int chan,
|
||||
* Input Parameters:
|
||||
* freerun Caller allocated instance of the freerun state structure. This
|
||||
* structure must have been previously initialized via a call to
|
||||
* stm32_freerun_initialize();
|
||||
* stm32l4_freerun_initialize();
|
||||
* ts The location in which to return the time remaining on the
|
||||
* oneshot timer.
|
||||
*
|
||||
@ -140,7 +140,7 @@ int stm32l4_freerun_counter(struct stm32l4_freerun_s *freerun,
|
||||
* Input Parameters:
|
||||
* freerun Caller allocated instance of the freerun state structure. This
|
||||
* structure must have been previously initialized via a call to
|
||||
* stm32_freerun_initialize();
|
||||
* stm32l4_freerun_initialize();
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) is returned on success; a negated errno value is returned
|
||||
|
@ -268,7 +268,7 @@ EXTERN const uint32_t g_gpiobase[STM32L4_NPORTS];
|
||||
* Description:
|
||||
* Configure a GPIO pin based on bit-encoded description of the pin.
|
||||
* Once it is configured as Alternative (GPIO_ALT|GPIO_CNF_AFPP|...)
|
||||
* function, it must be unconfigured with stm32_unconfiggpio() with
|
||||
* function, it must be unconfigured with stm32l4_unconfiggpio() with
|
||||
* the same cfgset first before it can be set to non-alternative function.
|
||||
*
|
||||
* Returns:
|
||||
|
@ -140,7 +140,7 @@ static inline void rcc_resetbkp(void)
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stm32_clockconfig
|
||||
* Name: stm32l4_clockconfig
|
||||
*
|
||||
* Description:
|
||||
* Called to establish the clock settings based on the values in board.h.
|
||||
|
@ -57,7 +57,7 @@
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#define STM32_NALARMS 2
|
||||
#define STM32L4_NALARMS 2
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
@ -93,7 +93,7 @@ struct stm32l4_lowerhalf_s
|
||||
#ifdef CONFIG_RTC_ALARM
|
||||
/* Alarm callback information */
|
||||
|
||||
struct stm32l4_cbinfo_s cbinfo[STM32_NALARMS];
|
||||
struct stm32l4_cbinfo_s cbinfo[STM32L4_NALARMS];
|
||||
#endif
|
||||
};
|
||||
|
||||
@ -200,7 +200,7 @@ static void stm32l4_alarm_callback(FAR void *arg, unsigned int alarmid)
|
||||
#endif /* CONFIG_RTC_ALARM */
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stm32_rdtime
|
||||
* Name: stm32l4_rdtime
|
||||
*
|
||||
* Description:
|
||||
* Implements the rdtime() method of the RTC driver interface
|
||||
|
@ -685,7 +685,7 @@ static int rtchw_check_alrbwf(void)
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
* Name: stm32_rtchw_set_alrmXr X is a or b
|
||||
* Name: stm32l4_rtchw_set_alrmXr X is a or b
|
||||
*
|
||||
* Description:
|
||||
* Set the alarm (A or B) hardware registers, using the required hardware access
|
||||
|
@ -1755,7 +1755,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
|
||||
/* Configure TX as a GPIO output pin and Send a break signal*/
|
||||
|
||||
tx_break = GPIO_OUTPUT | (~(GPIO_MODE_MASK|GPIO_OUTPUT_SET) & priv->tx_gpio);
|
||||
stm32_configgpio(tx_break);
|
||||
stm32l4_configgpio(tx_break);
|
||||
|
||||
leave_critical_section(flags);
|
||||
}
|
||||
@ -1769,7 +1769,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
|
||||
|
||||
/* Configure TX back to U(S)ART */
|
||||
|
||||
stm32_configgpio(priv->tx_gpio);
|
||||
stm32l4_configgpio(priv->tx_gpio);
|
||||
|
||||
priv->ie &= ~USART_CR1_IE_BREAK_INPROGRESS;
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -87,7 +87,7 @@
|
||||
* timer_lowerhalf_s structure.
|
||||
*/
|
||||
|
||||
struct stm32_lowerhalf_s
|
||||
struct stm32l4_lowerhalf_s
|
||||
{
|
||||
FAR const struct timer_ops_s *ops; /* Lower half operations */
|
||||
FAR struct stm32l4_tim_dev_s *tim; /* stm32 timer driver */
|
||||
@ -104,48 +104,48 @@ struct stm32_lowerhalf_s
|
||||
/* Interrupt handling *******************************************************/
|
||||
|
||||
#ifdef CONFIG_STM32L4_TIM1
|
||||
static int stm32_tim1_interrupt(int irq, FAR void *context);
|
||||
static int stm32l4_tim1_interrupt(int irq, FAR void *context);
|
||||
#endif
|
||||
#ifdef CONFIG_STM32L4_TIM2
|
||||
static int stm32_tim2_interrupt(int irq, FAR void *context);
|
||||
static int stm32l4_tim2_interrupt(int irq, FAR void *context);
|
||||
#endif
|
||||
#ifdef CONFIG_STM32L4_TIM3
|
||||
static int stm32_tim3_interrupt(int irq, FAR void *context);
|
||||
static int stm32l4_tim3_interrupt(int irq, FAR void *context);
|
||||
#endif
|
||||
#ifdef CONFIG_STM32L4_TIM4
|
||||
static int stm32_tim4_interrupt(int irq, FAR void *context);
|
||||
static int stm32l4_tim4_interrupt(int irq, FAR void *context);
|
||||
#endif
|
||||
#ifdef CONFIG_STM32L4_TIM5
|
||||
static int stm32_tim5_interrupt(int irq, FAR void *context);
|
||||
static int stm32l4_tim5_interrupt(int irq, FAR void *context);
|
||||
#endif
|
||||
#ifdef CONFIG_STM32L4_TIM6
|
||||
static int stm32_tim6_interrupt(int irq, FAR void *context);
|
||||
static int stm32l4_tim6_interrupt(int irq, FAR void *context);
|
||||
#endif
|
||||
#ifdef CONFIG_STM32L4_TIM7
|
||||
static int stm32_tim7_interrupt(int irq, FAR void *context);
|
||||
static int stm32l4_tim7_interrupt(int irq, FAR void *context);
|
||||
#endif
|
||||
#ifdef CONFIG_STM32L4_TIM8
|
||||
static int stm32_tim8_interrupt(int irq, FAR void *context);
|
||||
static int stm32l4_tim8_interrupt(int irq, FAR void *context);
|
||||
#endif
|
||||
#ifdef CONFIG_STM32L4_TIM15
|
||||
static int stm32_tim15_interrupt(int irq, FAR void *context);
|
||||
static int stm32l4_tim15_interrupt(int irq, FAR void *context);
|
||||
#endif
|
||||
#ifdef CONFIG_STM32L4_TIM16
|
||||
static int stm32_tim16_interrupt(int irq, FAR void *context);
|
||||
static int stm32l4_tim16_interrupt(int irq, FAR void *context);
|
||||
#endif
|
||||
#ifdef CONFIG_STM32L4_TIM17
|
||||
static int stm32_tim17_interrupt(int irq, FAR void *context);
|
||||
static int stm32l4_tim17_interrupt(int irq, FAR void *context);
|
||||
#endif
|
||||
|
||||
static int stm32_timer_handler(FAR struct stm32_lowerhalf_s *lower);
|
||||
static int stm32l4_timer_handler(FAR struct stm32l4_lowerhalf_s *lower);
|
||||
|
||||
/* "Lower half" driver methods **********************************************/
|
||||
|
||||
static int stm32_start(FAR struct timer_lowerhalf_s *lower);
|
||||
static int stm32_stop(FAR struct timer_lowerhalf_s *lower);
|
||||
static int stm32_settimeout(FAR struct timer_lowerhalf_s *lower,
|
||||
static int stm32l4_start(FAR struct timer_lowerhalf_s *lower);
|
||||
static int stm32l4_stop(FAR struct timer_lowerhalf_s *lower);
|
||||
static int stm32l4_settimeout(FAR struct timer_lowerhalf_s *lower,
|
||||
uint32_t timeout);
|
||||
static tccb_t stm32_sethandler(FAR struct timer_lowerhalf_s *lower,
|
||||
static tccb_t stm32l4_sethandler(FAR struct timer_lowerhalf_s *lower,
|
||||
tccb_t handler);
|
||||
|
||||
/****************************************************************************
|
||||
@ -155,109 +155,109 @@ static tccb_t stm32_sethandler(FAR struct timer_lowerhalf_s *lower,
|
||||
|
||||
static const struct timer_ops_s g_timer_ops =
|
||||
{
|
||||
.start = stm32_start,
|
||||
.stop = stm32_stop,
|
||||
.start = stm32l4_start,
|
||||
.stop = stm32l4_stop,
|
||||
.getstatus = NULL,
|
||||
.settimeout = stm32_settimeout,
|
||||
.sethandler = stm32_sethandler,
|
||||
.settimeout = stm32l4_settimeout,
|
||||
.sethandler = stm32l4_sethandler,
|
||||
.ioctl = NULL,
|
||||
};
|
||||
|
||||
#ifdef CONFIG_STM32L4_TIM1
|
||||
static struct stm32_lowerhalf_s g_tim1_lowerhalf =
|
||||
static struct stm32l4_lowerhalf_s g_tim1_lowerhalf =
|
||||
{
|
||||
.ops = &g_timer_ops,
|
||||
.timhandler = stm32_tim1_interrupt,
|
||||
.timhandler = stm32l4_tim1_interrupt,
|
||||
.resolution = STM32L4_TIM1_RES,
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32L4_TIM2
|
||||
static struct stm32_lowerhalf_s g_tim2_lowerhalf =
|
||||
static struct stm32l4_lowerhalf_s g_tim2_lowerhalf =
|
||||
{
|
||||
.ops = &g_timer_ops,
|
||||
.timhandler = stm32_tim2_interrupt,
|
||||
.timhandler = stm32l4_tim2_interrupt,
|
||||
.resolution = STM32L4_TIM2_RES,
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32L4_TIM3
|
||||
static struct stm32_lowerhalf_s g_tim3_lowerhalf =
|
||||
static struct stm32l4_lowerhalf_s g_tim3_lowerhalf =
|
||||
{
|
||||
.ops = &g_timer_ops,
|
||||
.timhandler = stm32_tim3_interrupt,
|
||||
.timhandler = stm32l4_tim3_interrupt,
|
||||
.resolution = STM32L4_TIM3_RES,
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32L4_TIM4
|
||||
static struct stm32_lowerhalf_s g_tim4_lowerhalf =
|
||||
static struct stm32l4_lowerhalf_s g_tim4_lowerhalf =
|
||||
{
|
||||
.ops = &g_timer_ops,
|
||||
.timhandler = stm32_tim4_interrupt,
|
||||
.timhandler = stm32l4_tim4_interrupt,
|
||||
.resolution = STM32L4_TIM4_RES,
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32L4_TIM5
|
||||
static struct stm32_lowerhalf_s g_tim5_lowerhalf =
|
||||
static struct stm32l4_lowerhalf_s g_tim5_lowerhalf =
|
||||
{
|
||||
.ops = &g_timer_ops,
|
||||
.timhandler = stm32_tim5_interrupt,
|
||||
.timhandler = stm32l4_tim5_interrupt,
|
||||
.resolution = STM32L4_TIM5_RES,
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32L4_TIM6
|
||||
static struct stm32_lowerhalf_s g_tim6_lowerhalf =
|
||||
static struct stm32l4_lowerhalf_s g_tim6_lowerhalf =
|
||||
{
|
||||
.ops = &g_timer_ops,
|
||||
.timhandler = stm32_tim6_interrupt,
|
||||
.timhandler = stm32l4_tim6_interrupt,
|
||||
.resolution = STM32L4_TIM6_RES,
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32L4_TIM7
|
||||
static struct stm32_lowerhalf_s g_tim7_lowerhalf =
|
||||
static struct stm32l4_lowerhalf_s g_tim7_lowerhalf =
|
||||
{
|
||||
.ops = &g_timer_ops,
|
||||
.timhandler = stm32_tim7_interrupt,
|
||||
.timhandler = stm32l4_tim7_interrupt,
|
||||
.resolution = STM32L4_TIM7_RES,
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32L4_TIM8
|
||||
static struct stm32_lowerhalf_s g_tim8_lowerhalf =
|
||||
static struct stm32l4_lowerhalf_s g_tim8_lowerhalf =
|
||||
{
|
||||
.ops = &g_timer_ops,
|
||||
.timhandler = stm32_tim8_interrupt,
|
||||
.timhandler = stm32l4_tim8_interrupt,
|
||||
.resolution = STM32L4_TIM8_RES,
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32L4_TIM15
|
||||
static struct stm32_lowerhalf_s g_tim15_lowerhalf =
|
||||
static struct stm32l4_lowerhalf_s g_tim15_lowerhalf =
|
||||
{
|
||||
.ops = &g_timer_ops,
|
||||
.timhandler = stm32_tim15_interrupt,
|
||||
.timhandler = stm32l4_tim15_interrupt,
|
||||
.resolution = STM32L4_TIM15_RES,
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32L4_TIM16
|
||||
static struct stm32_lowerhalf_s g_tim16_lowerhalf =
|
||||
static struct stm32l4_lowerhalf_s g_tim16_lowerhalf =
|
||||
{
|
||||
.ops = &g_timer_ops,
|
||||
.timhandler = stm32_tim16_interrupt,
|
||||
.timhandler = stm32l4_tim16_interrupt,
|
||||
.resolution = STM32L4_TIM16_RES,
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32L4_TIM17
|
||||
static struct stm32_lowerhalf_s g_tim17_lowerhalf =
|
||||
static struct stm32l4_lowerhalf_s g_tim17_lowerhalf =
|
||||
{
|
||||
.ops = &g_timer_ops,
|
||||
.timhandler = stm32_tim17_interrupt,
|
||||
.timhandler = stm32l4_tim17_interrupt,
|
||||
.resolution = STM32L4_TIM17_RES,
|
||||
};
|
||||
#endif
|
||||
@ -267,7 +267,7 @@ static struct stm32_lowerhalf_s g_tim17_lowerhalf =
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stm32_timN_interrupt, N=1..14
|
||||
* Name: stm32l4_timN_interrupt, N=1..14
|
||||
*
|
||||
* Description:
|
||||
* Individual interrupt handlers for each timer
|
||||
@ -275,84 +275,84 @@ static struct stm32_lowerhalf_s g_tim17_lowerhalf =
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_STM32L4_TIM1
|
||||
static int stm32_tim1_interrupt(int irq, FAR void *context)
|
||||
static int stm32l4_tim1_interrupt(int irq, FAR void *context)
|
||||
{
|
||||
return stm32_timer_handler(&g_tim1_lowerhalf);
|
||||
return stm32l4_timer_handler(&g_tim1_lowerhalf);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32L4_TIM2
|
||||
static int stm32_tim2_interrupt(int irq, FAR void *context)
|
||||
static int stm32l4_tim2_interrupt(int irq, FAR void *context)
|
||||
{
|
||||
return stm32_timer_handler(&g_tim2_lowerhalf);
|
||||
return stm32l4_timer_handler(&g_tim2_lowerhalf);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32L4_TIM3
|
||||
static int stm32_tim3_interrupt(int irq, FAR void *context)
|
||||
static int stm32l4_tim3_interrupt(int irq, FAR void *context)
|
||||
{
|
||||
return stm32_timer_handler(&g_tim3_lowerhalf);
|
||||
return stm32l4_timer_handler(&g_tim3_lowerhalf);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32L4_TIM4
|
||||
static int stm32_tim4_interrupt(int irq, FAR void *context)
|
||||
static int stm32l4_tim4_interrupt(int irq, FAR void *context)
|
||||
{
|
||||
return stm32_timer_handler(&g_tim4_lowerhalf);
|
||||
return stm32l4_timer_handler(&g_tim4_lowerhalf);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32L4_TIM5
|
||||
static int stm32_tim5_interrupt(int irq, FAR void *context)
|
||||
static int stm32l4_tim5_interrupt(int irq, FAR void *context)
|
||||
{
|
||||
return stm32_timer_handler(&g_tim5_lowerhalf);
|
||||
return stm32l4_timer_handler(&g_tim5_lowerhalf);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32L4_TIM6
|
||||
static int stm32_tim6_interrupt(int irq, FAR void *context)
|
||||
static int stm32l4_tim6_interrupt(int irq, FAR void *context)
|
||||
{
|
||||
return stm32_timer_handler(&g_tim6_lowerhalf);
|
||||
return stm32l4_timer_handler(&g_tim6_lowerhalf);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32L4_TIM7
|
||||
static int stm32_tim7_interrupt(int irq, FAR void *context)
|
||||
static int stm32l4_tim7_interrupt(int irq, FAR void *context)
|
||||
{
|
||||
return stm32_timer_handler(&g_tim7_lowerhalf);
|
||||
return stm32l4_timer_handler(&g_tim7_lowerhalf);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32L4_TIM8
|
||||
static int stm32_tim8_interrupt(int irq, FAR void *context)
|
||||
static int stm32l4_tim8_interrupt(int irq, FAR void *context)
|
||||
{
|
||||
return stm32_timer_handler(&g_tim8_lowerhalf);
|
||||
return stm32l4_timer_handler(&g_tim8_lowerhalf);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32L4_TIM15
|
||||
static int stm32_tim15_interrupt(int irq, FAR void *context)
|
||||
static int stm32l4_tim15_interrupt(int irq, FAR void *context)
|
||||
{
|
||||
return stm32_timer_handler(&g_tim15_lowerhalf);
|
||||
return stm32l4_timer_handler(&g_tim15_lowerhalf);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32L4_TIM16
|
||||
static int stm32_tim16_interrupt(int irq, FAR void *context)
|
||||
static int stm32l4_tim16_interrupt(int irq, FAR void *context)
|
||||
{
|
||||
return stm32_timer_handler(&g_tim16_lowerhalf);
|
||||
return stm32l4_timer_handler(&g_tim16_lowerhalf);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32L4_TIM17
|
||||
static int stm32_tim17_interrupt(int irq, FAR void *context)
|
||||
static int stm32l4_tim17_interrupt(int irq, FAR void *context)
|
||||
{
|
||||
return stm32_timer_handler(&g_tim17_lowerhalf);
|
||||
return stm32l4_timer_handler(&g_tim17_lowerhalf);
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stm32_timer_handler
|
||||
* Name: stm32l4_timer_handler
|
||||
*
|
||||
* Description:
|
||||
* timer interrupt handler
|
||||
@ -363,7 +363,7 @@ static int stm32_tim17_interrupt(int irq, FAR void *context)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int stm32_timer_handler(FAR struct stm32_lowerhalf_s *lower)
|
||||
static int stm32l4_timer_handler(FAR struct stm32l4_lowerhalf_s *lower)
|
||||
{
|
||||
uint32_t next_interval_us = 0;
|
||||
|
||||
@ -378,14 +378,14 @@ static int stm32_timer_handler(FAR struct stm32_lowerhalf_s *lower)
|
||||
}
|
||||
else
|
||||
{
|
||||
stm32_stop((struct timer_lowerhalf_s *)lower);
|
||||
stm32l4_stop((struct timer_lowerhalf_s *)lower);
|
||||
}
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stm32_start
|
||||
* Name: stm32l4_start
|
||||
*
|
||||
* Description:
|
||||
* Start the timer, resetting the time to the current timeout,
|
||||
@ -399,9 +399,9 @@ static int stm32_timer_handler(FAR struct stm32_lowerhalf_s *lower)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int stm32_start(FAR struct timer_lowerhalf_s *lower)
|
||||
static int stm32l4_start(FAR struct timer_lowerhalf_s *lower)
|
||||
{
|
||||
FAR struct stm32_lowerhalf_s *priv = (FAR struct stm32_lowerhalf_s *)lower;
|
||||
FAR struct stm32l4_lowerhalf_s *priv = (FAR struct stm32l4_lowerhalf_s *)lower;
|
||||
|
||||
if (!priv->started)
|
||||
{
|
||||
@ -423,7 +423,7 @@ static int stm32_start(FAR struct timer_lowerhalf_s *lower)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stm32_stop
|
||||
* Name: stm32l4_stop
|
||||
*
|
||||
* Description:
|
||||
* Stop the timer
|
||||
@ -437,9 +437,9 @@ static int stm32_start(FAR struct timer_lowerhalf_s *lower)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int stm32_stop(struct timer_lowerhalf_s *lower)
|
||||
static int stm32l4_stop(struct timer_lowerhalf_s *lower)
|
||||
{
|
||||
struct stm32_lowerhalf_s *priv = (struct stm32_lowerhalf_s *)lower;
|
||||
struct stm32l4_lowerhalf_s *priv = (struct stm32l4_lowerhalf_s *)lower;
|
||||
|
||||
if (priv->started)
|
||||
{
|
||||
@ -456,7 +456,7 @@ static int stm32_stop(struct timer_lowerhalf_s *lower)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stm32_settimeout
|
||||
* Name: stm32l4_settimeout
|
||||
*
|
||||
* Description:
|
||||
* Set a new timeout value (and reset the timer)
|
||||
@ -471,9 +471,9 @@ static int stm32_stop(struct timer_lowerhalf_s *lower)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int stm32_settimeout(FAR struct timer_lowerhalf_s *lower, uint32_t timeout)
|
||||
static int stm32l4_settimeout(FAR struct timer_lowerhalf_s *lower, uint32_t timeout)
|
||||
{
|
||||
FAR struct stm32_lowerhalf_s *priv = (FAR struct stm32_lowerhalf_s *)lower;
|
||||
FAR struct stm32l4_lowerhalf_s *priv = (FAR struct stm32l4_lowerhalf_s *)lower;
|
||||
uint64_t maxtimeout;
|
||||
|
||||
if (priv->started)
|
||||
@ -498,7 +498,7 @@ static int stm32_settimeout(FAR struct timer_lowerhalf_s *lower, uint32_t timeou
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stm32_sethandler
|
||||
* Name: stm32l4_sethandler
|
||||
*
|
||||
* Description:
|
||||
* Call this user provided timeout handler.
|
||||
@ -516,10 +516,10 @@ static int stm32_settimeout(FAR struct timer_lowerhalf_s *lower, uint32_t timeou
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static tccb_t stm32_sethandler(FAR struct timer_lowerhalf_s *lower,
|
||||
static tccb_t stm32l4_sethandler(FAR struct timer_lowerhalf_s *lower,
|
||||
tccb_t newhandler)
|
||||
{
|
||||
FAR struct stm32_lowerhalf_s *priv = (FAR struct stm32_lowerhalf_s *)lower;
|
||||
FAR struct stm32l4_lowerhalf_s *priv = (FAR struct stm32l4_lowerhalf_s *)lower;
|
||||
|
||||
irqstate_t flags = enter_critical_section();
|
||||
|
||||
@ -570,7 +570,7 @@ static tccb_t stm32_sethandler(FAR struct timer_lowerhalf_s *lower,
|
||||
|
||||
int stm32l4_timer_initialize(FAR const char *devpath, int timer)
|
||||
{
|
||||
FAR struct stm32_lowerhalf_s *lower;
|
||||
FAR struct stm32l4_lowerhalf_s *lower;
|
||||
|
||||
switch (timer)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user