'\" t .\" Title: pwm_get_relative_duty_cycle .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: January 2017 .\" Manual: Pulse-Width Modulation (PWM) .\" Source: Kernel Hackers Manual 4.8.15 .\" Language: English .\" .TH "PWM_GET_RELATIVE_DUT" "9" "January 2017" "Kernel Hackers Manual 4\&.8\&." "Pulse-Width Modulation (PWM)" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" pwm_get_relative_duty_cycle \- Get a relative duty cycle value .SH "SYNOPSIS" .HP \w'unsigned\ int\ pwm_get_relative_duty_cycle('u .BI "unsigned int pwm_get_relative_duty_cycle(const\ struct\ pwm_state\ *\ " "state" ", unsigned\ int\ " "scale" ");" .SH "ARGUMENTS" .PP \fIstate\fR .RS 4 PWM state to extract the duty cycle from .RE .PP \fIscale\fR .RS 4 target scale of the relative duty cycle .RE .SH "DESCRIPTION" .PP This functions converts the absolute duty cycle stored in \fIstate\fR (expressed in nanosecond) into a value relative to the period\&. .PP For example if you want to get the duty_cycle expressed in percent, call: .PP pwm_get_state(pwm, state); duty = pwm_get_relative_duty_cycle(state, 100); .SH "COPYRIGHT" .br