Add new STM32 driver files.
parent
f525e50307
commit
fb32554dc1
@ -0,0 +1,230 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file misc.c
|
||||||
|
* @author MCD Application Team
|
||||||
|
* @version V3.0.0
|
||||||
|
* @date 04/06/2009
|
||||||
|
* @brief This file provides all the miscellaneous firmware functions.
|
||||||
|
******************************************************************************
|
||||||
|
* @copy
|
||||||
|
*
|
||||||
|
* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
|
||||||
|
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
|
||||||
|
* TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
|
||||||
|
* DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
|
||||||
|
* FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
|
||||||
|
* CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
|
||||||
|
*
|
||||||
|
* <h2><center>© COPYRIGHT 2009 STMicroelectronics</center></h2>
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
#include "misc.h"
|
||||||
|
|
||||||
|
/** @addtogroup StdPeriph_Driver
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup MISC
|
||||||
|
* @brief MISC driver modules
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup MISC_Private_TypesDefinitions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup MISC_Private_Defines
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define AIRCR_VECTKEY_MASK ((uint32_t)0x05FA0000)
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup MISC_Private_Macros
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup MISC_Private_Variables
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup MISC_Private_FunctionPrototypes
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup MISC_Private_Functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Configures the priority grouping: pre-emption priority and
|
||||||
|
* subpriority.
|
||||||
|
* @param NVIC_PriorityGroup: specifies the priority grouping bits length.
|
||||||
|
* This parameter can be one of the following values:
|
||||||
|
* @arg NVIC_PriorityGroup_0: 0 bits for pre-emption priority
|
||||||
|
* 4 bits for subpriority
|
||||||
|
* @arg NVIC_PriorityGroup_1: 1 bits for pre-emption priority
|
||||||
|
* 3 bits for subpriority
|
||||||
|
* @arg NVIC_PriorityGroup_2: 2 bits for pre-emption priority
|
||||||
|
* 2 bits for subpriority
|
||||||
|
* @arg NVIC_PriorityGroup_3: 3 bits for pre-emption priority
|
||||||
|
* 1 bits for subpriority
|
||||||
|
* @arg NVIC_PriorityGroup_4: 4 bits for pre-emption priority
|
||||||
|
* 0 bits for subpriority
|
||||||
|
* @retval : None
|
||||||
|
*/
|
||||||
|
void NVIC_PriorityGroupConfig(uint32_t NVIC_PriorityGroup)
|
||||||
|
{
|
||||||
|
/* Check the parameters */
|
||||||
|
assert_param(IS_NVIC_PRIORITY_GROUP(NVIC_PriorityGroup));
|
||||||
|
|
||||||
|
/* Set the PRIGROUP[10:8] bits according to NVIC_PriorityGroup value */
|
||||||
|
SCB->AIRCR = AIRCR_VECTKEY_MASK | NVIC_PriorityGroup;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Initializes the NVIC peripheral according to the specified
|
||||||
|
* parameters in the NVIC_InitStruct.
|
||||||
|
* @param NVIC_InitStruct: pointer to a NVIC_InitTypeDef structure
|
||||||
|
* that contains the configuration information for the
|
||||||
|
* specified NVIC peripheral.
|
||||||
|
* @retval : None
|
||||||
|
*/
|
||||||
|
void NVIC_Init(NVIC_InitTypeDef* NVIC_InitStruct)
|
||||||
|
{
|
||||||
|
uint32_t tmppriority = 0x00, tmppre = 0x00, tmpsub = 0x0F;
|
||||||
|
|
||||||
|
/* Check the parameters */
|
||||||
|
assert_param(IS_FUNCTIONAL_STATE(NVIC_InitStruct->NVIC_IRQChannelCmd));
|
||||||
|
assert_param(IS_NVIC_PREEMPTION_PRIORITY(NVIC_InitStruct->NVIC_IRQChannelPreemptionPriority));
|
||||||
|
assert_param(IS_NVIC_SUB_PRIORITY(NVIC_InitStruct->NVIC_IRQChannelSubPriority));
|
||||||
|
|
||||||
|
if (NVIC_InitStruct->NVIC_IRQChannelCmd != DISABLE)
|
||||||
|
{
|
||||||
|
/* Compute the Corresponding IRQ Priority --------------------------------*/
|
||||||
|
tmppriority = (0x700 - ((SCB->AIRCR) & (uint32_t)0x700))>> 0x08;
|
||||||
|
tmppre = (0x4 - tmppriority);
|
||||||
|
tmpsub = tmpsub >> tmppriority;
|
||||||
|
|
||||||
|
tmppriority = (uint32_t)NVIC_InitStruct->NVIC_IRQChannelPreemptionPriority << tmppre;
|
||||||
|
tmppriority |= NVIC_InitStruct->NVIC_IRQChannelSubPriority & tmpsub;
|
||||||
|
tmppriority = tmppriority << 0x04;
|
||||||
|
|
||||||
|
NVIC->IP[NVIC_InitStruct->NVIC_IRQChannel] = tmppriority;
|
||||||
|
|
||||||
|
/* Enable the Selected IRQ Channels --------------------------------------*/
|
||||||
|
NVIC->ISER[NVIC_InitStruct->NVIC_IRQChannel >> 0x05] =
|
||||||
|
(uint32_t)0x01 << (NVIC_InitStruct->NVIC_IRQChannel & (uint8_t)0x1F);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Disable the Selected IRQ Channels -------------------------------------*/
|
||||||
|
NVIC->ICER[NVIC_InitStruct->NVIC_IRQChannel >> 0x05] =
|
||||||
|
(uint32_t)0x01 << (NVIC_InitStruct->NVIC_IRQChannel & (uint8_t)0x1F);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Sets the vector table location and Offset.
|
||||||
|
* @param NVIC_VectTab: specifies if the vector table is in RAM or
|
||||||
|
* FLASH memory.
|
||||||
|
* This parameter can be one of the following values:
|
||||||
|
* @arg NVIC_VectTab_RAM
|
||||||
|
* @arg NVIC_VectTab_FLASH
|
||||||
|
* @param Offset: Vector Table base offset field.
|
||||||
|
* This value must be a multiple of 0x100.
|
||||||
|
* @retval : None
|
||||||
|
*/
|
||||||
|
void NVIC_SetVectorTable(uint32_t NVIC_VectTab, uint32_t Offset)
|
||||||
|
{
|
||||||
|
/* Check the parameters */
|
||||||
|
assert_param(IS_NVIC_VECTTAB(NVIC_VectTab));
|
||||||
|
assert_param(IS_NVIC_OFFSET(Offset));
|
||||||
|
|
||||||
|
SCB->VTOR = NVIC_VectTab | (Offset & (uint32_t)0x1FFFFF80);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Selects the condition for the system to enter low power mode.
|
||||||
|
* @param LowPowerMode: Specifies the new mode for the system to enter
|
||||||
|
* low power mode.
|
||||||
|
* This parameter can be one of the following values:
|
||||||
|
* @arg NVIC_LP_SEVONPEND
|
||||||
|
* @arg NVIC_LP_SLEEPDEEP
|
||||||
|
* @arg NVIC_LP_SLEEPONEXIT
|
||||||
|
* @param NewState: new state of LP condition.
|
||||||
|
* This parameter can be: ENABLE or DISABLE.
|
||||||
|
* @retval : None
|
||||||
|
*/
|
||||||
|
void NVIC_SystemLPConfig(uint8_t LowPowerMode, FunctionalState NewState)
|
||||||
|
{
|
||||||
|
/* Check the parameters */
|
||||||
|
assert_param(IS_NVIC_LP(LowPowerMode));
|
||||||
|
assert_param(IS_FUNCTIONAL_STATE(NewState));
|
||||||
|
|
||||||
|
if (NewState != DISABLE)
|
||||||
|
{
|
||||||
|
SCB->SCR |= LowPowerMode;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SCB->SCR &= (uint32_t)(~(uint32_t)LowPowerMode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Configures the SysTick clock source.
|
||||||
|
* @param SysTick_CLKSource: specifies the SysTick clock source.
|
||||||
|
* This parameter can be one of the following values:
|
||||||
|
* @arg SysTick_CLKSource_HCLK_Div8: AHB clock divided by 8
|
||||||
|
* selected as SysTick clock source.
|
||||||
|
* @arg SysTick_CLKSource_HCLK: AHB clock selected as
|
||||||
|
* SysTick clock source.
|
||||||
|
* @retval : None
|
||||||
|
*/
|
||||||
|
void SysTick_CLKSourceConfig(uint32_t SysTick_CLKSource)
|
||||||
|
{
|
||||||
|
/* Check the parameters */
|
||||||
|
assert_param(IS_SYSTICK_CLK_SOURCE(SysTick_CLKSource));
|
||||||
|
if (SysTick_CLKSource == SysTick_CLKSource_HCLK)
|
||||||
|
{
|
||||||
|
SysTick->CTRL |= SysTick_CLKSource_HCLK;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SysTick->CTRL &= SysTick_CLKSource_HCLK_Div8;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/******************* (C) COPYRIGHT 2009 STMicroelectronics *****END OF FILE****/
|
@ -0,0 +1,164 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file stm32f10x_crc.c
|
||||||
|
* @author MCD Application Team
|
||||||
|
* @version V3.0.0
|
||||||
|
* @date 04/06/2009
|
||||||
|
* @brief This file provides all the CRC firmware functions.
|
||||||
|
******************************************************************************
|
||||||
|
* @copy
|
||||||
|
*
|
||||||
|
* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
|
||||||
|
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
|
||||||
|
* TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
|
||||||
|
* DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
|
||||||
|
* FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
|
||||||
|
* CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
|
||||||
|
*
|
||||||
|
* <h2><center>© COPYRIGHT 2009 STMicroelectronics</center></h2>
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
#include "stm32f10x_crc.h"
|
||||||
|
|
||||||
|
/** @addtogroup StdPeriph_Driver
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup CRC
|
||||||
|
* @brief CRC driver modules
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup CRC_Private_TypesDefinitions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup CRC_Private_Defines
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* CR register bit mask */
|
||||||
|
|
||||||
|
#define CR_RESET_Set ((uint32_t)0x00000001)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup CRC_Private_Macros
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup CRC_Private_Variables
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup CRC_Private_FunctionPrototypes
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup CRC_Private_Functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Resets the CRC Data register (DR).
|
||||||
|
* @param None
|
||||||
|
* @retval : None
|
||||||
|
*/
|
||||||
|
void CRC_ResetDR(void)
|
||||||
|
{
|
||||||
|
/* Reset CRC generator */
|
||||||
|
CRC->CR = CR_RESET_Set;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Computes the 32-bit CRC of a given data word(32-bit).
|
||||||
|
* @param Data: data word(32-bit) to compute its CRC
|
||||||
|
* @retval : 32-bit CRC
|
||||||
|
*/
|
||||||
|
uint32_t CRC_CalcCRC(uint32_t Data)
|
||||||
|
{
|
||||||
|
CRC->DR = Data;
|
||||||
|
|
||||||
|
return (CRC->DR);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Computes the 32-bit CRC of a given buffer of data word(32-bit).
|
||||||
|
* @param pBuffer: pointer to the buffer containing the data to be
|
||||||
|
* computed
|
||||||
|
* @param BufferLength: length of the buffer to be computed
|
||||||
|
* @retval : 32-bit CRC
|
||||||
|
*/
|
||||||
|
uint32_t CRC_CalcBlockCRC(uint32_t pBuffer[], uint32_t BufferLength)
|
||||||
|
{
|
||||||
|
uint32_t index = 0;
|
||||||
|
|
||||||
|
for(index = 0; index < BufferLength; index++)
|
||||||
|
{
|
||||||
|
CRC->DR = pBuffer[index];
|
||||||
|
}
|
||||||
|
return (CRC->DR);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Returns the current CRC value.
|
||||||
|
* @param None
|
||||||
|
* @retval : 32-bit CRC
|
||||||
|
*/
|
||||||
|
uint32_t CRC_GetCRC(void)
|
||||||
|
{
|
||||||
|
return (CRC->DR);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Stores a 8-bit data in the Independent Data(ID) register.
|
||||||
|
* @param IDValue: 8-bit value to be stored in the ID register
|
||||||
|
* @retval : None
|
||||||
|
*/
|
||||||
|
void CRC_SetIDRegister(uint8_t IDValue)
|
||||||
|
{
|
||||||
|
CRC->IDR = IDValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Returns the 8-bit data stored in the Independent Data(ID) register
|
||||||
|
* @param None
|
||||||
|
* @retval : 8-bit value of the ID register
|
||||||
|
*/
|
||||||
|
uint8_t CRC_GetIDRegister(void)
|
||||||
|
{
|
||||||
|
return (CRC->IDR);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/******************* (C) COPYRIGHT 2009 STMicroelectronics *****END OF FILE****/
|
@ -0,0 +1,412 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file stm32f10x_dac.c
|
||||||
|
* @author MCD Application Team
|
||||||
|
* @version V3.0.0
|
||||||
|
* @date 04/06/2009
|
||||||
|
* @brief This file provides all the DAC firmware functions.
|
||||||
|
******************************************************************************
|
||||||
|
* @copy
|
||||||
|
*
|
||||||
|
* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
|
||||||
|
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
|
||||||
|
* TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
|
||||||
|
* DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
|
||||||
|
* FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
|
||||||
|
* CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
|
||||||
|
*
|
||||||
|
* <h2><center>© COPYRIGHT 2009 STMicroelectronics</center></h2>
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
#include "stm32f10x_dac.h"
|
||||||
|
#include "stm32f10x_rcc.h"
|
||||||
|
|
||||||
|
/** @addtogroup StdPeriph_Driver
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup DAC
|
||||||
|
* @brief DAC driver modules
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup DAC_Private_TypesDefinitions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup DAC_Private_Defines
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* DAC EN mask */
|
||||||
|
#define CR_EN_Set ((uint32_t)0x00000001)
|
||||||
|
|
||||||
|
/* DAC DMAEN mask */
|
||||||
|
#define CR_DMAEN_Set ((uint32_t)0x00001000)
|
||||||
|
|
||||||
|
/* CR register Mask */
|
||||||
|
#define CR_CLEAR_Mask ((uint32_t)0x00000FFE)
|
||||||
|
|
||||||
|
/* DAC SWTRIG mask */
|
||||||
|
#define SWTRIGR_SWTRIG_Set ((uint32_t)0x00000001)
|
||||||
|
|
||||||
|
/* DAC Dual Channels SWTRIG masks */
|
||||||
|
#define DUAL_SWTRIG_Set ((uint32_t)0x00000003)
|
||||||
|
#define DUAL_SWTRIG_Reset ((uint32_t)0xFFFFFFFC)
|
||||||
|
|
||||||
|
/* DHR registers offsets */
|
||||||
|
#define DHR12R1_Offset ((uint32_t)0x00000008)
|
||||||
|
#define DHR12R2_Offset ((uint32_t)0x00000014)
|
||||||
|
#define DHR12RD_Offset ((uint32_t)0x00000020)
|
||||||
|
|
||||||
|
/* DOR register offset */
|
||||||
|
#define DOR_Offset ((uint32_t)0x0000002C)
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup DAC_Private_Macros
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup DAC_Private_Variables
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup DAC_Private_FunctionPrototypes
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup DAC_Private_Functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Deinitializes the DAC peripheral registers to their default
|
||||||
|
* reset values.
|
||||||
|
* @param None
|
||||||
|
* @retval : None
|
||||||
|
*/
|
||||||
|
void DAC_DeInit(void)
|
||||||
|
{
|
||||||
|
/* Enable DAC reset state */
|
||||||
|
RCC_APB1PeriphResetCmd(RCC_APB1Periph_DAC, ENABLE);
|
||||||
|
/* Release DAC from reset state */
|
||||||
|
RCC_APB1PeriphResetCmd(RCC_APB1Periph_DAC, DISABLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Initializes the DAC peripheral according to the specified
|
||||||
|
* parameters in the DAC_InitStruct.
|
||||||
|
* @param DAC_Channel: the selected DAC channel.
|
||||||
|
* This parameter can be one of the following values:
|
||||||
|
* @arg DAC_Channel_1: DAC Channel1 selected
|
||||||
|
* @arg DAC_Channel_2: DAC Channel2 selected
|
||||||
|
* @param DAC_InitStruct: pointer to a DAC_InitTypeDef structure that
|
||||||
|
* contains the configuration information for the specified
|
||||||
|
* DAC channel.
|
||||||
|
* @retval : None
|
||||||
|
*/
|
||||||
|
void DAC_Init(uint32_t DAC_Channel, DAC_InitTypeDef* DAC_InitStruct)
|
||||||
|
{
|
||||||
|
uint32_t tmpreg1 = 0, tmpreg2 = 0;
|
||||||
|
/* Check the DAC parameters */
|
||||||
|
assert_param(IS_DAC_TRIGGER(DAC_InitStruct->DAC_Trigger));
|
||||||
|
assert_param(IS_DAC_GENERATE_WAVE(DAC_InitStruct->DAC_WaveGeneration));
|
||||||
|
assert_param(IS_DAC_LFSR_UNMASK_TRIANGLE_AMPLITUDE(DAC_InitStruct->DAC_LFSRUnmask_TriangleAmplitude));
|
||||||
|
assert_param(IS_DAC_OUTPUT_BUFFER_STATE(DAC_InitStruct->DAC_OutputBuffer));
|
||||||
|
/*---------------------------- DAC CR Configuration --------------------------*/
|
||||||
|
/* Get the DAC CR value */
|
||||||
|
tmpreg1 = DAC->CR;
|
||||||
|
/* Clear BOFFx, TENx, TSELx, WAVEx and MAMPx bits */
|
||||||
|
tmpreg1 &= ~(CR_CLEAR_Mask << DAC_Channel);
|
||||||
|
/* Configure for the selected DAC channel: buffer output, trigger, wave genration,
|
||||||
|
mask/amplitude for wave genration */
|
||||||
|
/* Set TSELx and TENx bits according to DAC_Trigger value */
|
||||||
|
/* Set WAVEx bits according to DAC_WaveGeneration value */
|
||||||
|
/* Set MAMPx bits according to DAC_LFSRUnmask_TriangleAmplitude value */
|
||||||
|
/* Set BOFFx bit according to DAC_OutputBuffer value */
|
||||||
|
tmpreg2 = (DAC_InitStruct->DAC_Trigger | DAC_InitStruct->DAC_WaveGeneration |
|
||||||
|
DAC_InitStruct->DAC_LFSRUnmask_TriangleAmplitude | DAC_InitStruct->DAC_OutputBuffer);
|
||||||
|
/* Calculate CR register value depending on DAC_Channel */
|
||||||
|
tmpreg1 |= tmpreg2 << DAC_Channel;
|
||||||
|
/* Write to DAC CR */
|
||||||
|
DAC->CR = tmpreg1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Fills each DAC_InitStruct member with its default value.
|
||||||
|
* @param DAC_InitStruct : pointer to a DAC_InitTypeDef structure
|
||||||
|
* which will be initialized.
|
||||||
|
* @retval : None
|
||||||
|
*/
|
||||||
|
void DAC_StructInit(DAC_InitTypeDef* DAC_InitStruct)
|
||||||
|
{
|
||||||
|
/*--------------- Reset DAC init structure parameters values -----------------*/
|
||||||
|
/* Initialize the DAC_Trigger member */
|
||||||
|
DAC_InitStruct->DAC_Trigger = DAC_Trigger_None;
|
||||||
|
/* Initialize the DAC_WaveGeneration member */
|
||||||
|
DAC_InitStruct->DAC_WaveGeneration = DAC_WaveGeneration_None;
|
||||||
|
/* Initialize the DAC_LFSRUnmask_TriangleAmplitude member */
|
||||||
|
DAC_InitStruct->DAC_LFSRUnmask_TriangleAmplitude = DAC_LFSRUnmask_Bit0;
|
||||||
|
/* Initialize the DAC_OutputBuffer member */
|
||||||
|
DAC_InitStruct->DAC_OutputBuffer = DAC_OutputBuffer_Enable;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Enables or disables the specified DAC channel.
|
||||||
|
* @param DAC_Channel: the selected DAC channel.
|
||||||
|
* This parameter can be one of the following values:
|
||||||
|
* @arg DAC_Channel_1: DAC Channel1 selected
|
||||||
|
* @arg DAC_Channel_2: DAC Channel2 selected
|
||||||
|
* @param NewState: new state of the DAC channel.
|
||||||
|
* This parameter can be: ENABLE or DISABLE.
|
||||||
|
* @retval : None
|
||||||
|
*/
|
||||||
|
void DAC_Cmd(uint32_t DAC_Channel, FunctionalState NewState)
|
||||||
|
{
|
||||||
|
/* Check the parameters */
|
||||||
|
assert_param(IS_DAC_CHANNEL(DAC_Channel));
|
||||||
|
assert_param(IS_FUNCTIONAL_STATE(NewState));
|
||||||
|
if (NewState != DISABLE)
|
||||||
|
{
|
||||||
|
/* Enable the selected DAC channel */
|
||||||
|
DAC->CR |= CR_EN_Set << DAC_Channel;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Disable the selected DAC channel */
|
||||||
|
DAC->CR &= ~(CR_EN_Set << DAC_Channel);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Enables or disables the specified DAC channel DMA request.
|
||||||
|
* @param DAC_Channel: the selected DAC channel.
|
||||||
|
* This parameter can be one of the following values:
|
||||||
|
* @arg DAC_Channel_1: DAC Channel1 selected
|
||||||
|
* @arg DAC_Channel_2: DAC Channel2 selected
|
||||||
|
* @param NewState: new state of the selected DAC channel DMA request.
|
||||||
|
* This parameter can be: ENABLE or DISABLE.
|
||||||
|
* @retval : None
|
||||||
|
*/
|
||||||
|
void DAC_DMACmd(uint32_t DAC_Channel, FunctionalState NewState)
|
||||||
|
{
|
||||||
|
/* Check the parameters */
|
||||||
|
assert_param(IS_DAC_CHANNEL(DAC_Channel));
|
||||||
|
assert_param(IS_FUNCTIONAL_STATE(NewState));
|
||||||
|
if (NewState != DISABLE)
|
||||||
|
{
|
||||||
|
/* Enable the selected DAC channel DMA request */
|
||||||
|
DAC->CR |= CR_DMAEN_Set << DAC_Channel;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Disable the selected DAC channel DMA request */
|
||||||
|
DAC->CR &= ~(CR_DMAEN_Set << DAC_Channel);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Enables or disables the selected DAC channel software trigger.
|
||||||
|
* @param DAC_Channel: the selected DAC channel.
|
||||||
|
* This parameter can be one of the following values:
|
||||||
|
* @arg DAC_Channel_1: DAC Channel1 selected
|
||||||
|
* @arg DAC_Channel_2: DAC Channel2 selected
|
||||||
|
* @param NewState: new state of the selected DAC channel software trigger.
|
||||||
|
* This parameter can be: ENABLE or DISABLE.
|
||||||
|
* @retval : None
|
||||||
|
*/
|
||||||
|
void DAC_SoftwareTriggerCmd(uint32_t DAC_Channel, FunctionalState NewState)
|
||||||
|
{
|
||||||
|
/* Check the parameters */
|
||||||
|
assert_param(IS_DAC_CHANNEL(DAC_Channel));
|
||||||
|
assert_param(IS_FUNCTIONAL_STATE(NewState));
|
||||||
|
if (NewState != DISABLE)
|
||||||
|
{
|
||||||
|
/* Enable software trigger for the selected DAC channel */
|
||||||
|
DAC->SWTRIGR |= SWTRIGR_SWTRIG_Set << (DAC_Channel >> 4);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Disable software trigger for the selected DAC channel */
|
||||||
|
DAC->SWTRIGR &= ~(SWTRIGR_SWTRIG_Set << (DAC_Channel >> 4));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Enables or disables simultaneously the two DAC channels software
|
||||||
|
* triggers.
|
||||||
|
* @param NewState: new state of the DAC channels software triggers.
|
||||||
|
* This parameter can be: ENABLE or DISABLE.
|
||||||
|
* @retval : None
|
||||||
|
*/
|
||||||
|
void DAC_DualSoftwareTriggerCmd(FunctionalState NewState)
|
||||||
|
{
|
||||||
|
/* Check the parameters */
|
||||||
|
assert_param(IS_FUNCTIONAL_STATE(NewState));
|
||||||
|
if (NewState != DISABLE)
|
||||||
|
{
|
||||||
|
/* Enable software trigger for both DAC channels */
|
||||||
|
DAC->SWTRIGR |= DUAL_SWTRIG_Set ;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Disable software trigger for both DAC channels */
|
||||||
|
DAC->SWTRIGR &= DUAL_SWTRIG_Reset;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Enables or disables the selected DAC channel wave generation.
|
||||||
|
* @param DAC_Channel: the selected DAC channel.
|
||||||
|
* This parameter can be one of the following values:
|
||||||
|
* @arg DAC_Channel_1: DAC Channel1 selected
|
||||||
|
* @arg DAC_Channel_2: DAC Channel2 selected
|
||||||
|
* @param DAC_Wave: Specifies the wave type to enable or disable.
|
||||||
|
* This parameter can be one of the following values:
|
||||||
|
* @arg DAC_Wave_Noise: noise wave generation
|
||||||
|
* @arg DAC_Wave_Triangle: triangle wave generation
|
||||||
|
* @param NewState: new state of the selected DAC channel wave generation.
|
||||||
|
* This parameter can be: ENABLE or DISABLE.
|
||||||
|
* @retval : None
|
||||||
|
*/
|
||||||
|
void DAC_WaveGenerationCmd(uint32_t DAC_Channel, uint32_t DAC_Wave, FunctionalState NewState)
|
||||||
|
{
|
||||||
|
/* Check the parameters */
|
||||||
|
assert_param(IS_DAC_CHANNEL(DAC_Channel));
|
||||||
|
assert_param(IS_DAC_WAVE(DAC_Wave));
|
||||||
|
assert_param(IS_FUNCTIONAL_STATE(NewState));
|
||||||
|
if (NewState != DISABLE)
|
||||||
|
{
|
||||||
|
/* Enable the selected wave generation for the selected DAC channel */
|
||||||
|
DAC->CR |= DAC_Wave << DAC_Channel;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Disable the selected wave generation for the selected DAC channel */
|
||||||
|
DAC->CR &= ~(DAC_Wave << DAC_Channel);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Set the specified data holding register value for DAC channel1.
|
||||||
|
* @param DAC_Align: Specifies the data alignement for DAC channel1.
|
||||||
|
* This parameter can be one of the following values:
|
||||||
|
* @arg DAC_Align_8b_R: 8bit right data alignement selected
|
||||||
|
* @arg DAC_Align_12b_L: 12bit left data alignement selected
|
||||||
|
* @arg DAC_Align_12b_R: 12bit right data alignement selected
|
||||||
|
* @param Data : Data to be loaded in the selected data holding
|
||||||
|
* register.
|
||||||
|
* @retval : None
|
||||||
|
*/
|
||||||
|
void DAC_SetChannel1Data(uint32_t DAC_Align, uint16_t Data)
|
||||||
|
{
|
||||||
|
/* Check the parameters */
|
||||||
|
assert_param(IS_DAC_ALIGN(DAC_Align));
|
||||||
|
assert_param(IS_DAC_DATA(Data));
|
||||||
|
/* Set the DAC channel1 selected data holding register */
|
||||||
|
*((__IO uint32_t *)(DAC_BASE + DHR12R1_Offset + DAC_Align)) = (uint32_t)Data;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Set the specified data holding register value for DAC channel2.
|
||||||
|
* @param DAC_Align: Specifies the data alignement for DAC channel2.
|
||||||
|
* This parameter can be one of the following values:
|
||||||
|
* @arg DAC_Align_8b_R: 8bit right data alignement selected
|
||||||
|
* @arg DAC_Align_12b_L: 12bit left data alignement selected
|
||||||
|
* @arg DAC_Align_12b_R: 12bit right data alignement selected
|
||||||
|
* @param Data : Data to be loaded in the selected data holding
|
||||||
|
* register.
|
||||||
|
* @retval : None
|
||||||
|
*/
|
||||||
|
void DAC_SetChannel2Data(uint32_t DAC_Align, uint16_t Data)
|
||||||
|
{
|
||||||
|
/* Check the parameters */
|
||||||
|
assert_param(IS_DAC_ALIGN(DAC_Align));
|
||||||
|
assert_param(IS_DAC_DATA(Data));
|
||||||
|
/* Set the DAC channel2 selected data holding register */
|
||||||
|
*((__IO uint32_t *)(DAC_BASE + DHR12R2_Offset + DAC_Align)) = (uint32_t)Data;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Set the specified data holding register value for dual channel
|
||||||
|
* DAC.
|
||||||
|
* @param DAC_Align: Specifies the data alignement for dual channel DAC.
|
||||||
|
* This parameter can be one of the following values:
|
||||||
|
* @arg DAC_Align_8b_R: 8bit right data alignement selected
|
||||||
|
* @arg DAC_Align_12b_L: 12bit left data alignement selected
|
||||||
|
* @arg DAC_Align_12b_R: 12bit right data alignement selected
|
||||||
|
* @param Data2: Data for DAC Channel2 to be loaded in the selected data
|
||||||
|
* holding register.
|
||||||
|
* @param Data1: Data for DAC Channel1 to be loaded in the selected data
|
||||||
|
* holding register.
|
||||||
|
* @retval : None
|
||||||
|
*/
|
||||||
|
void DAC_SetDualChannelData(uint32_t DAC_Align, uint16_t Data2, uint16_t Data1)
|
||||||
|
{
|
||||||
|
uint32_t data = 0;
|
||||||
|
/* Check the parameters */
|
||||||
|
assert_param(IS_DAC_ALIGN(DAC_Align));
|
||||||
|
assert_param(IS_DAC_DATA(Data1));
|
||||||
|
assert_param(IS_DAC_DATA(Data2));
|
||||||
|
|
||||||
|
/* Calculate and set dual DAC data holding register value */
|
||||||
|
if (DAC_Align == DAC_Align_8b_R)
|
||||||
|
{
|
||||||
|
data = ((uint32_t)Data2 << 8) | Data1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
data = ((uint32_t)Data2 << 16) | Data1;
|
||||||
|
}
|
||||||
|
/* Set the dual DAC selected data holding register */
|
||||||
|
*((__IO uint32_t *)(DAC_BASE + DHR12RD_Offset + DAC_Align)) = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Returns the last data output value of the selected DAC cahnnel.
|
||||||
|
* @param DAC_Channel: the selected DAC channel.
|
||||||
|
* This parameter can be one of the following values:
|
||||||
|
* @arg DAC_Channel_1: DAC Channel1 selected
|
||||||
|
* @arg DAC_Channel_2: DAC Channel2 selected
|
||||||
|
* @retval : The selected DAC channel data output value.
|
||||||
|
*/
|
||||||
|
uint16_t DAC_GetDataOutputValue(uint32_t DAC_Channel)
|
||||||
|
{
|
||||||
|
/* Check the parameters */
|
||||||
|
assert_param(IS_DAC_CHANNEL(DAC_Channel));
|
||||||
|
/* Returns the DAC channel data output register value */
|
||||||
|
return (uint16_t) (*(__IO uint32_t*)(DAC_BASE + DOR_Offset + ((uint32_t)DAC_Channel >> 2)));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/******************* (C) COPYRIGHT 2009 STMicroelectronics *****END OF FILE****/
|
@ -0,0 +1,152 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file stm32f10x_dbgmcu.c
|
||||||
|
* @author MCD Application Team
|
||||||
|
* @version V3.0.0
|
||||||
|
* @date 04/06/2009
|
||||||
|
* @brief This file provides all the DBGMCU firmware functions.
|
||||||
|
******************************************************************************
|
||||||
|
* @copy
|
||||||
|
*
|
||||||
|
* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
|
||||||
|
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
|
||||||
|
* TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
|
||||||
|
* DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
|
||||||
|
* FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
|
||||||
|
* CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
|
||||||
|
*
|
||||||
|
* <h2><center>© COPYRIGHT 2009 STMicroelectronics</center></h2>
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
#include "stm32f10x_dbgmcu.h"
|
||||||
|
|
||||||
|
/** @addtogroup StdPeriph_Driver
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup DBGMCU
|
||||||
|
* @brief DBGMCU driver modules
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup DBGMCU_Private_TypesDefinitions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup DBGMCU_Private_Defines
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define IDCODE_DEVID_Mask ((uint32_t)0x00000FFF)
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup DBGMCU_Private_Macros
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup DBGMCU_Private_Variables
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup DBGMCU_Private_FunctionPrototypes
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup DBGMCU_Private_Functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Returns the device revision identifier.
|
||||||
|
* @param None
|
||||||
|
* @retval : Device revision identifier
|
||||||
|
*/
|
||||||
|
uint32_t DBGMCU_GetREVID(void)
|
||||||
|
{
|
||||||
|
return(DBGMCU->IDCODE >> 16);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Returns the device identifier.
|
||||||
|
* @param None
|
||||||
|
* @retval : Device identifier
|
||||||
|
*/
|
||||||
|
uint32_t DBGMCU_GetDEVID(void)
|
||||||
|
{
|
||||||
|
return(DBGMCU->IDCODE & IDCODE_DEVID_Mask);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Configures the specified peripheral and low power mode behavior
|
||||||
|
* when the MCU under Debug mode.
|
||||||
|
* @param DBGMCU_Periph: specifies the peripheral and low power mode.
|
||||||
|
* This parameter can be any combination of the following values:
|
||||||
|
* @arg DBGMCU_SLEEP: Keep debugger connection during SLEEP mode
|
||||||
|
* @arg DBGMCU_STOP: Keep debugger connection during STOP mode
|
||||||
|
* @arg DBGMCU_STANDBY: Keep debugger connection during STANDBY mode
|
||||||
|
* @arg DBGMCU_IWDG_STOP: Debug IWDG stopped when Core is halted
|
||||||
|
* @arg DBGMCU_WWDG_STOP: Debug WWDG stopped when Core is halted
|
||||||
|
* @arg DBGMCU_TIM1_STOP: TIM1 counter stopped when Core is halted
|
||||||
|
* @arg DBGMCU_TIM2_STOP: TIM2 counter stopped when Core is halted
|
||||||
|
* @arg DBGMCU_TIM3_STOP: TIM3 counter stopped when Core is halted
|
||||||
|
* @arg DBGMCU_TIM4_STOP: TIM4 counter stopped when Core is halted
|
||||||
|
* @arg DBGMCU_CAN1_STOP: Debug CAN 1 stopped when Core is halted
|
||||||
|
* @arg DBGMCU_I2C1_SMBUS_TIMEOUT: I2C1 SMBUS timeout mode stopped when Core is
|
||||||
|
* halted
|
||||||
|
* @arg DBGMCU_I2C2_SMBUS_TIMEOUT: I2C2 SMBUS timeout mode stopped when Core is
|
||||||
|
* halted
|
||||||
|
* @arg DBGMCU_TIM5_STOP: TIM5 counter stopped when Core is halted
|
||||||
|
* @arg DBGMCU_TIM6_STOP: TIM6 counter stopped when Core is halted
|
||||||
|
* @arg DBGMCU_TIM7_STOP: TIM7 counter stopped when Core is halted
|
||||||
|
* @arg DBGMCU_TIM8_STOP: TIM8 counter stopped when Core is halted
|
||||||
|
* @param NewState: new state of the specified peripheral in Debug mode.
|
||||||
|
* This parameter can be: ENABLE or DISABLE.
|
||||||
|
* @retval : None
|
||||||
|
*/
|
||||||
|
void DBGMCU_Config(uint32_t DBGMCU_Periph, FunctionalState NewState)
|
||||||
|
{
|
||||||
|
/* Check the parameters */
|
||||||
|
assert_param(IS_DBGMCU_PERIPH(DBGMCU_Periph));
|
||||||
|
assert_param(IS_FUNCTIONAL_STATE(NewState));
|
||||||
|
if (NewState != DISABLE)
|
||||||
|
{
|
||||||
|
DBGMCU->CR |= DBGMCU_Periph;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DBGMCU->CR &= ~DBGMCU_Periph;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/******************* (C) COPYRIGHT 2009 STMicroelectronics *****END OF FILE****/
|
Loading…
Reference in New Issue