CHERIoT RTOS
A compartmentalised RTOS for CHERIoT hardware
Loading...
Searching...
No Matches
SonataPulseWidthModulation::Output Struct Reference

A driver for Sonata's Pulse-Width Modulation (PWM). More...

#include <platform-pwm.hh>

Inheritance diagram for SonataPulseWidthModulation::Output:
Collaboration diagram for SonataPulseWidthModulation::Output:

Public Member Functions

void output_set (uint8_t period, uint8_t dutyCycle) volatile

Public Attributes

uint32_t dutyCycle
 The duty cycle of the wave, represented as a width counter.
uint32_t period
 The period (width) of the output block wave, set with the number of clock cycles that one period should last.

Detailed Description

A driver for Sonata's Pulse-Width Modulation (PWM).

Documentation source can be found at: https://github.com/lowRISC/sonata-system/blob/97a525c48f7bf051b999d0178dba04859819bc5e/doc/ip/pwm.md

Rendered documentation is served from: https://lowrisc.github.io/sonata-system/doc/ip/pwm.html

Definition at line 17 of file platform-pwm.hh.

Member Function Documentation

◆ output_set()

void SonataPulseWidthModulation::Output::output_set ( uint8_t period,
uint8_t dutyCycle ) volatile
inline

Definition at line 45 of file platform-pwm.hh.

Member Data Documentation

◆ dutyCycle

uint32_t SonataPulseWidthModulation::Output::dutyCycle

The duty cycle of the wave, represented as a width counter.

That is, the number of clock cycles for which the signal will be on. The duty cycle as a percentage is (duty cycle / period) * 100.

Definition at line 24 of file platform-pwm.hh.

◆ period

uint32_t SonataPulseWidthModulation::Output::period

The period (width) of the output block wave, set with the number of clock cycles that one period should last.

The maximum period is 255 as only an 8 bit counter is being used.

Definition at line 31 of file platform-pwm.hh.


The documentation for this struct was generated from the following file: