ADCdriverimplement0718v10Word格式.docx
《ADCdriverimplement0718v10Word格式.docx》由会员分享,可在线阅读,更多相关《ADCdriverimplement0718v10Word格式.docx(7页珍藏版)》请在冰点文库上搜索。
![ADCdriverimplement0718v10Word格式.docx](https://file1.bingdoc.com/fileroot1/2023-5/4/96d6d92b-402f-4402-9ea1-afd41c4cce73/96d6d92b-402f-4402-9ea1-afd41c4cce731.gif)
Creation
Contents
1Introduction4
1.1Overview4
1.2Reference4
2.Typedefinition5
3GlobalVariable6
4FunctionDefinitions7
4.1InitSync7
4.2DeInitSync8
4.3GetVersionOfDriver9
4.4ADC0_StartSampleSync10
4.5ADC0_StartSampleAllSync10
4.6ADC0_GetSync10
4.7ADC0_GetStateSync11
4.8ADC_StopSampleSync11
5ResourcesConfiguration12
5.1PeriperalConfig12
5.2InterruptConfig12
6CompileEnvironment13
1Introduction
1.1Overview
ThisdocumentdescribestheimplementationsoftheADCdrivertobedevelopedintheframeoftheGEMS-K1project.
TheADCdriverconfiguresconvertinganalogsignalstodigitalsignals.
1.2Reference
[1]ADCdrivertestreport
2.Typedefinition
Type
Description
Range
IO_ErrorType
Recommendedtype:
16bitunsignedvalue.Numbersfrom0to15arereservedfortheHISIOLibraryitself,numbersbetween16and63aredefinedintheHISIODriverdocument.Errorcodesfrom64to127arefordriverspecificerrorcodesnotdefinedintheHISIODriverdocumentandnumbersstartingfrom128arereservedforfutureuse.
IO_E_OK
IO_E_BUSY1
IO_E_UNKNOWN_MODE
IO_U32
16bitunsignedvalue.
100
IO_ValueType
16bitunsignedvalue.
IO_DeviceStateType
IO_STATE_IDLE
IO_STATE_ACTIVE
3GlobalVariable
Thischapterdescribestheglobalvariable.
Varialbes
4FunctionDefinitions
4.1InitSync
Syntax
IO_ErrorTypeInitSync(void);
Parameters
none
Return
IO_E_OK:
initializationwassuccessful.
Notification
ThisistheinitializationfunctionoftheADCfunctionlibrary.ItisassumedthattheSFRsusedbythislibraryareintheirresetstate.
Reentrancy
No
Remarks
4.2
DeInitSync
IO_ErrorTypeDeInitSync(void)
None
deinitializationwassuccessful.
ThisisthedeinitializationfunctionoftheADCfunctionlibrary.ItisassumedthattheSFRsusedbythislibraryareintheirresetstate.
4.3
GetVersionOfDriver
IO_U32GetVersionOfDriver(void)
ThisisthegettingdriverversionfunctionoftheADCfunctionlibrary.ItisassumedthattheSFRsusedbythislibraryareintheirresetstate.
4.4
ADC0_StartSampleSync
IO_ErrorTypeADC0_StartSampleSync(ubyteChannels)
ADC0_StartSampleSyncwassuccessful.
ThisfunctionstartsthemeasurementofanaloguevalueofthespecifiedADCchannelandstoresthevaluestoaninternalbuffer.
4.5ADC0_StartSampleAllSync
IO_ErrorTypeADC0_StartSampleAllSync(void)
ADC0_StartSampleAllSyncwassuccessful.
ThisfunctionstartsthemeasurementofanaloguevaluesofallADCchannelsandstoresthevaluestoaninternalbuffer.
4.6ADC0_GetSync
IO_ValueTypeADC0_GetSync(IO_ChannelTypeChannel)
ThisfunctionreturnstheanaloguevaluespecifiedbytheADCchannelADC0_GetSyncwassuccessful.
4.7ADC0_GetStateSync
IO_DeviceStateTypeADC0_GetStateSync(void)
IO_STATE_IDLE:
anewADCsamplecanbestarted
IO_STATE_ACTIVE:
thedriverisbusy.
ThisfunctionreturnsthedevicestateoftheADCdriver.
4.8ADC_StopSampleSync
voidADC_StopSampleSync(void)
ThisfunctionstopsameasurementstartedwithADC0_StartSampleSyncorADC0_StartSampleAllSync.
5ResourcesConfiguration
TheresourceusedbyADCdriver
5.1PeriperalConfig
Source
AN0~AN31
AsADCdriverinputpins
5.2InterruptConfig
SRN
TOS
Priority
Name
ADC0
ADC0_SRN0INT
72
ADC0_viSRN0
ThisistheinterruptserviceroutinefortheServiceRequestNode0oftheADC0module.
6CompileEnvironment
CompileTool:
TaskingforTricore