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.

关于MSO432P4011处理器的 CEPD



请问TI工程师:

      这个CEPD如何设置  他的API设置函数在哪里?如何使用

  • 您可以直接操作寄存器,如下代码

    /******************************************************************************
    * COMP_E Registers
    ******************************************************************************/
    /** @addtogroup COMP_E MSP432P401R (COMP_E)
      @{
    */
    typedef struct {
      __IO uint16_t CTL0;                                                            /*!< Comparator Control Register 0 */
      __IO uint16_t CTL1;                                                            /*!< Comparator Control Register 1 */
      __IO uint16_t CTL2;                                                            /*!< Comparator Control Register 2 */
      __IO uint16_t CTL3;                                                            /*!< Comparator Control Register 3 */
           uint16_t RESERVED0[2];
      __IO uint16_t INT;                                                             /*!< Comparator Interrupt Control Register */
      __I  uint16_t IV;                                                              /*!< Comparator Interrupt Vector Word Register */
    } COMP_E_Type;
    
    /*@}*/ /* end of group COMP_E */

    COMP_E0->CTL3 = BIT1;                   // Input Buffer Disable @P1.1/CE1

  • API的话,您可以使用

    //*****************************************************************************
    //
    //! Disables the input buffer of the selected input port to effectively allow
    //! for analog signals.
    //!
    //! \param comparator is the instance of the Comparator module. Valid
    //! parameters vary from part to part, but can include:
    //!         - \b COMP_E0_BASE
    //!         - \b COMP_E1_BASE
    //! \param inputPort is the port in which the input buffer will be disabled.
    //!        Valid values are a logical OR of the following:
    //!        - \b COMP_E_INPUT0 [Default]
    //!        - \b COMP_E_INPUT1
    //!        - \b COMP_E_INPUT2
    //!        - \b COMP_E_INPUT3
    //!        - \b COMP_E_INPUT4
    //!        - \b COMP_E_INPUT5
    //!        - \b COMP_E_INPUT6
    //!        - \b COMP_E_INPUT7
    //!        - \b COMP_E_INPUT8
    //!        - \b COMP_E_INPUT9
    //!        - \b COMP_E_INPUT10
    //!        - \b COMP_E_INPUT11
    //!        - \b COMP_E_INPUT12
    //!        - \b COMP_E_INPUT13
    //!        - \b COMP_E_INPUT14
    //!        - \b COMP_E_INPUT15
    //!       <br> Modified bits are \b CEPDx of \b CECTL3 register.
    //!
    //! This function sets the bit to disable the buffer for the specified input
    //! port to allow for analog signals from any of the comparator input pins. This
    //! bit is automatically set when the input is initialized to be used with the
    //! comparator module. This function should be used whenever an analog input is
    //! connected to one of these pins to prevent parasitic voltage from causing
    //! unexpected results.
    //!
    //! \return NONE
    //
    //*****************************************************************************
    extern void COMP_E_disableInputBuffer(uint32_t comparator,
            uint_fast16_t inputPort);

  • 很高兴能帮到您!