1 /***************************************************************************//** 2 * \file cyip_mxkeyscan.h 3 * 4 * \brief 5 * MXKEYSCAN IP definitions 6 * 7 ******************************************************************************** 8 * \copyright 9 * (c) (2016-2023), Cypress Semiconductor Corporation (an Infineon company) or 10 * an affiliate of Cypress Semiconductor Corporation. 11 * 12 * SPDX-License-Identifier: Apache-2.0 13 * 14 * Licensed under the Apache License, Version 2.0 (the "License"); 15 * you may not use this file except in compliance with the License. 16 * You may obtain a copy of the License at 17 * 18 * http://www.apache.org/licenses/LICENSE-2.0 19 * 20 * Unless required by applicable law or agreed to in writing, software 21 * distributed under the License is distributed on an "AS IS" BASIS, 22 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 23 * See the License for the specific language governing permissions and 24 * limitations under the License. 25 *******************************************************************************/ 26 27 #ifndef _CYIP_MXKEYSCAN_H_ 28 #define _CYIP_MXKEYSCAN_H_ 29 30 #include "cyip_headers.h" 31 32 /******************************************************************************* 33 * MXKEYSCAN 34 *******************************************************************************/ 35 36 #define MXKEYSCAN_SECTION_SIZE 0x00001000UL 37 38 /** 39 * \brief 0 (MXKEYSCAN) 40 */ 41 typedef struct { 42 __IOM uint32_t KEYSCAN_CTL; /*!< 0x00000000 Keyscan Control Reg */ 43 __IOM uint32_t DEBOUNCE; /*!< 0x00000004 Debounce (micro/macro) */ 44 __IM uint32_t KEYFIFO_CNT; /*!< 0x00000008 Number of entries in Key FIFO */ 45 __IM uint32_t KEYFIFO; /*!< 0x0000000C KEYFIFO values */ 46 __IM uint32_t RESERVED; 47 __IOM uint32_t MIA_CTL; /*!< 0x00000014 MIA CTL (legacy) */ 48 __IM uint32_t MIA_STATUS; /*!< 0x00000018 MIA STAUS (Legacy) */ 49 __IOM uint32_t KSI_USED; /*!< 0x0000001C Number of input key rows */ 50 __IOM uint32_t INTR; /*!< 0x00000020 Interrupt */ 51 __IOM uint32_t INTR_SET; /*!< 0x00000024 Interrupt set */ 52 __IOM uint32_t INTR_MASK; /*!< 0x00000028 Interrupt mask */ 53 __IM uint32_t INTR_MASKED; /*!< 0x0000002C Interrupt mask */ 54 } MXKEYSCAN_Type; /*!< Size = 48 (0x30) */ 55 56 57 /* MXKEYSCAN.KEYSCAN_CTL */ 58 #define MXKEYSCAN_KEYSCAN_CTL_KS_EN_Pos 0UL 59 #define MXKEYSCAN_KEYSCAN_CTL_KS_EN_Msk 0x1UL 60 #define MXKEYSCAN_KEYSCAN_CTL_GHOST_EN_Pos 2UL 61 #define MXKEYSCAN_KEYSCAN_CTL_GHOST_EN_Msk 0x4UL 62 #define MXKEYSCAN_KEYSCAN_CTL_KS_INT_EN_Pos 3UL 63 #define MXKEYSCAN_KEYSCAN_CTL_KS_INT_EN_Msk 0x8UL 64 #define MXKEYSCAN_KEYSCAN_CTL_KYS_RST_EN_Pos 4UL 65 #define MXKEYSCAN_KEYSCAN_CTL_KYS_RST_EN_Msk 0x10UL 66 #define MXKEYSCAN_KEYSCAN_CTL_RC_EXT_Pos 6UL 67 #define MXKEYSCAN_KEYSCAN_CTL_RC_EXT_Msk 0xC0UL 68 #define MXKEYSCAN_KEYSCAN_CTL_RCTC_ROW_Pos 8UL 69 #define MXKEYSCAN_KEYSCAN_CTL_RCTC_ROW_Msk 0x700UL 70 #define MXKEYSCAN_KEYSCAN_CTL_RCTC_COLUMN_Pos 11UL 71 #define MXKEYSCAN_KEYSCAN_CTL_RCTC_COLUMN_Msk 0xF800UL 72 #define MXKEYSCAN_KEYSCAN_CTL_PULL_HIGH_Pos 16UL 73 #define MXKEYSCAN_KEYSCAN_CTL_PULL_HIGH_Msk 0x10000UL 74 #define MXKEYSCAN_KEYSCAN_CTL_KSI_DRV_HIGH_Pos 17UL 75 #define MXKEYSCAN_KEYSCAN_CTL_KSI_DRV_HIGH_Msk 0x20000UL 76 #define MXKEYSCAN_KEYSCAN_CTL_KYSCLK_STAYON_Pos 18UL 77 #define MXKEYSCAN_KEYSCAN_CTL_KYSCLK_STAYON_Msk 0x40000UL 78 /* MXKEYSCAN.DEBOUNCE */ 79 #define MXKEYSCAN_DEBOUNCE_MD_DEBOUNCE_Pos 0UL 80 #define MXKEYSCAN_DEBOUNCE_MD_DEBOUNCE_Msk 0xFUL 81 #define MXKEYSCAN_DEBOUNCE_MU_DEBOUNCE_Pos 4UL 82 #define MXKEYSCAN_DEBOUNCE_MU_DEBOUNCE_Msk 0xF0UL 83 #define MXKEYSCAN_DEBOUNCE_U_DEBOUNCE_Pos 8UL 84 #define MXKEYSCAN_DEBOUNCE_U_DEBOUNCE_Msk 0x300UL 85 /* MXKEYSCAN.KEYFIFO_CNT */ 86 #define MXKEYSCAN_KEYFIFO_CNT_KEYFIFO_CNT_Pos 0UL 87 #define MXKEYSCAN_KEYFIFO_CNT_KEYFIFO_CNT_Msk 0x1FUL 88 /* MXKEYSCAN.KEYFIFO */ 89 #define MXKEYSCAN_KEYFIFO_KEYFIFO_Pos 0UL 90 #define MXKEYSCAN_KEYFIFO_KEYFIFO_Msk 0xFFUL 91 #define MXKEYSCAN_KEYFIFO_TRACK_SCAN_CYCLE_Pos 30UL 92 #define MXKEYSCAN_KEYFIFO_TRACK_SCAN_CYCLE_Msk 0x40000000UL 93 #define MXKEYSCAN_KEYFIFO_KEY_UP_DOWN_Pos 31UL 94 #define MXKEYSCAN_KEYFIFO_KEY_UP_DOWN_Msk 0x80000000UL 95 /* MXKEYSCAN.MIA_CTL */ 96 #define MXKEYSCAN_MIA_CTL_FREEZE_MIA_Pos 0UL 97 #define MXKEYSCAN_MIA_CTL_FREEZE_MIA_Msk 0x1UL 98 #define MXKEYSCAN_MIA_CTL_REPORTED_CLEAR_KYS_Pos 1UL 99 #define MXKEYSCAN_MIA_CTL_REPORTED_CLEAR_KYS_Msk 0x2UL 100 #define MXKEYSCAN_MIA_CTL_CLK_LF_SEL_Pos 2UL 101 #define MXKEYSCAN_MIA_CTL_CLK_LF_SEL_Msk 0x4UL 102 /* MXKEYSCAN.MIA_STATUS */ 103 #define MXKEYSCAN_MIA_STATUS_MIA_CLOCK_FREEZED_STATUS_Pos 0UL 104 #define MXKEYSCAN_MIA_STATUS_MIA_CLOCK_FREEZED_STATUS_Msk 0x1UL 105 #define MXKEYSCAN_MIA_STATUS_KEYCODE_SET_STATUS_Pos 1UL 106 #define MXKEYSCAN_MIA_STATUS_KEYCODE_SET_STATUS_Msk 0x2UL 107 #define MXKEYSCAN_MIA_STATUS_OVERFLOW_STATUS_Pos 2UL 108 #define MXKEYSCAN_MIA_STATUS_OVERFLOW_STATUS_Msk 0x4UL 109 #define MXKEYSCAN_MIA_STATUS_GHOST_STATUS_Pos 3UL 110 #define MXKEYSCAN_MIA_STATUS_GHOST_STATUS_Msk 0x8UL 111 #define MXKEYSCAN_MIA_STATUS_KYS_INT_SYNC_STATUS_Pos 5UL 112 #define MXKEYSCAN_MIA_STATUS_KYS_INT_SYNC_STATUS_Msk 0x20UL 113 #define MXKEYSCAN_MIA_STATUS_CLK_G_TO_KYS_DBG_Pos 6UL 114 #define MXKEYSCAN_MIA_STATUS_CLK_G_TO_KYS_DBG_Msk 0x40UL 115 /* MXKEYSCAN.KSI_USED */ 116 #define MXKEYSCAN_KSI_USED_KSI_USED_Pos 0UL 117 #define MXKEYSCAN_KSI_USED_KSI_USED_Msk 0x7UL 118 /* MXKEYSCAN.INTR */ 119 #define MXKEYSCAN_INTR_KEY_EDGE_Pos 0UL 120 #define MXKEYSCAN_INTR_KEY_EDGE_Msk 0x1UL 121 #define MXKEYSCAN_INTR_FIFO_THRESH_Pos 1UL 122 #define MXKEYSCAN_INTR_FIFO_THRESH_Msk 0x2UL 123 /* MXKEYSCAN.INTR_SET */ 124 #define MXKEYSCAN_INTR_SET_KEY_EDGE_Pos 0UL 125 #define MXKEYSCAN_INTR_SET_KEY_EDGE_Msk 0x1UL 126 #define MXKEYSCAN_INTR_SET_FIFO_THRESH_Pos 1UL 127 #define MXKEYSCAN_INTR_SET_FIFO_THRESH_Msk 0x2UL 128 /* MXKEYSCAN.INTR_MASK */ 129 #define MXKEYSCAN_INTR_MASK_KEY_EDGE_Pos 0UL 130 #define MXKEYSCAN_INTR_MASK_KEY_EDGE_Msk 0x1UL 131 #define MXKEYSCAN_INTR_MASK_FIFO_THRESH_Pos 1UL 132 #define MXKEYSCAN_INTR_MASK_FIFO_THRESH_Msk 0x2UL 133 /* MXKEYSCAN.INTR_MASKED */ 134 #define MXKEYSCAN_INTR_MASKED_KEY_EDGE_Pos 0UL 135 #define MXKEYSCAN_INTR_MASKED_KEY_EDGE_Msk 0x1UL 136 #define MXKEYSCAN_INTR_MASKED_FIFO_THRESH_Pos 1UL 137 #define MXKEYSCAN_INTR_MASKED_FIFO_THRESH_Msk 0x2UL 138 139 140 #endif /* _CYIP_MXKEYSCAN_H_ */ 141 142 143 /* [] END OF FILE */ 144