📄 cc6.c
字号:
//****************************************************************************
// @Module Capture / Compare Unit 6 (CCU6)
// @Filename CC6.C
// @Project BLDC.dav
//----------------------------------------------------------------------------
// @Controller Infineon XC866-4FR
//
// @Compiler Keil
//
// @Codegenerator 1.6
//
// @Description This file contains functions that use the CCU6 module.
//
//----------------------------------------------------------------------------
// @Date 7/25/2005 1:17:33 AM
//
//****************************************************************************
// USER CODE BEGIN (CCU6_General,1)
// USER CODE END
//****************************************************************************
// @Project Includes
//****************************************************************************
#include "MAIN.H"
// USER CODE BEGIN (CCU6_General,2)
// USER CODE END
//****************************************************************************
// @Macros
//****************************************************************************
// USER CODE BEGIN (CCU6_General,3)
// USER CODE END
//****************************************************************************
// @Defines
//****************************************************************************
// USER CODE BEGIN (CCU6_General,4)
// USER CODE END
//****************************************************************************
// @Typedefs
//****************************************************************************
// USER CODE BEGIN (CCU6_General,5)
// USER CODE END
//****************************************************************************
// @Imported Global Variables
//****************************************************************************
// USER CODE BEGIN (CCU6_General,6)
// USER CODE END
//****************************************************************************
// @Global Variables
//****************************************************************************
// USER CODE BEGIN (CCU6_General,7)
// USER CODE END
//****************************************************************************
// @External Prototypes
//****************************************************************************
// USER CODE BEGIN (CCU6_General,8)
// USER CODE END
//****************************************************************************
// @Prototypes Of Local Functions
//****************************************************************************
// USER CODE BEGIN (CCU6_General,9)
// USER CODE END
//****************************************************************************
// @Function void CC6_vInit(void)
//
//----------------------------------------------------------------------------
// @Description This is the initialization function of the CCU6 function
// library. It is assumed that the SFRs used by this library
// are in their reset state.
//
//----------------------------------------------------------------------------
// @Returnvalue None
//
//----------------------------------------------------------------------------
// @Parameters None
//
//----------------------------------------------------------------------------
// @Date 7/25/2005
//
//****************************************************************************
// USER CODE BEGIN (Init,1)
// USER CODE END
void CC6_vInit(void)
{
// USER CODE BEGIN (Init,2)
// USER CODE END
SFR_PAGE(_cc1, noSST); // switch to page 1
/// -----------------------------------------------------------------------
/// Configuration of Timer Control Register
/// -----------------------------------------------------------------------
CCU6_TCTR0L = 0x07; // load CCU6 timer control register 0 low
CCU6_TCTR0H = 0x00; // load CCU6 timer control register 0 high
/// -----------------------------------------------------------------------
/// Configuration of CCU6 Timer 12:
/// -----------------------------------------------------------------------
/// - prescaler factor is 128
/// - timer 12 run bit is set
/// - single shot mode is disabled
/// - timer 12 works in edge aligned mode
/// - interrupt on period match is disabled
/// - interrupt on one match is disabled
CCU6_T12PRL = 0xFF; // load CCU6 T12 period register low
CCU6_T12PRH = 0xFF; // load CCU6 T12 period register lhigh
/// -----------------------------------------------------------------------
/// Configuration of CCU6 Timer 13:
/// -----------------------------------------------------------------------
/// - prescaler factor is 1
/// - timer 13 run bit is reset
/// - trigger control is disabled
/// - single shot mode is disabled
/// - interrupt on period match is disabled
/// - interrupt on compare match is disabled
CCU6_T13PRL = 0x01; // load CCU6 T13 period register low
CCU6_T13PRH = 0x00; // load CCU6 T13 period register high
/// -----------------------------------------------------------------------
/// Configuration of Dead-Time Control Register for Timer T12
/// -----------------------------------------------------------------------
CCU6_T12DTCL = 0x08; // load CCU6 dead time control register low
// for timer T12
CCU6_T12DTCH = 0x01; // load CCU6 dead time control register high
// for timer T12
SFR_PAGE(_cc0, noSST); // switch to page 0
/// -----------------------------------------------------------------------
/// Configuration of CCU6 Channel 0:
/// -----------------------------------------------------------------------
/// - hall sensor mode is selected
/// - T13 modulation for output CC60 is disabled
/// - the output CC60 is set to the passive state
/// - the trap functionality of the pin CC60 is disabled
/// - the passive level of the output CC60 is '0'
/// - T13 modulation for output COUT60 is disabled
/// - the output COUT60 is set to the passive state
/// - the trap functionality of the pin COUT60 is disabled
/// - the passive level of the output COUT60 is '0'
/// - dead time generation is enabled
/// - generation interrupt on flag ICC60R is disabled
/// - generation interrupt on flag ICC60F is disabled
CCU6_CC60SRL = 0x00; // load CCU6 capture/compare shadow register
// low for channel 0
CCU6_CC60SRH = 0x00; // load CCU6 capture/compare shadow register
// high for channel 0
/// -----------------------------------------------------------------------
/// Configuration of CCU6 Channel 1:
/// -----------------------------------------------------------------------
/// - hall sensor mode is selected
/// - T13 modulation for output CC61 is disabled
/// - the output CC61 is set to the passive state
/// - the trap functionality of the pin CC61 is disabled
/// - the passive level of the output CC61 is '0'
/// - T13 modulation for output COUT61 is disabled
/// - the output COUT61 is set to the passive state
/// - the trap functionality of the pin COUT61 is disabled
/// - the passive level of the output COUT61 is '0'
/// - dead time generation is disabled
/// - generation interrupt on flag ICC61R is disabled
/// - generation interrupt on flag ICC61F is disabled
CCU6_CC61SRL = 0x00; // load CCU6 capture/compare shadow register
// low for channel 1
CCU6_CC61SRH = 0x00; // load CCU6 capture/compare shadow register
// high for channel 1
/// -----------------------------------------------------------------------
/// Configuration of CCU6 Channel 2:
/// -----------------------------------------------------------------------
/// - hall sensor mode is selected
/// - T13 modulation for output CC62 is disabled
/// - the output CC62 is set to the passive state
/// - the trap functionality of the pin CC62 is disabled
/// - the passive level of the output CC62 is '0'
/// - T13 modulation for output COUT62 is disabled
/// - the output COUT62 is set to the passive state
/// - the trap functionality of the pin COUT62 is disabled
/// - the passive level of the output COUT62 is '0'
/// - dead time generation is disabled
/// - generation interrupt on flag ICC62R is disabled
/// - generation interrupt on flag ICC62F is disabled
CCU6_CC62SRL = 0x00; // load CCU6 capture/compare shadow register
// low for channel 2
CCU6_CC62SRH = 0x00; // load CCU6 capture/compare shadow register
// high for channel 2
/// -----------------------------------------------------------------------
/// Configuration of CCU6 Channel 3:
/// -----------------------------------------------------------------------
/// - T13 output is not inverted
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -