1.1 --- a/pkg/devices/lib/cpm/src/common.cc Thu Nov 16 17:48:32 2023 +0100
1.2 +++ b/pkg/devices/lib/cpm/src/common.cc Thu Nov 16 22:03:51 2023 +0100
1.3 @@ -301,6 +301,41 @@
1.4
1.5
1.6
1.7 +// Fixed divider.
1.8 +
1.9 +uint64_t
1.10 +Divider_fixed::get_frequency(Cpm_regs ®s, uint64_t source_frequency)
1.11 +{
1.12 + (void) regs;
1.13 + return source_frequency / _value;
1.14 +}
1.15 +
1.16 +int
1.17 +Divider_fixed::set_frequency(Cpm_regs ®s, uint64_t source_frequency, uint64_t frequency)
1.18 +{
1.19 + (void) regs; (void) source_frequency; (void) frequency;
1.20 + return 0;
1.21 +}
1.22 +
1.23 +int
1.24 +Divider_fixed::get_parameters(Cpm_regs ®s, uint32_t parameters[])
1.25 +{
1.26 + (void) regs;
1.27 + parameters[0] = _value;
1.28 + return 1;
1.29 +}
1.30 +
1.31 +int
1.32 +Divider_fixed::set_parameters(Cpm_regs ®s, int num_parameters, uint32_t parameters[])
1.33 +{
1.34 + (void) regs; (void) num_parameters; (void) parameters;
1.35 + return 0;
1.36 +}
1.37 +
1.38 +
1.39 +
1.40 +// Simple divider for regular clocks.
1.41 +
1.42 uint32_t
1.43 Divider::get_divider(Cpm_regs ®s)
1.44 {