1、ADCdriverimplement0718v10 ADC Driver Implement DocumentTianjin UniversityInfineon Automotive Electronic Joint LaboratoryState Key Laboratory of EnginesTianJin University, ChinaTianjin UniversityInfineon Automotive Electronic Joint LaboratoryRevision historyVersionByModificationsV0.1, 18th July 2007J
2、iang TangCreationContents1 Introduction 41.1 Overview 41.2 Reference 42. Type definition 53 Global Variable 64 Function Definitions 74.1 InitSync 74.2 DeInitSync 84.3 GetVersionOfDriver 94.4 ADC0_StartSampleSync 104.5 ADC0_StartSampleAllSync 104.6 ADC0_GetSync 104.7 ADC0_GetStateSync 114.8 ADC_StopS
3、ampleSync 115 Resources Configuration 125.1 Periperal Config 125.2 Interrupt Config 126 Compile Environment 131 Introduction1.1 OverviewThis document describes the implementations of the ADC driver to be developed in the frame of the GEMS-K1 project. The ADC driver configures converting analog signa
4、ls to digital signals. 1.2 Reference1 ADC driver test report2. Type definitionTypeDescriptionRangeIO_ErrorTypeRecommended type: 16 bit unsigned value. Numbers from 0 to 15 are reserved for the HIS IO Library itself, numbers between 16 and 63 are defined in the HIS IO Driver document. Error codes fro
5、m 64 to 127 are for driver specific error codes not defined in the HIS IO Driver document and numbers starting from 128 are reserved for future use.IO_E_OK IO_E_BUSY 1IO_E_UNKNOWN_MODE IO_U32Recommended type: 16 bit unsigned value. 100IO_ValueTypeRecommended type: 16 bit unsigned value.IO_DeviceStat
6、eTypeRecommended type: 16 bit unsigned value.IO_STATE_IDLEIO_STATE_ACTIVE3 Global VariableThis chapter describes the global variable.VarialbesTypeDescription4 Function Definitions4.1 InitSyncSyntaxIO_ErrorType InitSync (void);ParametersnoneReturnIO_E_OK: initialization was successful.NotificationDes
7、criptionThis is the initialization function of the ADC function library. It is assumed that the SFRs used by this library are in their reset state.ReentrancyNoRemarks4.2 DeInitSyncSyntaxIO_ErrorType DeInitSync (void)ParametersNoneReturnIO_E_OK: deinitialization was successful.NotificationDescription
8、This is the deinitialization function of the ADC function library. It is assumed that the SFRs used by this library are in their reset state.ReentrancyNoRemarks4.3 GetVersionOfDriverSyntaxIO_U32 GetVersionOfDriver(void) ParametersnoneReturn100NotificationDescriptionThis is the getting driver version
9、 function of the ADC function library. It is assumed that the SFRs used by this library are in their reset state.ReentrancyNoRemarks4.4 ADC0_StartSampleSyncSyntaxIO_ErrorType ADC0_StartSampleSync(ubyte Channels)ParametersnoneReturnIO_E_OK: ADC0_StartSampleSync was successful.NotificationDescriptionT
10、his function starts the measurement of analogue value of the specified ADC channel and stores the values to an internal buffer.ReentrancyNoRemarks4.5 ADC0_StartSampleAllSyncSyntaxIO_ErrorType ADC0_StartSampleAllSync(void)ParametersnoneReturnIO_E_OK: ADC0_StartSampleAllSync was successful.Notificatio
11、nDescriptionThis function starts the measurement of analogue values of all ADC channels and stores the values to an internal buffer.ReentrancyNoRemarks4.6 ADC0_GetSyncSyntaxIO_ValueType ADC0_GetSync(IO_ChannelType Channel)ParametersnoneReturnIO_E_OK: ADC0_StartSampleAllSync was successful.Notificati
12、onDescriptionThis function returns the analogue value specified by the ADC channel ADC0_GetSync was successful.ReentrancyNoRemarks4.7 ADC0_GetStateSyncSyntaxIO_DeviceStateType ADC0_GetStateSync(void)ParametersnoneReturnIO_STATE_IDLE: a new ADC sample can be startedIO_STATE_ACTIVE: the driver is busy
13、.NotificationDescriptionThis function returns the device state of the ADC driver.ReentrancyNoRemarks4.8 ADC_StopSampleSyncSyntaxvoid ADC_StopSampleSync(void)ParametersnoneReturnNoneNotificationDescriptionThis function stops a measurement started with ADC0_StartSampleSync or ADC0_StartSampleAllSync.R
14、eentrancyNoRemarks5 Resources ConfigurationThe resource used by ADC driver5.1 Periperal ConfigSourceDescriptionAN0AN31As ADC driver input pins5.2 Interrupt ConfigSourceSRNTOSPriorityNameDescriptionADC0ADC0_SRN0INT72ADC0_viSRN0This is the interrupt service routine for the Service Request Node 0 of the ADC0 module.6 Compile EnvironmentCompile Tool: Tasking for Tricore
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1