This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

关于TMS320F28069的问题



哪位大侠可以帮我一下吗?在user.h头文件中如下定义:

//! \brief Defines the location of the HRPWMENCLK bits in the PCLKCR0 register

//!

#define  CLK_PCLKCR0_HRPWMENCLK_BITS     (1 << 0)

 

//! \brief Defines the location of the LINAENCLK bits in the PCLKCR0 register

//!

#define  CLK_PCLKCR0_LINAENCLK_BITS      (1 << 1)

中 (1 << 0),和  (1 << 1) 是什么意思??

 

谢谢啦

  • ruiping,

    1<<0, 表示1左移0位,

    1<<1 表示左移1位。

    这些是用在寄存器配置。

    Eric

  • 1 << 0:对bit0置1;

    #define  CLK_PCLKCR0_HRPWMENCLK_BITS     (1 << 0) 的意思是使能HRPWM模块的时钟信号;

    1 << 1:对bit1置1;(1左移1位)

    #define  CLK_PCLKCR0_LINAENCLK_BITS      (1 << 1)的意思是使能LIN模块的时钟信号;

     

  • 麻烦再追问一下,在头文件中有

    //! \brief Defines the number of bits per INTSELxNy register //! #define ADC_INTSELxNy_NUMBITS_PER_REG        8

    //! \brief Defines the log2() of the number of bits per INTSELxNy register //! #define ADC_INTSELxNy_LOG2_NUMBITS_PER_REG   3

    //! \brief Defines the location of the INTSEL bits in the INTSELxNy register //! #define ADC_INTSELxNy_INTSEL_BITS          (31 << 0)

    //! \brief Defines the location of the INTE bits in the INTSELxNy register //! #define ADC_INTSELxNy_INTE_BITS            (1 << 5)

    //! \brief Defines the location of the INTCONT bits in the INTSELxNy register //! #define ADC_INTSELxNy_INTCONT_BITS         (1 << 6)

    //! \brief Defines the location of the ACQPS bits in the ADCSOCxCTL register //! #define ADC_ADCSOCxCTL_ACQPS_BITS          (63 << 0)

    //! \brief Defines the location of the CHSEL bits in the ADCSOCxCTL register //! #define ADC_ADCSOCxCTL_CHSEL_BITS          (15 << 6)

    //! \brief Defines the location of the TRIGSEL bits in the ADCSOCxCTL register //! #define ADC_ADCSOCxCTL_TRIGSEL_BITS        (31 << 11)

    8在这里如何解释,  (15 << 6)如何解释,是15位左移6位吗, (31 << 11),寄存器是最多32位吗,31位左移11位后变成什么了,不就又回到低位了?

    谢谢

  • 31=0x1F,左移11位为0xF800.对应着ADCSOCxCTL的TRIGSEL所在的高五位

  • //! \brief Defines the location of the CHSEL bits in the ADCSOCxCTL register //! #define ADC_ADCSOCxCTL_CHSEL_BITS (15 << 6)
    请问这是对应哪个通道啊