Skip to content

Cypress: fix GPIO mode NONE #11765

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion targets/TARGET_Cypress/TARGET_PSOC6/PinNamesTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include "cybsp_types.h"

// Pin Modes
#define PullNone CYHAL_GPIO_DRIVE_STRONG
#define PullNone CYHAL_GPIO_DRIVE_PULL_NONE
#define PullDefault CYHAL_GPIO_DRIVE_NONE
#define PullDown CYHAL_GPIO_DRIVE_PULLDOWN
#define PullUp CYHAL_GPIO_DRIVE_PULLUP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ typedef enum {
CYHAL_GPIO_DRIVE_OPENDRAINDRIVESHIGH, /**< Open-drain, Drives High */
CYHAL_GPIO_DRIVE_STRONG, /**< Strong output */
CYHAL_GPIO_DRIVE_PULLUPDOWN, /**< Pull-up and pull-down resistors */
CYHAL_GPIO_DRIVE_PULL_NONE, /**< No Pull-up or pull-down resistors */
} cyhal_gpio_drive_mode_t;

/** GPIO callback function type */
Expand Down
10 changes: 10 additions & 0 deletions targets/TARGET_Cypress/TARGET_PSOC6/psoc6csp/hal/src/cyhal_gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,16 @@ static uint32_t cyhal_gpio_convert_drive_mode(cyhal_gpio_drive_mode_t drive_mode
case CYHAL_GPIO_DRIVE_PULLUPDOWN:
drvMode = CY_GPIO_DM_PULLUP_DOWN;
break;
case CYHAL_GPIO_DRIVE_PULL_NONE:
if (direction == CYHAL_GPIO_DIR_OUTPUT || direction == CYHAL_GPIO_DIR_BIDIRECTIONAL)
{
drvMode = CY_GPIO_DM_STRONG;
}
else
{
drvMode = CY_GPIO_DM_HIGHZ;
}
break;
default:
CY_ASSERT(false);
drvMode = CY_GPIO_DM_HIGHZ;
Expand Down