You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/09/17 18:52:33 UTC

[GitHub] [incubator-nuttx] patacongo commented on pull request #1832: STMPE811: Fix name collision in include/nuttx/input/stmpe811.h

patacongo commented on pull request #1832:
URL: https://github.com/apache/incubator-nuttx/pull/1832#issuecomment-694431378


   > 
   > 
   > @patacongo does this definition make sense for `STMPE811_GPIO_PIN(n)` I would expect to do something like this to define the pin config:
   > 
   > ```
   > #define KB_FW_BL (STMPE811_GPIO_OUTPUT | STMPE811_GPIO_PIN(3))
   > ```
   > 
   > But that sets the bit shift in the register not pin config. Instead I have to do something like this:
   > 
   > ```
   > #define KB_FW_BL (STMPE811_GPIO_OUTPUT | STMPE811_GPIO_PIN3)
   > ```
   > 
   > That seems inconsistent to me with how we normally set GPIO pincfg.
   
   What is there seems correct to me.  The encoding is  "Bits 0-2 is the pin number".  For:
   
       #define KB_FW_BL (STMPE811_GPIO_OUTPUT | STMPE811_GPIO_PIN3)
   
   That would be Bits 0-2 == 0b011.  For:
   
       #define KB_FW_BL (STMPE811_GPIO_OUTPUT | STMPE811_GPIO_PIN(3))
   
   STMPE811_GPIO_PIN(3) ix 0b1000 sowhich would not fit into Bits 0-2 and would clobber Bit 3:  "Bit 3 is the initial value for output pins"
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org