@@ -39,39 +39,39 @@ void pinMode( uint32_t ulPin, uint32_t ulMode )
39
39
{
40
40
case INPUT :
41
41
// 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 ;
45
45
46
46
case INPUT_PULLUP :
47
47
// 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 ;
50
50
51
51
// 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 ;
54
54
55
55
case INPUT_PULLDOWN :
56
56
// 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 ;
59
59
60
60
// 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 ;
63
63
64
64
case OUTPUT :
65
65
// 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 ) ;
67
67
68
68
// Set pin to output mode
69
- PORT -> Group [port ].DIRSET .reg = pinMask ;
70
- break ;
69
+ PORT -> Group [port ].DIRSET .reg = pinMask ;
70
+ break ;
71
71
72
72
default :
73
73
// do nothing
74
- break ;
74
+ break ;
75
75
}
76
76
}
77
77
0 commit comments