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

📄 config.h

📁 无刷电机驱动原理
💻 H
字号:
/**
* @file config.h
*
* Copyright (c) 2005 Atmel.
*
* @brief This module provide services to define config for AT90PWM3 only
* Describes the system dependant software configuration.
* This file is included by all source files in order to access to system wide
* configuration.
* @version 1.0 (CVS revision : $Revision: 1.2 $)
* @date $Date: 2006/06/23 13:16:31 $
* @author $Author: raubree $

*****************************************************************************/



/*_____ I N C L U D E S ____________________________________________________*/
#include "compiler.h"
#include "mcu.h"
#include "inavr.h"

#ifndef _CONFIG_H_
#define _CONFIG_H_
#endif

#define BOARD_ID 1 /* 0:unknown, 1 : MC100, 2 : MC200 */
#define SOFT_ID 3 /* 0:unknown, 1:bldc sensor, 2:bldc sinus, 3:bldc sensorless */
#define REV_ID 1

/* when AT90PWM3B is used on MC100 board */
#define MCU_REV_B

/* if we want to use the AT90PWMx internal comparators */
//#define USE_INTERNAL_COMPARATORS

/*-------------- UART LIB CONFIGURATION ---------------*/

#define BAUDRATE      38400
#define FOSC          16000

#define uart_putchar putchar


//! @defgroup ADC_defines_configuration_values ADC Defines Configuration Values
//! Defines allowing to init the ADC with the wanted configuration
//! @{
#define USE_ADC

#define ADC_RIGHT_ADJUST_RESULT                 0 //!< 0: Result left adjusted  1: Result right adjusted
#define ADC_HIGH_SPEED_MODE                     1 //
#define ADC_INTERNAL_VREF                       1 //!< 0: External Vref         1: Internal Vref  2: Vref is connected to Vcc
#define ADC_IT                                  1 //!< 0: No ADC End of Conv IT 1: ADC End of conversion generates an IT
#define ADC_PRESCALER                           4 //!< 2, 4, 8, 16, 32, 64, 128  : The input ADC frequency is the system clock frequency divided by the const value

//! @defgroup DAC_defines_configuration_values DAC Defines Configuration Values
//! Defines allowing to init the DAC with the wanted configuration
//! @{
#define USE_DAC

#define DAC_INPUT_RIGHT_ADJUST                  0 //!< 0: Result left adjusted  1: Result right adjusted
#define DAC_INTERNAL_VREF                       1 //!<
#define DAC_OUTPUT_DRIVER                       1 //!<

//! @defgroup AMP1_defines_configuration_values AMP1 Defines Configuration Values
//! Defines allowing to init the AMP1 with the wanted configuration
//! @{
#define USE_AMP1

#define AMP1_INPUT_SHUNT                        0 //!< 0: Disable Input Shunt   1: Enable Input Shunt
#define AMP1_GAIN                               20 //!< 5: Gain 5    10: Gain 10     20: Gain 20     40: Gain 40
#define AMP1_CLOCK                              1 //!< 0: Internal Clock            1: PSC0 Clock     2: PSC1 Clock     3: PSC2 Clock

//! @defgroup COMPARATORs_defines_configuration_values COMPARATORs Defines Configuration Values
//! Defines allowing to init the COMPARATORs with the wanted configuration
//! @{
#define USE_COMP0
#define COMPARATOR0_IT                          1 //!< 0: Disable Comparator Interrupt    1: Enable Comparator Interrupt
#define COMPARATOR0_IT_EVENT                    0 //!< Comparator Interrupt on outut => 0: toggle     2: falling edge     3: rising edge
#ifdef USE_INTERNAL_COMPARATORS
 #define COMPARATOR0_NEGATIVE_INPUT             5 //!< Comparator negative input selection => 0: vref/6.40  1: vref/3.20  2: vref/2.13  3: vref/1.60  4: ACMPM  5: DAC result
#else
 #define COMPARATOR0_NEGATIVE_INPUT             3 //!< Comparator negative input selection => 0: vref/6.40  1: vref/3.20  2: vref/2.13  3: vref/1.60  4: ACMPM  5: DAC result
#endif

#define USE_COMP1
#define COMPARATOR1_IT                          1 //!< 0: Disable Comparator Interrupt    1: Enable Comparator Interrupt
#define COMPARATOR1_IT_EVENT                    0 //!< Comparator Interrupt on outut => 0: toggle     2: falling edge     3: rising edge
#ifdef USE_INTERNAL_COMPARATORS
 #define COMPARATOR1_NEGATIVE_INPUT             5 //!< Comparator negative input selection => 0: vref/6.40  1: vref/3.20  2: vref/2.13  3: vref/1.60  4: ACMPM  5: DAC result
#else
 #define COMPARATOR1_NEGATIVE_INPUT             3 //!< Comparator negative input selection => 0: vref/6.40  1: vref/3.20  2: vref/2.13  3: vref/1.60  4: ACMPM  5: DAC result
#endif

#define USE_COMP2
#define COMPARATOR2_IT                          1 //!< 0: Disable Comparator Interrupt    1: Enable Comparator Interrupt
#define COMPARATOR2_IT_EVENT                    0 //!< Comparator Interrupt on outut => 0: toggle     2: falling edge     3: rising edge
#ifdef USE_INTERNAL_COMPARATORS
 #define COMPARATOR2_NEGATIVE_INPUT             5 //!< Comparator negative input selection => 0: vref/6.40  1: vref/3.20  2: vref/2.13  3: vref/1.60  4: ACMPM  5: DAC result
#else
 #define COMPARATOR2_NEGATIVE_INPUT             3 //!< Comparator negative input selection => 0: vref/6.40  1: vref/3.20  2: vref/2.13  3: vref/1.60  4: ACMPM  5: DAC result
#endif

⌨️ 快捷键说明

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