Number of Return Values using "GPIO_GetPinStatus()"

3 posts / 0 new
Last post
Jun-ichi Tobe
Offline
Last seen:4 months 4 days ago
加入:2016-04-01 10:39
Number of Return Values using "GPIO_GetPinStatus()"

related Question "get pin status"(gayan_gamage-san)

When I call the "bool GPIO_GetPinStatus( GPIO_PORT port, GPIO_PIN pin )",
this function seems to return the "TRUE" and "FALSE" and non-"TRUE or FALSE".

And MT_dialog has suggested using the "enums" type rather than "bool" type.

How many return values using this function ?
And could you show me the meaning of the each return values("TRUE", "FALSE" and "?????")?

SDK Information:
源代码
\...\DA1458x_SDK\5.0.3\sdk\platform\driver\gpio\gpio.c

Discription:

* @brief Gets the GPIO status. The GPIO should have been previously configured as input!
*
* @param[in] port GPIO port
* @param[in] pin GPIO pin
*
* @return bool TRUE if the pin is high, FALSE if low. <<=====

regards.

Device:
MT_dialog
Offline
Last seen:2 weeks 12 hours ago
工作人员
加入:2015-06-08 11:34
Hi Jun-ichi Tobe,

Hi Jun-ichi Tobe,

I suppose the post that you are talking about is thishttp://support.dialog-semiconductor.com/get-pin-statusthe function accepts as parameters the enums GPIO_PORT and GPIO_PIN thats why the compiler was complaining, the output of the function is bool that means that returns true or false (true if the pin is hign and false if the pin is true). You can find this either in the comments of the function in the gpio.c as you ve indicated in your post or in the UM-B-051 document in the peripheral drivers section.

Thanks MT_dialog

Jun-ichi Tobe
Offline
Last seen:4 months 4 days ago
加入:2016-04-01 10:39
谢谢你的中rt.

谢谢你的中rt.
I had misunderstood the ENUM(return value type) and ENUMS(.function parameters).

I will check on again return values to my partner.

regards.