flinklib
flinklib: flink C library for Linux
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
wd.c File Reference

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

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

Go to the source code of this file.

Functions

int flink_wd_get_baseclock (flink_subdev *subdev, uint32_t *base_clk)
 Reads the base clock of a watchdog subdevice. More...
 
int flink_wd_get_status (flink_subdev *subdev, uint8_t *status)
 Reads the status word of a watchdog subdevice. More...
 
int flink_wd_set_counter (flink_subdev *subdev, uint32_t counter)
 Presets the watchdog counter. More...
 
int flink_wd_arm (flink_subdev *subdev)
 Starts the watchdog counter. More...
 

Detailed Description

flink userspace library, subdevice function "watchdog".

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

Author
Martin Züger

Definition in file wd.c.

Function Documentation

int flink_wd_arm ( flink_subdev subdev)

Starts the watchdog counter.

Parameters
subdevSubdevice.
Returns
int: 0 on success, -1 in case of failure.

Definition at line 100 of file wd.c.

int flink_wd_get_baseclock ( flink_subdev subdev,
uint32_t *  base_clk 
)

Reads the base clock of a watchdog 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 wd.c.

int flink_wd_get_status ( flink_subdev subdev,
uint8_t *  status 
)

Reads the status word of a watchdog subdevice.

Parameters
subdevSubdevice.
statusContains the status word.
Returns
int: 0 on success, -1 in case of failure.

Definition at line 57 of file wd.c.

int flink_wd_set_counter ( flink_subdev subdev,
uint32_t  counter 
)

Presets the watchdog counter.

Parameters
subdevSubdevice.
counterDesired counter value.
Returns
int: 0 on success, -1 in case of failure.

Definition at line 79 of file wd.c.