38 printf(
"Reading base clock from watchdog subdevice %d\n", subdev->
id);
41 dbg_print(
" --> calculated offset is 0x%x!\n", offset);
60 dbg_print(
"Reading WD status from subdevice %d\n", subdev->
id);
63 dbg_print(
" --> calculated offset is 0x%x!\n", offset);
82 dbg_print(
"Setting WD counter on subdevice %d to %d (%x)\n", subdev->
id, counter, counter);
85 dbg_print(
" --> calculated offset is 0x%x!\n", offset);
87 if(
flink_write(subdev, offset, REGISTER_WITH, &counter) != REGISTER_WITH) {
104 dbg_print(
"[DEBUG] Arming WD (subdevice %d)\n", subdev->
id);
107 dbg_print(
" --> calculated offset is 0x%x!\n", offset);
Data structures for flink devices and subdevices.
int flink_wd_get_status(flink_subdev *subdev, uint8_t *status)
Reads the status word of a watchdog subdevice.
ssize_t flink_read(flink_subdev *subdev, uint32_t offset, uint8_t size, void *rdata)
Read from a flink subdevice.
int flink_write_bit(flink_subdev *subdev, uint32_t offset, uint8_t bit, void *wdata)
Write a single bit to a flink subdevice.
int flink_read_bit(flink_subdev *subdev, uint32_t offset, uint8_t bit, void *rdata)
Read a single bit from a flink subdevice.
int flink_wd_arm(flink_subdev *subdev)
Starts the watchdog counter.
int flink_wd_set_counter(flink_subdev *subdev, uint32_t counter)
Presets the watchdog counter.
int flink_wd_get_baseclock(flink_subdev *subdev, uint32_t *base_clk)
Reads the base clock of a watchdog subdevice.
ssize_t flink_write(flink_subdev *subdev, uint32_t offset, uint8_t size, void *wdata)
Write to a flink subdevice.
#define dbg_print(fmt,...)