Module rustberry::peripherals[][src]

Implementation of the BCM283x Peripherals (GPIO, PWM, Serial, Timers) using their memory-mapped register segments.

The normal use-case is to use the high-level interface provided by Peripherals; however, the register accessors are also made available if you want to write your own interface.

This module is made entirely safe through the use of Reservations at the high level and atomics to enforce that the low-level register objects are singletons. It is not possible (without some unsafe hacking) to make multiple instances of anything that could possibly share access to a single resource.

Be aware that the high-level interface does use some RefCells so that individual pin objects can share the same register maps. This means that the low-level objects may still remain even after the main Peripherals object is dropped, preventing the creation of a new instance. All objects created by a previous instance of Peripherals need to be dropped before it can be reinstantiated.

Modules

clock

Frontend for the Clock Manager register map.

gpio

Frontend for the GPIO register map.

pwm

Frontend for the PWM register map.

Structs

DigitalInput

Encapsulates a pin reserved as a digital input.

DigitalOutput

Encapsulates a pin reserved as a digital output.

Peripherals

High-level wrapper around the peripheral registers with utilities for enforcing individual ownership of each component.

PwmConfig

The supported PWM configuration options.

PwmOutput

Encapsulates a pin reserved as a PWM output.

Enums

PwmMode

The supported modes of PWM operation.