9 years, 5 months ago.

Does DigitalOut has to support LED=!LED ?

I was trying to add support for one of our board in mbed. When we configure our GPIO as output the data register will be always set to logical one. So in the application code if we put a statement like LED = !LED it wont be working properly.

Is it like mbed always expects a DigitalOut Pin to have a output data register which could read back the current value of pin?

I think all currently do this, so it would for sure be nice if a new target does this to. You could do it in software, although I don't know if it really is required to support this. Consistency is nice though. (Not too much of a performance impact also).

Do you have a datasheet of the device you are working on?

posted by Erik - 23 Jun 2015

yes. I do have a datasheet. We already have a device driver code base. We are reusing the same code for Mbed.

posted by Akhil Panayamparambil 24 Jun 2015

Thank you for the support. The controller had 2 separate registers having the logical value of pin in input and output mode.

posted by Akhil Panayamparambil 24 Jun 2015
Be the first to answer this question.