@@ -39,39 +39,39 @@ void pinMode( uint32_t ulPin, uint32_t ulMode )
3939 {
4040 case INPUT :
4141 // Set pin to input mode
42- PORT -> Group [port ].PINCFG [pin ].reg = (uint8_t )(PORT_PINCFG_INEN ) ;
43- PORT -> Group [port ].DIRCLR .reg = pinMask ;
44- break ;
42+ PORT -> Group [port ].PINCFG [pin ].reg = (uint8_t ) (PORT_PINCFG_INEN );
43+ PORT -> Group [port ].DIRCLR .reg = pinMask ;
44+ break ;
4545
4646 case INPUT_PULLUP :
4747 // Set pin to input mode with pull-up resistor enabled
48- PORT -> Group [port ].PINCFG [pin ].reg = (uint8_t )(PORT_PINCFG_INEN | PORT_PINCFG_PULLEN ) ;
49- PORT -> Group [port ].DIRCLR .reg = pinMask ;
48+ PORT -> Group [port ].PINCFG [pin ].reg = (uint8_t ) (PORT_PINCFG_INEN | PORT_PINCFG_PULLEN );
49+ PORT -> Group [port ].DIRCLR .reg = pinMask ;
5050
5151 // Enable pull level (cf '22.6.3.2 Input Configuration' and '22.8.7 Data Output Value Set')
52- PORT -> Group [port ].OUTSET .reg = pinMask ;
53- break ;
52+ PORT -> Group [port ].OUTSET .reg = pinMask ;
53+ break ;
5454
5555 case INPUT_PULLDOWN :
5656 // Set pin to input mode with pull-down resistor enabled
57- PORT -> Group [port ].PINCFG [pin ].reg = (uint8_t )(PORT_PINCFG_INEN | PORT_PINCFG_PULLEN ) ;
58- PORT -> Group [port ].DIRCLR .reg = pinMask ;
57+ PORT -> Group [port ].PINCFG [pin ].reg = (uint8_t ) (PORT_PINCFG_INEN | PORT_PINCFG_PULLEN );
58+ PORT -> Group [port ].DIRCLR .reg = pinMask ;
5959
6060 // Enable pull level (cf '22.6.3.2 Input Configuration' and '22.8.6 Data Output Value Clear')
61- PORT -> Group [port ].OUTCLR .reg = pinMask ;
62- break ;
61+ PORT -> Group [port ].OUTCLR .reg = pinMask ;
62+ break ;
6363
6464 case OUTPUT :
6565 // enable input, to support reading back values, with pullups disabled
66- PORT -> Group [port ].PINCFG [pin ].reg = (uint8_t )(PORT_PINCFG_INEN ) ;
66+ PORT -> Group [port ].PINCFG [pin ].reg = (uint8_t ) (PORT_PINCFG_INEN | PORT_PINCFG_DRVSTR ) ;
6767
6868 // Set pin to output mode
69- PORT -> Group [port ].DIRSET .reg = pinMask ;
70- break ;
69+ PORT -> Group [port ].DIRSET .reg = pinMask ;
70+ break ;
7171
7272 default :
7373 // do nothing
74- break ;
74+ break ;
7575 }
7676}
7777
0 commit comments