diff options
author | Anton Staaf <robotboy@chromium.org> | 2014-09-10 12:37:06 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-10-14 23:59:15 +0000 |
commit | c9e71277b4af9199125fbebc389ef19aa70045ab (patch) | |
tree | 00d9fc1c3611227383d3b09163bfb8f73e1c20a0 /extra/usb_gpio/Makefile | |
parent | 46102d3b4ed4958986b2272237a33513ee32fc92 (diff) | |
download | chrome-ec-c9e71277b4af9199125fbebc389ef19aa70045ab.tar.gz |
discovery-stm32f072: discovery USB GPIO test
Wire up the discovery's four LEDs and one user
button as GPIOs that can be written and read using
the new USB GPIO driver. This also adds an extra
tool called usb_gpio that provides control of GPIOs
from the linux command line.
Signed-off-by: Anton Staaf <robotboy@chromium.org>
BRANCH=None
BUG=None
TEST=cd board/discovery-stm32f072 ; make flash
cd extra/usb_gpio ; make
usb_gpio write 0x1e 0x00
Change-Id: I15115f82b15b6c35d1a34b83b7114a6bfa6a3d67
Reviewed-on: https://chromium-review.googlesource.com/218270
Reviewed-by: Anton Staaf <robotboy@chromium.org>
Commit-Queue: Anton Staaf <robotboy@chromium.org>
Tested-by: Anton Staaf <robotboy@chromium.org>
Diffstat (limited to 'extra/usb_gpio/Makefile')
-rw-r--r-- | extra/usb_gpio/Makefile | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/extra/usb_gpio/Makefile b/extra/usb_gpio/Makefile new file mode 100644 index 0000000000..2006c8ca67 --- /dev/null +++ b/extra/usb_gpio/Makefile @@ -0,0 +1,34 @@ +# Copyright (c) 2014 The Chromium OS Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +PROGRAM := usb_gpio +SOURCE := $(PROGRAM).c +LIBS := +LFLAGS := +CFLAGS := -std=gnu99 \ + -g3 \ + -O3 \ + -Wall \ + -Werror \ + -Wpointer-arith \ + -Wcast-align \ + -Wcast-qual \ + -Wundef \ + -Wsign-compare \ + -Wredundant-decls \ + -Wmissing-declarations + +# +# Add libusb-1.0 required flags +# +LIBS += $(shell pkg-config --libs libusb-1.0) +CFLAGS += $(shell pkg-config --cflags libusb-1.0) + +$(PROGRAM): $(SOURCE) Makefile + gcc $(CFLAGS) $(SOURCE) $(LFLAGS) $(LIBS) -o $@ + +.PHONY: clean + +clean: + rm -rf $(PROGRAM) *~ |