/tools/gencfg/schema/common/stm32/stm32_gpiov2_port.xsd

https://bitbucket.org/doudoudou/incas · XML Schema · 214 lines · 211 code · 3 blank · 0 comment · 0 complexity · afed26023fbe60306f5def2cc13c1594 MD5 · raw file

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xs:schema
  3. elementFormDefault="qualified"
  4. xmlns:xs="http://www.w3.org/2001/XMLSchema">
  5. <xs:complexType name="STM32GPIOv2PortType">
  6. <xs:sequence>
  7. <xs:element
  8. name="pin0"
  9. type="STM32GPIOv2PinType"
  10. maxOccurs="1"
  11. minOccurs="1"></xs:element>
  12. <xs:element
  13. name="pin1"
  14. type="STM32GPIOv2PinType"
  15. maxOccurs="1"
  16. minOccurs="1"></xs:element>
  17. <xs:element
  18. name="pin2"
  19. type="STM32GPIOv2PinType"
  20. maxOccurs="1"
  21. minOccurs="1"></xs:element>
  22. <xs:element
  23. name="pin3"
  24. type="STM32GPIOv2PinType"
  25. maxOccurs="1"
  26. minOccurs="1"></xs:element>
  27. <xs:element
  28. name="pin4"
  29. type="STM32GPIOv2PinType"
  30. maxOccurs="1"
  31. minOccurs="1"></xs:element>
  32. <xs:element
  33. name="pin5"
  34. type="STM32GPIOv2PinType"
  35. maxOccurs="1"
  36. minOccurs="1"></xs:element>
  37. <xs:element
  38. name="pin6"
  39. type="STM32GPIOv2PinType"
  40. maxOccurs="1"
  41. minOccurs="1"></xs:element>
  42. <xs:element
  43. name="pin7"
  44. type="STM32GPIOv2PinType"
  45. maxOccurs="1"
  46. minOccurs="1"></xs:element>
  47. <xs:element
  48. name="pin8"
  49. type="STM32GPIOv2PinType"
  50. maxOccurs="1"
  51. minOccurs="1"></xs:element>
  52. <xs:element
  53. name="pin9"
  54. type="STM32GPIOv2PinType"
  55. maxOccurs="1"
  56. minOccurs="1"></xs:element>
  57. <xs:element
  58. name="pin10"
  59. type="STM32GPIOv2PinType"
  60. maxOccurs="1"
  61. minOccurs="1"></xs:element>
  62. <xs:element
  63. name="pin11"
  64. type="STM32GPIOv2PinType"
  65. maxOccurs="1"
  66. minOccurs="1"></xs:element>
  67. <xs:element
  68. name="pin12"
  69. type="STM32GPIOv2PinType"
  70. maxOccurs="1"
  71. minOccurs="1"></xs:element>
  72. <xs:element
  73. name="pin13"
  74. type="STM32GPIOv2PinType"
  75. maxOccurs="1"
  76. minOccurs="1"></xs:element>
  77. <xs:element
  78. name="pin14"
  79. type="STM32GPIOv2PinType"
  80. maxOccurs="1"
  81. minOccurs="1"></xs:element>
  82. <xs:element
  83. name="pin15"
  84. type="STM32GPIOv2PinType"
  85. maxOccurs="1"
  86. minOccurs="1"></xs:element>
  87. </xs:sequence>
  88. </xs:complexType>
  89. <xs:complexType name="STM32GPIOv2PinType">
  90. <xs:annotation>
  91. <xs:documentation>
  92. Object representing an STM32 pin for the GPIOv2
  93. peripheral.
  94. </xs:documentation>
  95. </xs:annotation>
  96. <xs:attribute
  97. name="ID"
  98. use="required">
  99. <xs:annotation>
  100. <xs:documentation>Pin identifier, used to generate a #define with the
  101. pin name.
  102. </xs:documentation>
  103. </xs:annotation>
  104. <xs:simpleType>
  105. <xs:annotation>
  106. <xs:documentation>
  107. </xs:documentation>
  108. </xs:annotation>
  109. <xs:restriction base="xs:string">
  110. <xs:pattern value="\w?[\w\d_]*"></xs:pattern>
  111. </xs:restriction>
  112. </xs:simpleType>
  113. </xs:attribute>
  114. <xs:attribute
  115. name="Mode"
  116. use="required">
  117. <xs:annotation>
  118. <xs:documentation>
  119. Pin mode, as defined for MODER register.
  120. </xs:documentation>
  121. </xs:annotation>
  122. <xs:simpleType>
  123. <xs:restriction base="xs:string">
  124. <xs:enumeration value="Input"></xs:enumeration>
  125. <xs:enumeration value="Output"></xs:enumeration>
  126. <xs:enumeration value="Alternate"></xs:enumeration>
  127. <xs:enumeration value="Analog"></xs:enumeration>
  128. </xs:restriction>
  129. </xs:simpleType>
  130. </xs:attribute>
  131. <xs:attribute
  132. name="Level"
  133. use="required">
  134. <xs:annotation>
  135. <xs:documentation>Logic level for the ODR register.</xs:documentation>
  136. </xs:annotation>
  137. <xs:simpleType>
  138. <xs:restriction base="xs:string">
  139. <xs:enumeration value="High"></xs:enumeration>
  140. <xs:enumeration value="Low"></xs:enumeration>
  141. </xs:restriction>
  142. </xs:simpleType>
  143. </xs:attribute>
  144. <xs:attribute
  145. name="Speed"
  146. use="required">
  147. <xs:annotation>
  148. <xs:documentation>
  149. Pin speed as defined in SPEEDR register.
  150. </xs:documentation>
  151. </xs:annotation>
  152. <xs:simpleType>
  153. <xs:restriction base="xs:string">
  154. <xs:enumeration value="Minimum"></xs:enumeration>
  155. <xs:enumeration value="Low"></xs:enumeration>
  156. <xs:enumeration value="High"></xs:enumeration>
  157. <xs:enumeration value="Maximum"></xs:enumeration>
  158. </xs:restriction>
  159. </xs:simpleType>
  160. </xs:attribute>
  161. <xs:attribute
  162. name="Type"
  163. use="required">
  164. <xs:annotation>
  165. <xs:documentation>
  166. Pin type as defined in TYPER register.
  167. </xs:documentation>
  168. </xs:annotation>
  169. <xs:simpleType>
  170. <xs:restriction base="xs:string">
  171. <xs:enumeration value="PushPull"></xs:enumeration>
  172. <xs:enumeration value="OpenDrain"></xs:enumeration>
  173. </xs:restriction>
  174. </xs:simpleType>
  175. </xs:attribute>
  176. <xs:attribute
  177. name="Resistor"
  178. use="required">
  179. <xs:annotation>
  180. <xs:documentation>
  181. Pin pull-up/down resistor as defined in PUDR register.
  182. </xs:documentation>
  183. </xs:annotation>
  184. <xs:simpleType>
  185. <xs:restriction base="xs:string">
  186. <xs:enumeration value="Floating"></xs:enumeration>
  187. <xs:enumeration value="PullUp"></xs:enumeration>
  188. <xs:enumeration value="PullDown"></xs:enumeration>
  189. </xs:restriction>
  190. </xs:simpleType>
  191. </xs:attribute>
  192. <xs:attribute
  193. name="Alternate"
  194. use="required">
  195. <xs:annotation>
  196. <xs:documentation>
  197. Pin alternate function number, only valid if
  198. "Alternate" is selected
  199. in the Mode attribute.
  200. </xs:documentation>
  201. </xs:annotation>
  202. <xs:simpleType>
  203. <xs:restriction base="xs:int">
  204. <xs:minInclusive value="0"></xs:minInclusive>
  205. <xs:maxInclusive value="15"></xs:maxInclusive>
  206. <xs:whiteSpace value="collapse"></xs:whiteSpace>
  207. </xs:restriction>
  208. </xs:simpleType>
  209. </xs:attribute>
  210. </xs:complexType>
  211. </xs:schema>