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.

tms570ls0714 spi

Other Parts Discussed in Thread: TMS570LS0714

tms570ls0714的spi3的ncs5怎么配置为gpio?

  • 请您尝试一下如下操作:

    After reset all pins on MIBSPI are by default in GIO mode (fun=0).

    以下是使用 GIO driver定义的.

    /** @def mibspiPORT1
    * @brief MIBSPI1 GIO Port Register Pointer
    *
    * Pointer used by the GIO driver to access I/O PORT of MIBSPI1
    * (use the GIO drivers to access the port pins).
    */
    #define mibspiPORT1 ((gioPORT_t *)0xFFF7F418U)

    MIBSPI的GIO结构与GIO模块本身的GIO结构相同。
    
    如果您想将MIBSPI引脚用作简单的I / O,并控制方向In和Out,则您需要在HalcoGen中启用GIO驱动程序。
    
    这将为您提供控制MIBSPI引脚所需的功能。如下所示:


    void gioSetDirection(gioPort_t *port, uint32_dir) // Set the direction of GIO pins at run time
    void gioSetBit(gioPort_t *port, uint32_t bit, uint32_t value) // Writes a value to the specified pin of given GIO port

    您可以在 GIO.C 进行查看

    使用方式如下

    gioSetDirection(mibspiPORT1,0x01); // This will set the MIBSPI1_CS(0) as output