PebbleOS Documentation

repository·main·Indexed 26 days ago

https://github.com/google/pebble

Software repository for Pebble watches. This information-only version contains the PebbleOS source code with proprietary components removed. Includes documentation for the Pebble Developer website environment, PebbleKit JS and Rocky JS documentation generation, the pblprog utility for flashing BigBoard devices, libOS for FreeRTOS on ARM, and flash memory APIs.

Tokens
218.4K
Snippets
525
Records
1.3K
Agent score
89%

What's inside PebbleOS

  1. Overview of Smartstraps for Pebble

    main
    Smartstraps are wrist-mounted hardware accessories that interface with the smart accessory port on the back of specific Pebble watches. They allow developers to add electronic components such as LEDs, temperature sensors, or external batteries to enhance the watch's capabilities. Development involves 3D CAD design, electrical engineering, and implementing the Smartstrap software API and protocol.
  2. Overview of the AMS AS7000 SoC

    main

    The AMS AS7000 is a Cortex-M0 SoC used as a heart-rate monitor (HRM). It is not a black-box device; it must be programmed with specific firmware to function.

    Hardware Specifications:

    • CPU: Cortex-M0
    • Main Application Flash: 32 kB
    • Reserved Flash: Contains a loader application.
    • Bootloader: ROM first-stage bootloader.
    • Wake Signal: Pull the GPIO8 pin low to wake the chip from shutdown.
  3. Overview of Sports and Golf API Apps

    main

    PebbleOS includes two built-in system watchapps: the Sports app and the Golf app. These apps are hidden from the launcher and are intended to be controlled by a mobile companion app (via PebbleKit Android or iOS) to display sports-related data without requiring a custom Pebble app.

    Sports App

    • Displays: Activity duration, distance, and a configurable third field (pace or speed).
    • Units: Supports metric (default) or imperial units.
    • Interactions: Uses the action bar to allow users to pause/resume activity via the Select button.

    Golf App

    • Displays: Par, hole numbers, and yardage (front, mid, and rear).
    • Interactions: Uses the action bar to trigger 'up', 'ball', and 'down' events.
  4. Overview of Pebble Resource Generation

    main

    The Pebble resource generation system is designed to transform resource definitions into usable formats for both the SDK and Firmware. The system is built around five core design goals to ensure modularity and performance:

    1. Decoupled Processing: Different resource types are processed in separate, dedicated files.
    2. Platform Independence: The generation process is independent of whether the target is the SDK or Firmware. Differences in behavior are handled via parameters rather than explicit conditional logic.
    3. Native Execution: The system avoids 'shelling out' to external processes, performing operations natively.
    4. Filesystem-based Intermediate State: To optimize build times, intermediate states are captured in the filesystem rather than being held in large, transient in-memory data structures.
    5. Modular Resource Definitions: Dynamically generated content (such as Bluetooth patches or stored apps) is decoupled from static resource definition JSON files to improve modularity.
  5. Overview of Pebble sensors and services

    main

    Pebble watches provide several onboard sensors that apps can use as input devices.

    Available Sensors:

    • Buttons: Four physical buttons are available on all Pebble watches.
    • Accelerometer: Available on all Pebble watches.
    • Magnetometer: Accessible via the CompassService API.
    • Microphone: Available on Basalt and Chalk platforms via the Dictation API.
    • Pebble Health data sets: Available on Basalt and Chalk platforms.

    Battery Life Warning: Excessive or continuous use of sensors prevents the CPU from entering sleep mode, leading to rapid battery drain. To conserve power, consider obtaining data in batches rather than constant polling. See the best-practices/conserving-battery-life guide for more details.

  6. Overview of JerryScript

    main

    JerryScript is a lightweight JavaScript engine designed for resource-constrained Internet of Things (IoT) devices, such as microcontrollers. It is optimized for extremely low memory consumption, capable of running on devices with less than 64 KB of RAM and less than 200 KB of flash memory.

    Key features include:

    • Full ECMAScript 5.1 standard compliance.
    • Small binary size (e.g., 160K when compiled for ARM Thumb-2).
    • Written in C99 for high portability.
    • Snapshot support for precompiling JavaScript source code into bytecode.
    • A mature C API designed for easy embedding into applications.
  7. Overview of Nanopb

    main

    Nanopb is an ANSI-C library designed for encoding and decoding Google Protocol Buffers messages with minimal RAM and code space requirements. It is optimized for 32-bit microcontrollers and supports static allocation (no malloc required) by allowing users to specify maximum sizes for strings and arrays.

    Key features include:

    • Pure C runtime with small code size (5–10 kB).
    • Small RAM usage (typically ~300 bytes stack).
    • Support for nested submessages, default values, repeated/optional fields, oneofs, and packed arrays.
    • Callback mechanism for handling messages larger than available RAM.