⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ad2.h

📁 飞思卡尔智能车的程序。红外循迹
💻 H
📖 第 1 页 / 共 2 页
字号:
*/

byte AD2_Start(void);
/*
** ===================================================================
**     Method      :  AD2_Start (bean ADC)
**
**     Description :
**         This method starts continuous conversion on all channels
**         that are set in the bean inspector. When each measurement
**         on all channels has finished the <OnEnd > event may be
**         invoked. This method is not available if the <interrupt
**         service> is disabled and the device doesn't support the
**         continuous mode. Note: If time of measurement is too
**         short and the instruction clock is too slow then the
**         conversion complete interrupt and its handler may cause a
**         system overflow.
**     Parameters  : None
**     Returns     :
**         ---             - Error code, possible codes:
**                           ERR_OK - OK
**                           ERR_SPEED - This device does not work in
**                           the active speed mode
**                           ERR_DISABLED - Device is disabled
**                           ERR_BUSY - A conversion is already
**                           running
** ===================================================================
*/

byte AD2_Stop(void);
/*
** ===================================================================
**     Method      :  AD2_Stop (bean ADC)
**
**     Description :
**         This method stops the continuous measurement, which had
**         been started by <Start> method, or this method disables a
**         trigger mode which has been enabled by <EnableInt(Chan)
**         Trigger> or <EnableExt(Chan)Trigger> method (if these are
**         supported by HW). This method is available if at least
**         one of <Start>, <EnableInt(Chan)Trigger> or
**         <EnableExt(Chan)Trigger> methods is supported by A/D
**         converter device and it is enabled to be generated.
**     Parameters  : None
**     Returns     :
**         ---             - Error code, possible codes:
**                           ERR_OK - OK
**                           ERR_SPEED - This device does not work in
**                           the active speed mode
**                           ERR_BUSY - No continuous measurement is
**                           running. Neither internal trigger nor
**                           external trigger have been enabled (if
**                           these are supported by HW).
** ===================================================================
*/

byte AD2_Measure(bool WaitForResult);
/*
** ===================================================================
**     Method      :  AD2_Measure (bean ADC)
**
**     Description :
**         This method performs one measurement on all channels that
**         are set in the bean inspector. (Note: If the <number of
**         conversions> is more than one the conversion of A/D
**         channels is performed specified number of times.)
**     Parameters  :
**         NAME            - DESCRIPTION
**         WaitForResult   - Wait for a result
**                           of a conversion. If <interrupt service>
**                           is disabled, A/D peripheral doesn't
**                           support measuring all channels at once
**                           or <Autoscan mode> property isn't
**                           enabled and at the same time the <number
**                           of channel> is greater than 1, then the
**                           WaitForResult parameter is ignored and
**                           the method waits for each result every
**                           time. If the <interrupt service> is
**                           disabled and a <number of conversions>
**                           is greater than 1, the parameter is
**                           ignored and the method also waits for
**                           each result every time.
**     Returns     :
**         ---             - Error code, possible codes:
**                           ERR_OK - OK
**                           ERR_SPEED - This device does not work in
**                           the active speed mode
**                           ERR_DISABLED - Device is disabled
**                           ERR_BUSY - A conversion is already
**                           running
** ===================================================================
*/

byte AD2_GetValue8(byte *Values);
/*
** ===================================================================
**     Method      :  AD2_GetValue8 (bean ADC)
**
**     Description :
**         This method returns the last measured values of all
**         channels justified to the left. Compared with <GetValue>
**         method this method returns more accurate result if the
**         <number of conversions> is greater than 1 and <AD
**         resolution> is less than 8 bits. In addition, the user
**         code dependency on <AD resolution> is eliminated.
**     Parameters  :
**         NAME            - DESCRIPTION
**       * Values          - Pointer to the array that
**                           contains the measured data.
**     Returns     :
**         ---             - Error code, possible codes:
**                           ERR_OK - OK
**                           ERR_SPEED - This device does not work in
**                           the active speed mode
**                           ERR_NOTAVAIL - Requested value not
**                           available
**                           ERR_OVERRUN - External trigger overrun
**                           flag was detected after the last value(s)
**                           was obtained (for example by GetValue).
**                           This error may not be supported on some
**                           CPUs (see generated code).
** ===================================================================
*/

byte AD2_GetChanValue8(byte Channel,byte *Value);
/*
** ===================================================================
**     Method      :  AD2_GetChanValue8 (bean ADC)
**
**     Description :
**         This method returns the last measured value of required
**         channel justified to the left. Compared with
**         <GetChanValue> method this method returns more accurate
**         result if the <number of conversions> is greater than 1
**         and <AD resolution> is less than 8 bits. In addition, the
**         user code dependency on <AD resolution> is eliminated.
**     Parameters  :
**         NAME            - DESCRIPTION
**         Channel         - Channel number. If only one
**                           channel in the bean is set then this
**                           parameter is ignored.
**       * Value           - Pointer to the measured value.
**     Returns     :
**         ---             - Error code, possible codes:
**                           ERR_OK - OK
**                           ERR_SPEED - This device does not work in
**                           the active speed mode
**                           ERR_NOTAVAIL - Requested value not
**                           available
**                           ERR_RANGE - Parameter "Channel" out of
**                           range
**                           ERR_OVERRUN - External trigger overrun
**                           flag was detected after the last value(s)
**                           was obtained (for example by GetValue).
**                           This error may not be supported on some
**                           CPUs (see generated code).
** ===================================================================
*/

void AD2_Init(void);
/*
** ===================================================================
**     Method      :  AD2_Init (bean ADC)
**
**     Description :
**         Initializes the associated peripheral(s) and the bean's 
**         internal variables. The method is called automatically as a 
**         part of the application initialization code.
**         This method is internal. It is used by Processor Expert only.
** ===================================================================
*/

#pragma CODE_SEG DEFAULT

/* END AD2. */

#endif /* ifndef __AD2 */
/*
** ###################################################################
**
**     This file was created by UNIS Processor Expert 2.96 [03.76]
**     for the Freescale HCS12 series of microcontrollers.
**
** ###################################################################
*/

⌨️ 快捷键说明

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