您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ DAC_Cmd函数代码示例

51自学网 2021-06-01 20:17:30
  C++
这篇教程C++ DAC_Cmd函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中DAC_Cmd函数的典型用法代码示例。如果您正苦于以下问题:C++ DAC_Cmd函数的具体用法?C++ DAC_Cmd怎么用?C++ DAC_Cmd使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了DAC_Cmd函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: DAC_ConfigurationInit

void DAC_ConfigurationInit(){	DAC_InitTypeDef DAC_InitStruct;	GPIO_InitTypeDef GPIO_InitStruct;	RCC_APB2PeriphClockCmd( RCC_APB2Periph_GPIOA, ENABLE );	RCC_APB1PeriphClockCmd( RCC_APB1Periph_DAC, ENABLE );        	GPIO_InitStruct.GPIO_Pin = GPIO_Pin_4;	GPIO_InitStruct.GPIO_Mode = GPIO_Mode_Out_PP;	GPIO_InitStruct.GPIO_Speed = GPIO_Speed_50MHz;	GPIO_Init( GPIOA, &GPIO_InitStruct );	GPIO_InitStruct.GPIO_Pin = GPIO_Pin_5;	GPIO_InitStruct.GPIO_Mode = GPIO_Mode_AIN;	GPIO_InitStruct.GPIO_Speed = GPIO_Speed_50MHz;	GPIO_Init( GPIOA, &GPIO_InitStruct );	DAC_InitStruct.DAC_Trigger = DAC_Trigger_Software;	DAC_InitStruct.DAC_WaveGeneration = DAC_WaveGeneration_None;	DAC_InitStruct.DAC_LFSRUnmask_TriangleAmplitude = DAC_LFSRUnmask_Bit0;	DAC_InitStruct.DAC_OutputBuffer = DAC_OutputBuffer_Disable;	DAC_Init( DAC_Channel_1, &DAC_InitStruct );	DAC_Init( DAC_Channel_2, &DAC_InitStruct );	DAC_Cmd( DAC_Channel_1, ENABLE );	DAC_Cmd( DAC_Channel_2, ENABLE );	DAC_SetChannel1Data( DAC_Align_12b_R, 0X0fFF);	DAC_SoftwareTriggerCmd( DAC_Channel_1, ENABLE );	DAC_SetChannel1Data( DAC_Align_12b_R, 0X03FF);	DAC_SoftwareTriggerCmd( DAC_Channel_2, ENABLE );}
开发者ID:RTOS-Developers,项目名称:TRTOS,代码行数:35,


示例2: DAC_Noise_TriangleConfig

/**  * @brief  DAC Channel2 Triangle and Channel1 Noise Configuration  * @param  None  * @retval None  */static void DAC_Noise_TriangleConfig(void){  /* DAC channel2 Configuration */  DAC_InitStructure.DAC_Trigger = DAC_Trigger_T2_TRGO;  DAC_InitStructure.DAC_WaveGeneration = DAC_WaveGeneration_Triangle;  DAC_InitStructure.DAC_LFSRUnmask_TriangleAmplitude = DAC_TriangleAmplitude_1023;  DAC_InitStructure.DAC_OutputBuffer = DAC_OutputBuffer_Enable;  DAC_Init(DAC_Channel_2, &DAC_InitStructure);    /* Enable DAC Channel2 */  DAC_Cmd(DAC_Channel_2, ENABLE);    /* Set DAC channel2 DHR12RD register */  DAC_SetChannel2Data(DAC_Align_12b_R, 0x100);     /* DAC channel1 Configuration */  DAC_InitStructure.DAC_Trigger = DAC_Trigger_T2_TRGO;  DAC_InitStructure.DAC_WaveGeneration = DAC_WaveGeneration_Noise;  DAC_InitStructure.DAC_LFSRUnmask_TriangleAmplitude = DAC_LFSRUnmask_Bits10_0;  DAC_InitStructure.DAC_OutputBuffer = DAC_OutputBuffer_Enable;  DAC_Init(DAC_Channel_1, &DAC_InitStructure);    /* Enable DAC Channel1 */  DAC_Cmd(DAC_Channel_1, ENABLE);    /* Set DAC Channel1 DHR12L register */  DAC_SetChannel1Data(DAC_Align_12b_L, 0x7FF0);}
开发者ID:zegervdv,项目名称:PS2-controller,代码行数:33,


示例3: init_DACs

void init_DACs(void){    // Now to output to some pin ofcourse, PA4 for example (routed to audio PA)    //  Enable clock to GPIOA    RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA, ENABLE);    // Init the pins    GPIO_InitTypeDef GPIOInit = {0, };    GPIOInit.GPIO_Pin	= GPIO_Pin_4 | GPIO_Pin_5; // PA4    GPIOInit.GPIO_Mode	= GPIO_Mode_AN; // Analog function    GPIOInit.GPIO_PuPd	= GPIO_PuPd_NOPULL;        GPIO_Init(GPIOA, &GPIOInit);    // Enable the clock to the DAC    RCC_APB1PeriphClockCmd(RCC_APB1Periph_DAC, ENABLE);    DAC_InitTypeDef dacInit;    memset( (void *)&dacInit, 0, sizeof(DAC_InitTypeDef) );    dacInit.DAC_Trigger = DAC_Trigger_None;    dacInit.DAC_OutputBuffer = DAC_OutputBuffer_Disable;        DAC_Init(DAC_Channel_1, &dacInit);    DAC_Cmd(DAC_Channel_1, ENABLE);    DAC_Init(DAC_Channel_2, &dacInit);    DAC_Cmd(DAC_Channel_2, ENABLE);}
开发者ID:mathiashelsen,项目名称:stm32-playground,代码行数:27,


示例4: DAC_Config

/**  * @brief  Configures DAC channel 1 and channel 2  * @param  None  * @retval None  */void DAC_Config(void){  /* Enable GPIOA Periph clock --------------------------------------*/  RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE);  /* Configure PA.04 (DAC_OUT1), PA.05 (DAC_OUT2) as analog */  GPIO_InitStructure.GPIO_Pin =  GPIO_Pin_4 | GPIO_Pin_5;  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AN;  GPIO_Init(GPIOA, &GPIO_InitStructure);  /* DAC Periph clock enable */  RCC_APB1PeriphClockCmd(RCC_APB1Periph_DAC, ENABLE);  /* DAC init struct configuration */  DAC_InitStructure.DAC_Trigger = DAC_Trigger_T2_TRGO;  DAC_InitStructure.DAC_WaveGeneration = DAC_WaveGeneration_None;  DAC_InitStructure.DAC_OutputBuffer = DAC_OutputBuffer_Enable;  /* DAC channel1 Configuration */  DAC_Init(DAC_Channel_1, &DAC_InitStructure);  /* DAC channel2 Configuration */  DAC_Init(DAC_Channel_2, &DAC_InitStructure);  /* Enable DAC Channel1: Once the DAC channel1 is enabled, PA.04 is      automatically connected to the DAC converter. */  DAC_Cmd(DAC_Channel_1, ENABLE);    /* Enable DAC Channel2: Once the DAC channel2 is enabled, PA.05 is      automatically connected to the DAC converter. */  DAC_Cmd(DAC_Channel_2, ENABLE);  /* Enable DMA for DAC Channel2 */  DAC_DMACmd(DAC_Channel_2, ENABLE);}
开发者ID:RTOS-Developers,项目名称:TRTOS,代码行数:39,


示例5: setup_dac

void setup_dac(){#if isUsingDevBoard	//Setup GPIO	RCC_APB1PeriphClockCmd(RCC_APB1Periph_DAC, ENABLE);	DAC_InitTypeDef DAC_InitStructure;	/* DAC channel1 Configuration */	DAC_InitStructure.DAC_Trigger = DAC_Trigger_None;	DAC_InitStructure.DAC_WaveGeneration = DAC_WaveGeneration_None;	DAC_InitStructure.DAC_LFSRUnmask_TriangleAmplitude = DAC_LFSRUnmask_Bits10_0;	DAC_InitStructure.DAC_OutputBuffer = DAC_OutputBuffer_Enable;	DAC_Init(DAC_Channel_1, &DAC_InitStructure);	DAC_Init(DAC_Channel_2, &DAC_InitStructure);	/* Enable DAC Channel1 */	DAC_Cmd(DAC_Channel_1, ENABLE);	DAC_Cmd(DAC_Channel_2, ENABLE);	/* Set DAC Channel1 DHR12L register */	DAC_SetChannel1Data(DAC_Align_8b_R, 0x0000);	DAC_SetChannel2Data(DAC_Align_8b_R, 0x0000);#else#endif}
开发者ID:AjRyan1,项目名称:WPI_LulzMouse-2.0,代码行数:32,


示例6: main

/**  * @brief   Main program.  * @param  None  * @retval None  */int main(void){  /*!< At this stage the microcontroller clock setting is already configured,       this is done through SystemInit() function which is called from startup       file (startup_stm32f10x_xx.s) before to branch to application main.       To reconfigure the default setting of SystemInit() function, refer to       system_stm32f10x.c file     */  /* System Clocks Configuration */  RCC_Configuration();  /* Once the DAC channel is enabled, the corresponding GPIO pin is automatically     connected to the DAC converter. In order to avoid parasitic consumption,     the GPIO pin should be configured in analog */  GPIO_Configuration();  /* TIM2 Configuration */  TIM_TimeBaseStructInit(&TIM_TimeBaseStructure);  TIM_TimeBaseStructure.TIM_Period = 0xF;  TIM_TimeBaseStructure.TIM_Prescaler = 0xF;  TIM_TimeBaseStructure.TIM_ClockDivision = 0x0;  TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up;  TIM_TimeBaseInit(TIM2, &TIM_TimeBaseStructure);  /* TIM2 TRGO selection */  TIM_SelectOutputTrigger(TIM2, TIM_TRGOSource_Update);  /* DAC channel1 Configuration */  DAC_InitStructure.DAC_Trigger = DAC_Trigger_T2_TRGO;  DAC_InitStructure.DAC_WaveGeneration = DAC_WaveGeneration_Triangle;  DAC_InitStructure.DAC_LFSRUnmask_TriangleAmplitude = DAC_TriangleAmplitude_2047;  DAC_InitStructure.DAC_OutputBuffer = DAC_OutputBuffer_Disable;  DAC_Init(DAC_Channel_1, &DAC_InitStructure);  /* DAC channel2 Configuration */  DAC_InitStructure.DAC_LFSRUnmask_TriangleAmplitude = DAC_TriangleAmplitude_1023;  DAC_Init(DAC_Channel_2, &DAC_InitStructure);  /* Enable DAC Channel1: Once the DAC channel1 is enabled, PA.04 is     automatically connected to the DAC converter. */  DAC_Cmd(DAC_Channel_1, ENABLE);  /* Enable DAC Channel2: Once the DAC channel2 is enabled, PA.05 is     automatically connected to the DAC converter. */  DAC_Cmd(DAC_Channel_2, ENABLE);  /* Set DAC dual channel DHR12RD register */  DAC_SetDualChannelData(DAC_Align_12b_R, 0x100, 0x100);  /* TIM2 enable counter */  TIM_Cmd(TIM2, ENABLE);  while (1)  {  }}
开发者ID:Joe-Merten,项目名称:Stm32,代码行数:62,


示例7: SOUNDInitDAC

void SOUNDInitDAC(uint32_t sampleRate){	GPIO_InitTypeDef GPIO_InitStructure;	DAC_InitTypeDef DAC_InitStructure;//	CS43L22Init();	RCC_APB1PeriphClockCmd(RCC_APB1Periph_DAC | RCC_APB1Periph_TIM6, ENABLE);	RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_DMA1 | RCC_AHB1Periph_GPIOA | RCC_AHB1Periph_GPIOC, ENABLE);	// PC5 MAX4410 Audio Amp Shutdown	GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5;	GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;	GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;	GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;	GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;	GPIO_Init(GPIOC, &GPIO_InitStructure);	// 初期化
C++ DAC_Init函数代码示例
C++ D4U5函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。