Skip to content

Commit 83129e5

Browse files
author
elms
authored
Merge pull request #194 from dgarske/nuvoton_fixups
2 parents 05d5a0b + 4ea2520 commit 83129e5

12 files changed

Lines changed: 444 additions & 478 deletions

File tree

examples/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ Some TPM 2.0 modules have extra I/O functionalities and additional GPIO that the
441441

442442
Currently, the GPIO control examples support ST33 and NPCT75x TPM 2.0 modules.
443443

444-
There are four examples available: `gpio/gpio_config` for ST33 and `gpio/gpio_nuvoton` for NPCT75x.
444+
There are four examples available. Configuration using `gpio/gpio_config`.
445445

446446
Every example has a help option `-h`. Please consult with `gpio_config -h` about the various GPIO modes.
447447

@@ -495,12 +495,12 @@ NV Index for GPIO access created
495495

496496
### GPIO Config (NPCT75xx)
497497

498-
NPCT75x supports 3 output modes (no input modes), information from `gpio/gpio_nuvoton` below:
498+
NPCT75x supports 3 output modes (no input modes), information from `gpio/gpio_config` below:
499499

500500
```
501-
$ ./examples/gpio/gpio_nuvoton -h
501+
$ ./examples/gpio/gpio_config -h
502502
Expected usage:
503-
./examples/gpio/gpio_nuvoton [num] [mode]
503+
./examples/gpio/gpio_config [num] [mode]
504504
* num is a GPIO number between 3 and 4 (default 3)
505505
* mode is either push-pull, open-drain or open-drain with pull-up
506506
1. pushpull - output in push pull configuration
@@ -526,7 +526,7 @@ NV Index for GPIO access created
526526

527527
Switching a GPIO configuration is seamless.
528528
* For ST33 `gpio/gpio_config` takes care of deleting existing NV Index, so a new GPIO configuration can be chosen.
529-
* For NPCT75xx `gpio/gpio_nuvoton` can reconfigure any GPIO without deleting the created NV index.
529+
* For NPCT75xx `gpio/gpio_config` can reconfigure any GPIO without deleting the created NV index.
530530

531531
```
532532
$ ./examples/gpio/gpio_set 0 -high

examples/gpio/gpio.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,9 @@
2626
extern "C" {
2727
#endif
2828

29-
#if defined(WOLFTPM_ST33) || defined(WOLFTPM_NUVOTON) || defined(WOLFTPM_AUTODETECT)
30-
#define GPIO_NUM_MIN TPM_GPIO_A
31-
#define GPIO_NUM_MAX TPM_GPIO_A+TPM_GPIO_COUNT-1 /* see wolftpm/tpm2.h */
32-
#endif
33-
34-
#ifdef WOLFTPM_NUVOTON
35-
/* Nuvoton GPIO Modes - only output */
36-
#define NUVOTON_GPIO_MODE_PUSHPULL 1
37-
#define NUVOTON_GPIO_MODE_OPENDRAIN 2
38-
#define NUVOTON_GPIO_MODE_PULLUP 3
39-
#define NUVOTON_GPIO_MODE_UNCONFIG 4 /* Not a real GPIO mode, deleting NV index */
40-
#define NUVOTON_GPIO_MODE_MAX 4
41-
#endif
42-
4329
int TPM2_GPIO_Config_Example(void* userCtx, int argc, char *argv[]);
4430
int TPM2_GPIO_Read_Example(void* userCtx, int argc, char *argv[]);
4531
int TPM2_GPIO_Set_Example(void* userCtx, int argc, char *argv[]);
46-
int TPM2_GPIO_Nuvoton_Example(void* userCtx, int argc, char *argv[]);
4732

4833
#ifdef __cplusplus
4934
} /* extern "C" */

0 commit comments

Comments
 (0)