//FPGA : Write Reg Value by Name public static int SL_CommBase_WriteReg(string RegName, uint Val) { SL_Param_Util PramUtil = new SL_Param_Util(); if (SL_Param_Util.ListRegInfo == null) { return(Chip.ERROR_LOOKUPREG_FAL); } return(SL_CommBase_WriteReg(RegName, Val, PramUtil.getWriteNum(RegName))); }
//FPGA :Write Reg Value by Name public static int SL_CommBase_WriteReg(string RegName, uint Val, int xbufLen) { uint RegVal = 0; int errcode = 0; SL_Param_Util PramUtil = new SL_Param_Util(); if (SL_Param_Util.ListRegInfo == null) { return(Chip.ERROR_LOOKUPREG_FAL); } byte RegAddr = PramUtil.getAddrByName(RegName); if (SL_CommBase_ReadReg(RegAddr, ref RegVal, xbufLen) == Chip.ERROR_RESULT_OK) { uint RegData = PramUtil.AutoLoopUpGetData(RegName, RegVal, Val); errcode = SL_CommBase_WriteReg(RegAddr, RegData, (uint)xbufLen); if (errcode == 0) { return(Chip.ERROR_RESULT_OK); } } return(Chip.ERROR_WRITEREG_FAIL); }