STM32L4: Bring LPTIM driver in from the Motorola MDK.

This commit is contained in:
Gregory Nutt
2017-02-18 11:06:20 -06:00
parent 6bafdb1cdc
commit d900e1fac0
12 changed files with 885 additions and 32 deletions
+26 -12
View File
@@ -43,6 +43,8 @@ config STM32L4_STM32L4X3
select STM32L4_HAVE_USART1
select STM32L4_HAVE_USART2
select STM32L4_HAVE_USART3
select STM32L4_HAVE_LPTIM1
select STM32L4_HAVE_LPTIM2
select STM32L4_HAVE_SAI1
select STM32L4_HAVE_SAI2
@@ -54,6 +56,8 @@ config STM32L4_STM32L4X6
select STM32L4_HAVE_USART3
select STM32L4_HAVE_UART4
select STM32L4_HAVE_UART5
select STM32L4_HAVE_LPTIM1
select STM32L4_HAVE_LPTIM2
select STM32L4_HAVE_SAI1
select STM32L4_HAVE_SAI2
@@ -130,6 +134,14 @@ config STM32L4_HAVE_LTDC
bool
default n
config STM32L4_HAVE_LPTIM1
bool
default n
config STM32L4_HAVE_LPTIM2
bool
default n
config STM32L4_HAVE_SAI1
bool
default n
@@ -174,8 +186,8 @@ config STM32L4_USART
default n
config STM32L4_LPTIM
bool
default n
bool
default n
# These are the peripheral selections proper
@@ -446,8 +458,8 @@ config STM32L4_TIM7
default n
config STM32L4_LCD
bool "LCD"
default n
bool "LCD"
default n
config STM32L4_SPI2
bool "SPI2"
@@ -533,13 +545,14 @@ config STM32L4_DAC2
select STM32L4_DAC
config STM32L4_OPAMP
bool "OPAMP"
default n
bool "OPAMP"
default n
config STM32L4_LPTIM1
bool "LPTIM1"
default n
select STM32L4_LPTIM
select STM32L4_LPTIM
depends on STM32L4_HAVE_LPTIM1
config STM32L4_LPUART1
bool "LPUART1"
@@ -548,13 +561,14 @@ config STM32L4_LPUART1
select ARCH_HAVE_LPUART1
config STM32L4_SWPMI
bool "SWPMI"
default n
bool "SWPMI"
default n
config STM32L4_LPTIM2
bool "LPTIM2"
default n
select STM32L4_LPTIM
select STM32L4_LPTIM
depends on STM32L4_HAVE_LPTIM2
comment "APB2 Peripherals"
@@ -614,8 +628,8 @@ config STM32L4_SAI2
default n
config STM32L4_DFSDM
bool "DFSDM"
default n
bool "DFSDM"
default n
comment "Other Peripherals"
+4
View File
@@ -195,6 +195,10 @@ ifeq ($(CONFIG_STM32L4_SAI),y)
CHIP_CSRCS += stm32l4_sai.c
endif
ifeq ($(CONFIG_STM32L4_LPTIM),y)
CHIP_CSRCS += stm32l4_lptim.c
endif
ifeq ($(CONFIG_PWM),y)
CHIP_CSRCS += stm32l4_pwm.c
endif
+117
View File
@@ -0,0 +1,117 @@
/****************************************************************************************************
* arch/arm/src/stm32l4/stm32l4_lptim.h
*
* Copyright (C) 2016 Motorola Mobility, LLC. All rights reserved.
* Copyright (C) 2009, 2011-2012, 2017 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************************************/
#ifndef __ARCH_ARM_SRC_STM32L4_CHIP_STM32L4_LPTIM_H
#define __ARCH_ARM_SRC_STM32L4_CHIP_STM32L4_LPTIM_H
/****************************************************************************************************
* Pre-processor Definitions
****************************************************************************************************/
/* Register Offsets *********************************************************************************/
/* Basic Timers - TIM6 and TIM7 */
#define STM32L4_LPTIM_ISR_OFFSET 0x0000 /* Interrupt and Status Register */
#define STM32L4_LPTIM_ICR_OFFSET 0x0004 /* Interrupt Clear Register */
#define STM32L4_LPTIM_IER_OFFSET 0x0008 /* Interrupt Enable Register */
#define STM32L4_LPTIM_CFGR_OFFSET 0x000c /* Configuration Register */
#define STM32L4_LPTIM_CR_OFFSET 0x0010 /* Control Register */
#define STM32L4_LPTIM_CMP_OFFSET 0x0014 /* Compare Register */
#define STM32L4_LPTIM_ARR_OFFSET 0x0018 /* Autoreload Register */
#define STM32L4_LPTIM_CNT_OFFSET 0x001c /* Counter Register */
/* Register Addresses *******************************************************************************/
/* Low-Power Timers - LPTIM1 and LPTIM2 */
#define STM32L4_LPTIM1_ISR (STM32L4_LPTIM1_BASE+STM32L4_LPTIM_ISR_OFFSET)
#define STM32L4_LPTIM1_ICR (STM32L4_LPTIM1_BASE+STM32L4_LPTIM_ICR_OFFSET)
#define STM32L4_LPTIM1_IER (STM32L4_LPTIM1_BASE+STM32L4_LPTIM_IER_OFFSET)
#define STM32L4_LPTIM1_CFGR (STM32L4_LPTIM1_BASE+STM32L4_LPTIM_CFGR_OFFSET)
#define STM32L4_LPTIM1_CR (STM32L4_LPTIM1_BASE+STM32L4_LPTIM_CR_OFFSET)
#define STM32L4_LPTIM1_CMP (STM32L4_LPTIM1_BASE+STM32L4_LPTIM_CMP_OFFSET)
#define STM32L4_LPTIM1_ARR (STM32L4_LPTIM1_BASE+STM32L4_LPTIM_ARR_OFFSET)
#define STM32L4_LPTIM1_CNT (STM32L4_LPTIM1_BASE+STM32L4_LPTIM_CNT_OFFSET)
#define STM32L4_LPTIM2_ISR (STM32L4_LPTIM2_BASE+STM32L4_LPTIM_ISR_OFFSET)
#define STM32L4_LPTIM2_ICR (STM32L4_LPTIM2_BASE+STM32L4_LPTIM_ICR_OFFSET)
#define STM32L4_LPTIM2_IER (STM32L4_LPTIM2_BASE+STM32L4_LPTIM_IER_OFFSET)
#define STM32L4_LPTIM2_CFGR (STM32L4_LPTIM2_BASE+STM32L4_LPTIM_CFGR_OFFSET)
#define STM32L4_LPTIM2_CR (STM32L4_LPTIM2_BASE+STM32L4_LPTIM_CR_OFFSET)
#define STM32L4_LPTIM2_CMP (STM32L4_LPTIM2_BASE+STM32L4_LPTIM_CMP_OFFSET)
#define STM32L4_LPTIM2_ARR (STM32L4_LPTIM2_BASE+STM32L4_LPTIM_ARR_OFFSET)
#define STM32L4_LPTIM2_CNT (STM32L4_LPTIM2_BASE+STM32L4_LPTIM_CNT_OFFSET)
/* Register Bitfield Definitions ********************************************************************/
#define LPTIM_CFGR_CKSEL (1 << 0) /* Bit 0: Clock selector */
#define LPTIM_CFGR_CKPOL_SHIFT (1) /* Bits 2-1: Clock Polarity */
#define LPTIM_CFGR_CKPOL_MASK (3 << LPTIM_CFGR_CKPOL_SHIFT)
#define LPTIM_CFGR_CKFLT_SHIFT (3) /* Bits 4-3: Digital filter for external clock */
#define LPTIM_CFGR_CKFLTN_MASK (3 << LPTIM_CFGR_CKFLT_SHIFT)
/* Bit 5: reserved */
#define LPTIM_CFGR_TRGFLT_SHIFT (6) /* Bits 7-6: Digital filter for trigger */
#define LPTIM_CFGR_TRGFLT_MASK (3 << LPTIM_CFGR_TRGFLT_SHIFT)
/* Bit 8: reserved */
#define LPTIM_CFGR_PRESC_SHIFT (9) /* Bits 11-9: clock pre-scaler */
#define LPTIM_CFGR_PRESC_MASK (7 << LPTIM_CFGR_PRESC_SHIFT)
# define LPTIM_CFGR_PRESCd1 (0 << LPTIM_CFGR_PRESC_SHIFT) /* 000: divide by 1 */
# define LPTIM_CFGR_PRESCd2 (1 << LPTIM_CFGR_PRESC_SHIFT) /* 001: divide by 2 */
# define LPTIM_CFGR_PRESCd4 (2 << LPTIM_CFGR_PRESC_SHIFT) /* 010: divide by 4 */
# define LPTIM_CFGR_PRESCd8 (3 << LPTIM_CFGR_PRESC_SHIFT) /* 011: divide by 8 */
# define LPTIM_CFGR_PRESCd16 (4 << LPTIM_CFGR_PRESC_SHIFT) /* 100: divide by 16 */
# define LPTIM_CFGR_PRESCd32 (5 << LPTIM_CFGR_PRESC_SHIFT) /* 101: divide by 32 */
# define LPTIM_CFGR_PRESCd64 (6 << LPTIM_CFGR_PRESC_SHIFT) /* 110: divide by 64 */
# define LPTIM_CFGR_PRESCd128 (7 << LPTIM_CFGR_PRESC_SHIFT) /* 111: divide by 128 */
/* Bit 12: reserved */
#define LPTIM_CFGR_TRIGSEL_SHIFT (13) /* Bits 15-13: Trigger selector */
#define LPTIM_CFGR_TRIGSEL_MASK (7 << LPTIM_CFGR_TRIGSEL_SHIFT)
/* Bit 16: reserved */
#define LPTIM_CFGR_TRIGEN_SHIFT (17) /* Bits 18-17: Trigger enable and polarity */
#define LPTIM_CFGR_TRIGEN_MASK (3 << LPTIM_CFGR_TRIGEN_SHIFT)
#define LPTIM_CFGR_TIMOUT (1 << 19) /* Bit 19: Timeout enable */
#define LPTIM_CFGR_WAVE (1 << 20) /* Bit 20: Waveform shape */
#define LPTIM_CFGR_WAVPOL (1 << 21) /* Bit 21: Waveform polarity */
#define LPTIM_CFGR_PRELOAD (1 << 22) /* Bit 22: Update mode enable */
#define LPTIM_CFGR_COUNTMODE (1 << 23) /* Bit 23: Count mode enable */
#define LPTIM_CFGR_ENC (1 << 24) /* Bit 24: Encoder mode enable (LPTIM1 only) */
#define LPTIM_CR_ENABLE (1 << 0) /* Bit 0: Enable */
#define LPTIM_CR_SNGSTRT (1 << 1) /* Bit 1: Single Mode */
#define LPTIM_CR_CNTSTRT (1 << 2) /* Bit 2: Continuous Mode */
#endif /* __ARCH_ARM_SRC_STM32L4_CHIP_STM32L4_LPTIM_H */
+3 -3
View File
@@ -33,8 +33,8 @@
*
************************************************************************************/
#ifndef __ARCH_ARM_SRC_STM32L4_CHIP_STM32_PINMAP_H
#define __ARCH_ARM_SRC_STM32L4_CHIP_STM32_PINMAP_H
#ifndef __ARCH_ARM_SRC_STM32L4_CHIP_STM32L4_PINMAP_H
#define __ARCH_ARM_SRC_STM32L4_CHIP_STM32L4_PINMAP_H
/************************************************************************************
* Included Files
@@ -49,5 +49,5 @@
# error "Unsupported STM32 L4 pin map"
#endif
#endif /* __ARCH_ARM_SRC_STM32L4_CHIP_STM32_PINMAP_H */
#endif /* __ARCH_ARM_SRC_STM32L4_CHIP_STM32L4_PINMAP_H */
+3 -3
View File
@@ -33,8 +33,8 @@
*
************************************************************************************/
#ifndef __ARCH_ARM_STC_STM32_CHIP_STM32L4_RNG_H
#define __ARCH_ARM_STC_STM32_CHIP_STM32L4_RNG_H
#ifndef __ARCH_ARM_STC_STM32L4_CHIP_STM32L4_RNG_H
#define __ARCH_ARM_STC_STM32L4_CHIP_STM32L4_RNG_H
/************************************************************************************
* Included Files
@@ -74,4 +74,4 @@
#define RNG_SR_CEIS (1 << 5) /* Bit 5: Clock error interrupt status */
#define RNG_SR_SEIS (1 << 6) /* Bit 6: Seed error interrupt status */
#endif /* __ARCH_ARM_STC_STM32_CHIP_STM32L4_RNG_H */
#endif /* __ARCH_ARM_STC_STM32L4_CHIP_STM32L4_RNG_H */
+3 -3
View File
@@ -33,8 +33,8 @@
*
************************************************************************************/
#ifndef __ARCH_ARM_STC_STM32_CHIP_STM32L4_SAI_H
#define __ARCH_ARM_STC_STM32_CHIP_STM32L4_SAI_H
#ifndef __ARCH_ARM_STC_STM32L4_CHIP_STM32L4_SAI_H
#define __ARCH_ARM_STC_STM32L4_CHIP_STM32L4_SAI_H
/************************************************************************************
* Included Files
@@ -256,4 +256,4 @@
/* SAI Data Register (32-bit data) */
#endif /* __ARCH_ARM_STC_STM32_CHIP_STM32L4_SAI_H */
#endif /* __ARCH_ARM_STC_STM32L4_CHIP_STM32L4_SAI_H */
File diff suppressed because it is too large Load Diff
+171
View File
@@ -0,0 +1,171 @@
/************************************************************************************
* arch/arm/src/stm32l4/stm32l4_lptim.h
*
* Copyright (C) 2011 Uros Platise. All rights reserved.
* Author: Uros Platise <uros.platise@isotel.eu>
*
* With modifications and updates by:
*
* Copyright (C) 2016 Motorola Mobility, LLC. All rights reserved.
* Copyright (C) 2011-2012, 2017 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
************************************************************************************/
/************************************************************************************
* Copyright (c) 2015 Google, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its
* may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
************************************************************************************/
#ifndef __ARCH_ARM_SRC_STM32L4_STM32L4_LPTIM_H
#define __ARCH_ARM_SRC_STM32L4_STM32L4_LPTIM_H
/************************************************************************************
* Included Files
************************************************************************************/
#include <nuttx/config.h>
#include "chip.h"
#include "chip/stm32l4_lptim.h"
/************************************************************************************
* Pre-processor Definitions
************************************************************************************/
/* Helpers **************************************************************************/
#define STM32L4_LPTIM_SETMODE(d,mode) ((d)->ops->setmode(d,mode))
#define STM32L4_LPTIM_SETCLOCK(d,freq) ((d)->ops->setclock(d,freq))
#define STM32L4_LPTIM_SETCHANNEL(d,ch,en) ((d)->ops->setchannel(d,ch,en))
/************************************************************************************
* Public Types
************************************************************************************/
#ifndef __ASSEMBLY__
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
/* LPTIM Device Structure */
struct stm32l4_lptim_dev_s
{
struct stm32l4_lptim_ops_s *ops;
};
/* LPTIM Modes of Operation */
typedef enum
{
STM32L4_LPTIM_MODE_UNUSED = -1,
/* MODES */
STM32L4_LPTIM_MODE_DISABLED = 0x0000,
STM32L4_LPTIM_MODE_SINGLE = 0x0001,
STM32L4_LPTIM_MODE_CONTINUOUS = 0x0002,
STM32L4_LPTIM_MODE_MASK = 0x003f,
} stm32l4_lptim_mode_t;
/* LPTIM Channel Modes */
typedef enum
{
STM32L4_LPTIM_CH_DISABLED = 0x0000,
/* CHANNELS */
STM32L4_LPTIM_CH_CHINVALID = 0x0000,
STM32L4_LPTIM_CH_CH1 = 0x0001,
STM32L4_LPTIM_CH_CH2 = 0x0002,
STM32L4_LPTIM_CH_CH3 = 0x0003,
STM32L4_LPTIM_CH_MASK = 0x000f,
} stm32l4_lptim_channel_t;
/* LPTIM Operations */
struct stm32l4_lptim_ops_s
{
int (*setmode)(FAR struct stm32l4_lptim_dev_s *dev, stm32l4_lptim_mode_t mode);
int (*setclock)(FAR struct stm32l4_lptim_dev_s *dev, uint32_t freq);
int (*setchannel)(FAR struct stm32l4_lptim_dev_s *dev,
stm32l4_lptim_channel_t channel, int enable);
};
/************************************************************************************
* Public Functions
************************************************************************************/
/* Get timer structure, power-up, reset, and mark it as used */
FAR struct stm32l4_lptim_dev_s *stm32l4_lptim_init(int timer);
/* Power-down timer, mark it as unused */
int stm32l4_lptim_deinit(FAR struct stm32l4_lptim_dev_s * dev);
#undef EXTERN
#if defined(__cplusplus)
}
#endif
#endif /* __ASSEMBLY__ */
#endif /* __ARCH_ARM_SRC_STM32L4_STM32L4_LPTIM_H */
+2 -3
View File
@@ -124,6 +124,5 @@ void stm32l4_usbsuspend(FAR struct usbdev_s *dev, bool resume);
#endif
#endif /* __ASSEMBLY__ */
#endif /* CONFIG_STM32_OTGFS */
#endif /* __ARCH_ARM_SRC_STM32_STM32_OTGFS_H */
#endif /* CONFIG_STM32L4_OTGFS */
#endif /* __ARCH_ARM_SRC_STM32L4_STM32L4_OTGFS_H */
+1 -1
View File
@@ -105,7 +105,7 @@
*
****************************************************************************/
#if defined(CONFIG_STM32_PWR) && defined(CONFIG_RTC)
#if defined(CONFIG_STM32L4_PWR) && defined(CONFIG_RTC)
static inline void rcc_resetbkp(void)
{
bool init_stat;
+3 -3
View File
@@ -54,8 +54,8 @@
* Pre-processor Definitions
****************************************************************************/
#define STM32_RTC_PRESCALER_SECOND 32767 /* Default prescaler to get a second base */
#define STM32_RTC_PRESCALER_MIN 1 /* Maximum speed of 16384 Hz */
#define STM32L4_RTC_PRESCALER_SECOND 32767 /* Default prescaler to get a second base */
#define STM32L4_RTC_PRESCALER_MIN 1 /* Maximum speed of 16384 Hz */
/****************************************************************************
* Public Types
@@ -146,7 +146,7 @@ bool rtc_is_inits(void);
*
****************************************************************************/
#ifdef CONFIG_STM32_HAVE_RTC_SUBSECONDS
#ifdef CONFIG_STM32L4_HAVE_RTC_SUBSECONDS
int stm32l4_rtc_getdatetime_with_subseconds(FAR struct tm *tp, FAR long *nsec);
#endif
+4 -4
View File
@@ -1750,8 +1750,8 @@ static int stm32l4serial_ioctl(FAR struct file *filep, int cmd,
irqstate_t flags;
flags = enter_critical_section();
cr1 = stm32l4serial_getreg(priv, STM32_USART_CR1_OFFSET);
stm32l4serial_putreg(priv, STM32_USART_CR1_OFFSET, cr1 | USART_CR1_SBK);
cr1 = stm32l4serial_getreg(priv, STM32L4_USART_CR1_OFFSET);
stm32l4serial_putreg(priv, STM32L4_USART_CR1_OFFSET, cr1 | USART_CR1_SBK);
leave_critical_section(flags);
}
break;
@@ -1762,8 +1762,8 @@ static int stm32l4serial_ioctl(FAR struct file *filep, int cmd,
irqstate_t flags;
flags = enter_critical_section();
cr1 = stm32l4serial_getreg(priv, STM32_USART_CR1_OFFSET);
stm32l4serial_putreg(priv, STM32_USART_CR1_OFFSET, cr1 & ~USART_CR1_SBK);
cr1 = stm32l4serial_getreg(priv, STM32L4_USART_CR1_OFFSET);
stm32l4serial_putreg(priv, STM32L4_USART_CR1_OFFSET, cr1 & ~USART_CR1_SBK);
leave_critical_section(flags);
}
break;