1<?xml version="1.0" encoding="utf-8"?>
2
3
4<!--****************************************************************************
5* \file keyscan.cypersonality
6* \version 1.1
7*
8* \brief
9* KeyScan personality description file. It Supports CAT1B family of devices.
10*
11********************************************************************************
12* \copyright
13* Copyright 2022 Cypress Semiconductor Corporation
14* SPDX-License-Identifier: Apache-2.0
15*
16* Licensed under the Apache License, Version 2.0 (the "License");
17* you may not use this file except in compliance with the License.
18* You may obtain a copy of the License at
19*
20*     http://www.apache.org/licenses/LICENSE-2.0
21*
22* Unless required by applicable law or agreed to in writing, software
23* distributed under the License is distributed on an "AS IS" BASIS,
24* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
25* See the License for the specific language governing permissions and
26* limitations under the License.
27*****************************************************************************-->
28
29<Personality id="keyscan" name="keyscan" version="1.1" xmlns="http://cypress.com/xsd/cyhwpersonality_v7">
30  <Dependencies>
31    <IpBlock name="mxkeyscan" />
32    <Resource name="keyscan" />
33  </Dependencies>
34  <ExposedMembers />
35  <Parameters>
36    <!-- PDL documentation -->
37    <ParamDoc id="pdlDoc" name="Configuration Help" group="Overview" default="file:///`${cy_libs_path()}`/docs/pdl_api_reference_manual/html/group__group__keyscan.html" linkText="Open KeyScan Documentation" visible="true" desc="Opens the Peripheral Driver Library Documentation" />
38
39    <!-- IP Block property DeepSleepCapable -->
40    <ParamBool id="GhostEnable" name="Enable Ghost detection" group="Keyscan_Config" default="true" visible="true" editable="true" desc="Enables/Disables Ghost key detection." />
41    <ParamBool id="CPUWakeupEnable" name="Wake UP CPU Enable" group="Keyscan_Config" default="true" visible="true" editable="true" desc="Enables/Disables the keyscan block to wake the MCU module if key is detected." />
42    <ParamBool id="ClkAlwaysOn" name="Clock Always On" group="Keyscan_Config" default="true" visible="true" editable="true" desc="The keyscan clock will stay on when set; otherwise, the clock will be gated off by when no activity is detected." />
43
44    <ParamRange id="noofRows" name="No Of Rows" group="Keyscan_Config" default="8" min="1" max="8" resolution="1" visible="true" editable="true" desc="set the number of rows of the key matrix" />
45
46    <ParamRange id="noofColumns" name="No Of Columns" group="Keyscan_Config" default="2" min="1" max="18" resolution="1" visible="true" editable="true" desc="set the number of columns of the key matrix. 20829 has only 18 columns available." />
47
48    <ParamRange id="macroDownDebCnt" name="Macro Down Debounce Count" group="Keyscan_Config" default="3" min="0" max="15" resolution="1" visible="true" editable="true" desc="Macro down debounce count. 2nd stage of filtering. 4-bit value dedicated each for down events for qualifying to FIFO." />
49
50    <ParamRange id="macroUpDebCnt" name="Macro UP Debounce Count" group="Keyscan_Config" default="3" min="0" max="15" resolution="1" visible="true" editable="true" desc="Macro up debounce count. 2nd stage of filtering. 4-bit value dedicated each for up events for qualifying to FIFO." />
51
52    <ParamRange id="microDebCnt" name="Micro Debounce Count" group="Keyscan_Config" default="3" min="0" max="3" resolution="1" visible="true" editable="true" desc="Micro debounce count. 1st stage of filtering. 2-bit value dedicated each for up and down events for filtering for short key events." />
53
54    <!-- Connections -->
55
56    <!-- ROW1 -->
57    <ParamSignal port="ks_row[0]" name="Row 1" group="Inputs" visible="`${noofRows &gt; 0}`" desc="Keyscan input signal t" canBeEmpty="true" >
58      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
59        <Parameter id="DriveModes" severity="DEFAULT" reason="">
60          <Fixed value="CY_GPIO_DM_PULLUP" />
61        </Parameter>
62      </Constraint>
63      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
64        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
65          <Fixed value="CY_GPIO_DM_PULLUP" />
66        </Parameter>
67      </Constraint>
68      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
69    </ParamSignal>
70
71    <!-- ROW2 -->
72    <ParamSignal port="ks_row[1]" name="Row 2" group="Inputs" visible="`${noofRows &gt; 1}`" desc="Keyscan Input signal t" canBeEmpty="true" >
73      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
74        <Parameter id="DriveModes" severity="DEFAULT" reason="">
75          <Fixed value="CY_GPIO_DM_PULLUP" />
76        </Parameter>
77      </Constraint>
78      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
79        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
80          <Fixed value="CY_GPIO_DM_PULLUP" />
81        </Parameter>
82      </Constraint>
83      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
84    </ParamSignal>
85
86
87    <!-- ROW3 -->
88    <ParamSignal port="ks_row[2]" name="Row 3" group="Inputs" visible="`${noofRows &gt; 2}`" desc="Keyscan Input signal t" canBeEmpty="true" >
89      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
90        <Parameter id="DriveModes" severity="DEFAULT" reason="">
91          <Fixed value="CY_GPIO_DM_PULLUP" />
92        </Parameter>
93      </Constraint>
94      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
95        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
96          <Fixed value="CY_GPIO_DM_PULLUP" />
97        </Parameter>
98      </Constraint>
99      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
100    </ParamSignal>
101
102    <!-- ROW4 -->
103    <ParamSignal port="ks_row[3]" name="Row 4" group="Inputs" visible="`${noofRows &gt; 3}`" desc="Keyscan Input signal t" canBeEmpty="true" >
104      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
105        <Parameter id="DriveModes" severity="DEFAULT" reason="">
106          <Fixed value="CY_GPIO_DM_PULLUP" />
107        </Parameter>
108      </Constraint>
109      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
110        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
111          <Fixed value="CY_GPIO_DM_PULLUP" />
112        </Parameter>
113      </Constraint>
114      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
115    </ParamSignal>
116
117    <!-- ROW5 -->
118    <ParamSignal port="ks_row[4]" name="Row 5" group="Inputs" visible="`${noofRows &gt; 4}`" desc="Keyscan Input signal t" canBeEmpty="true" >
119      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
120        <Parameter id="DriveModes" severity="DEFAULT" reason="">
121          <Fixed value="CY_GPIO_DM_PULLUP" />
122        </Parameter>
123      </Constraint>
124      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
125        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
126          <Fixed value="CY_GPIO_DM_PULLUP" />
127        </Parameter>
128      </Constraint>
129      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
130    </ParamSignal>
131
132    <!-- ROW6 -->
133    <ParamSignal port="ks_row[5]" name="Row 6" group="Inputs" visible="`${noofRows &gt; 5}`" desc="Keyscan Input signal t" canBeEmpty="true" >
134      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
135        <Parameter id="DriveModes" severity="DEFAULT" reason="">
136          <Fixed value="CY_GPIO_DM_PULLUP" />
137        </Parameter>
138      </Constraint>
139      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
140        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
141          <Fixed value="CY_GPIO_DM_PULLUP" />
142        </Parameter>
143      </Constraint>
144      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
145    </ParamSignal>
146
147    <!-- ROW7 -->
148    <ParamSignal port="ks_row[6]" name="Row 7" group="Inputs" visible="`${noofRows &gt; 6}`" desc="Keyscan Input signal t" canBeEmpty="true" >
149      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
150        <Parameter id="DriveModes" severity="DEFAULT" reason="">
151          <Fixed value="CY_GPIO_DM_PULLUP" />
152        </Parameter>
153      </Constraint>
154      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
155        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
156          <Fixed value="CY_GPIO_DM_PULLUP" />
157        </Parameter>
158      </Constraint>
159      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
160    </ParamSignal>
161
162    <!-- ROW8 -->
163    <ParamSignal port="ks_row[7]" name="Row 8" group="Inputs" visible="`${noofRows &gt; 7}`" desc="Keyscan Input signal t" canBeEmpty="true" >
164      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
165        <Parameter id="DriveModes" severity="DEFAULT" reason="">
166          <Fixed value="CY_GPIO_DM_PULLUP" />
167        </Parameter>
168      </Constraint>
169      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
170        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
171          <Fixed value="CY_GPIO_DM_PULLUP" />
172        </Parameter>
173      </Constraint>
174      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
175    </ParamSignal>
176
177    <!-- Column1 -->
178    <ParamSignal port="ks_col[0]" name="Column 1" group="Outputs" visible="`${noofColumns &gt; 0}`" desc="Keyscan output signal t" canBeEmpty="true" >
179      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
180        <Parameter id="DriveModes" severity="DEFAULT" reason="">
181          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
182        </Parameter>
183      </Constraint>
184      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
185        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
186          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
187        </Parameter>
188      </Constraint>
189      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
190    </ParamSignal>
191
192    <!-- Column2 -->
193    <ParamSignal port="ks_col[1]" name="Column 2" group="Outputs" visible="`${noofColumns &gt; 1}`" desc="Keyscan output signal t" canBeEmpty="true" >
194      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
195        <Parameter id="DriveModes" severity="DEFAULT" reason="">
196          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
197        </Parameter>
198      </Constraint>
199      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
200        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
201          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
202        </Parameter>
203      </Constraint>
204      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
205    </ParamSignal>
206
207
208    <!-- Column3 -->
209    <ParamSignal port="ks_col[2]" name="Column 3" group="Outputs" visible="`${noofColumns &gt; 2}`" desc="Keyscan output signal t" canBeEmpty="true" >
210      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
211        <Parameter id="DriveModes" severity="DEFAULT" reason="">
212          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
213        </Parameter>
214      </Constraint>
215      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
216        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
217          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
218        </Parameter>
219      </Constraint>
220      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
221    </ParamSignal>
222
223    <!-- Column4 -->
224    <ParamSignal port="ks_col[3]" name="Column 4" group="Outputs" visible="`${noofColumns &gt; 3}`" desc="Keyscan output signal t" canBeEmpty="true" >
225      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
226        <Parameter id="DriveModes" severity="DEFAULT" reason="">
227          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
228        </Parameter>
229      </Constraint>
230      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
231        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
232          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
233        </Parameter>
234      </Constraint>
235      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
236    </ParamSignal>
237
238    <!-- Column5 -->
239    <ParamSignal port="ks_col[4]" name="Column 5" group="Outputs" visible="`${noofColumns &gt; 4}`" desc="Keyscan output signal t" canBeEmpty="true" >
240      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
241        <Parameter id="DriveModes" severity="DEFAULT" reason="">
242          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
243        </Parameter>
244      </Constraint>
245      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
246        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
247          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
248        </Parameter>
249      </Constraint>
250      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
251    </ParamSignal>
252
253    <!-- Column6 -->
254    <ParamSignal port="ks_col[5]" name="Column 6" group="Outputs" visible="`${noofColumns &gt; 5}`" desc="Keyscan output signal t" canBeEmpty="true" >
255      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
256        <Parameter id="DriveModes" severity="DEFAULT" reason="">
257          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
258        </Parameter>
259      </Constraint>
260      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
261        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
262          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
263        </Parameter>
264      </Constraint>
265      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
266    </ParamSignal>
267
268    <!-- Column7 -->
269    <ParamSignal port="ks_col[6]" name="Column 7" group="Outputs" visible="`${noofColumns &gt; 6}`" desc="Keyscan output signal t" canBeEmpty="true" >
270      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
271        <Parameter id="DriveModes" severity="DEFAULT" reason="">
272          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
273        </Parameter>
274      </Constraint>
275      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
276        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
277          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
278        </Parameter>
279      </Constraint>
280      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
281    </ParamSignal>
282
283    <!-- Column8 -->
284    <ParamSignal port="ks_col[7]" name="Column 8" group="Outputs" visible="`${noofColumns &gt; 7}`" desc="Keyscan output signal t" canBeEmpty="true" >
285      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
286        <Parameter id="DriveModes" severity="DEFAULT" reason="">
287          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
288        </Parameter>
289      </Constraint>
290      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
291        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
292          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
293        </Parameter>
294      </Constraint>
295      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
296    </ParamSignal>
297
298    <!-- Column9 -->
299    <ParamSignal port="ks_col[8]" name="Column 9" group="Outputs" visible="`${noofColumns &gt; 8}`" desc="Keyscan output signal t" canBeEmpty="true" >
300      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
301        <Parameter id="DriveModes" severity="DEFAULT" reason="">
302          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
303        </Parameter>
304      </Constraint>
305      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
306        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
307          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
308        </Parameter>
309      </Constraint>
310      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
311    </ParamSignal>
312
313    <!-- Column10 -->
314    <ParamSignal port="ks_col[9]" name="Column 10" group="Outputs" visible="`${noofColumns &gt; 9}`" desc="Keyscan output signal t" canBeEmpty="true" >
315      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
316        <Parameter id="DriveModes" severity="DEFAULT" reason="">
317          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
318        </Parameter>
319      </Constraint>
320      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
321        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
322          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
323        </Parameter>
324      </Constraint>
325      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
326    </ParamSignal>
327
328    <!-- Column11 -->
329    <ParamSignal port="ks_col[10]" name="Column 11" group="Outputs" visible="`${noofColumns &gt; 10}`" desc="Keyscan output signal t" canBeEmpty="true" >
330      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
331        <Parameter id="DriveModes" severity="DEFAULT" reason="">
332          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
333        </Parameter>
334      </Constraint>
335      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
336        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
337          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
338        </Parameter>
339      </Constraint>
340      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
341    </ParamSignal>
342
343    <!-- Column12 -->
344    <ParamSignal port="ks_col[11]" name="Column 12" group="Outputs" visible="`${noofColumns &gt; 11}`" desc="Keyscan output signal t" canBeEmpty="true" >
345      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
346        <Parameter id="DriveModes" severity="DEFAULT" reason="">
347          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
348        </Parameter>
349      </Constraint>
350      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
351        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
352          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
353        </Parameter>
354      </Constraint>
355      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
356    </ParamSignal>
357
358    <!-- Column13 -->
359    <ParamSignal port="ks_col[12]" name="Column 13" group="Outputs" visible="`${noofColumns &gt; 12}`" desc="Keyscan output signal t" canBeEmpty="true" >
360      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
361        <Parameter id="DriveModes" severity="DEFAULT" reason="">
362          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
363        </Parameter>
364      </Constraint>
365      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
366        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
367          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
368        </Parameter>
369      </Constraint>
370      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
371    </ParamSignal>
372
373    <!-- Column14 -->
374    <ParamSignal port="ks_col[13]" name="Column 14" group="Outputs" visible="`${noofColumns &gt; 13}`" desc="Keyscan output signal t" canBeEmpty="true" >
375      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
376        <Parameter id="DriveModes" severity="DEFAULT" reason="">
377          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
378        </Parameter>
379      </Constraint>
380      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
381        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
382          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
383        </Parameter>
384      </Constraint>
385      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
386    </ParamSignal>
387
388    <!-- Column15 -->
389    <ParamSignal port="ks_col[14]" name="Column 15" group="Outputs" visible="`${noofColumns &gt; 14}`" desc="Keyscan output signal t" canBeEmpty="true" >
390      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
391        <Parameter id="DriveModes" severity="DEFAULT" reason="">
392          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
393        </Parameter>
394      </Constraint>
395      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
396        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
397          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
398        </Parameter>
399      </Constraint>
400      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
401    </ParamSignal>
402
403    <!-- Column16 -->
404    <ParamSignal port="ks_col[15]" name="Column 16" group="Outputs" visible="`${noofColumns &gt; 15}`" desc="Keyscan output signal t" canBeEmpty="true" >
405      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
406        <Parameter id="DriveModes" severity="DEFAULT" reason="">
407          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
408        </Parameter>
409      </Constraint>
410      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
411        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
412          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
413        </Parameter>
414      </Constraint>
415      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
416    </ParamSignal>
417
418    <!-- Column17 -->
419    <ParamSignal port="ks_col[16]" name="Column 17" group="Outputs" visible="`${noofColumns &gt; 16}`" desc="Keyscan output signal t" canBeEmpty="true" >
420      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
421        <Parameter id="DriveModes" severity="DEFAULT" reason="">
422          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
423        </Parameter>
424      </Constraint>
425      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
426        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
427          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
428        </Parameter>
429      </Constraint>
430      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
431    </ParamSignal>
432
433    <!-- Column18 -->
434    <ParamSignal port="ks_col[17]" name="Column 18" group="Outputs" visible="`${noofColumns &gt; 17}`" desc="Keyscan output signal t" canBeEmpty="true" >
435      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
436        <Parameter id="DriveModes" severity="DEFAULT" reason="">
437          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
438        </Parameter>
439      </Constraint>
440      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
441        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
442          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
443        </Parameter>
444      </Constraint>
445      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
446    </ParamSignal>
447
448    <!-- Column19 -->
449    <ParamSignal port="ks_col[18]" name="Column 19" group="Outputs" visible="`${noofColumns &gt; 18}`" desc="Keyscan output signal t" canBeEmpty="true" >
450      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
451        <Parameter id="DriveModes" severity="DEFAULT" reason="">
452          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
453        </Parameter>
454      </Constraint>
455      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
456        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
457          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
458        </Parameter>
459      </Constraint>
460      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
461    </ParamSignal>
462
463    <!-- Column20 -->
464    <ParamSignal port="ks_col[19]" name="Column 20" group="Outputs" visible="`${noofColumns &gt; 19}`" desc="Keyscan output signal t" canBeEmpty="true" >
465      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
466        <Parameter id="DriveModes" severity="DEFAULT" reason="">
467          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
468        </Parameter>
469      </Constraint>
470      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
471        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
472          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
473        </Parameter>
474      </Constraint>
475      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
476    </ParamSignal>
477
478    <ParamBool id="inFlash" name="Store Config in Flash" group="Advanced" default="true" visible="true" editable="true" desc="Controls whether the configuration structure is stored in flash (const, true) or SRAM (not const, false)." />
479
480    <ParamString id="sourceMFClock" name="sourcemfClock" group="Internal" default="`${(&quot;srss[0].clock[0].mfclk[0]&quot;)}`" visible="false" editable="false" desc="Source Clock Resource" />
481
482    <ParamBool id="MFClockEnabled" name="Is MF clock Enabled" group="Internal" default="`${isBlockUsed(sourceMFClock)}`" visible="false" editable="false" desc="Checks whether there is a MFCLK connected and enabled." />
483
484    <ParamString id="sourceLFClock" name="sourcelfClock" group="Internal" default="`${(&quot;srss[0].clock[0].lfclk[0]&quot;)}`" visible="false" editable="false" desc="Source Clock Resource" />
485
486    <ParamBool id="LFClockEnabled" name="Is LF clock Enabled" group="Internal" default="`${isBlockUsed(sourceLFClock)}`" visible="false" editable="false" desc="Checks whether there is a LFCLK connected and enabled." />
487
488  </Parameters>
489
490  <!-- DRC -->
491  <DRCs>
492    <DRC type="ERROR" text="CLK_MF or CLK_LF must be enabled" condition="`${!LFClockEnabled &amp;&amp; !MFClockEnabled}`" />
493    <DRC type="INFO" text="Keyscan column has to be connected for button to work." condition="`${(noofColumns &gt; 0) &amp;&amp; !hasConnection(&quot;ks_col&quot;, 0)}`" />
494    <DRC type="INFO" text="Keyscan column has to be connected for button to work." condition="`${(noofColumns &gt; 1) &amp;&amp; !hasConnection(&quot;ks_col&quot;, 1)}`" />
495    <DRC type="INFO" text="Keyscan column has to be connected for button to work." condition="`${(noofColumns &gt; 2) &amp;&amp; !hasConnection(&quot;ks_col&quot;, 2)}`" />
496    <DRC type="INFO" text="Keyscan column has to be connected for button to work." condition="`${(noofColumns &gt; 3) &amp;&amp; !hasConnection(&quot;ks_col&quot;, 3)}`" />
497    <DRC type="INFO" text="Keyscan column has to be connected for button to work." condition="`${(noofColumns &gt; 4) &amp;&amp; !hasConnection(&quot;ks_col&quot;, 4)}`" />
498    <DRC type="INFO" text="Keyscan column has to be connected for button to work." condition="`${(noofColumns &gt; 5) &amp;&amp; !hasConnection(&quot;ks_col&quot;, 5)}`" />
499    <DRC type="INFO" text="Keyscan column has to be connected for button to work." condition="`${(noofColumns &gt; 6) &amp;&amp; !hasConnection(&quot;ks_col&quot;, 6)}`" />
500    <DRC type="INFO" text="Keyscan column has to be connected for button to work." condition="`${(noofColumns &gt; 7) &amp;&amp; !hasConnection(&quot;ks_col&quot;, 7)}`" />
501    <DRC type="INFO" text="Keyscan column has to be connected for button to work." condition="`${(noofColumns &gt; 8) &amp;&amp; !hasConnection(&quot;ks_col&quot;, 8)}`" />
502    <DRC type="INFO" text="Keyscan column has to be connected for button to work." condition="`${(noofColumns &gt; 9) &amp;&amp; !hasConnection(&quot;ks_col&quot;, 9)}`" />
503    <DRC type="INFO" text="Keyscan column has to be connected for button to work." condition="`${(noofColumns &gt; 10) &amp;&amp; !hasConnection(&quot;ks_col&quot;, 10)}`" />
504    <DRC type="INFO" text="Keyscan column has to be connected for button to work." condition="`${(noofColumns &gt; 11) &amp;&amp; !hasConnection(&quot;ks_col&quot;, 11)}`" />
505    <DRC type="INFO" text="Keyscan column has to be connected for button to work." condition="`${(noofColumns &gt; 12) &amp;&amp; !hasConnection(&quot;ks_col&quot;, 12)}`" />
506    <DRC type="INFO" text="Keyscan column has to be connected for button to work." condition="`${(noofColumns &gt; 13) &amp;&amp; !hasConnection(&quot;ks_col&quot;, 13)}`" />
507    <DRC type="INFO" text="Keyscan column has to be connected for button to work." condition="`${(noofColumns &gt; 14) &amp;&amp; !hasConnection(&quot;ks_col&quot;, 14)}`" />
508    <DRC type="INFO" text="Keyscan column has to be connected for button to work." condition="`${(noofColumns &gt; 15) &amp;&amp; !hasConnection(&quot;ks_col&quot;, 15)}`" />
509    <DRC type="INFO" text="Keyscan column has to be connected for button to work." condition="`${(noofColumns &gt; 16) &amp;&amp; !hasConnection(&quot;ks_col&quot;, 16)}`" />
510    <DRC type="INFO" text="Keyscan column has to be connected for button to work." condition="`${(noofColumns &gt; 17) &amp;&amp; !hasConnection(&quot;ks_col&quot;, 17)}`" />
511    <DRC type="INFO" text="Keyscan column has to be connected for button to work." condition="`${(noofColumns &gt; 18) &amp;&amp; !hasConnection(&quot;ks_col&quot;, 18)}`" />
512    <DRC type="INFO" text="Keyscan column has to be connected for button to work." condition="`${(noofColumns &gt; 19) &amp;&amp; !hasConnection(&quot;ks_col&quot;, 19)}`" />
513
514    <DRC type="ERROR" text="Keyscan row has to be connected for button to work." condition="`${(noofRows &gt; 0) &amp;&amp; !hasConnection(&quot;ks_row&quot;, 0)}`" />
515    <DRC type="ERROR" text="Keyscan row has to be connected for button to work." condition="`${(noofRows &gt; 1) &amp;&amp; !hasConnection(&quot;ks_row&quot;, 1)}`" />
516    <DRC type="ERROR" text="Keyscan row has to be connected for button to work." condition="`${(noofRows &gt; 2) &amp;&amp; !hasConnection(&quot;ks_row&quot;, 2)}`" />
517    <DRC type="ERROR" text="Keyscan row has to be connected for button to work." condition="`${(noofRows &gt; 3) &amp;&amp; !hasConnection(&quot;ks_row&quot;, 3)}`" />
518    <DRC type="ERROR" text="Keyscan row has to be connected for button to work." condition="`${(noofRows &gt; 4) &amp;&amp; !hasConnection(&quot;ks_row&quot;, 4)}`" />
519    <DRC type="ERROR" text="Keyscan row has to be connected for button to work." condition="`${(noofRows &gt; 5) &amp;&amp; !hasConnection(&quot;ks_row&quot;, 5)}`" />
520    <DRC type="ERROR" text="Keyscan row has to be connected for button to work." condition="`${(noofRows &gt; 6) &amp;&amp; !hasConnection(&quot;ks_row&quot;, 6)}`" />
521    <DRC type="ERROR" text="Keyscan row has to be connected for button to work." condition="`${(noofRows &gt; 7) &amp;&amp; !hasConnection(&quot;ks_row&quot;, 7)}`" />
522  </DRCs>
523
524  <ConfigFirmware>
525    <ConfigInclude value="cy_keyscan.h" include="true" />
526    <ConfigInclude value="cyhal.h" include="true" guard="defined (CY_USING_HAL)" />
527
528    <ConfigDefine name="`${INST_NAME}`_HW" value="MXKEYSCAN" public="true" include="true" />
529    <ConfigDefine name="`${INST_NAME}`_IRQ" value="keyscan_interrupt_IRQn" public="true" include="true" />
530    <ConfigStruct name="`${INST_NAME}`_config" type="cy_stc_ks_config_t" const="`${inFlash}`" public="true" include="true" >
531      <Member name="macroDownDebCnt" value="`${macroDownDebCnt}`UL" />
532      <Member name="macroUpDebCnt" value="`${macroUpDebCnt}`UL" />
533      <Member name="microDebCnt" value="`${microDebCnt}`UL" />
534      <Member name="noofRows" value="`${noofRows}`UL" />
535      <Member name="noofColumns" value="`${noofColumns}`UL" />
536      <Member name="ghostEnable" value="`${GhostEnable}`" />
537      <Member name="cpuWakeupEnable" value="`${CPUWakeupEnable}`" />
538      <Member name="clkStayOn" value="`${ClkAlwaysOn}`" />
539    </ConfigStruct>
540
541    <ConfigStruct name="`${INST_NAME}`_obj" type="cyhal_resource_inst_t" const="true" public="true" include="true" guard="defined (CY_USING_HAL)">
542      <Member name="type" value="CYHAL_RSC_KEYSCAN" />
543      <Member name="block_num" value="0U" />
544      <Member name="channel_num" value="0U" />
545    </ConfigStruct>
546
547    <ConfigStruct name="`${INST_NAME}`_clock" type="cyhal_clock_t" const="`${inFlash}`" public="true" include="true" guard="defined (CY_USING_HAL)">
548      <Member name="block" value="`${MFClockEnabled ? &quot;CYHAL_CLOCK_BLOCK_MF&quot; : &quot;CYHAL_CLOCK_BLOCK_LF&quot;}`" />
549      <Member name="channel" value="0U" />
550      <Member name="reserved" value="false" />
551      <Member name="funcs" value="NULL" />
552    </ConfigStruct>
553
554    <ConfigStruct name="`${INST_NAME}`_hal_config" type="cyhal_keyscan_configurator_t" const="`${inFlash}`" public="true" include="true" guard="defined (CY_USING_HAL)">
555      <Member name="resource" value="&amp;`${INST_NAME}`_obj" />
556      <Member name="config" value="&amp;`${INST_NAME}`_config" />
557      <Member name="clock" value="&amp;`${INST_NAME}`_clock" />
558    </ConfigStruct>
559
560  </ConfigFirmware>
561
562</Personality>
563