flinklib
flinklib: flink C library for Linux
pwm.c File Reference

flink userspace library, subdevice function "pwm". More...

#include "flinklib.h"
#include "types.h"
#include "error.h"
#include "log.h"
Include dependency graph for pwm.c:

Go to the source code of this file.

Functions

int flink_pwm_get_baseclock (flink_subdev *subdev, uint32_t *frequency)
 Reads the base clock of a PWM subdevice. More...
 
int flink_pwm_set_period (flink_subdev *subdev, uint32_t channel, uint32_t period)
 Sets the PWM period. More...
 
int flink_pwm_get_period (flink_subdev *subdev, uint32_t channel, uint32_t *period)
 Gets the PWM period. More...
 
int flink_pwm_set_hightime (flink_subdev *subdev, uint32_t channel, uint32_t hightime)
 Sets the PWM hightime. More...
 
int flink_pwm_get_hightime (flink_subdev *subdev, uint32_t channel, uint32_t *hightime)
 Gets the PWM hightime. More...
 

Detailed Description

flink userspace library, subdevice function "pwm".

Contains the high-level functions for a flink subdevice which realizes the function "pwm".

Author
Martin Züger

Definition in file pwm.c.

Function Documentation

int flink_pwm_get_baseclock ( flink_subdev subdev,
uint32_t *  frequency 
)

Reads the base clock of a PWM subdevice.

Parameters
subdevSubdevice.
frequencyContains the base clock in Hz.
Returns
int: 0 on success, -1 in case of failure.

Definition at line 35 of file pwm.c.

Here is the caller graph for this function:

int flink_pwm_get_hightime ( flink_subdev subdev,
uint32_t  channel,
uint32_t *  hightime 
)

Gets the PWM hightime.

Parameters
subdevSubdevice.
channelChannel number.
*hightimeHightime of the PWM signal in multiples of the base clock.
Returns
int: 0 on success, -1 in case of failure.

Definition at line 126 of file pwm.c.

Here is the caller graph for this function:

int flink_pwm_get_period ( flink_subdev subdev,
uint32_t  channel,
uint32_t *  period 
)

Gets the PWM period.

Parameters
subdevSubdevice.
channelChannel number.
*periodPeriod of the PWM signal in multiples of the base clock.
Returns
int: 0 on success, -1 in case of failure.

Definition at line 80 of file pwm.c.

Here is the caller graph for this function:

int flink_pwm_set_hightime ( flink_subdev subdev,
uint32_t  channel,
uint32_t  hightime 
)

Sets the PWM hightime.

Parameters
subdevSubdevice.
channelChannel number.
hightimeHightime of the PWM signal in multiples of the base clock.
Returns
int: 0 on success, -1 in case of failure.

Definition at line 104 of file pwm.c.

Here is the caller graph for this function:

int flink_pwm_set_period ( flink_subdev subdev,
uint32_t  channel,
uint32_t  period 
)

Sets the PWM period.

Parameters
subdevSubdevice.
channelChannel number.
periodPeriod of the PWM signal in multiples of the base clock.
Returns
int: 0 on success, -1 in case of failure.

Definition at line 57 of file pwm.c.

Here is the caller graph for this function: