19.2.8. ASL 资源模板项
> ResourceMacroList := > > > Nothing | <resourcemacroterm resourcemacrolist>
> ResourceMacroTerm := > > > DMATerm | DWordIOTerm | DWordMemoryTerm | DWordSpaceTerm | EndDependentFnTerm | ExtendedIOTerm | ExtendedMemoryTerm | ExtendedSpaceTerm | FixedDMATerm | FixedIOTerm | GpioIntTerm | GpioIOTerm | I2CSerialBusTerm | InterruptTerm | IOTerm | IRQNoFlagsTerm | IRQTerm | Memory24Term | Memory32FixedTerm | Memory32Term | PinConfigTerm | PinFunctionTerm | PinGroupTerm | PinGroupConfigTerm | PinGroupFunctionTerm | QWordIOTerm | QWordMemoryTerm | QWordSpaceTerm | RegisterTerm | SPISerialBusTerm | StartDependentFnTerm | StartDependentFnNoPriTerm | UARTSerialBusTerm | VendorLongTerm | VendorShortTerm | WordBusNumberTerm | WordIOTerm | WordSpaceTerm
> DMATerm := > > > DMA ( > > DMA类型, // DMATypeKeyword (_TYP) > > 总线主控, // BusMasterKeyword (_BM) > > 传输类型, // XferTypeKeyword (_SIZ) > > 描述符名称 // Nothing | NameString > > ) {ByteList} // 通道列表(0-7 字节)
> DWordIOTerm := > > > DWordIO ( > > 资源用途, // Nothing (ResourceConsumer)| ResourceTypeKeyword > > 最小值类型, // Nothing (MinNotFixed) | MinKeyword (_MIF) > > 最大值类型, // Nothing (MaxNotFixed) | MaxKeyword (_MAF) > > 解码, // Nothing (PosDecode) | DecodeKeyword (_DEC) > > 范围类型, // Nothing (EntireRange) | RangeTypeKeyword (_RNG) > > 地址粒度, // DWordConstExpr (_GRA) > > 最小地址, // DWordConstExpr (_MIN) > > 最大地址, // DWordConstExpr (_MAX) > > 地址转换, // DWordConstExpr (_TRA) > > 地址长度, // DWordConstExpr (_LEN) > > 资源源索引, // Nothing | ByteConstExpr > > 资源源, // Nothing | StringData > > 描述符名称, // Nothing | NameString > > 转换类型, // Nothing | TypeKeyword (_TTP) > > 转换密度 // Nothing | TranslationKeyword (_TRS) > > )
> DWordMemoryTerm := > > > DWordMemory ( > > 资源用途, // Nothing (ResourceConsumer)| ResourceTypeKeyword > > 解码, // Nothing (PosDecode) | DecodeKeyword (_DEC) > > 最小值类型, // Nothing (MinNotFixed) | MinKeyword (_MIF) > > 最大值类型, // Nothing (MaxNotFixed) | MaxKeyword (_MAF) > > 内存类型, // Nothing (NonCacheable) | MemTypeKeyword (_MEM) > > 读写类型, // ReadWriteKeyword (_RW) > > 地址粒度, // DWordConstExpr (_GRA) > > 最小地址, // DWordConstExpr (_MIN) > > 最大地址, // DWordConstExpr (_MAX) > > 地址转换, // DWordConstExpr (_TRA) > > 地址长度, // DWordConstExpr (_LEN) > > 资源源索引, // Nothing | ByteConstExpr > > 资源源, // Nothing | StringData > > 描述符名称, // Nothing | NameString > > 内存范围类型, // Nothing | AddressKeyword (_MTP) > > 转换类型 // Nothing | TypeKeyword (_TTP) > > )
> DWordSpaceTerm := > > > DWordSpace ( > > 资源类型, // ByteConstExpr (_RT), 0xC0 - 0xFF > > 资源用途, // Nothing (ResourceConsumer)| ResourceTypeKeyword > > 解码, // Nothing (PosDecode) | DecodeKeyword (_DEC) > > 最小值类型, // Nothing (MinNotFixed) | MinKeyword (_MIF) > > 最大值类型, // Nothing (MaxNotFixed) | MaxKeyword (_MAF) > > 类型特定标志, // ByteConstExpr (_TSF) > > 地址粒度, // DWordConstExpr (_GRA) > > 最小地址, // DWordConstExpr (_MIN) > > 最大地址, // DWordConstExpr (_MAX) > > 地址转换, // DWordConstExpr (_TRA) > > 地址长度, // DWordConstExpr (_LEN) > > 资源源索引, // Nothing | ByteConstExpr > > 资源源, // Nothing | StringData > > 描述符名称 // Nothing | NameString > > )
> EndDependentFnTerm := > > > EndDependentFn ()
> ExtendedIOTerm := > > > ExtendedIO ( > > 资源用途, // Nothing (ResourceConsumer)| ResourceTypeKeyword > > 最小值类型, // Nothing (MinNotFixed) | MinKeyword (_MIF) > > 最大值类型, // Nothing (MaxNotFixed) | MaxKeyword (_MAF) > > 解码, // Nothing (PosDecode) | DecodeKeyword (_DEC) > > 范围类型, // Nothing (EntireRange) | RangeTypeKeyword (_RNG) > > 地址粒度, // QWordConstExpr (_GRA) > > 最小地址, // QWordConstExpr (_MIN) > > 最大地址, // QWordConstExpr (_MAX) > > 地址转换, // QWordConstExpr (_TRA) > > 地址长度, // QWordConstExpr (_LEN) > > 类型特定属性, // Nothing | QWordConstExpr > > 描述符名称, // Nothing | NameString > > 转换类型, // Nothing | TypeKeyword (_TTP) > > 转换密度 // Nothing | TranslationKeyword (_TRS) > > )
> ExtendedMemoryTerm := > > > ExtendedMemory ( > > 资源用途, // Nothing (ResourceConsumer)| ResourceTypeKeyword > > 解码, // Nothing (PosDecode) | DecodeKeyword (_DEC) > > 最小值类型, // Nothing (MinNotFixed) | MinKeyword (_MIF) > > 最大值类型, // Nothing (MaxNotFixed) | MaxKeyword (_MAF) > > 内存类型, // Nothing (NonCacheable) | MemTypeKeyword (_MEM) > > 读写类型, // ReadWriteKeyword (_RW) > > 地址粒度, // QWordConstExpr (_GRA) > > 最小地址, // QWordConstExpr (_MIN) > > 最大地址, // QWordConstExpr (_MAX) > > 地址转换, // QWordConstExpr (_TRA) > > 地址长度, // QWordConstExpr (_LEN) > > 类型特定属性, // Nothing | QWordConstExpr > > 描述符名称, // Nothing | NameString > > 内存范围类型, // Nothing | AddressKeyword (_MTP) > > 转换类型 // Nothing | TypeKeyword (_TTP) > > )
> ExtendedSpaceTerm := > > > ExtendedSpace ( > > 资源类型, // ByteConstExpr (_RT), 0xC0 - 0xFF > > 资源用途, // Nothing (ResourceConsumer)| ResourceTypeKeyword > > 解码, // Nothing (PosDecode) | DecodeKeyword (_DEC) > > 最小值类型, // Nothing (MinNotFixed) | MinKeyword (_MIF) > > 最大值类型, // Nothing (MaxNotFixed) | MaxKeyword (_MAF) > > 类型特定标志, // ByteConstExpr (_TSF) > > 地址粒度, // QWordConstExpr (_GRA) > > 最小地址, // QWordConstExpr (_MIN) > > 最大地址, // QWordConstExpr (_MAX) > > 地址转换, // QWordConstExpr (_TRA) > > 地址长度, // QWordConstExpr (_LEN) > > 类型特定属性, // Nothing | QWordConstExpr (_ATT) > > 描述符名称 // Nothing | NameString > > )
> FixedDMATerm := > > > FixedDMA ( > > DMA请求, // WordConstExpr (_DMA) > > 通道, // WordConstExpr (_TYP) > > 传输宽度, // Nothing (Width32Bit) | TransferWidthKeyword (_SIZ) > > 描述符名称, // Nothing | NameString > > )
> FixedIOTerm := > > > FixedIO ( > > 基地址, // WordConstExpr (_BAS) > > 范围长度, // ByteConstExpr (_LEN) > > 描述符名称 // Nothing | NameString > > )
> GpioInt项 := > > > GpioInt ( > > InterruptType, // InterruptType关键字 (_MOD) > > InterruptLevel, // InterruptLevel关键字 (_POL) > > ShareType, // 无(独占) | ShareType关键字 (_SHR) > > PinConfig, // PinConfig关键字 | ByteConstExpr (_PPI) > > DeBounceTime // 无 | WordConstExpr (_DBT) > > ResourceSource, // StringData > > ResourceSourceIndex, // 无(0) | ByteConstExpr > > ResourceUsage, // 无(ResourceConsumer)| ResourceType关键字 > > DescriptorName, // 无 | NameString > > VendorData // 无 | RawDataBuffer (_VEN) > > ) {DWordList} // GPIO 引脚列表 (_PIN)
> GpioIO项 := > > > GpioIO ( > > ShareType, // 无(独占) | ShareType关键字 (_SHR) > > PinConfig, // PinConfig关键字 | ByteConstExpr (_PPIC) > > DeBounceTime // 无 | WordConstExpr (_DBT) > > DriveStrength // 无 | WordConstExpr (_DRS) > > IORestriction // 无(无) | IORestriction关键字 (_IOR) > > ResourceSource, // StringData > > ResourceSourceIndex, // 无(0) | ByteConstExpr > > ResourceUsage, // 无(ResourceConsumer)| ResourceType关键字 > > DescriptorName, // 无 | NameString > > VendorData // 无 | RawDataBuffer (_VEN) > > ) {DWordList} // GPIO 引脚列表 (_PIN)
> I2CSerialBus项 := > > > I2CSerialBusV2 ( > > SlaveAddress, // WordConstExpr (_ADR) > > SlaveMode, // 无(ControllerInitiated) | SlaveMode关键字 (_SLV) > > ConnectionSpeed, // DWordConstExpr (_SPE) > > AddressingMode, // 无(AddressingMode7Bit) | AddressMode关键字 (_MOD) > > ResourceSource, // StringData > > ResourceSourceIndex, // 无 | ByteConstExpr > > ResourceUsage, // 无(ResourceConsumer)| ResourceType关键字 > > DescriptorName, // 无 | NameString > > ShareType, // 无(独占) | ShareType关键字 (_SHR) > > VendorData // 无 | RawDataBuffer (_VEN) > > )
> Interrupt项 := > > > Interrupt ( > > ResourceType, // 无(ResourceConsumer)| ResourceType关键字 > > InterruptType, // InterruptType关键字 (_LL, _HE) > > InterruptLevel, // InterruptLevel关键字 (_LL, _HE) > > ShareType, // 无(独占) ShareType关键字 (_SHR) > > ResourceSourceIndex, // 无 | ByteConstExpr > > ResourceSource, // 无 | StringData > > DescriptorName // 无 | NameString > > ) {DWordList} // 中断列表 (_INT)
> IO项 := > > > IO ( > > IODecode, // IODecode关键字 (_DEC) > > MinAddress, // WordConstExpr (_MIN) > > MaxAddress, // WordConstExpr (_MAX) > > Alignment, // ByteConstExpr (_ALN) > > RangeLength, // ByteConstExpr (_LEN) > > DescriptorName // 无 | NameString > > )
> IRQNoFlags项 := > > > IRQNoFlags ( > > DescriptorName // 无 | NameString > > ) {ByteList} // 中断列表(0-15 字节)
> IRQ项 := > > > IRQ ( > > InterruptType, // InterruptType关键字 (_LL, _HE) > > InterruptLevel, // InterruptLevel关键字 (_LL, _HE) > > ShareType, // 无(独占) | ShareType关键字 (_SHR) > > DescriptorName // 无 | NameString > > ) {ByteList} // 中断列表(0-15 字节)
> Memory24项 := > > > Memory24 ( > > ReadWriteType, // ReadWrite关键字 (_RW) > > MinAddress[23:8], // WordConstExpr (_MIN) > > MaxAddress[23:8], // WordConstExpr (_MAX) > > Alignment, // WordConstExpr (_ALN) > > RangeLength, // WordConstExpr (_LEN) > > DescriptorName // 无 | NameString > > )
> Memory32Fixed项 := > > > Memory32Fixed ( > > ReadWriteType, // ReadWrite关键字 (_RW) > > AddressBase, // DWordConstExpr (_BAS) > > RangeLength, // DWordConstExpr (_LEN) > > DescriptorName // 无 | NameString > > )
> Memory32项 := > > > Memory32 ( > > ReadWriteType, // ReadWrite关键字 (_RW) > > MinAddress, // DWordConstExpr (_MIN) > > MaxAddress, // DWordConstExpr (_MAX) > > Alignment, // DWordConstExpr (_ALN) > > RangeLength, // DWordConstExpr (_LEN) > > DescriptorName // 无 | NameString > > )
> PinConfig项 := > > > PinConfig ( > > ShareType, // 无(独占) | ShareType关键字 (_SHR) > > PinConfigType, // ByteData (_TYP) > > PinConfigValue, // ByteData (_VAL) > > ResourceSource, // StringData > > ResourceSourceIndex, // 无(0) | ByteConstExpr > > ResourceUsage, // 无(ResourceConsumer)| ResourceType关键字 > > DescriptorName, // 无 | NameString > > VendorData // 无 | RawDataBuffer (_VEN) > > ) {DWordList} (_PIN)
> PinFunction项 := > > > PinFunction ( > > ShareType, // 无(独占) | ShareType关键字 (_SHR) > > PinPullConfiguration, // PinConfig关键字 | ByteConstExpr (_PPI) > > FunctionNumber, // WordData > > ResourceSource, // StringData > > ResourceSourceIndex, // 无(0) | ByteConstExpr > > ResourceUsage, // 无(ResourceConsumer)| ResourceType关键字 > > DescriptorName, // 无 | NameString > > VendorData // 无 | RawDataBuffer (_VEN) > > ) {DWordList} (_PIN)
> PinGroup项 := > > > PinGroup ( > > ResourceLabel, // StringData > > ResourceUsage, // 无(ResourceConsumer)| ResourceType关键字 > > DescriptorName, // 无 | NameString > > VendorData // 无 | RawDataBuffer (_VEN) > > ) {DWordList} (_PIN)
> PinGroupConfig项 := > > > PinGroupConfig ( > > ShareType, // 无(独占) | ShareType关键字 (_SHR) > > PinConfigType, // ByteData (_TYP) > > PinConfigValue, // ByteData (_VAL) > > ResourceSource, // StringData > > ResourceSourceIndex, // 无(0) | ByteConstExpr > > ResourceSourceLabel, // StringData > > ResourceUsage, // 无(ResourceConsumer)| ResourceType关键字 > > DescriptorName, // 无 | NameString > > VendorData // 无 | RawDataBuffer (_VEN) > > )
> PinGroupFunction项 := > > > PinGroupFunction ( > > ShareType, // 无(独占) | ShareType关键字 (_SHR) > > FunctionNumber, // WordData (_FUN) > > ResourceSource, // StringData > > ResourceSourceIndex, // 无(0) | ByteConstExpr > > ResourceSourceLabel, // StringData > > ResourceUsage, // 无(ResourceConsumer)| ResourceType关键字 > > DescriptorName, // 无 | NameString > > VendorData // 无 | RawDataBuffer (_VEN) > > )
> QWordIO项 := > > > QWordIO ( > > ResourceUsage, // 无(ResourceConsumer)| ResourceType关键字 > > MinType, // 无(MinNotFixed) | Min关键字 (_MIF) > > MaxType, // 无(MaxNotFixed) | Max关键字 (_MAF) > > Decode, // 无(PosDecode) | Decode关键字 (_DEC) > > RangeType, // 无(EntireRange) | RangeType关键字 (_RNG) > > AddressGranularity, // QWordConstExpr (_GRA) > > MinAddress, // QWordConstExpr (_MIN) > > MaxAddress, // QWordConstExpr (_MAX) > > AddressTranslation, // QWordConstExpr (_TRA) > > AddressLength, // QWordConstExpr (_LEN) > > ResourceSourceIndex, // 无 | ByteConstExpr > > ResourceSource, // 无 | StringData > > DescriptorName, // 无 | NameString > > TranslationType, // 无 | Type关键字 (_TTP) > > TranslationDensity // 无 | Translation关键字 (_TRS) > > )
> QWordMemory项 := > > > QWordMemory ( > > ResourceUsage, // 无(ResourceConsumer)| ResourceType关键字 > > Decode, // 无(PosDecode) | Decode关键字 (_DEC) > > MinType, // 无(MinNotFixed) | Min关键字 (_MIF) > > MaxType, // 无(MaxNotFixed) | Max关键字 (_MAF) > > MemType, // 无(NonCacheable) | MemType关键字 (_MEM) > > ReadWriteType, // ReadWrite关键字 (_RW) > > AddressGranularity, // QWordConstExpr (_GRA) > > MinAddress, // QWordConstExpr (_MIN) > > MaxAddress, // QWordConstExpr (_MAX) > > AddressTranslation, // QWordConstExpr (_TRA) > > AddressLength, // QWordConstExpr (_LEN) > > ResourceSourceIndex, // 无 | ByteConstExpr > > ResourceSource, // 无 | StringData > > DescriptorName, // 无 | NameString > > MemoryRangeType, // 无 | Address关键字 (_MTP) > > TranslationType // 无 | Type关键字 (_TTP) > > )
> QWordSpace项 := > > > QWordSpace ( > > ResourceType, // ByteConstExpr (_RT), 0xC0 - 0xFF > > ResourceUsage, // 无(ResourceConsumer)| ResourceType关键字 > > Decode, // 无(PosDecode) | Decode关键字 (_DEC) > > MinType, // 无(MinNotFixed) | Min关键字 (_MIF) > > MaxType, // 无(MaxNotFixed) | Max关键字 (_MAF) > > TypeSpecificFlags, // ByteConstExpr (_TSF) > > AddressGranularity, // QWordConstExpr (_GRA) > > MinAddress, // QWordConstExpr (_MIN) > > MaxAddress, // QWordConstExpr (_MAX) > > AddressTranslation, // QWordConstExpr (_TRA) > > AddressLength, // QWordConstExpr (_LEN) > > ResourceSourceIndex, // 无 | ByteConstExpr > > ResourceSource, // 无 | StringData > > DescriptorName // 无 | NameString > > )
> Register项 := > > > Register ( > > AddressSpaceID, // AddressSpace关键字 (_ASI) > > RegisterBitWidth, // ByteConstExpr (_RBW) > > RegisterOffset, // ByteConstExpr (_RBO) > > RegisterAddress, // QWordConstExpr (_ADR) > > AccessSize, // ByteConstExpr (_ASZ) > > DescriptorName // 无 | NameString > > )
> SPISerialBus项 := > > > SPISerialBusV2 ( > > DeviceSelection, // WordConstExpr (_ADR) > > DeviceSelectionPolarity, // 无(PolarityLow) | > > DevicePolarity关键字 (_DPL) > > WireMode, // 无(FourWireMode) | WireMode关键字 (_MOD) > > DataBitLength, // ByteConstExpr (_LEN) > > SlaveMode, // 无(ControllerInitiated) | SlaveMode关键字 (_SLV) > > ConnectionSpeed, // DWordConstExpr (_SPE) > > ClockPolarity, // ClockPolarity关键字 (_POL) > > ClockPhase, // ClockPhase关键字 (_PHA) > > ResourceSource, // StringData > > ResourceSourceIndex, // 无 | ByteConstExpr > > ResourceUsage, // 无(ResourceConsumer)| ResourceType关键字 > > DescriptorName, // 无 | NameString > > ShareType, // 无(独占) | ShareType关键字 (_SHR) > > VendorData // 无 | RawDataBuffer (_VEN) > > )
> StartDependentFnNoPri项 := > > > StartDependentFnNoPri () {ResourceMacroList}
> StartDependentFn项 := > > > StartDependentFn ( > > CompatPriority, // ByteConstExpr (0-2) > > PerfRobustPriority // ByteConstExpr (0-2) > > ) {ResourceMacroList}
> UARTSerialBus项 := > > > UARTSerialBusV2( > > 初始 BaudRate, // DwordConstExpr (_SPE) > > BitsPerByte, // 无(DataBitsEight) | DataBits关键字 (_LEN) > > StopBits, // 无(StopBitsOne) | StopBits关键字 (_STB) > > LinesInUse, // ByteConstExpr (_LIN) > > IsBigEndian, // 无(LittleEndian) | Endianess关键字 (_END) > > Parity, // 无(ParityTypeNone) | ParityType关键字 (_PAR) > > FlowControl, // 无(FlowControlNone) | FlowControl关键字 (_FLC) > > ReceiveBufferSize, // WordConstExpr (_RXL) > > TransmitBufferSize, // WordConstExpr (_TXL) > > ResourceSource, // StringData > > ResourceSourceIndex, // 无 | ByteConstExpr > > ResourceUsage, // 无(ResourceConsumer)| ResourceType关键字 > > DescriptorName, // 无 | NameString > > ShareType, // 无(独占) | ShareType关键字 (_SHR) > > VendorData // 无 | Object (_VEN) > > )
> VendorLong项 := > > > VendorLong ( > > DescriptorName // 无 | NameString > > ) {ByteList}
> VendorShort项 := > > > VendorShort ( > > DescriptorName // 无 | NameString > > ) {ByteList} // 最多 7 字节
> WordBusNumber项 := > > > WordBusNumber ( > > ResourceUsage, // 无(ResourceConsumer)| ResourceType关键字 > > MinType, // 无(MinNotFixed) | Min关键字 (_MIF) > > MaxType, // 无(MaxNotFixed) | Max关键字 (_MAF) > > Decode, // 无(PosDecode) | Decode关键字 (_DEC) > > AddressGranularity, // WordConstExpr (_GRA) > > MinAddress, // WordConstExpr (_MIN) > > MaxAddress, // WordConstExpr (_MAX) > > AddressTranslation, // WordConstExpr (_TRA) > > AddressLength, // WordConstExpr (_LEN) > > ResourceSourceIndex, // 无 | ByteConstExpr > > ResourceSource, // 无 | StringData > > DescriptorName // 无 | NameString > > )
> WordIOTerm := > > > WordIO ( > > ResourceUsage, // 无(资源使用者)| 资源类型关键字 > > MinType, // 无(最小值不可固定) | 最小值关键字 (_MIF) > > MaxType, // 无(最大值不可固定) | 最大值关键字 (_MAF) > > Decode, // 无(正向解码) | 解码关键字 (_DEC) > > RangeType, // 无(整个范围) | 范围类型关键字 (_RNG) > > AddressGranularity, // 字常量表达式 (_GRA) > > MinAddress, // 字常量表达式 (_MIN) > > MaxAddress, // 字常量表达式 (_MAX) > > AddressTranslation, // 字常量表达式 (_TRA) > > AddressLength, // 字常量表达式 (_LEN) > > ResourceSourceIndex, // 无 | 字节常量表达式 > > ResourceSource, // 无 | 字符串数据 > > DescriptorName, // 无 | 名称字符串 > > TranslationType, // 无 | 类型关键字 (_TTP) > > TranslationDensity // 无 | 转换关键字 (_TRS) > > )
> WordSpaceTerm := > > > WordSpace ( > > ResourceType, // 字节常量表达式 (_RT), 0xC0 - 0xFF > > ResourceUsage, // 无(资源使用者)| 资源类型关键字 > > Decode, // 无(正向解码) | 解码关键字 (_DEC) > > MinType, // 无(最小值不可固定) | 最小值关键字 (_MIF) > > MaxType, // 无(最大值不可固定) | 最大值关键字 (_MAF) > > TypeSpecificFlags, // 字节常量表达式 (_TSF) > > AddressGranularity, // 字常量表达式 (_GRA) > > MinAddress, // 字常量表达式 (_MIN) > > MaxAddress, // 字常量表达式 (_MAX) > > AddressTranslation, // 字常量表达式 (_TRA) > > AddressLength, // 字常量表达式 (_LEN) > > ResourceSourceIndex, // 无 | 字节常量表达式 > > ResourceSource, // 无 | 字符串数据 > > DescriptorName // 无 | 名称字符串 > > )