⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.c

📁 Lcd test demo code based on St arm mcu
💻 C
字号:
/******************** (C) COPYRIGHT 2003 STMicroelectronics ********************
* File Name          : main.c
* Author             : MCD Application Team
* Date First Issued  : 16/09/2003
* Description        : This file gives an example of the use of the PWM input
*                      feature. The signal periode is stored in the ICAR
*                      register and the pulse length in the ICBR.
********************************************************************************
* History:
*  03/07/03 : First Version
*******************************************************************************/

#include "71x_lib.h"

#define T3_OCMP_A 0x04

int main(void)
{
  #ifdef DEBUG
  debug ();
  #endif

  //---------------------------------------------------------------------------
  // Initialization
  //---------------------------------------------------------------------------
  // Configure P0.0 pis as Push-Pull Output
  GPIO_Config (????,1,????);
  // Configure the GPIO1 Port
  // Timer 3 Output Compare function pin (P1.2) configured as Alternate
  // function pushpull.
  GPIO_Config (????,T3_OCMP_A,????);


  // Initialize the Timer 3
  ????

  // Configure the Timer 3 Prescaler
  ???? (????,0xFF);

  // Generate a PWM Signal :
  // Full Period  = 0x7FFF
  // Duty Cycle   = 50 % ( 0x3FFF )

  ???? (TIM3,0x3FFF,TIM_HIGH,0x7FFF,TIM_LOW );

  // Enable the Timer 3 Overflow Interrupt
  ????(TIM3,????,????);

// EIC configuration
  // Set the Timer 3 interrupt chanel priority level to 1
  EIC_IRQChannelPriorityConfig(????,1);
  // Enable the Timer 3 IRQ channel interrupts
  ????
  // Enable IRQ interrupts
  EIC_IRQConfig(????);

  // Start The Counter
  ???? (TIM3,TIM_START);

  // infinite loop
  while (1);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -