📄 ad1.h
字号:
/** ###################################################################
** THIS BEAN MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT.
** Filename : AD1.H
** Project : Project_1
** Processor : MC9S08QD4CPC
** Beantype : ADC
** Version : Bean 01.404, Driver 01.16, CPU db: 2.87.049
** Compiler : CodeWarrior HCS08 C Compiler
** Date/Time : 2008-2-18, 13:59
** Abstract :
** This device "ADC" implements an A/D converter,
** its control methods and interrupt/event handling procedure.
** Settings :
** AD control register : ADCSC1 [$0010]
** AD control register : ADCCFG [$0016]
** AD control register : ADCR [$0012]
** AD control register : ADCRL [$0013]
** AD control register : ADCCV [$0014]
** AD control register : ADCCVL [$0015]
** AD control register : ADCSC2 [$0011]
** AD control register : APCTL1 [$0017]
** AD result register : ADCres [$0012]
** AD result register : ADCres [$0012]
** AD result register : ADCres [$0012]
** AD result register : ADCres [$0012]
** User handling procedure : not specified
** Number of conversions : 1
** AD resolution : 8-bit
**
** Input pins
**
** Port name : PTA
** Bit number (in port) : 0
** Bit mask of the port : $0001
** Port data register : PTAD [$0000]
** Port control register : PTADD [$0001]
** Port function register : KBIPE [$000D]
**
** Port name : PTA
** Bit number (in port) : 1
** Bit mask of the port : $0002
** Port data register : PTAD [$0000]
** Port control register : PTADD [$0001]
** Port function register : KBIPE [$000D]
**
** Port name : PTA
** Bit number (in port) : 2
** Bit mask of the port : $0004
** Port data register : PTAD [$0000]
** Port control register : PTADD [$0001]
** Port function register : KBIPE [$000D]
**
** Port name : PTA
** Bit number (in port) : 3
** Bit mask of the port : $0008
** Port data register : PTAD [$0000]
** Port control register : PTADD [$0001]
** Port function register : KBIPE [$000D]
**
** Initialization:
** Conversion : Enabled
** Event : Enabled
** High speed mode
** Prescaler : divide-by-8
** Contents :
** MeasureChan - byte AD1_MeasureChan(bool WaitForResult, byte Channel);
** EnableIntChanTrigger - byte AD1_EnableIntChanTrigger(byte Channel);
** GetChanValue - byte AD1_GetChanValue(byte Channel, void* Value);
** GetChanValue8 - byte AD1_GetChanValue8(byte Channel, byte *Value);
**
** (c) Copyright UNIS, spol. s r.o. 1997-2006
** UNIS, spol. s r.o.
** Jundrovska 33
** 624 00 Brno
** Czech Republic
** http : www.processorexpert.com
** mail : info@processorexpert.com
** ###################################################################*/
#ifndef __AD1
#define __AD1
/*Include shared modules, which are used for whole project*/
#include "PE_Types.h"
#include "PE_Error.h"
#include "PE_Const.h"
#include "IO_Map.h"
/* MODULE AD1. */
#include "Cpu.h"
void AD1_HWEnDi(void);
/*
** ===================================================================
** Method : AD1_HWEnDi (bean ADC)
**
** Description :
** Enables or disables the peripheral(s) associated with the bean.
** The method is called automatically as a part of the Enable and
** Disable methods and several internal methods.
** This method is internal. It is used by Processor Expert only.
** ===================================================================
*/
byte AD1_MeasureChan(bool WaitForResult,byte Channel);
/*
** ===================================================================
** Method : AD1_MeasureChan (bean ADC)
**
** Description :
** This method performs measurement on one channel. (Note:
** If the <number of conversions> is more than one the
** conversion of the A/D channel is performed specified
** number of times.)
** Parameters :
** NAME - DESCRIPTION
** WaitForResult - Wait for a result
** of conversion. If the <interrupt service>
** is disabled and at the same time a
** <number of conversions> is greater than
** 1, the WaitForResult parameter is
** ignored and the method waits for each
** result every time.
** Channel - Channel number. If only one
** channel in the bean is set this
** parameter is ignored, because the
** parameter is set inside this method.
** 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
** ERR_RANGE - Parameter "Channel" out of
** range
** ===================================================================
*/
byte AD1_GetChanValue(byte Channel,void* Value);
/*
** ===================================================================
** Method : AD1_GetChanValue (bean ADC)
**
** Description :
** Returns the last measured value of the required channel.
** Format and width of the value is a native format of the
** A/D converter.
** 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. Data
** type is a byte, a word or an int. It
** depends on the supported modes,
** resolution, etc. of the AD converter.
** See the Version specific information for
** the current CPU in <General Info>.
** 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).
** ===================================================================
*/
byte AD1_GetChanValue8(byte Channel,byte *Value);
/*
** ===================================================================
** Method : AD1_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).
** ===================================================================
*/
byte AD1_EnableIntChanTrigger(byte Channel);
/*
** ===================================================================
** Method : AD1_EnableIntChanTrigger (bean ADC)
**
** Description :
** Enables the internal trigger mode. A conversion of one
** required channel will be launched by internal sync pulse.
** If the <Number of conversions> property is greater than 1,
** a conversion will be launched more than once (by an
** internal signal) according to <Number of conversions>.
** It's possible to disable the trigger mode by <Stop>
** method. This EnableIntChanTrigger method is available
** only when the <Internal trigger> property is enabled.
** Parameters :
** NAME - DESCRIPTION
** Channel - Channel number which will be
** measured at internal trigger control. If
** only one channel in the bean is set then
** this parameter is ignored.
** Returns :
** --- - Error code, possible codes:
** ERR_OK - OK
** ERR_BUSY - A conversion is already
** running
** ERR_RANGE - Parameter "Channel" out of
** range
** ===================================================================
*/
void AD1_Init(void);
/*
** ===================================================================
** Method : AD1_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.
** ===================================================================
*/
/* END AD1. */
#endif /* ifndef __AD1 */
/*
** ###################################################################
**
** This file was created by UNIS Processor Expert 3.00 [03.89]
** for the Freescale HCS08 series of microcontrollers.
**
** ###################################################################
*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -