pebble
  • Tutorials
  • Get the SDK
  • Guides
  • Documentation
  • PebbleOS
  • Mobile App
  • Examples
  • Index 01
  • Community
  • Blog
  • More
Privacy
Cookies
Publish

PebbleOS

  • Overview
  • Start here
    • Getting started guide
  • Pebble Firmware
    • Overview
    • Playground
    • Application SDK
  • Development
    • The pbl CLI
    • Build system
    • Samples
      • Kernel
      • Subsystems
      • Drivers
      • Third-party
      • Rust
      • Benchmarks
    • Emulator and simulator
    • Testing
    • Debugging
    • Conventions
  • System
    • Architecture overview
    • Kernel
    • Drivers
    • Subsystems
    • Libraries
    • Third-party
  • Hardware
    • Boards
    • Board Add-ons
    • Programmers
  • Community
    • Contribution Guidelines
  • Reference
    • Reference
    • Kconfig options

USB: Test function

This sample runs the USB test function (CONFIG_USB_TEST) and nothing else, for the integration tests in tests/integration/usb, which drive it from the host the board’s USB device port is connected to. See USB for what the function does, and Integration tests for running the tests.

Run:

pbl samples samples/subsys/usb/test

Boards:

every board

Sources

src/main.c
#include <stdio.h>

#include <pbl/usb/usbd.h>

int main(void) {
  int ret;

  ret = pbl_usbd_enable();
  if (ret != 0) {
    fprintf(stderr, "usb: test function failed (%d)\n", ret);
    return ret;
  }

  printf("usb: test function up\n");

  return 0;
}

Output

usb: test function up

Generated from PebbleOS 9fa910d13. This page is maintained in the pebbleos repository: docs/samples/subsys/usb/test.md.

Overview

  • Sources
  • Output