Skip to content

Commit 50b0847

Browse files
author
yarb
committed
Cypress: fix gpio mode none
1 parent 87b150a commit 50b0847

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

targets/TARGET_Cypress/TARGET_PSOC6/PinNamesTypes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include "cybsp_types.h"
2424

2525
// Pin Modes
26-
#define PullNone CYHAL_GPIO_DRIVE_STRONG
26+
#define PullNone CYHAL_GPIO_DRIVE_PULL_NONE
2727
#define PullDefault CYHAL_GPIO_DRIVE_NONE
2828
#define PullDown CYHAL_GPIO_DRIVE_PULLDOWN
2929
#define PullUp CYHAL_GPIO_DRIVE_PULLUP

targets/TARGET_Cypress/TARGET_PSOC6/psoc6csp/hal/include/cyhal_gpio.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ typedef enum {
7979
CYHAL_GPIO_DRIVE_OPENDRAINDRIVESHIGH, /**< Open-drain, Drives High */
8080
CYHAL_GPIO_DRIVE_STRONG, /**< Strong output */
8181
CYHAL_GPIO_DRIVE_PULLUPDOWN, /**< Pull-up and pull-down resistors */
82+
CYHAL_GPIO_DRIVE_PULL_NONE, /**< No Pull-up or pull-down resistors */
8283
} cyhal_gpio_drive_mode_t;
8384

8485
/** GPIO callback function type */

targets/TARGET_Cypress/TARGET_PSOC6/psoc6csp/hal/src/cyhal_gpio.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,16 @@ static uint32_t cyhal_gpio_convert_drive_mode(cyhal_gpio_drive_mode_t drive_mode
105105
case CYHAL_GPIO_DRIVE_PULLUPDOWN:
106106
drvMode = CY_GPIO_DM_PULLUP_DOWN;
107107
break;
108+
case CYHAL_GPIO_DRIVE_PULL_NONE:
109+
if (direction == CYHAL_GPIO_DIR_OUTPUT || direction == CYHAL_GPIO_DIR_BIDIRECTIONAL)
110+
{
111+
drvMode = CY_GPIO_DM_STRONG;
112+
}
113+
else
114+
{
115+
drvMode = CY_GPIO_DM_HIGHZ;
116+
}
117+
break;
108118
default:
109119
CY_ASSERT(false);
110120
drvMode = CY_GPIO_DM_HIGHZ;

0 commit comments

Comments
 (0)