mirror of https://github.com/wolfSSL/wolfTPM.git
Merge pull request #159 from elms/make/fix_install
make: Rename GPIO example source files to avoid conflictpull/160/head
commit
1cacdba9a4
|
@ -433,18 +433,18 @@ Some TPM 2.0 modules have extra I/O functionalities and additional GPIO that the
|
||||||
|
|
||||||
Currently, the GPIO control examples support only ST33 TPM 2.0 modules.
|
Currently, the GPIO control examples support only ST33 TPM 2.0 modules.
|
||||||
|
|
||||||
There are three examples available: `gpio/config`, `gpio/set`, `gpio/read`.
|
There are three examples available: `gpio/gpio_config`, `gpio/gpio_set`, `gpio/gpio_read`.
|
||||||
|
|
||||||
Every example has a help option `-h`. Please consult with `config -h` about the various GPIO modes.
|
Every example has a help option `-h`. Please consult with `gpio_config -h` about the various GPIO modes.
|
||||||
|
|
||||||
Demo usage is available, when no parameters are supplied. Then, GPIO 0 is used in output mode.
|
Demo usage is available, when no parameters are supplied. Then, GPIO 0 is used in output mode.
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
examples/gpio/config -h
|
examples/gpio/gpio_config -h
|
||||||
Expected usage:
|
Expected usage:
|
||||||
./examples/gpio/gpio [num] [mode]
|
./examples/gpio/gpio_config [num] [mode]
|
||||||
* num is a GPIO number between 0-3 (default 0)
|
* num is a GPIO number between 0-3 (default 0)
|
||||||
* mode is a number selecting the GPIO mode between 0-6 (default 3):
|
* mode is a number selecting the GPIO mode between 0-6 (default 3):
|
||||||
0. standard - reset to the GPIO's default mode
|
0. standard - reset to the GPIO's default mode
|
||||||
|
@ -462,7 +462,7 @@ Example usage for configuring a GPIO to output can be found below:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
$ ./examples/gpio/config
|
$ ./examples/gpio/gpio_config
|
||||||
GPIO num is: 0
|
GPIO num is: 0
|
||||||
GPIO mode is: 5
|
GPIO mode is: 5
|
||||||
Example how to use extra GPIO on a TPM 2.0 modules
|
Example how to use extra GPIO on a TPM 2.0 modules
|
||||||
|
@ -471,7 +471,7 @@ Trying to configure GPIO0...
|
||||||
TPM2_GPIO_Config success
|
TPM2_GPIO_Config success
|
||||||
NV Index for GPIO access created
|
NV Index for GPIO access created
|
||||||
|
|
||||||
$ ./examples/gpio/set
|
$ ./examples/gpio/gpio_set
|
||||||
GPIO0 set to high level
|
GPIO0 set to high level
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -482,7 +482,7 @@ Example usage for configuring a GPIO as input with a pulp-up can be found below:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
$ ./examples/gpio/config 0 3
|
$ ./examples/gpio/gpio_config 0 3
|
||||||
GPIO num is: 0
|
GPIO num is: 0
|
||||||
GPIO mode is: 3
|
GPIO mode is: 3
|
||||||
Demo how to use extra GPIO on a TPM 2.0 modules
|
Demo how to use extra GPIO on a TPM 2.0 modules
|
||||||
|
@ -491,7 +491,7 @@ Trying to configure GPIO0...
|
||||||
TPM2_GPIO_Config success
|
TPM2_GPIO_Config success
|
||||||
NV Index for GPIO access created
|
NV Index for GPIO access created
|
||||||
|
|
||||||
$ ./examples/gpio/read 0
|
$ ./examples/gpio/gpio_read 0
|
||||||
GPIO0 is Low
|
GPIO0 is Low
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
static void usage(void)
|
static void usage(void)
|
||||||
{
|
{
|
||||||
printf("Expected usage:\n");
|
printf("Expected usage:\n");
|
||||||
printf("./examples/gpio/gpio [num] [mode]\n");
|
printf("./examples/gpio/gpio_config [num] [mode]\n");
|
||||||
printf("* num is a GPIO number between %d-%d (default %d)\n", GPIO_NUM_MIN, GPIO_NUM_MAX, TPM_GPIO_A);
|
printf("* num is a GPIO number between %d-%d (default %d)\n", GPIO_NUM_MIN, GPIO_NUM_MAX, TPM_GPIO_A);
|
||||||
printf("* mode is a number selecting the GPIO mode between 0-%d (default %d):\n", GPIO_MODE_MAX, TPM_GPIO_MODE_PULLDOWN);
|
printf("* mode is a number selecting the GPIO mode between 0-%d (default %d):\n", GPIO_MODE_MAX, TPM_GPIO_MODE_PULLDOWN);
|
||||||
printf("\t0. standard - reset to the GPIO's default mode\n");
|
printf("\t0. standard - reset to the GPIO's default mode\n");
|
|
@ -43,7 +43,7 @@
|
||||||
static void usage(void)
|
static void usage(void)
|
||||||
{
|
{
|
||||||
printf("Expected usage:\n");
|
printf("Expected usage:\n");
|
||||||
printf("./examples/gpio/read [num]\n");
|
printf("./examples/gpio/gpio_read [num]\n");
|
||||||
printf("* num is a GPIO number between %d-%d (default %d)\n", GPIO_NUM_MIN, GPIO_NUM_MAX, TPM_GPIO_A);
|
printf("* num is a GPIO number between %d-%d (default %d)\n", GPIO_NUM_MIN, GPIO_NUM_MAX, TPM_GPIO_A);
|
||||||
printf("Example usage, without parameters, read GPIO%d\n", TPM_GPIO_A);
|
printf("Example usage, without parameters, read GPIO%d\n", TPM_GPIO_A);
|
||||||
}
|
}
|
|
@ -42,7 +42,7 @@
|
||||||
static void usage(void)
|
static void usage(void)
|
||||||
{
|
{
|
||||||
printf("Expected usage:\n");
|
printf("Expected usage:\n");
|
||||||
printf("./examples/gpio/set [num] [-high/-low]\n");
|
printf("./examples/gpio/gpio_set [num] [-high/-low]\n");
|
||||||
printf("* num is a GPIO number between %d-%d (default %d)\n", GPIO_NUM_MIN, GPIO_NUM_MAX, TPM_GPIO_A);
|
printf("* num is a GPIO number between %d-%d (default %d)\n", GPIO_NUM_MIN, GPIO_NUM_MAX, TPM_GPIO_A);
|
||||||
printf("Example usage, without parameters, set GPIO%d high\n", TPM_GPIO_A);
|
printf("Example usage, without parameters, set GPIO%d high\n", TPM_GPIO_A);
|
||||||
}
|
}
|
|
@ -2,33 +2,33 @@
|
||||||
# All paths should be given relative to the root
|
# All paths should be given relative to the root
|
||||||
|
|
||||||
if BUILD_EXAMPLES
|
if BUILD_EXAMPLES
|
||||||
noinst_PROGRAMS += examples/gpio/config \
|
noinst_PROGRAMS += examples/gpio/gpio_config \
|
||||||
examples/gpio/read \
|
examples/gpio/gpio_read \
|
||||||
examples/gpio/set
|
examples/gpio/gpio_set
|
||||||
|
|
||||||
noinst_HEADERS += examples/gpio/gpio.h
|
noinst_HEADERS += examples/gpio/gpio.h
|
||||||
|
|
||||||
examples_gpio_config_SOURCES = examples/gpio/config.c \
|
examples_gpio_gpio_config_SOURCES = examples/gpio/gpio_config.c \
|
||||||
examples/tpm_io.c
|
examples/tpm_io.c
|
||||||
examples_gpio_config_LDADD = src/libwolftpm.la $(LIB_STATIC_ADD)
|
examples_gpio_gpio_config_LDADD = src/libwolftpm.la $(LIB_STATIC_ADD)
|
||||||
examples_gpio_config_DEPENDENCIES = src/libwolftpm.la
|
examples_gpio_gpio_config_DEPENDENCIES = src/libwolftpm.la
|
||||||
|
|
||||||
examples_gpio_read_SOURCES = examples/gpio/read.c \
|
examples_gpio_gpio_read_SOURCES = examples/gpio/gpio_read.c \
|
||||||
examples/tpm_io.c
|
examples/tpm_io.c
|
||||||
examples_gpio_read_LDADD = src/libwolftpm.la $(LIB_STATIC_ADD)
|
examples_gpio_gpio_read_LDADD = src/libwolftpm.la $(LIB_STATIC_ADD)
|
||||||
examples_gpio_read_DEPENDENCIES = src/libwolftpm.la
|
examples_gpio_gpio_read_DEPENDENCIES = src/libwolftpm.la
|
||||||
|
|
||||||
examples_gpio_set_SOURCES = examples/gpio/set.c \
|
examples_gpio_gpio_set_SOURCES = examples/gpio/gpio_set.c \
|
||||||
examples/tpm_io.c
|
examples/tpm_io.c
|
||||||
examples_gpio_set_LDADD = src/libwolftpm.la $(LIB_STATIC_ADD)
|
examples_gpio_gpio_set_LDADD = src/libwolftpm.la $(LIB_STATIC_ADD)
|
||||||
examples_gpio_set_DEPENDENCIES = src/libwolftpm.la
|
examples_gpio_gpio_set_DEPENDENCIES = src/libwolftpm.la
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
dist_example_DATA+= examples/gpio/config.c
|
dist_example_DATA+= examples/gpio/gpio_config.c
|
||||||
dist_example_DATA+= examples/gpio/read.c
|
dist_example_DATA+= examples/gpio/gpio_read.c
|
||||||
dist_example_DATA+= examples/gpio/set.c
|
dist_example_DATA+= examples/gpio/gpio_set.c
|
||||||
|
|
||||||
DISTCLEANFILES+= examples/gpio/.libs/config
|
DISTCLEANFILES+= examples/gpio/.libs/gpio_config
|
||||||
DISTCLEANFILES+= examples/gpio/.libs/read
|
DISTCLEANFILES+= examples/gpio/.libs/gpio_read
|
||||||
DISTCLEANFILES+= examples/gpio/.libs/set
|
DISTCLEANFILES+= examples/gpio/.libs/gpio_set
|
||||||
|
|
Loading…
Reference in New Issue