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

CRC

CRC drivers accelerate the CRC subsystem with a hardware CRC unit. They are optional: without one, the subsystem computes every CRC in software.

Interface

The CRC unit class, struct pbl_crc, sits under CONFIG_CRC_HW, which the application enables. Its drivers select the hidden CONFIG_CRC_HW_ACCEL symbol and implement one operation per algorithm. Each takes a running value and a buffer, processes a prefix of it that is a whole number of 32-bit words, and returns its length in bytes. The subsystem calls the unit of the crc role.

The subsystem includes include/pbl/drivers/crc.h, where the unit is opaque. CRC drivers include include/pbl/drivers/crc/driver.h, which adds the unit structure, its operations and the class state and initializer macros.

Returning less than the full length is always allowed: the subsystem finishes in software. The class returns 0 before the device is ready, as when its self-test failed, and a driver returns 0 whenever the hardware cannot be used for any other reason, so callers never see a failure.

Implementations

  • SF32LB
  • STM32

The API reference documents the interface.

Generated from PebbleOS 7416f78a1. This page is maintained in the pebbleos repository: docs/drivers/crc/index.md.

Overview

  • Interface
  • Implementations