File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
targets/TARGET_Cypress/TARGET_PSOC6 Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -60,9 +60,16 @@ void gpio_mode(gpio_t *obj, PinMode mode)
60
60
}
61
61
}
62
62
63
- void gpio_dir (MBED_UNUSED gpio_t * obj , MBED_UNUSED PinDirection direction )
63
+ void gpio_dir (gpio_t * obj , PinDirection direction )
64
64
{
65
- // mbed reads from input buffer instead of DR even for output pins so always leave input buffer enabled
65
+ if (direction == PIN_INPUT ) {
66
+ cyhal_gpio_direction (obj -> pin , CYHAL_GPIO_DIR_INPUT );
67
+ gpio_mode (obj , CYHAL_GPIO_DRIVE_ANALOG );
68
+ } else if (direction == PIN_OUTPUT ) {
69
+ // mbed reads from input buffer instead of DR even for output pins so always leave input buffer enabled
70
+ cyhal_gpio_direction (obj -> pin , CYHAL_GPIO_DIR_BIDIRECTIONAL );
71
+ gpio_mode (obj , CYHAL_GPIO_DRIVE_STRONG );
72
+ }
66
73
}
67
74
68
75
#ifdef __cplusplus
You can’t perform that action at this time.
0 commit comments