/**
    This file is mostly autogenerated, if you need to make large changes see
    the documentation!
*/

#include <pybind11/pybind11.h>
namespace py = pybind11;

#include "CanTalonSRX.h"

void CheckCTRCode(CTR_Code code) {
    if (code != 0) {
        const char * err;
        
        #define ERR(x) case x: err = "CTRE error: " #x; break;
        
        switch (code) {
            ERR(CTR_RxTimeout)
            ERR(CTR_TxTimeout)
            ERR(CTR_InvalidParamValue)
            ERR(CTR_UnexpectedArbId)
            ERR(CTR_TxFailed)
            ERR(CTR_SigNotUpdated)
            ERR(CTR_BufferFull)
            default:
                err = "Invalid CTR error code";
        }
        
        if (PyErr_WarnEx(PyExc_UserWarning, err, 1) == -1) {
            throw new py::error_already_set;
        }
    }
}

PYBIND11_PLUGIN(cantalon_roborio) {
    py::module m("cantalon_roborio");
    
    py::enum_<CTR_Code>(m, "CTR_Code")
      .value("CTR_OKAY", CTR_OKAY)
      .value("CTR_RxTimeout", CTR_RxTimeout)
      .value("CTR_TxTimeout", CTR_TxTimeout)
      .value("CTR_InvalidParamValue", CTR_InvalidParamValue)
      .value("CTR_UnexpectedArbId", CTR_UnexpectedArbId)
      .value("CTR_TxFailed", CTR_TxFailed)
      .value("CTR_SigNotUpdated", CTR_SigNotUpdated)
      .value("CTR_BufferFull", CTR_BufferFull);

      py::class_<CanTalonSRX> cantalonsrx(m, "CanTalonSRX");
      cantalonsrx
        .def(py::init<int,int,int>())
        .def("Set", &CanTalonSRX::Set)
        .def("SetParam", [](CanTalonSRX &__inst, CanTalonSRX::param_t paramEnum, double value) {
          auto __ret = __inst.SetParam(paramEnum, value);
          CheckCTRCode(__ret);
        })
        .def("RequestParam", [](CanTalonSRX &__inst, CanTalonSRX::param_t paramEnum) {
          auto __ret = __inst.RequestParam(paramEnum);
          CheckCTRCode(__ret);
        })
        .def("GetParamResponse", [](CanTalonSRX &__inst, CanTalonSRX::param_t paramEnum) {
          double value;
          auto __ret = __inst.GetParamResponse(paramEnum, value);
          CheckCTRCode(__ret);
          return value;
        })
        .def("GetParamResponseInt32", [](CanTalonSRX &__inst, CanTalonSRX::param_t paramEnum) {
          int value;
          auto __ret = __inst.GetParamResponseInt32(paramEnum, value);
          CheckCTRCode(__ret);
          return value;
        })
        .def("SetPgain", [](CanTalonSRX &__inst, unsigned slotIdx, double gain) {
          auto __ret = __inst.SetPgain(slotIdx, gain);
          CheckCTRCode(__ret);
        })
        .def("SetIgain", [](CanTalonSRX &__inst, unsigned slotIdx, double gain) {
          auto __ret = __inst.SetIgain(slotIdx, gain);
          CheckCTRCode(__ret);
        })
        .def("SetDgain", [](CanTalonSRX &__inst, unsigned slotIdx, double gain) {
          auto __ret = __inst.SetDgain(slotIdx, gain);
          CheckCTRCode(__ret);
        })
        .def("SetFgain", [](CanTalonSRX &__inst, unsigned slotIdx, double gain) {
          auto __ret = __inst.SetFgain(slotIdx, gain);
          CheckCTRCode(__ret);
        })
        .def("SetIzone", [](CanTalonSRX &__inst, unsigned slotIdx, int zone) {
          auto __ret = __inst.SetIzone(slotIdx, zone);
          CheckCTRCode(__ret);
        })
        .def("SetCloseLoopRampRate", [](CanTalonSRX &__inst, unsigned slotIdx, int closeLoopRampRate) {
          auto __ret = __inst.SetCloseLoopRampRate(slotIdx, closeLoopRampRate);
          CheckCTRCode(__ret);
        })
        .def("SetVoltageCompensationRate", [](CanTalonSRX &__inst, double voltagePerMs) {
          auto __ret = __inst.SetVoltageCompensationRate(voltagePerMs);
          CheckCTRCode(__ret);
        })
        .def("SetSensorPosition", [](CanTalonSRX &__inst, int pos) {
          auto __ret = __inst.SetSensorPosition(pos);
          CheckCTRCode(__ret);
        })
        .def("SetForwardSoftLimit", [](CanTalonSRX &__inst, int forwardLimit) {
          auto __ret = __inst.SetForwardSoftLimit(forwardLimit);
          CheckCTRCode(__ret);
        })
        .def("SetReverseSoftLimit", [](CanTalonSRX &__inst, int reverseLimit) {
          auto __ret = __inst.SetReverseSoftLimit(reverseLimit);
          CheckCTRCode(__ret);
        })
        .def("SetForwardSoftEnable", [](CanTalonSRX &__inst, int enable) {
          auto __ret = __inst.SetForwardSoftEnable(enable);
          CheckCTRCode(__ret);
        })
        .def("SetReverseSoftEnable", [](CanTalonSRX &__inst, int enable) {
          auto __ret = __inst.SetReverseSoftEnable(enable);
          CheckCTRCode(__ret);
        })
        .def("GetPgain", [](CanTalonSRX &__inst, unsigned slotIdx) {
          double gain;
          auto __ret = __inst.GetPgain(slotIdx, gain);
          CheckCTRCode(__ret);
          return gain;
        })
        .def("GetIgain", [](CanTalonSRX &__inst, unsigned slotIdx) {
          double gain;
          auto __ret = __inst.GetIgain(slotIdx, gain);
          CheckCTRCode(__ret);
          return gain;
        })
        .def("GetDgain", [](CanTalonSRX &__inst, unsigned slotIdx) {
          double gain;
          auto __ret = __inst.GetDgain(slotIdx, gain);
          CheckCTRCode(__ret);
          return gain;
        })
        .def("GetFgain", [](CanTalonSRX &__inst, unsigned slotIdx) {
          double gain;
          auto __ret = __inst.GetFgain(slotIdx, gain);
          CheckCTRCode(__ret);
          return gain;
        })
        .def("GetIzone", [](CanTalonSRX &__inst, unsigned slotIdx) {
          int zone;
          auto __ret = __inst.GetIzone(slotIdx, zone);
          CheckCTRCode(__ret);
          return zone;
        })
        .def("GetCloseLoopRampRate", [](CanTalonSRX &__inst, unsigned slotIdx) {
          int closeLoopRampRate;
          auto __ret = __inst.GetCloseLoopRampRate(slotIdx, closeLoopRampRate);
          CheckCTRCode(__ret);
          return closeLoopRampRate;
        })
        .def("GetVoltageCompensationRate", [](CanTalonSRX &__inst) {
          double voltagePerMs;
          auto __ret = __inst.GetVoltageCompensationRate(voltagePerMs);
          CheckCTRCode(__ret);
          return voltagePerMs;
        })
        .def("GetForwardSoftLimit", [](CanTalonSRX &__inst) {
          int forwardLimit;
          auto __ret = __inst.GetForwardSoftLimit(forwardLimit);
          CheckCTRCode(__ret);
          return forwardLimit;
        })
        .def("GetReverseSoftLimit", [](CanTalonSRX &__inst) {
          int reverseLimit;
          auto __ret = __inst.GetReverseSoftLimit(reverseLimit);
          CheckCTRCode(__ret);
          return reverseLimit;
        })
        .def("GetForwardSoftEnable", [](CanTalonSRX &__inst) {
          int enable;
          auto __ret = __inst.GetForwardSoftEnable(enable);
          CheckCTRCode(__ret);
          return enable;
        })
        .def("GetReverseSoftEnable", [](CanTalonSRX &__inst) {
          int enable;
          auto __ret = __inst.GetReverseSoftEnable(enable);
          CheckCTRCode(__ret);
          return enable;
        })
        .def("GetPulseWidthRiseToFallUs", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetPulseWidthRiseToFallUs(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("IsPulseWidthSensorPresent", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.IsPulseWidthSensorPresent(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("SetModeSelect", [](CanTalonSRX &__inst, int modeSelect, int demand) {
          auto __ret = __inst.SetModeSelect(modeSelect, demand);
          CheckCTRCode(__ret);
        })
        .def("SetModeSelect", [](CanTalonSRX &__inst, int param) {
          auto __ret = __inst.SetModeSelect(param);
          CheckCTRCode(__ret);
        })
        .def("SetStatusFrameRate", [](CanTalonSRX &__inst, unsigned frameEnum, unsigned periodMs) {
          auto __ret = __inst.SetStatusFrameRate(frameEnum, periodMs);
          CheckCTRCode(__ret);
        })
        .def("ClearStickyFaults", [](CanTalonSRX &__inst) {
          auto __ret = __inst.ClearStickyFaults();
          CheckCTRCode(__ret);
        })
        .def("ChangeMotionControlFramePeriod", &CanTalonSRX::ChangeMotionControlFramePeriod)
        .def("ClearMotionProfileTrajectories", &CanTalonSRX::ClearMotionProfileTrajectories)
        .def("GetMotionProfileTopLevelBufferCount", &CanTalonSRX::GetMotionProfileTopLevelBufferCount)
        .def("IsMotionProfileTopLevelBufferFull", &CanTalonSRX::IsMotionProfileTopLevelBufferFull)
        .def("PushMotionProfileTrajectory", [](CanTalonSRX &__inst, int targPos, int targVel, int profileSlotSelect, int timeDurMs, int velOnly, int isLastPoint, int zeroPos) {
          auto __ret = __inst.PushMotionProfileTrajectory(targPos, targVel, profileSlotSelect, timeDurMs, velOnly, isLastPoint, zeroPos);
          CheckCTRCode(__ret);
        })
        .def("ProcessMotionProfileBuffer", &CanTalonSRX::ProcessMotionProfileBuffer)
        .def("GetMotionProfileStatus", [](CanTalonSRX &__inst) {
          uint32_t flags; uint32_t profileSlotSelect; int32_t targPos; int32_t targVel; uint32_t topBufferRemaining; uint32_t topBufferCnt; uint32_t btmBufferCnt; uint32_t outputEnable;
          auto __ret = __inst.GetMotionProfileStatus(flags, profileSlotSelect, targPos, targVel, topBufferRemaining, topBufferCnt, btmBufferCnt, outputEnable);
          CheckCTRCode(__ret);
          return std::make_tuple(flags, profileSlotSelect, targPos, targVel, topBufferRemaining, topBufferCnt, btmBufferCnt, outputEnable);
        })
        .def("SetThrottleBump", [](CanTalonSRX &__inst, int32_t throttleBump) {
          auto __ret = __inst.SetThrottleBump(throttleBump);
          CheckCTRCode(__ret);
        })
        .def("GetMotionMagic_ActiveTrajVelocity", [](CanTalonSRX &__inst) {
          int32_t param;
          auto __ret = __inst.GetMotionMagic_ActiveTrajVelocity(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetMotionMagic_ActiveTrajPosition", [](CanTalonSRX &__inst) {
          int32_t param;
          auto __ret = __inst.GetMotionMagic_ActiveTrajPosition(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("SetCurrentLimEnable", [](CanTalonSRX &__inst, bool bEnableCurrLim) {
          auto __ret = __inst.SetCurrentLimEnable(bEnableCurrLim);
          CheckCTRCode(__ret);
        })
        .def("SetPersistentStorageWriteTimeout", [](CanTalonSRX &__inst, uint32_t persStorageWriteTimeoutMs) {
          auto __ret = __inst.SetPersistentStorageWriteTimeout(persStorageWriteTimeoutMs);
          CheckCTRCode(__ret);
        })
        .def("GetGadgeteerStatus", [](CanTalonSRX &__inst) {
          CanTalonSRX::GadgeteerUartStatus status;
          auto __ret = __inst.GetGadgeteerStatus(status);
          return std::make_tuple(__ret, status);
        })
        .def("HasResetOccured", &CanTalonSRX::HasResetOccured)
        .def("GetLastError", &CanTalonSRX::GetLastError)
        .def("SetLastError", &CanTalonSRX::SetLastError)
        .def("GetFault_OverTemp", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetFault_OverTemp(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetFault_UnderVoltage", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetFault_UnderVoltage(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetFault_ForLim", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetFault_ForLim(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetFault_RevLim", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetFault_RevLim(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetFault_HardwareFailure", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetFault_HardwareFailure(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetFault_ForSoftLim", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetFault_ForSoftLim(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetFault_RevSoftLim", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetFault_RevSoftLim(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetStckyFault_OverTemp", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetStckyFault_OverTemp(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetStckyFault_UnderVoltage", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetStckyFault_UnderVoltage(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetStckyFault_ForLim", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetStckyFault_ForLim(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetStckyFault_RevLim", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetStckyFault_RevLim(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetStckyFault_ForSoftLim", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetStckyFault_ForSoftLim(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetStckyFault_RevSoftLim", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetStckyFault_RevSoftLim(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetAppliedThrottle", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetAppliedThrottle(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetCloseLoopErr", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetCloseLoopErr(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetFeedbackDeviceSelect", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetFeedbackDeviceSelect(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetModeSelect", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetModeSelect(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetLimitSwitchEn", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetLimitSwitchEn(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetLimitSwitchClosedFor", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetLimitSwitchClosedFor(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetLimitSwitchClosedRev", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetLimitSwitchClosedRev(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetSensorPosition", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetSensorPosition(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetSensorVelocity", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetSensorVelocity(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetCurrent", [](CanTalonSRX &__inst) {
          double param;
          auto __ret = __inst.GetCurrent(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetBrakeIsEnabled", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetBrakeIsEnabled(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetEncPosition", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetEncPosition(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetEncVel", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetEncVel(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetEncIndexRiseEvents", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetEncIndexRiseEvents(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetQuadApin", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetQuadApin(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetQuadBpin", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetQuadBpin(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetQuadIdxpin", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetQuadIdxpin(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetAnalogInWithOv", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetAnalogInWithOv(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetAnalogInVel", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetAnalogInVel(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetTemp", [](CanTalonSRX &__inst) {
          double param;
          auto __ret = __inst.GetTemp(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetBatteryV", [](CanTalonSRX &__inst) {
          double param;
          auto __ret = __inst.GetBatteryV(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetClearPosOnIdx", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetClearPosOnIdx(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetClearPosOnLimR", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetClearPosOnLimR(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetClearPosOnLimF", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetClearPosOnLimF(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetResetCount", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetResetCount(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetResetFlags", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetResetFlags(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetFirmVers", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetFirmVers(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetPulseWidthPosition", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetPulseWidthPosition(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetPulseWidthVelocity", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetPulseWidthVelocity(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetPulseWidthRiseToRiseUs", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetPulseWidthRiseToRiseUs(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetActTraj_IsValid", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetActTraj_IsValid(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetActTraj_ProfileSlotSelect", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetActTraj_ProfileSlotSelect(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetActTraj_VelOnly", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetActTraj_VelOnly(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetActTraj_IsLast", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetActTraj_IsLast(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetOutputType", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetOutputType(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetHasUnderrun", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetHasUnderrun(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetIsUnderrun", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetIsUnderrun(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetNextID", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetNextID(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetBufferIsFull", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetBufferIsFull(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetCount", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetCount(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetActTraj_Velocity", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetActTraj_Velocity(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("GetActTraj_Position", [](CanTalonSRX &__inst) {
          int param;
          auto __ret = __inst.GetActTraj_Position(param);
          CheckCTRCode(__ret);
          return param;
        })
        .def("SetDemand", [](CanTalonSRX &__inst, int param) {
          auto __ret = __inst.SetDemand(param);
          CheckCTRCode(__ret);
        })
        .def("SetOverrideLimitSwitchEn", [](CanTalonSRX &__inst, int param) {
          auto __ret = __inst.SetOverrideLimitSwitchEn(param);
          CheckCTRCode(__ret);
        })
        .def("SetFeedbackDeviceSelect", [](CanTalonSRX &__inst, int param) {
          auto __ret = __inst.SetFeedbackDeviceSelect(param);
          CheckCTRCode(__ret);
        })
        .def("SetRevMotDuringCloseLoopEn", [](CanTalonSRX &__inst, int param) {
          auto __ret = __inst.SetRevMotDuringCloseLoopEn(param);
          CheckCTRCode(__ret);
        })
        .def("SetOverrideBrakeType", [](CanTalonSRX &__inst, int param) {
          auto __ret = __inst.SetOverrideBrakeType(param);
          CheckCTRCode(__ret);
        })
        .def("SetProfileSlotSelect", [](CanTalonSRX &__inst, int param) {
          auto __ret = __inst.SetProfileSlotSelect(param);
          CheckCTRCode(__ret);
        })
        .def("SetRampThrottle", [](CanTalonSRX &__inst, int param) {
          auto __ret = __inst.SetRampThrottle(param);
          CheckCTRCode(__ret);
        })
        .def("SetRevFeedbackSensor", [](CanTalonSRX &__inst, int param) {
          auto __ret = __inst.SetRevFeedbackSensor(param);
          CheckCTRCode(__ret);
        });
    
    py::enum_<CanTalonSRX::param_t>(cantalonsrx, "param_t")
      .value("eProfileParamSlot0_P", CanTalonSRX::param_t::eProfileParamSlot0_P)
      .value("eProfileParamSlot0_I", CanTalonSRX::param_t::eProfileParamSlot0_I)
      .value("eProfileParamSlot0_D", CanTalonSRX::param_t::eProfileParamSlot0_D)
      .value("eProfileParamSlot0_F", CanTalonSRX::param_t::eProfileParamSlot0_F)
      .value("eProfileParamSlot0_IZone", CanTalonSRX::param_t::eProfileParamSlot0_IZone)
      .value("eProfileParamSlot0_CloseLoopRampRate", CanTalonSRX::param_t::eProfileParamSlot0_CloseLoopRampRate)
      .value("eProfileParamSlot1_P", CanTalonSRX::param_t::eProfileParamSlot1_P)
      .value("eProfileParamSlot1_I", CanTalonSRX::param_t::eProfileParamSlot1_I)
      .value("eProfileParamSlot1_D", CanTalonSRX::param_t::eProfileParamSlot1_D)
      .value("eProfileParamSlot1_F", CanTalonSRX::param_t::eProfileParamSlot1_F)
      .value("eProfileParamSlot1_IZone", CanTalonSRX::param_t::eProfileParamSlot1_IZone)
      .value("eProfileParamSlot1_CloseLoopRampRate", CanTalonSRX::param_t::eProfileParamSlot1_CloseLoopRampRate)
      .value("eProfileParamSoftLimitForThreshold", CanTalonSRX::param_t::eProfileParamSoftLimitForThreshold)
      .value("eProfileParamSoftLimitRevThreshold", CanTalonSRX::param_t::eProfileParamSoftLimitRevThreshold)
      .value("eProfileParamSoftLimitForEnable", CanTalonSRX::param_t::eProfileParamSoftLimitForEnable)
      .value("eProfileParamSoftLimitRevEnable", CanTalonSRX::param_t::eProfileParamSoftLimitRevEnable)
      .value("eOnBoot_BrakeMode", CanTalonSRX::param_t::eOnBoot_BrakeMode)
      .value("eOnBoot_LimitSwitch_Forward_NormallyClosed", CanTalonSRX::param_t::eOnBoot_LimitSwitch_Forward_NormallyClosed)
      .value("eOnBoot_LimitSwitch_Reverse_NormallyClosed", CanTalonSRX::param_t::eOnBoot_LimitSwitch_Reverse_NormallyClosed)
      .value("eOnBoot_LimitSwitch_Forward_Disable", CanTalonSRX::param_t::eOnBoot_LimitSwitch_Forward_Disable)
      .value("eOnBoot_LimitSwitch_Reverse_Disable", CanTalonSRX::param_t::eOnBoot_LimitSwitch_Reverse_Disable)
      .value("eFault_OverTemp", CanTalonSRX::param_t::eFault_OverTemp)
      .value("eFault_UnderVoltage", CanTalonSRX::param_t::eFault_UnderVoltage)
      .value("eFault_ForLim", CanTalonSRX::param_t::eFault_ForLim)
      .value("eFault_RevLim", CanTalonSRX::param_t::eFault_RevLim)
      .value("eFault_HardwareFailure", CanTalonSRX::param_t::eFault_HardwareFailure)
      .value("eFault_ForSoftLim", CanTalonSRX::param_t::eFault_ForSoftLim)
      .value("eFault_RevSoftLim", CanTalonSRX::param_t::eFault_RevSoftLim)
      .value("eStckyFault_OverTemp", CanTalonSRX::param_t::eStckyFault_OverTemp)
      .value("eStckyFault_UnderVoltage", CanTalonSRX::param_t::eStckyFault_UnderVoltage)
      .value("eStckyFault_ForLim", CanTalonSRX::param_t::eStckyFault_ForLim)
      .value("eStckyFault_RevLim", CanTalonSRX::param_t::eStckyFault_RevLim)
      .value("eStckyFault_ForSoftLim", CanTalonSRX::param_t::eStckyFault_ForSoftLim)
      .value("eStckyFault_RevSoftLim", CanTalonSRX::param_t::eStckyFault_RevSoftLim)
      .value("eAppliedThrottle", CanTalonSRX::param_t::eAppliedThrottle)
      .value("eCloseLoopErr", CanTalonSRX::param_t::eCloseLoopErr)
      .value("eFeedbackDeviceSelect", CanTalonSRX::param_t::eFeedbackDeviceSelect)
      .value("eRevMotDuringCloseLoopEn", CanTalonSRX::param_t::eRevMotDuringCloseLoopEn)
      .value("eModeSelect", CanTalonSRX::param_t::eModeSelect)
      .value("eProfileSlotSelect", CanTalonSRX::param_t::eProfileSlotSelect)
      .value("eRampThrottle", CanTalonSRX::param_t::eRampThrottle)
      .value("eRevFeedbackSensor", CanTalonSRX::param_t::eRevFeedbackSensor)
      .value("eLimitSwitchEn", CanTalonSRX::param_t::eLimitSwitchEn)
      .value("eLimitSwitchClosedFor", CanTalonSRX::param_t::eLimitSwitchClosedFor)
      .value("eLimitSwitchClosedRev", CanTalonSRX::param_t::eLimitSwitchClosedRev)
      .value("eSensorPosition", CanTalonSRX::param_t::eSensorPosition)
      .value("eSensorVelocity", CanTalonSRX::param_t::eSensorVelocity)
      .value("eCurrent", CanTalonSRX::param_t::eCurrent)
      .value("eBrakeIsEnabled", CanTalonSRX::param_t::eBrakeIsEnabled)
      .value("eEncPosition", CanTalonSRX::param_t::eEncPosition)
      .value("eEncVel", CanTalonSRX::param_t::eEncVel)
      .value("eEncIndexRiseEvents", CanTalonSRX::param_t::eEncIndexRiseEvents)
      .value("eQuadApin", CanTalonSRX::param_t::eQuadApin)
      .value("eQuadBpin", CanTalonSRX::param_t::eQuadBpin)
      .value("eQuadIdxpin", CanTalonSRX::param_t::eQuadIdxpin)
      .value("eAnalogInWithOv", CanTalonSRX::param_t::eAnalogInWithOv)
      .value("eAnalogInVel", CanTalonSRX::param_t::eAnalogInVel)
      .value("eTemp", CanTalonSRX::param_t::eTemp)
      .value("eBatteryV", CanTalonSRX::param_t::eBatteryV)
      .value("eResetCount", CanTalonSRX::param_t::eResetCount)
      .value("eResetFlags", CanTalonSRX::param_t::eResetFlags)
      .value("eFirmVers", CanTalonSRX::param_t::eFirmVers)
      .value("eSettingsChanged", CanTalonSRX::param_t::eSettingsChanged)
      .value("eQuadFilterEn", CanTalonSRX::param_t::eQuadFilterEn)
      .value("ePidIaccum", CanTalonSRX::param_t::ePidIaccum)
      .value("eStatus1FrameRate", CanTalonSRX::param_t::eStatus1FrameRate)
      .value("eStatus2FrameRate", CanTalonSRX::param_t::eStatus2FrameRate)
      .value("eStatus3FrameRate", CanTalonSRX::param_t::eStatus3FrameRate)
      .value("eStatus4FrameRate", CanTalonSRX::param_t::eStatus4FrameRate)
      .value("eStatus6FrameRate", CanTalonSRX::param_t::eStatus6FrameRate)
      .value("eStatus7FrameRate", CanTalonSRX::param_t::eStatus7FrameRate)
      .value("eClearPositionOnIdx", CanTalonSRX::param_t::eClearPositionOnIdx)
      .value("ePeakPosOutput", CanTalonSRX::param_t::ePeakPosOutput)
      .value("eNominalPosOutput", CanTalonSRX::param_t::eNominalPosOutput)
      .value("ePeakNegOutput", CanTalonSRX::param_t::ePeakNegOutput)
      .value("eNominalNegOutput", CanTalonSRX::param_t::eNominalNegOutput)
      .value("eQuadIdxPolarity", CanTalonSRX::param_t::eQuadIdxPolarity)
      .value("eStatus8FrameRate", CanTalonSRX::param_t::eStatus8FrameRate)
      .value("eAllowPosOverflow", CanTalonSRX::param_t::eAllowPosOverflow)
      .value("eProfileParamSlot0_AllowableClosedLoopErr", CanTalonSRX::param_t::eProfileParamSlot0_AllowableClosedLoopErr)
      .value("eNumberPotTurns", CanTalonSRX::param_t::eNumberPotTurns)
      .value("eNumberEncoderCPR", CanTalonSRX::param_t::eNumberEncoderCPR)
      .value("ePwdPosition", CanTalonSRX::param_t::ePwdPosition)
      .value("eAinPosition", CanTalonSRX::param_t::eAinPosition)
      .value("eProfileParamVcompRate", CanTalonSRX::param_t::eProfileParamVcompRate)
      .value("eProfileParamSlot1_AllowableClosedLoopErr", CanTalonSRX::param_t::eProfileParamSlot1_AllowableClosedLoopErr)
      .value("eStatus9FrameRate", CanTalonSRX::param_t::eStatus9FrameRate)
      .value("eMotionProfileHasUnderrunErr", CanTalonSRX::param_t::eMotionProfileHasUnderrunErr)
      .value("eReserved120", CanTalonSRX::param_t::eReserved120)
      .value("eLegacyControlMode", CanTalonSRX::param_t::eLegacyControlMode)
      .value("eMotMag_Accel", CanTalonSRX::param_t::eMotMag_Accel)
      .value("eMotMag_VelCruise", CanTalonSRX::param_t::eMotMag_VelCruise)
      .value("eStatus10FrameRate", CanTalonSRX::param_t::eStatus10FrameRate)
      .value("eCurrentLimThreshold", CanTalonSRX::param_t::eCurrentLimThreshold)
      .value("eBldcStatus1FrameRate", CanTalonSRX::param_t::eBldcStatus1FrameRate)
      .value("eBldcStatus2FrameRate", CanTalonSRX::param_t::eBldcStatus2FrameRate)
      .value("eBldcStatus3FrameRate", CanTalonSRX::param_t::eBldcStatus3FrameRate)
      .value("eCustomParam0", CanTalonSRX::param_t::eCustomParam0)
      .value("eCustomParam1", CanTalonSRX::param_t::eCustomParam1)
      .value("ePersStorageSaving", CanTalonSRX::param_t::ePersStorageSaving)
      .value("eClearPositionOnLimitF", CanTalonSRX::param_t::eClearPositionOnLimitF)
      .value("eClearPositionOnLimitR", CanTalonSRX::param_t::eClearPositionOnLimitR)
      .value("eMotionMeas_YawOffset", CanTalonSRX::param_t::eMotionMeas_YawOffset)
      .value("eMotionMeas_CompassOffset", CanTalonSRX::param_t::eMotionMeas_CompassOffset)
      .value("eMotionMeas_BetaGain", CanTalonSRX::param_t::eMotionMeas_BetaGain)
      .value("eMotionMeas_Reserved163", CanTalonSRX::param_t::eMotionMeas_Reserved163)
      .value("eMotionMeas_GyroNoMotionCal", CanTalonSRX::param_t::eMotionMeas_GyroNoMotionCal)
      .value("eMotionMeas_EnterCalibration", CanTalonSRX::param_t::eMotionMeas_EnterCalibration)
      .value("eMotionMeas_FusedHeadingOffset", CanTalonSRX::param_t::eMotionMeas_FusedHeadingOffset);

    return m.ptr();
}