AnsweredAssumed Answered

MQX GPIO setting quesion

Question asked by Mini Wang on Jan 25, 2013
Latest reply on Jan 28, 2013 by Martin Kojtal

Hi All,

There is a question about GPIO setting.

I would like to open a gpio file containing pin setting. The code as below. After open the output_set, all of them are set as output, but the pin status only BSP_2972_STANDBY and BSP_2972_RST (D0,D7) are correct. In another words, BSP_9127_RST,BSP_HS_8524_MUTE,BSP_HS_8524_MODE (E24,E25,E26) are set as output LOW.(expect HIGH)

Why I can't control the pin status?

Thank you in advance.

 

Mini


The environment is [MQX3.8.1] & [CW10.2].

The chip is K20DN512.

-----------------------------------------------------------------------

#define BSP_9127_RST               (GPIO_PORT_E | GPIO_PIN24)   

#define BSP_2972_STANDBY       (GPIO_PORT_D | GPIO_PIN0)

#define BSP_2972_RST               (GPIO_PORT_D | GPIO_PIN7)

#define BSP_HS_8524_MUTE       (GPIO_PORT_E | GPIO_PIN25)

#define BSP_HS_8524_MODE       (GPIO_PORT_E | GPIO_PIN26)

-----------------------------------------------------------------------

    GPIO_PIN_STRUCT output_set[] = {

        BSP_9127_RST              | GPIO_PIN_STATUS_1,

        BSP_2972_STANDBY     | GPIO_PIN_STATUS_0,

        BSP_2972_RST              | GPIO_PIN_STATUS_1,

        BSP_HS_8524_MUTE     | GPIO_PIN_STATUS_1,

        BSP_HS_8524_MODE    | GPIO_PIN_STATUS_1,

        GPIO_LIST_END

    };

 

    /* Open and set port pins as output */

    output_port = fopen("gpio:write", (char_ptr) &output_set);

    if (NULL == output_port)

    {

        printf("Open to output_port  failed.\n");

    }

 

-----------------------------------------------------------------------

 

 


Outcomes