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
    • Emulator and simulator
    • Testing
    • Debugging
    • Conventions
  • System
    • Architecture overview
    • Kernel
    • Drivers
      • Device model
      • Simulators
      • Buses and I/O
      • Clocks, power and timing
      • Memory and storage
      • Display and graphics
      • Sensors and input
      • Audio and haptics
      • Power supply
      • System
    • Subsystems
    • Libraries
    • Third-party
  • Hardware
    • Boards
    • Board Add-ons
    • Programmers
  • Community
    • Contribution Guidelines
  • Reference
    • Reference
    • Kconfig options

Disk

A disk is block storage read and written by whole sectors of one size, numbered from 0: what a file system or the USB mass storage function (see USB) sits on. The class only checks that the sectors are on the disk, that it is ready and that it takes writes; how a driver stores them, erase blocks and caching included, is its own. A write may stay in the driver until pbl_disk_sync(). The class does not serialize calls: a driver that cannot take them from several threads at once serializes them itself.

Directory

drivers/disk

Header

pbl/drivers/disk.h

Kconfig

CONFIG_DISK, enabled by the application

Sample

USB: Mass storage

API

API reference

Drivers

Driver

Device

Kconfig

RAM disk

pbl_disk_ram (pbl/drivers/disk/ram.h)

CONFIG_DISK_RAM

The RAM disk has no hardware to describe, so it is not a devicetree node: the driver defines its one device, CONFIG_DISK_RAM_SIZE KiB of the application’s RAM in 512-byte sectors, zeroed at boot.

Generated from PebbleOS d278268fe. This page is maintained in the pebbleos repository: docs/drivers/disk.md.