diff --git a/clock.c b/clock.c index 8533b39..beca9d6 100644 --- a/clock.c +++ b/clock.c @@ -1835,3 +1835,13 @@ double clock_rate_ratio(struct clock *c) } return servo_rate_ratio(c->servo); } + +struct servo *clock_servo(struct clock *c) +{ + return c->servo; +} + +enum servo_state clock_servo_state(struct clock *c) +{ + return c->servo_state; +} diff --git a/clock.h b/clock.h index 07aba18..9d3133a 100644 --- a/clock.h +++ b/clock.h @@ -253,6 +253,20 @@ void clock_set_sde(struct clock *c, int sde); */ int clock_poll(struct clock *c); +/** + * Obtain the servo struct. + * @param c The clock instance. + * @return A pointer to the clock's servo. + */ +struct servo *clock_servo(struct clock *c); + +/** + * Obtain the current state of clock's servo. + * @param c The clock instance. + * @return The current state of the clock's servo. + */ +enum servo_state clock_servo_state(struct clock *c); + /** * Obtain the slave-only flag from a clock's default data set. * @param c The clock instance.