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.

some questions about C6678 GPIO

Hi,everyone ,

       I want to use GPIO to control LED,and I have some questions as following :

      1.What's the difference between BM_GPIO and DSP_GPIO?

      2.If the Schematic diagram about LED as following :

      

      You can see DSP_GPIO_14 and DSP_GPIO_15 control the LED,how can I write the code ?

      Thank you,

      Simon 

  • Hi,

    You can see DSP_GPIO_14 and DSP_GPIO_15 control the LED,how can I write the code ?


    See the pdk_c667x_2_0_3/packages/ti/drv/gpio source code. You can use either GPIO_toggle() or GPIO_write():
    /*!
    * @brief Toggles the current state of a GPIO
    *
    * @param index GPIO index
    */
    extern void GPIO_toggle(uint32_t index);

    /*!
    * @brief Writes the value to a GPIO pin
    *
    * @param index GPIO index
    * @param value must be either 0 or 1
    */
    extern void GPIO_write(uint32_t index, uint32_t value);

    Connected this way, the led will be on, when GPIO is low (0) & led will be off, when GPIO is high (1).

    Best Regards,
    Yordan
  • Hi,Yordan,

          Thank you for your reply .

          I have found a function platform_led() under pdk_c6678 direction ,but I don't know how to use it,Can I use this function to turn on or turn off the LED?

          Best Regards, 

          Simon