adc.lst

来自「该程序是ST7MC驱动三洋压缩机(交流)」· LST 代码 · 共 478 行 · 第 1/2 页

LST
478
字号
  002b 3400     SRL   result
  002d 3601     RRC   result:1
  159:  	return ((u8)result);
  002f b601     LD    A,result:1
  160:  }
  0031 81       RET   
  161:           
  162:  
  163:  /*-----------------------------------------------------------------------------
  164:  ROUTINE Name :  ADC_GetRV1/ADC_GetRV2/ADC_GetRV3
  165:  
  166:  Description:	return potentiometers value (RV1/RV2/RV3).
  167:  Input/Output:	None/u8
  168:  Comments: 		None
  169:  -----------------------------------------------------------------------------*/
  170:  u8 ADC_GetRV1(void)
  171:  {

Function: ADC_GetRV1
Source  : ..\..\source\adc.c
Options : -Cc -F7 -Lasm=%n.lst -Ml -N -Os -Ou -Of -Ol0 -OnPMNC -Or

  172:  	return(ADC_Get_8bits(CONVERT_AIN13));
  0000 a61d     LD    A,#29
  0002 2000     JRT   ADC_Get_8bits
  173:  }
  174:  
  175:  u8 ADC_GetRV2(void)
  176:  {

Function: ADC_GetRV2
Source  : ..\..\source\adc.c
Options : -Cc -F7 -Lasm=%n.lst -Ml -N -Os -Ou -Of -Ol0 -OnPMNC -Or

  177:  	return(ADC_Get_8bits(CONVERT_AIN11));
  0000 a61b     LD    A,#27
  0002 2000     JRT   ADC_Get_8bits
  178:  }        
  179:  
  180:  u8 ADC_GetRV3(void)
  181:  {

Function: ADC_GetRV3
Source  : ..\..\source\adc.c
Options : -Cc -F7 -Lasm=%n.lst -Ml -N -Os -Ou -Of -Ol0 -OnPMNC -Or

  182:  	return(ADC_Get_8bits(CONVERT_AIN7));
  0000 a617     LD    A,#23
  0002 2000     JRT   ADC_Get_8bits
  183:  }
  184:  
  185:  
  186:  /*-----------------------------------------------------------------------------
  187:  ROUTINE Name :  ADC_CheckOverTemp
  188:  
  189:  Description:	Return TRUE if the voltage on the thermal resistor connected 
  190:                  to channel AIN0 has reached the threshold level or if the voltage 
  191:                  has not yet reached back the threshold level minus the hysteresis 
  192:                  value after an overheat detection.
  193:  Input/Output:	none/boolean
  194:  Comments: 		None
  195:  -----------------------------------------------------------------------------*/
  196:  BOOL ADC_CheckOverTemp(void)
  197:  {

Function: ADC_CheckOverTemp
Source  : ..\..\source\adc.c
Options : -Cc -F7 -Lasm=%n.lst -Ml -N -Os -Ou -Of -Ol0 -OnPMNC -Or

  198:  		u16 HeatsinkTemp;
  199:  
  200:  	HeatsinkTemp = ADC_Get_10bits(TEMP_SENSOR_CHANNEL);
  0000 a610     LD    A,#16
  0002 cd0000   CALL  ADC_Get_10bits
  0005 b701     LD    HeatsinkTemp:1,A
  0007 bf00     LD    HeatsinkTemp,X
  201:  
  202:  	if (HeatsinkTemp >= NTC_THRESHOLD)
  0009 a300     CP    X,#0
  000b 2510     JRULT *18 ;abs = 001d
  000d 2604     JRNE  *6 ;abs = 0013
  000f a16e     CP    A,#110
  0011 250a     JRULT *12 ;abs = 001d
  203:  	{
  204:  		InverterStatus |= OVER_TEMPERATURE;
  0013 c60000   LD    A,InverterStatus
  0016 aa01     OR    A,#1
  0018 c70000   LD    InverterStatus,A
  205:  		return(TRUE);
  001b 2011     JRT   *19 ;abs = 002e
  206:  	}
  207:  	else
  208:  	{
  209:  		if ( (HeatsinkTemp >= (NTC_THRESHOLD - NTC_HYSTERESIS))
  001d a300     CP    X,#0
  001f 2510     JRULT *18 ;abs = 0031
  0021 2604     JRNE  *6 ;abs = 0027
  0023 a166     CP    A,#102
  0025 250a     JRULT *12 ;abs = 0031
  210:              && (InverterStatus & OVER_TEMPERATURE) )
  0027 c60000   LD    A,InverterStatus
  002a a501     BCP   A,#1
  002c 2703     JREQ  *5 ;abs = 0031
  211:  		{
  212:  			return(TRUE);	// Wait heatsink cooling before re-enabling inverter
  002e a601     LD    A,#1
  0030 81       RET   
  213:  		}
  214:  		else
  215:  		{
  216:  			InverterStatus &= (u8)(~OVER_TEMPERATURE);
  0031 c60000   LD    A,InverterStatus
  0034 a4fe     AND   A,#-2
  0036 c70000   LD    InverterStatus,A
  217:  			return(FALSE);	// Normal operation
  0039 4f       CLR   A
  218:  		}
  219:  	}
  220:  
  221:  }
  003a 81       RET   
  222:  
  223:  
  224:  /*-----------------------------------------------------------------------------
  225:  ROUTINE Name :  ADC_CheckBusVoltage
  226:  
  227:  Description:	Return TRUE if the voltage of the HVBUS connected to channel AIN1 
  228:                  has reached the threshold level or if the voltage has not yet
  229:                  reached back the threshold level minus the hysteresis 
  230:                  value after an overvoltage detection.
  231:  
  232:  Input/Output:	none/boolean
  233:  Comments: 		None
  234:  -----------------------------------------------------------------------------*/
  235:  BOOL ADC_CheckOverVoltage(void)
  236:  {

Function: ADC_CheckOverVoltage
Source  : ..\..\source\adc.c
Options : -Cc -F7 -Lasm=%n.lst -Ml -N -Os -Ou -Of -Ol0 -OnPMNC -Or

  237:  		u16 BusVoltage;
  238:  
  239:  
  240:      BusVoltage = ADC_Get_10bits(BUS_VOLTAGE_CHANNEL);
  0000 a611     LD    A,#17
  0002 cd0000   CALL  ADC_Get_10bits
  0005 b701     LD    BusVoltage:1,A
  0007 bf00     LD    BusVoltage,X
  241:  
  242:  	if (BusVoltage >= HVBUS_THRESHOLD)
  0009 a303     CP    X,#3
  000b 2510     JRULT *18 ;abs = 001d
  000d 2604     JRNE  *6 ;abs = 0013
  000f a1fc     CP    A,#252
  0011 250a     JRULT *12 ;abs = 001d
  243:  	{
  244:  		InverterStatus |= OVER_VOLTAGE;
  0013 c60000   LD    A,InverterStatus
  0016 aa02     OR    A,#2
  0018 c70000   LD    InverterStatus,A
  245:  		return(TRUE);
  001b 2011     JRT   *19 ;abs = 002e
  246:  	}
  247:  	else
  248:  	{
  249:  		if ( (BusVoltage >= (HVBUS_THRESHOLD - HVBUS_HYSTERESIS))
  001d a303     CP    X,#3
  001f 2510     JRULT *18 ;abs = 0031
  0021 2604     JRNE  *6 ;abs = 0027
  0023 a1e9     CP    A,#233
  0025 250a     JRULT *12 ;abs = 0031
  250:              && (InverterStatus & OVER_VOLTAGE) )
  0027 c60000   LD    A,InverterStatus
  002a a502     BCP   A,#2
  002c 2703     JREQ  *5 ;abs = 0031
  251:  		{
  252:  			return(TRUE);	// Wait Bus voltage decrease before re-enabling inverter
  002e a601     LD    A,#1
  0030 81       RET   
  253:  		}
  254:  		else
  255:  		{
  256:  			InverterStatus &= (u8)(~OVER_VOLTAGE);
  0031 c60000   LD    A,InverterStatus
  0034 a4fd     AND   A,#-3
  0036 c70000   LD    InverterStatus,A
  257:  			return(FALSE);	// Normal operation
  0039 4f       CLR   A
  258:  		}
  259:  	}
  260:  }
  003a 81       RET   
  261:  
  262:  /*-----------------------------------------------------------------------------
  263:  ROUTINE Name :  ADC_GetBusVoltage
  264:  
  265:  Description:	Return the high voltage bus value voltage with arbitrary unit
  266:  				depending from external voltage divider
  267:  
  268:  Input/Output:	none/u8
  269:  Comments: 		None
  270:  -----------------------------------------------------------------------------*/
  271:  u8 ADC_GetBusVoltage(void)
  272:  {

Function: ADC_GetBusVoltage
Source  : ..\..\source\adc.c
Options : -Cc -F7 -Lasm=%n.lst -Ml -N -Os -Ou -Of -Ol0 -OnPMNC -Or

  273:  	return(ADC_Get_8bits(BUS_VOLTAGE_CHANNEL));
  0000 a611     LD    A,#17
  0002 cc0000   JP    ADC_Get_8bits
  274:  }
  275:  
  276:  
  277:  /*-----------------------------------------------------------------------------
  278:  ROUTINE Name :  ADC_GetHeatsinkTemp
  279:  
  280:  Description:	Return the Heatsink temperature value with arbitrary unit
  281:  				depending from NTC value and bias resistor
  282:  
  283:  Input/Output:	none/u8
  284:  Comments: 		None
  285:  -----------------------------------------------------------------------------*/
  286:  u8 ADC_GetHeatsinkTemp(void)
  287:  {

Function: ADC_GetHeatsinkTemp
Source  : ..\..\source\adc.c
Options : -Cc -F7 -Lasm=%n.lst -Ml -N -Os -Ou -Of -Ol0 -OnPMNC -Or

  288:  	return(ADC_Get_8bits(TEMP_SENSOR_CHANNEL));
  0000 a610     LD    A,#16
  0002 cc0000   JP    ADC_Get_8bits
  289:  }
  290:  
  291:  /*** (c) 2004  STMicroelectronics ****************** END OF FILE ***/

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?