#
# This file is autogenerated, do not edit manually. Instead,
# edit gen/CANifier_data.yml
#

import typing

from hal_impl.data import hal_data

class CANifier:

    def __init__(self):
        self.create_called = False

    def create1(self, deviceNumber: int) -> None:
        assert isinstance(deviceNumber, int)
        self.create_called = True

    def setLEDOutput(self, dutyCycle: int, ledChannel: int) -> int:
        '''Sets the LED Output

        :param percentOutput: Output duty cycle expressed as percentage.
        :param ledChannel: Channel to set the output of.

        '''
        assert isinstance(dutyCycle, int) and dutyCycle < 4294967296 and dutyCycle >= 0
        assert isinstance(ledChannel, int) and ledChannel < 4294967296 and ledChannel >= 0
        raise NotImplementedError

    def setGeneralOutputs(self, outputsBits: int, isOutputBits: int) -> int:
        '''Sets the output of all General Pins

        :param outputBits: A bit mask of all the output states.  LSB->MSB is in the order of the #GeneralPin enum.
        :param isOutputBits: A boolean bit mask that sets the pins to be outputs or inputs.  A bit of 1 enables output.

        '''
        assert isinstance(outputsBits, int) and outputsBits < 4294967296 and outputsBits >= 0
        assert isinstance(isOutputBits, int) and isOutputBits < 4294967296 and isOutputBits >= 0
        raise NotImplementedError

    def setGeneralOutput(self, outputPin: int, outputValue: bool, outputEnable: bool) -> int:
        '''Sets the output of a General Pin

        :param outputPin: The pin to use as output.
        :param outputValue: The desired output state.
        :param outputEnable: Whether this pin is an output. "True" enables output.

        '''
        assert isinstance(outputPin, int) and outputPin < 4294967296 and outputPin >= 0
        assert isinstance(outputValue, bool)
        assert isinstance(outputEnable, bool)
        raise NotImplementedError

    def setPWMOutput(self, pwmChannel: int, dutyCycle: int) -> int:
        '''
        '''
        assert isinstance(pwmChannel, int) and pwmChannel < 4294967296 and pwmChannel >= 0
        assert isinstance(dutyCycle, int) and dutyCycle < 4294967296 and dutyCycle >= 0
        raise NotImplementedError

    def enablePWMOutput(self, pwmChannel: int, bEnable: bool) -> int:
        assert isinstance(pwmChannel, int) and pwmChannel < 4294967296 and pwmChannel >= 0
        assert isinstance(bEnable, bool)
        raise NotImplementedError

    def getGeneralInput(self, inputPin: int) -> typing.Tuple[int, bool]:
        '''Gets the state of the specified pin

        :param inputPin: The index of the pin.
        :returns: The state of the pin.

        '''
        assert isinstance(inputPin, int) and inputPin < 4294967296 and inputPin >= 0
        raise NotImplementedError

    def getPWMInput(self, pwmChannel: int) -> typing.Tuple[int, list]:
        '''Gets the PWM Input

        :param pwmChannel: PWM channel to get.
        :param dutyCycleAndPeriod: Double array to hold Duty Cycle [0] and Period [1].

        '''
        assert isinstance(pwmChannel, int) and pwmChannel < 4294967296 and pwmChannel >= 0
        raise NotImplementedError

    def getLastError(self) -> int:
        '''Call GetLastError() generated by this object.
        Not all functions return an error code but can
        potentially report errors.

        This function can be used to retrieve those error codes.

        :returns: The last ErrorCode generated.

        '''
        raise NotImplementedError

    def getBusVoltage(self) -> typing.Tuple[int, float]:
        '''Gets the bus voltage seen by the device.

        :returns: The bus voltage value (in volts).

        '''
        raise NotImplementedError

    def setLastError(self, error: int) -> None:
        assert isinstance(error, int)
        raise NotImplementedError

    def configSetParameter(self, param: int, value: float, subValue: int, ordinal: int, timeoutMs: int) -> int:
        '''Sets a parameter. Generally this is not used.

        This can be utilized in

        - Using new features without updating API installation.
        - Errata workarounds to circumvent API implementation.
        - Allows for rapid testing / unit testing of firmware.

        :param param:
            Parameter enumeration.
        :param value:
            Value of parameter.
        :param subValue:
            Subvalue for parameter. Maximum value of 255.
        :param ordinal:
            Ordinal of parameter.
        :param timeoutMs:
            Timeout value in ms. If nonzero, function will wait for config
            success and report an error if it times out. If zero, no
            blocking or checking is performed.
        :returns: Error Code generated by function. 0 indicates no error.

        '''
        assert isinstance(param, int)
        assert isinstance(value, (int, float))
        assert isinstance(subValue, int)
        assert isinstance(ordinal, int)
        assert isinstance(timeoutMs, int)
        raise NotImplementedError

    def configGetParameter(self, param: int, ordinal: int, timeoutMs: int) -> typing.Tuple[int, float]:
        '''Gets a parameter. Generally this is not used.

        This can be utilized in

        - Using new features without updating API installation.
        - Errata workarounds to circumvent API implementation.
        - Allows for rapid testing / unit testing of firmware.

        :param param:
            Parameter enumeration.
        :param ordinal:
            Ordinal of parameter.
        :param timeoutMs:
            Timeout value in ms. If nonzero, function will wait for config
            success and report an error if it times out. If zero, no
            blocking or checking is performed.
        :returns: Value of parameter.

        '''
        assert isinstance(param, int)
        assert isinstance(ordinal, int)
        assert isinstance(timeoutMs, int)
        raise NotImplementedError

    def configSetCustomParam(self, newValue: int, paramIndex: int, timeoutMs: int) -> int:
        '''Sets the value of a custom parameter. This is for arbitrary use.

        Sometimes it is necessary to save calibration/duty cycle/output
        information in the device. Particularly if the
        device is part of a subsystem that can be replaced.

        :param newValue:
            Value for custom parameter.
        :param paramIndex:
            Index of custom parameter [0-1].
        :param timeoutMs:
            Timeout value in ms. If nonzero, function will wait for config
            success and report an error if it times out. If zero, no
            blocking or checking is performed.
        :returns: Error Code generated by function. 0 indicates no error.

        '''
        assert isinstance(newValue, int)
        assert isinstance(paramIndex, int)
        assert isinstance(timeoutMs, int)
        raise NotImplementedError

    def configGetCustomParam(self, paramIndex: int, timoutMs: int) -> typing.Tuple[int, int]:
        '''Gets the value of a custom parameter. This is for arbitrary use.

        Sometimes it is necessary to save calibration/duty cycle/output
        information in the device. Particularly if the
        device is part of a subsystem that can be replaced.

        :param paramIndex:
            Index of custom parameter [0-1].
        :param timeoutMs:
            Timeout value in ms. If nonzero, function will wait for config
            success and report an error if it times out. If zero, no
            blocking or checking is performed.
        :returns: Value of the custom param.

        '''
        assert isinstance(paramIndex, int)
        assert isinstance(timoutMs, int)
        raise NotImplementedError

    def getFaults(self) -> typing.Tuple[int, int]:
        raise NotImplementedError

    def getStickyFaults(self) -> typing.Tuple[int, int]:
        raise NotImplementedError

    def clearStickyFaults(self, timeoutMs: int) -> int:
        '''Clears the Sticky Faults

        :returns: Error Code generated by function. 0 indicates no error.

        '''
        assert isinstance(timeoutMs, int)
        raise NotImplementedError

    def getFirmwareVersion(self) -> typing.Tuple[int, int]:
        '''Gets the firmware version of the device.

        :returns: Firmware version of device.

        '''
        raise NotImplementedError

    def hasResetOccurred(self) -> typing.Tuple[int, bool]:
        '''Returns true if the device has reset since last call.

        :returns: Has a Device Reset Occurred?

        '''
        raise NotImplementedError

    def setStatusFramePeriod(self, frame: int, periodMs: int, timeoutMs: int) -> int:
        '''Sets the period of the given status frame.

        :param statusFrame:
            Frame whose period is to be changed.
        :param periodMs:
            Period in ms for the given frame.
        :param timeoutMs:
            Timeout value in ms. If nonzero, function will wait for config
            success and report an error if it times out. If zero, no
            blocking or checking is performed.
        :returns: Error Code generated by function. 0 indicates no error.

        '''
        assert isinstance(frame, int)
        assert isinstance(periodMs, int)
        assert isinstance(timeoutMs, int)
        raise NotImplementedError

    def getStatusFramePeriod(self, frame: int, timeoutMs: int) -> typing.Tuple[int, int]:
        '''Gets the period of the given status frame.

        :param frame:
            Frame to get the period of.
        :param timeoutMs:
            Timeout value in ms. If nonzero, function will wait for config
            success and report an error if it times out. If zero, no
            blocking or checking is performed.
        :returns: Period of the given status frame.

        '''
        assert isinstance(frame, int)
        assert isinstance(timeoutMs, int)
        raise NotImplementedError

    def setControlFramePeriod(self, frame: int, periodMs: int) -> int:
        '''Sets the period of the given control frame.

        :param frame:
            Frame whose period is to be changed.
        :param periodMs:
            Period in ms for the given frame.
        :returns: Error Code generated by function. 0 indicates no error.

        '''
        assert isinstance(frame, int)
        assert isinstance(periodMs, int)
        raise NotImplementedError

