diff options
author | Bill Richardson <wfrichar@chromium.org> | 2015-05-19 00:00:23 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-06-18 05:07:55 +0000 |
commit | b72a5f5e8e97ba86736c1e26b4204fc6d0c215da (patch) | |
tree | 155559713f9432bbc849bbe18a12983a672db5c6 /extra | |
parent | dd1987051b473e74dab3490921d0cc77c76fcac3 (diff) | |
download | chrome-ec-b72a5f5e8e97ba86736c1e26b4204fc6d0c215da.tar.gz |
discovery-stm32f072: Blink the LEDs
This just makes the LEDs blink continually, because I have a
development board sitting on my desk and I like to see it doing
something.
You can still force the GPIOs on and off using the tool in
extra/usb_gpio/.
BUG=none
BRANCH=none
TEST=make buildall
Try it:
sudo make BOARD=discovery-stm32f072 flash
The LEDs blink.
Force them on and off with:
cd extra/usb_gpio
make
./usb_gpio write -1 0
./usb_gpio write 0 -1
./usb_gpio write 2 0
./usb_gpio write 4 2
To resume blinking, use
./usb_gpio write 0 0
Change-Id: Iadbe7436c02de5b6eae81885d95bad154ca3692c
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/274131
Reviewed-by: Anton Staaf <robotboy@chromium.org>
Diffstat (limited to 'extra')
-rw-r--r-- | extra/usb_gpio/usb_gpio.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/extra/usb_gpio/usb_gpio.c b/extra/usb_gpio/usb_gpio.c index 6c6d464963..70cf4a81c2 100644 --- a/extra/usb_gpio/usb_gpio.c +++ b/extra/usb_gpio/usb_gpio.c @@ -109,8 +109,9 @@ int main(int argc, char **argv) { libusb_context *context; libusb_device_handle *device; - uint16_t vendor_id = 0x18d1; - uint16_t product_id = 0x500f; + uint16_t vendor_id = 0x18d1; /* Google */ + uint16_t product_id = 0x500f; /* discovery-stm32f072 */ + int interface = 1; /* gpio interface */ if (!(argc == 2 && strcmp(argv[1], "read") == 0) && !(argc == 4 && strcmp(argv[1], "write") == 0)) { @@ -134,7 +135,7 @@ int main(int argc, char **argv) } CHECK(libusb_set_auto_detach_kernel_driver(device, 1)); - CHECK(libusb_claim_interface(device, 0)); + CHECK(libusb_claim_interface(device, interface)); if (argc == 2 && strcmp(argv[1], "read") == 0) { uint32_t mask; |