Newer
Older
mbed-os / targets / TARGET_Cypress / TARGET_PSOC6 / mtb-pdl-cat1 / personalities / peripheral / mcwdt-1.0.cypersonality
@Dustin Crossman Dustin Crossman on 4 Jun 2021 7 KB Fix file modes.
<?xml version="1.0" encoding="utf-8"?>


<!--****************************************************************************
* \file mcwdt.cypersonality
* \version 1.0
*
* \brief
* Multi-counter watchdog personality description file.
*
********************************************************************************
* \copyright
* Copyright 2018-2019 Cypress Semiconductor Corporation
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************-->

<Personality id="mxs40mcwdt" name="Multi-counter watchdog" version="1.0" path="System" xmlns="http://cypress.com/xsd/cyhwpersonality_v1">
  <Dependencies>
    <IpBlock name="mxs40srss" />
    <Resource name="srss\.mcwdt" used="true" />
  </Dependencies>
  <ExposedMembers />
  <Parameters>
    <!-- PDL documentation -->
    <ParamDoc id="pdlDoc" name="Configuration Help" group="Peripheral Documentation" default="file:///`${cy_libs_path()}`/docs/pdl_api_reference_manual/html/group__group__mcwdt.html" linkText="Open MCWDT Documentation" visible="true" desc="Opens the Peripheral Driver Library Documentation" />

    <!--Counter0-->
    <ParamChoice id="C0ClearOnMatch" name="Clear on Match" group="Counter0" default="FREE_RUNNING" visible="true" editable="true" desc="Controls whether the counter is free running, with a period of 65,536 counts, or clear on match, where the period equals the match value + 1.">
      <Entry name="Free running" value="FREE_RUNNING" visible="true" />
      <Entry name="Clear on match" value="CLEAR_ON_MATCH" visible="true" />
    </ParamChoice>
    <ParamRange id="C0Match" name="Match" group="Counter0" default="32768" min="`${(C0ClearOnMatch eq CLEAR_ON_MATCH) ? 1 : 0}`" max="65535" resolution="1" visible="true" editable="true" desc="Counter match comparison value, for interrupt or watchdog timeout. The frequency is the interrupt frequency in interrupt action mode. The period is the inverse of the frequency." />
    <ParamChoice id="C0Mode" name="Mode" group="Counter0" default="CY_MCWDT_MODE_NONE" visible="true" editable="true" desc="Counter 0 mode.">
      <Entry name="Interrupt" value="CY_MCWDT_MODE_INT" visible="true" />
      <Entry name="Watchdog reset" value="CY_MCWDT_MODE_RESET" visible="true" />
      <Entry name="Three interrupts then Watchdog reset" value="CY_MCWDT_MODE_INT_RESET" visible="true" />
      <Entry name="No action" value="CY_MCWDT_MODE_NONE" visible="true" />
    </ParamChoice>
    
    <!--Counter1-->
    <ParamChoice id="C1ClearOnMatch" name="Clear on Match" group="Counter1" default="FREE_RUNNING" visible="true" editable="true" desc="Controls whether the counter is free running, with a period of 65,536 counts, or clear on match, where the period equals the match value + 1.">
      <Entry name="Free running" value="FREE_RUNNING" visible="true" />
      <Entry name="Clear on match" value="CLEAR_ON_MATCH" visible="true" />
    </ParamChoice>
    <ParamRange id="C1Match" name="Match" group="Counter1" default="32768" min="`${(C1ClearOnMatch eq CLEAR_ON_MATCH) ? 1 : 0}`" max="65535" resolution="1" visible="true" editable="true" desc="Counter match comparison value, for interrupt or watchdog timeout. The frequency is the interrupt frequency in interrupt action mode. The period is the inverse of the frequency." />
    <ParamChoice id="C1Mode" name="Mode" group="Counter1" default="CY_MCWDT_MODE_NONE" visible="true" editable="true" desc="Counter 1 mode.">
      <Entry name="Interrupt" value="CY_MCWDT_MODE_INT" visible="true" />
      <Entry name="Watchdog reset" value="CY_MCWDT_MODE_RESET" visible="true" />
      <Entry name="Three interrupts then Watchdog reset" value="CY_MCWDT_MODE_INT_RESET" visible="true" />
      <Entry name="No action" value="CY_MCWDT_MODE_NONE" visible="true" />
    </ParamChoice>
    
    <!--Counter2-->
    <ParamChoice id="C2Mode" name="Mode" group="Counter2" default="CY_MCWDT_MODE_NONE" visible="true" editable="true" desc="Counter 2 mode.">
      <Entry name="Interrupt" value="CY_MCWDT_MODE_INT" visible="true" />
      <Entry name="No action" value="CY_MCWDT_MODE_NONE" visible="true" />
    </ParamChoice>
    <ParamRange id="C2Period" name="Period / Toggle Bit" group="Counter2" default="16" min="0" max="31" resolution="1" visible="true" editable="true" desc="Counter 2 period (toggle bit) select. The 32 values are calculated based on the counter clock frequency divided for each of the 32 bits in the counter." />
    <ParamBool id="CascadeC0C1" name="Cascade C0C1" group="Cascade" default="false" visible="true" editable="true" desc="Controls whether Counter1 is clocked by LFCLK or from Counter0." />
    <ParamBool id="CascadeC1C2" name="Cascade C1C2" group="Cascade" default="false" visible="true" editable="true" desc="Controls whether Counter2 is clocked by LFCLK or from Counter1 cascade." />
    
    <!-- MCWDT instance number -->
    <ParamString id="InstNumber" name="InstNumber" group="Internal" default="`${getInstNumber(&quot;mcwdt&quot;)}`" visible="false" editable="false" desc="MCWDT Instance name number." />
    
    <!--Config-->
    <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)." />
  </Parameters>
  <ConfigFirmware>
    <ConfigInclude value="cy_mcwdt.h" include="true" />
    <ConfigInclude value="cyhal_hwmgr.h" include="true" guard="defined (CY_USING_HAL)" />
    
    <ConfigDefine name="`${INST_NAME}`_HW" value="MCWDT_STRUCT`${InstNumber}`" public="true" include="true" />
    <ConfigDefine name="`${INST_NAME}`_IRQ" value="srss_interrupt_mcwdt_`${InstNumber}`_IRQn" public="true" include="`${(C0Mode eq CY_MCWDT_MODE_INT) || (C0Mode eq CY_MCWDT_MODE_INT_RESET)|| (C1Mode eq CY_MCWDT_MODE_INT) || (C1Mode eq CY_MCWDT_MODE_INT_RESET) || (C2Mode eq CY_MCWDT_MODE_INT)}`" />
    <ConfigStruct name="`${INST_NAME . &quot;_config&quot;}`" type="cy_stc_mcwdt_config_t" const="`${inFlash}`" public="true" include="true">
      <Member name="c0Match" value="`${C0Match}`U" />
      <Member name="c1Match" value="`${C1Match}`U" />
      <Member name="c0Mode" value="`${C0Mode}`" />
      <Member name="c1Mode" value="`${C1Mode}`" />
      <Member name="c2ToggleBit" value="`${C2Period}`U" />
      <Member name="c2Mode" value="`${C2Mode}`" />
      <Member name="c0ClearOnMatch" value="`${(C0ClearOnMatch eq CLEAR_ON_MATCH) ? &quot;true&quot; : &quot;false&quot;}`" />
      <Member name="c1ClearOnMatch" value="`${(C1ClearOnMatch eq CLEAR_ON_MATCH) ? &quot;true&quot; : &quot;false&quot;}`" />
      <Member name="c0c1Cascade" value="`${CascadeC0C1}`" />
      <Member name="c1c2Cascade" value="`${CascadeC1C2}`" />
    </ConfigStruct>

    <ConfigStruct name="`${INST_NAME}`_obj" type="cyhal_resource_inst_t" const="true" public="true" include="true" guard="defined (CY_USING_HAL)">
      <Member name="type" value="CYHAL_RSC_LPTIMER" />
      <Member name="block_num" value="`${getInstNumber(&quot;mcwdt&quot;)}`U" />
      <Member name="channel_num" value="0U" />
    </ConfigStruct>
    
    <ConfigInstruction value="cyhal_hwmgr_reserve(&amp;`${INST_NAME}`_obj);" include="true" guard="defined (CY_USING_HAL)" />
  </ConfigFirmware>
</Personality>