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.

MSPM0G3507: Regarding GPIO Read Pin

Part Number: MSPM0G3507

Tool/software:

Dear TI,

I was trying to read the GPIO PA25 pin which is configured as INPUT, but I see here when I give 3.3 Volt, I get register decimal value instead of  HIGH or LOW.

my question is there any why to get pin value as HIGH or LOW instead of HIGH or LOW.

 

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
/** * @brief Set a group of GPIO pins * * @param[in] gpio Pointer to the register overlay for the peripheral * @param[in] pins Pins to set high. Bitwise OR of @ref DL_GPIO_PIN. */
__STATIC_INLINE void DL_GPIO_setPins(GPIO_Regs* gpio, uint32_t pins)
{
gpio->DOUTSET31_0 = pins;
}
__STATIC_INLINE uint32_t DL_GPIO_readPins(GPIO_Regs* gpio, uint32_t pins)
{
return (gpio->DIN31_0 & pins);
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Best regards 

thank you,

 

best regard

  • Hello Karan,

    Because this function will read the DIN31_0 register. Each bit represents one GPIO, you set PA25 to high voltage, you will read out 0x200 0000 (the bit DIO25 is set) whose  decimal value is 33,554,432.

    Best Regards,

    Janz Bai