1<?xml version="1.0" encoding="utf-8"?>
2
3
4<!--****************************************************************************
5* \file tickclk.cypersonality
6* \version 3.0
7*
8* \brief
9* CLK_ALT_SYS_TICK personality description file.
10* This supports CAT1A, CAT1B, CAT1C and CAT1D devices.
11*
12********************************************************************************
13* \copyright
14* Copyright (c) (2020-2022), Cypress Semiconductor Corporation (an Infineon company) or
15* an affiliate of Cypress Semiconductor Corporation.
16* SPDX-License-Identifier: Apache-2.0
17*
18* Licensed under the Apache License, Version 2.0 (the "License");
19* you may not use this file except in compliance with the License.
20* You may obtain a copy of the License at
21*
22*     http://www.apache.org/licenses/LICENSE-2.0
23*
24* Unless required by applicable law or agreed to in writing, software
25* distributed under the License is distributed on an "AS IS" BASIS,
26* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27* See the License for the specific language governing permissions and
28* limitations under the License.
29*****************************************************************************-->
30
31<Personality id="altsystick" name="CLK_ALT_SYS_TICK" version="3.0" xmlns="http://cypress.com/xsd/cyhwpersonality_v7">
32  <Dependencies>
33    <IpBlock name="mxs40srss,mxs40ssrss,mxs40srss_ver3,m0seccpuss,m33syscpuss,m55appcpuss" />
34    <Resource name="srss\.clock\.altsystickclk|(m0seccpuss|m33syscpuss|m55appcpuss)\.(systick|systick_s|systick_ns)" />
35  </Dependencies>
36  <ExposedMembers>
37    <ExposedMember key="frequency" paramId="frequency" />
38    <ExposedMember key="accuracy"  paramId="accuracy" />
39  </ExposedMembers>
40  <Parameters>
41    <!-- PDL documentation -->
42    <ParamDoc id="pdlDoc" name="Configuration Help" group="Overview" default="file:///`${cy_libs_path()}`/docs/pdl_api_reference_manual/html/group__group__arm__system__timer.html" linkText="Open SysTick Documentation" visible="true" desc="Opens the Peripheral Driver Library Documentation" />
43
44    <ParamChoice id="sourceClock" name="Source Clock" group="General" default="`${&quot;m0seccpuss&quot; eq getIpBlockName() ? &quot;lfclk&quot; :
45                                                                                  &quot;m33syscpuss&quot; eq getIpBlockName() ? &quot;lfclk&quot; :
46                                                                                  &quot;m55appcpuss&quot; eq getIpBlockName() ? &quot;lfclk&quot; : &quot;imo&quot;}`" visible="true" editable="true" desc="The clock source selection">
47      <Entry name="CLK_LF" value="lfclk" visible="true"/>
48      <Entry name="IMO" value="imo" visible="`${hasBlock(&quot;srss[0].clock[0].imo[0]&quot;)}`"/>
49      <Entry name="ECO" value="eco" visible="`${&quot;m0seccpuss&quot; ne getIpBlockName() ? hasBlock(&quot;srss[0].clock[0].eco[0]&quot;) : &quot;false&quot;}`"/>
50      <Entry name="CLK_TIMER" value="timerclk" visible="true"/>
51      <Entry name="`${&quot;m55appcpuss&quot; eq getIpBlockName() ? &quot;CLK_HF1&quot; : &quot;CLK_HF0&quot;}`" value="hfclk" visible="`${&quot;mxs40ssrss&quot; eq getIpBlockName() ? &quot;true&quot; :
52                                                      &quot;m0seccpuss&quot; eq getIpBlockName() ? &quot;true&quot; :
53                                                      &quot;m33syscpuss&quot; eq getIpBlockName() ? &quot;true&quot; :
54                                                      &quot;m55appcpuss&quot; eq getIpBlockName() ? &quot;true&quot; : &quot;false&quot;}`"/>
55    </ParamChoice>
56    <ParamString id="sourceClockRsc" name="Source Clock Resource" group="Internal" default="srss[0].clock[0].`${sourceClock}`[`${(&quot;m55appcpuss&quot; eq getIpBlockName()&amp;&amp; (sourceClock eq hfclk)) ? &quot;1&quot; : &quot;0&quot;}`]" visible="false" editable="false" desc="" />
57    <ParamString id="sourceClockRscName" name="Source Clock" group="Internal" default="`${sourceClock eq lfclk ? &quot;LF&quot; :
58                                                                                          sourceClock eq imo   ? &quot;IMO&quot; :
59                                                                                          sourceClock eq hfclk ? &quot;CPU&quot; :
60                                                                                          sourceClock eq eco ? &quot;ECO&quot; : &quot;TIMER&quot;}`" visible="false" editable="false" desc="" />
61    <!-- Set an error if the source clock is not enabled -->
62    <ParamBool  id="error" name="Clock Error" group="Internal" default="`${!isBlockUsed(sourceClockRsc)}`" visible="false" editable="false" desc="" />
63    <ParamRange id="frequency" name="Frequency" group="Internal" default="`${((&quot;mxs40srss&quot; ne getIpBlockName()) &amp;&amp; (sourceClock eq timerclk)) ? (1000000) : (!error ? getExposedMember(sourceClockRsc, &quot;frequency&quot;) : 0)}`" min="0" max="400000000" resolution="1" visible="false" editable="false" desc="" />
64    <ParamString id="accuracy" name="Accuracy" group="General" default="`${((&quot;mxs40srss&quot; ne getIpBlockName()) &amp;&amp; (sourceClock eq timerclk)) ? (0) : (!error ? getExposedMember(sourceClockRsc, &quot;accuracy&quot;) : 0)}`" visible="false" editable="false" desc="" />
65
66    <!-- If the frequency is less than one MHz, display its value in kHz -->
67    <ParamString id="frequencyInfo" name="Frequency" group="General" default="`${formatFrequency(frequency,accuracy)}`" visible="true" editable="false" desc="The resulting CLK_ALT_SYS_TICK output clock frequency" />
68   <ParamRange id="interval" name="Interval (µs)" group="General" default="0" min="0" max="`${floor(((16777215.0 / frequency) * 1000000) )}`" resolution="1" visible="true" editable="true" desc="Systick Interrupt Interval. Range (0 - `${floor(((16777215.0 / frequency) * 1000000) )}`) µs" />
69 </Parameters>
70  <DRCs>
71    <DRC type="ERROR" text="Source clock for CLK_ALT_SYS_TICK is not enabled" condition="`${error}`" >
72      <FixIt action="ENABLE_BLOCK" target="`${sourceClockRsc}`" value="" valid="true" />
73    </DRC>
74  </DRCs>
75  <ConfigFirmware>
76    <ConfigInclude value="cy_systick.h" include="true" />
77    <ConfigDefine name="CY_CFG_SYSCLK_CLKALTSYSTICK_ENABLED" value="1" public="false" include="true" />
78    <ConfigDefine name="CY_CFG_SYSCLK_CLKALTSYSTICK_SOURCE" value="CY_SYSTICK_CLOCK_SOURCE_CLK_`${sourceClockRscName}`" public="false" include="true" />
79	<ConfigDefine name="CY_CFG_SYSCLK_CLKALTSYSTICK_INTERVAL" value="`${interval}`" public="false" include="true" />
80	<ConfigDefine name="CY_CFG_SYSCLK_CLKALTSYSTICK_FREQUENCY" value="`${frequency}`" public="false" include="true" />
81	<ConfigDefine name="CY_CFG_SYSCLK_CLKALTSYSTICK_TICKS" value="((`${interval}`)/1000000.0)*`${frequency}`" public="false" include="true" />
82    <ConfigFunction signature="__STATIC_INLINE void Cy_SysClk_ClkAltSysTickInit()" body=" Cy_SysTick_Init(CY_CFG_SYSCLK_CLKALTSYSTICK_SOURCE, CY_CFG_SYSCLK_CLKALTSYSTICK_TICKS);" public="false" include="true" />
83  </ConfigFirmware>
84</Personality>
85