1<?xml version="1.0" encoding="utf-8"?>
2
3
4<!--****************************************************************************
5* \file althf_bleeco.cypersonality
6* \version 1.0
7*
8* \brief
9* ALTHF (BLE ECO) personality description file.
10*
11********************************************************************************
12* \copyright
13* Copyright 2018-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="mxs40althfble" name="ALTHF (BLE ECO)" version="1.0" xmlns="http://cypress.com/xsd/cyhwpersonality_v7">
30  <Dependencies>
31    <IpBlock name="mxbless" />
32    <IpBlock name="mxs40srss" />
33    <Resource name="srss\.clock\.althf" />
34    <DependentResource name="bless" />
35  </Dependencies>
36  <ExposedMembers>
37    <ExposedMember key="frequency" paramId="frequency" />
38    <ExposedMember key="accuracy"  paramId="accuracyPct" />
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__ble__clk.html" linkText="Open BLE ECO Clock Documentation" visible="true" desc="Opens the Peripheral Driver Library Documentation" />
43
44    <ParamChoice id="ecoFrequency" name="Frequency" group="General" default="32000000" visible="true" editable="true" desc="ECO Frequency">
45      <Entry name="16 MHz" value="16000000" visible="true" />
46      <Entry name="32 MHz" value="32000000" visible="true" />
47    </ParamChoice>
48    <ParamRange id="accuracyPpm" name="Accuracy (&#177;ppm)" group="General" default="50" min="0" max="1000000" resolution="1" visible="true" editable="true" desc="Clock accuracy in ppm" />
49    <ParamString id="accuracyPct" name="Accuracy (&#177;%)" group="General" default="`${accuracyPpm/10000.0}`" visible="true" editable="false" desc="Clock accuracy in %" />
50    <ParamChoice id="divider" name="Divider" group="General" default="4" visible="true" editable="true" desc="System divider for ECO clock">
51      <Entry name="1" value="1" visible="true" />
52      <Entry name="2" value="2" visible="true" />
53      <Entry name="4" value="4" visible="true" />
54      <Entry name="8" value="8" visible="true" />
55    </ParamChoice>
56    <ParamRange id="frequency" name="Frequency" group="Internal" default="`${ecoFrequency / divider}`" min="2000000" max="32000000" resolution="1" visible="false" editable="false" desc="" />
57    <ParamRange id="startupTime" name="Startup Time (us)" group="General" default="785" min="400" max="4593.75" resolution="0.01" visible="true" editable="true" desc="ECO crystal startup time" />
58    <ParamRange id="loadCap" name="Load Cap (pF)" group="General" default="9.900" min="7.5" max="26.325" resolution="0.001" visible="true" editable="true" desc="ECO crystal load capacitance" />
59    <ParamChoice id="bleVoltageReg" name="BLE Voltage Regulator" group="General" visible="true" editable="true" default="CY_BLE_ECO_VOLTAGE_REG_AUTO" desc="Provides the ability to switch between using the BLESS LDO Linear Regulator or the SIMO Buck to supply the BLE Sub System. If the SIMO/BLESS LDO option is selected, the BLESS will be supplied by the SIMO Buck if it is enabled in system; otherwise, the BLESS will be supplied by the internal BLESS LDO Regulator">
60      <Entry name="SIMO/BLESS LDO" value="CY_BLE_ECO_VOLTAGE_REG_AUTO" visible="true" />
61      <Entry name="BLESS LDO" value="CY_BLE_ECO_VOLTAGE_REG_BLESSLDO" visible="true" />
62    </ParamChoice>
63  </Parameters>
64  <ConfigFirmware>
65    <ConfigInclude value="cy_ble_clk.h" include="true" />
66    <ConfigDefine name="CY_CFG_SYSCLK_ALTHF_ENABLED" value="1" public="false" include="true" />
67    <ConfigDefine name="CY_CFG_SYSCLK_ALTHF_BLE_ECO_FREQ" value="`${(ecoFrequency == 16000000) ? &quot;CY_BLE_BLESS_ECO_FREQ_16MHZ&quot; : &quot;CY_BLE_BLESS_ECO_FREQ_32MHZ&quot;}`" public="false" include="true" />
68    <ConfigDefine name="CY_CFG_SYSCLK_ALTHF_BLE_ECO_CLK_DIV" value="CY_BLE_SYS_ECO_CLK_DIV_`${divider}`" public="false" include="true" />
69    <ConfigDefine name="CY_CFG_SYSCLK_ALTHF_BLE_ECO_VOL_REGULATOR" value="`${bleVoltageReg}`" public="false" include="true" />
70    <ConfigDefine name="CY_CFG_SYSCLK_ALTHF_BLE_ECO_CLOAD" value="`${cast(uint64, (loadCap - 7.5) / 0.075)}`U" public="false" include="true" />
71    <ConfigDefine name="CY_CFG_SYSCLK_ALTHF_BLE_ECO_TIME" value="`${cast(uint64, startupTime / 31.25)}`U" public="false" include="true" />
72    <ConfigFunction signature="__STATIC_INLINE void Cy_SysClk_AltHfInit()" body="    cy_en_ble_eco_status_t status = Cy_BLE_EcoConfigure(`${(ecoFrequency == 16000000) ? &quot;CY_BLE_BLESS_ECO_FREQ_16MHZ&quot; : &quot;CY_BLE_BLESS_ECO_FREQ_32MHZ&quot;}`, CY_BLE_SYS_ECO_CLK_DIV_`${divider}`, `${cast(uint64, (loadCap - 7.5) / 0.075)}`U, `${cast(uint64, startupTime / 31.25)}`U, `${bleVoltageReg}`);&#xA;    if ((CY_BLE_ECO_SUCCESS != status) &amp;&amp; (CY_BLE_ECO_ALREADY_STARTED !=status))&#xA;    {&#xA;        cycfg_ClockStartupError(CY_CFG_SYSCLK_ALTHF_ERROR);&#xA;    }" public="false" include="true" guard="(!defined(CY_DEVICE_SECURE))" />
73  </ConfigFirmware>
74</Personality>
75