Class FlinkPWM

  • All Implemented Interfaces:
    FlinkDefinitions

    public class FlinkPWM
    extends Object
    implements FlinkDefinitions
    The flink PWM subdevice realizes a PWM (pulse with modulation) function within a flink device. It offers several channels. Each channel has its own period and duty cycle.
    Author:
    Urs Graf
    • Field Detail

      • dev

        public FlinkSubDevice dev
        Handle to the subdevice within our flink device
    • Constructor Detail

      • FlinkPWM

        public FlinkPWM​(FlinkSubDevice dev)
        Creates a PWM subdevice.
        Parameters:
        dev - handle to the subdevice
    • Method Detail

      • getBaseClock

        public int getBaseClock()
        Returns the base clock of the underlying hardware counter.
        Returns:
        the base clock in Hz.
      • getPeriod

        public int getPeriod​(int channel)
        Reads the period of a single channel. Channel number must be 0 <= channel < nof available channels. Period setting is in multiple of the base clock, @see getBaseClock().
        Parameters:
        channel - channel number
        Returns:
        multiple of base clock
      • getHighTime

        public int getHighTime​(int channel)
        Reads the hightime of a single channel. Channel number must be 0 <= channel < nof available channels. Hightime setting is in multiple of the base clock, @see getBaseClock().
        Parameters:
        channel - channel number
        Returns:
        multiple of base clock
      • setPeriod

        public void setPeriod​(int channel,
                              int period)
        Sets the period of a single channel. Channel number must be 0 <= channel < nof available channels. Period setting is in multiple of the base clock, @see getBaseClock().
        Parameters:
        channel - channel number
        period - multiple of base clock
      • setHighTime

        public void setHighTime​(int channel,
                                int highTime)
        Sets the hightime of a single channel. Channel number must be 0 <= channel < nof available channels. Hightime setting is in multiple of the base clock, @see getBaseClock().
        Parameters:
        channel - channel number
        highTime - multiple of base clock