1 /***************************************************************************//** 2 * \file cyip_sg.h 3 * 4 * \brief 5 * SG IP definitions 6 * 7 ******************************************************************************** 8 * \copyright 9 * (c) (2016-2024), 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_SG_H_ 28 #define _CYIP_SG_H_ 29 30 #include "cyip_headers.h" 31 32 /******************************************************************************* 33 * SG 34 *******************************************************************************/ 35 36 #define SG_SG_STRUCT_SECTION_SIZE 0x00000100UL 37 #define SG_SECTION_SIZE 0x00010000UL 38 39 /** 40 * \brief Sound generator structure (SG_SG_STRUCT) 41 */ 42 typedef struct { 43 __IOM uint32_t CTL; /*!< 0x00000000 Source control */ 44 __IM uint32_t RESERVED[3]; 45 __IOM uint32_t IF_CTL; /*!< 0x00000010 Interface control */ 46 __IM uint32_t RESERVED1[3]; 47 __IOM uint32_t TIME_CTL; /*!< 0x00000020 Time control */ 48 __IOM uint32_t TONE_CTL; /*!< 0x00000024 Tone control */ 49 __IOM uint32_t AMPL_CTL; /*!< 0x00000028 Amplitude control */ 50 __IOM uint32_t STEP_CTL; /*!< 0x0000002C Step control */ 51 __IOM uint32_t TIME_CTL_BUFF; /*!< 0x00000030 Buffered time control */ 52 __IOM uint32_t TONE_CTL_BUFF; /*!< 0x00000034 Buffered tone control */ 53 __IOM uint32_t AMPL_CTL_BUFF; /*!< 0x00000038 Buffered amplitude control */ 54 __IOM uint32_t STEP_CTL_BUFF; /*!< 0x0000003C Buffered step control */ 55 __IM uint32_t RESERVED2[32]; 56 __IOM uint32_t INTR_TX; /*!< 0x000000C0 Interrupt */ 57 __IOM uint32_t INTR_TX_SET; /*!< 0x000000C4 Interrupt set */ 58 __IOM uint32_t INTR_TX_MASK; /*!< 0x000000C8 Interrupt mask */ 59 __IM uint32_t INTR_TX_MASKED; /*!< 0x000000CC Interrupt masked */ 60 __IM uint32_t RESERVED3[12]; 61 } SG_SG_STRUCT_Type; /*!< Size = 256 (0x100) */ 62 63 /** 64 * \brief SG (SG) 65 */ 66 typedef struct { 67 __IM uint32_t RESERVED[8192]; 68 SG_SG_STRUCT_Type SG_STRUCT[8]; /*!< 0x00008000 Sound generator structure */ 69 } SG_Type; /*!< Size = 34816 (0x8800) */ 70 71 72 /* SG_SG_STRUCT.CTL */ 73 #define SG_SG_STRUCT_CTL_FORMAT_Pos 0UL 74 #define SG_SG_STRUCT_CTL_FORMAT_Msk 0x1UL 75 #define SG_SG_STRUCT_CTL_ACTIVE_Pos 18UL 76 #define SG_SG_STRUCT_CTL_ACTIVE_Msk 0x40000UL 77 #define SG_SG_STRUCT_CTL_ENABLED_Pos 31UL 78 #define SG_SG_STRUCT_CTL_ENABLED_Msk 0x80000000UL 79 /* SG_SG_STRUCT.IF_CTL */ 80 #define SG_SG_STRUCT_IF_CTL_CLOCK_DIV_Pos 0UL 81 #define SG_SG_STRUCT_IF_CTL_CLOCK_DIV_Msk 0xFFUL 82 #define SG_SG_STRUCT_IF_CTL_CLOCK_SEL_Pos 8UL 83 #define SG_SG_STRUCT_IF_CTL_CLOCK_SEL_Msk 0x700UL 84 /* SG_SG_STRUCT.TIME_CTL */ 85 #define SG_SG_STRUCT_TIME_CTL_PERIOD8_Pos 0UL 86 #define SG_SG_STRUCT_TIME_CTL_PERIOD8_Msk 0xFFUL 87 #define SG_SG_STRUCT_TIME_CTL_NR_Pos 16UL 88 #define SG_SG_STRUCT_TIME_CTL_NR_Msk 0xFF0000UL 89 /* SG_SG_STRUCT.TONE_CTL */ 90 #define SG_SG_STRUCT_TONE_CTL_PERIOD8_Pos 0UL 91 #define SG_SG_STRUCT_TONE_CTL_PERIOD8_Msk 0xFFUL 92 #define SG_SG_STRUCT_TONE_CTL_HIGH8_Pos 16UL 93 #define SG_SG_STRUCT_TONE_CTL_HIGH8_Msk 0xFF0000UL 94 /* SG_SG_STRUCT.AMPL_CTL */ 95 #define SG_SG_STRUCT_AMPL_CTL_PERIOD16_Pos 0UL 96 #define SG_SG_STRUCT_AMPL_CTL_PERIOD16_Msk 0xFFFFUL 97 #define SG_SG_STRUCT_AMPL_CTL_HIGH16_Pos 16UL 98 #define SG_SG_STRUCT_AMPL_CTL_HIGH16_Msk 0xFFFF0000UL 99 /* SG_SG_STRUCT.STEP_CTL */ 100 #define SG_SG_STRUCT_STEP_CTL_STEP_Pos 0UL 101 #define SG_SG_STRUCT_STEP_CTL_STEP_Msk 0xFFFFUL 102 #define SG_SG_STRUCT_STEP_CTL_VALID_Pos 31UL 103 #define SG_SG_STRUCT_STEP_CTL_VALID_Msk 0x80000000UL 104 /* SG_SG_STRUCT.TIME_CTL_BUFF */ 105 #define SG_SG_STRUCT_TIME_CTL_BUFF_PERIOD8_Pos 0UL 106 #define SG_SG_STRUCT_TIME_CTL_BUFF_PERIOD8_Msk 0xFFUL 107 #define SG_SG_STRUCT_TIME_CTL_BUFF_NR_Pos 16UL 108 #define SG_SG_STRUCT_TIME_CTL_BUFF_NR_Msk 0xFF0000UL 109 /* SG_SG_STRUCT.TONE_CTL_BUFF */ 110 #define SG_SG_STRUCT_TONE_CTL_BUFF_PERIOD8_Pos 0UL 111 #define SG_SG_STRUCT_TONE_CTL_BUFF_PERIOD8_Msk 0xFFUL 112 #define SG_SG_STRUCT_TONE_CTL_BUFF_HIGH8_Pos 16UL 113 #define SG_SG_STRUCT_TONE_CTL_BUFF_HIGH8_Msk 0xFF0000UL 114 /* SG_SG_STRUCT.AMPL_CTL_BUFF */ 115 #define SG_SG_STRUCT_AMPL_CTL_BUFF_PERIOD16_Pos 0UL 116 #define SG_SG_STRUCT_AMPL_CTL_BUFF_PERIOD16_Msk 0xFFFFUL 117 #define SG_SG_STRUCT_AMPL_CTL_BUFF_HIGH16_Pos 16UL 118 #define SG_SG_STRUCT_AMPL_CTL_BUFF_HIGH16_Msk 0xFFFF0000UL 119 /* SG_SG_STRUCT.STEP_CTL_BUFF */ 120 #define SG_SG_STRUCT_STEP_CTL_BUFF_STEP_Pos 0UL 121 #define SG_SG_STRUCT_STEP_CTL_BUFF_STEP_Msk 0xFFFFUL 122 #define SG_SG_STRUCT_STEP_CTL_BUFF_VALID_Pos 31UL 123 #define SG_SG_STRUCT_STEP_CTL_BUFF_VALID_Msk 0x80000000UL 124 /* SG_SG_STRUCT.INTR_TX */ 125 #define SG_SG_STRUCT_INTR_TX_COMPLETE_Pos 0UL 126 #define SG_SG_STRUCT_INTR_TX_COMPLETE_Msk 0x1UL 127 #define SG_SG_STRUCT_INTR_TX_UNDERFLOW_Pos 2UL 128 #define SG_SG_STRUCT_INTR_TX_UNDERFLOW_Msk 0x4UL 129 #define SG_SG_STRUCT_INTR_TX_IF_UNDERFLOW_Pos 8UL 130 #define SG_SG_STRUCT_INTR_TX_IF_UNDERFLOW_Msk 0x100UL 131 /* SG_SG_STRUCT.INTR_TX_SET */ 132 #define SG_SG_STRUCT_INTR_TX_SET_COMPLETE_Pos 0UL 133 #define SG_SG_STRUCT_INTR_TX_SET_COMPLETE_Msk 0x1UL 134 #define SG_SG_STRUCT_INTR_TX_SET_UNDERFLOW_Pos 2UL 135 #define SG_SG_STRUCT_INTR_TX_SET_UNDERFLOW_Msk 0x4UL 136 #define SG_SG_STRUCT_INTR_TX_SET_IF_UNDERFLOW_Pos 8UL 137 #define SG_SG_STRUCT_INTR_TX_SET_IF_UNDERFLOW_Msk 0x100UL 138 /* SG_SG_STRUCT.INTR_TX_MASK */ 139 #define SG_SG_STRUCT_INTR_TX_MASK_COMPLETE_Pos 0UL 140 #define SG_SG_STRUCT_INTR_TX_MASK_COMPLETE_Msk 0x1UL 141 #define SG_SG_STRUCT_INTR_TX_MASK_UNDERFLOW_Pos 2UL 142 #define SG_SG_STRUCT_INTR_TX_MASK_UNDERFLOW_Msk 0x4UL 143 #define SG_SG_STRUCT_INTR_TX_MASK_IF_UNDERFLOW_Pos 8UL 144 #define SG_SG_STRUCT_INTR_TX_MASK_IF_UNDERFLOW_Msk 0x100UL 145 /* SG_SG_STRUCT.INTR_TX_MASKED */ 146 #define SG_SG_STRUCT_INTR_TX_MASKED_COMPLETE_Pos 0UL 147 #define SG_SG_STRUCT_INTR_TX_MASKED_COMPLETE_Msk 0x1UL 148 #define SG_SG_STRUCT_INTR_TX_MASKED_UNDERFLOW_Pos 2UL 149 #define SG_SG_STRUCT_INTR_TX_MASKED_UNDERFLOW_Msk 0x4UL 150 #define SG_SG_STRUCT_INTR_TX_MASKED_IF_UNDERFLOW_Pos 8UL 151 #define SG_SG_STRUCT_INTR_TX_MASKED_IF_UNDERFLOW_Msk 0x100UL 152 153 154 #endif /* _CYIP_SG_H_ */ 155 156 157 /* [] END OF FILE */ 158