1 /** 2 **************************************************************************************** 3 * 4 * @file gr55xx_hal_msio_ex.h 5 * @author BLE Driver Team 6 * @brief Header file containing extended macro of MSIO HAL library. 7 * 8 **************************************************************************************** 9 * @attention 10 #####Copyright (c) 2019 GOODIX 11 All rights reserved. 12 13 Redistribution and use in source and binary forms, with or without 14 modification, are permitted provided that the following conditions are met: 15 * Redistributions of source code must retain the above copyright 16 notice, this list of conditions and the following disclaimer. 17 * Redistributions in binary form must reproduce the above copyright 18 notice, this list of conditions and the following disclaimer in the 19 documentation and/or other materials provided with the distribution. 20 * Neither the name of GOODIX nor the names of its contributors may be used 21 to endorse or promote products derived from this software without 22 specific prior written permission. 23 24 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 25 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 26 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 27 ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE 28 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 29 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 30 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 31 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 32 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 33 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 34 POSSIBILITY OF SUCH DAMAGE. 35 **************************************************************************************** 36 */ 37 38 /** @addtogroup PERIPHERAL Peripheral Driver 39 * @{ 40 */ 41 42 /** @addtogroup HAL_DRIVER HAL Driver 43 * @{ 44 */ 45 46 /** @defgroup HAL_MSIOEx MSIOEx 47 * @brief MSIOEx HAL module driver. 48 * @{ 49 */ 50 51 /* Define to prevent recursive inclusion -------------------------------------*/ 52 #ifndef __GR55xx_HAL_MSIO_EX_H__ 53 #define __GR55xx_HAL_MSIO_EX_H__ 54 55 /* Includes ------------------------------------------------------------------*/ 56 #include "gr55xx_hal_def.h" 57 #include "gr55xx_ll_msio.h" 58 59 #ifdef __cplusplus 60 extern "C" { 61 #endif 62 63 /* Exported types ------------------------------------------------------------*/ 64 65 /** 66 * @defgroup HAL_MSIOEX_MACRO Defines 67 * @{ 68 */ 69 70 /* Exported constants --------------------------------------------------------*/ 71 /** @defgroup MSIOEx_Exported_Constants MSIOEx Exported Constants 72 * @{ 73 */ 74 75 /** @defgroup MSIOEx_Mux_Mode MSIOEx Mux Mode definition 76 * @{ 77 */ 78 #define MSIO_MUX_0 LL_MSIO_MUX_0 /**< MSIO mux mode 0 */ 79 #define MSIO_MUX_1 LL_MSIO_MUX_1 /**< MSIO mux mode 1 */ 80 #define MSIO_MUX_2 LL_MSIO_MUX_2 /**< MSIO mux mode 2 */ 81 #define MSIO_MUX_3 LL_MSIO_MUX_3 /**< MSIO mux mode 3 */ 82 #define MSIO_MUX_4 LL_MSIO_MUX_4 /**< MSIO mux mode 4 */ 83 #define MSIO_MUX_5 LL_MSIO_MUX_5 /**< MSIO mux mode 5 */ 84 #define MSIO_MUX_6 LL_MSIO_MUX_6 /**< MSIO mux mode 6 */ 85 #define MSIO_MUX_7 LL_MSIO_MUX_7 /**< MSIO mux mode 7 */ 86 /** @} */ 87 88 /** @defgroup MSIOEx_Mux_Function_Selection MSIOEx Mux function selection 89 * @{ 90 */ 91 92 #if defined (GR551xx) 93 /*---------------------------------- GR551xx ------------------------------*/ 94 95 /** @defgroup MSIOEx_Common_Selection MSIO PIN common MUX selection(Available for all MSIO pins) 96 * @{ 97 */ 98 99 #define MSIO_PIN_MUX_GPIO MSIO_MUX_7 /**< MSIO PIN x Mux Select GPIO */ 100 101 /** @} */ 102 103 /** @defgroup MSIOEx_PIN0_Mux_Selection MSIO_PIN0 MUX selection 104 * @{ 105 */ 106 #define MSIO_PIN0_MUX_PWM0_A MSIO_MUX_0 /**< MSIO_PIN0 Mux Select PWM0_A */ 107 #define MSIO_PIN0_MUX_UART0_TX MSIO_MUX_1 /**< MSIO_PIN0 Mux Select UART0_TX */ 108 #define MSIO_PIN0_MUX_UART1_TX MSIO_MUX_2 /**< MSIO_PIN0 Mux Select UART1_TX */ 109 #define MSIO_PIN0_MUX_I2C0_SCL MSIO_MUX_3 /**< MSIO_PIN0 Mux Select I2C0_SCL */ 110 #define MSIO_PIN0_MUX_I2C1_SCL MSIO_MUX_4 /**< MSIO_PIN0 Mux Select I2C1_SCL */ 111 /** @} */ 112 113 /** @defgroup MSIOEx_PIN1_Mux_Selection MSIO_PIN1 MUX selection 114 * @{ 115 */ 116 #define MSIO_PIN1_MUX_PWM0_B MSIO_MUX_0 /**< MSIO_PIN1 Mux Select PWM0_B */ 117 #define MSIO_PIN1_MUX_UART0_RX MSIO_MUX_1 /**< MSIO_PIN1 Mux Select UART0_RX */ 118 #define MSIO_PIN1_MUX_UART1_RX MSIO_MUX_2 /**< MSIO_PIN1 Mux Select UART1_RX */ 119 #define MSIO_PIN1_MUX_I2C0_SDA MSIO_MUX_3 /**< MSIO_PIN1 Mux Select I2C0_SDA */ 120 #define MSIO_PIN1_MUX_I2C1_SDA MSIO_MUX_4 /**< MSIO_PIN1 Mux Select I2C1_SDA */ 121 /** @} */ 122 123 /** @defgroup MSIOEx_PIN2_Mux_Selection MSIO_PIN2 MUX selection 124 * @{ 125 */ 126 #define MSIO_PIN2_MUX_PWM0_C MSIO_MUX_0 /**< MSIO_PIN2 Mux Select PWM0_C */ 127 /** @} */ 128 129 /** @defgroup MSIOEx_PIN3_Mux_Selection MSIO_PIN3 MUX selection 130 * @{ 131 */ 132 #define MSIO_PIN3_MUX_PWM1_A MSIO_MUX_0 /**< MSIO_PIN3 Mux Select PWM1_A */ 133 #define MSIO_PIN3_MUX_UART0_RTS MSIO_MUX_1 /**< MSIO_PIN3 Mux Select UART0_RTS */ 134 #define MSIO_PIN3_MUX_UART1_RTS MSIO_MUX_2 /**< MSIO_PIN3 Mux Select UART1_RTS */ 135 #define MSIO_PIN3_MUX_I2C0_SCL MSIO_MUX_3 /**< MSIO_PIN3 Mux Select I2C0_SCL */ 136 #define MSIO_PIN3_MUX_I2C1_SCL MSIO_MUX_4 /**< MSIO_PIN3 Mux Select I2C1_SCL */ 137 /** @} */ 138 139 /** @defgroup MSIOEx_PIN4_Mux_Selection MSIO_PIN4 MUX selection 140 * @{ 141 */ 142 #define MSIO_PIN4_MUX_PWM1_B MSIO_MUX_0 /**< MSIO_PIN4 Mux Select PWM1_B */ 143 #define MSIO_PIN4_MUX_UART0_CTS MSIO_MUX_1 /**< MSIO_PIN4 Mux Select UART0_CTS */ 144 #define MSIO_PIN4_MUX_UART1_CTS MSIO_MUX_2 /**< MSIO_PIN4 Mux Select UART1_CTS */ 145 #define MSIO_PIN4_MUX_I2C0_SDA MSIO_MUX_3 /**< MSIO_PIN4 Mux Select I2C0_SDA */ 146 #define MSIO_PIN4_MUX_I2C1_SDA MSIO_MUX_4 /**< MSIO_PIN4 Mux Select I2C1_SDA */ 147 /** @} */ 148 149 /** 150 * @brief Check if MSIO mux mode is valid. 151 * @param __MUX__ MSIO mux mode. 152 * @retval SET (__ACTION__ is valid) or RESET (__ACTION__ is invalid) 153 */ 154 #define IS_MSIO_MUX(__MUX__) (((__MUX__) <= MSIO_MUX_7)) 155 156 /*------------------------------------------------------------------------------------------*/ 157 #endif /* GR551xx */ 158 159 /** @} */ 160 161 /** @} */ 162 163 /** @} */ 164 165 #ifdef __cplusplus 166 } 167 #endif 168 169 #endif /* __GR55xx_HAL_MSIO_EX_H__ */ 170 171 /** @} */ 172 173 /** @} */ 174 175 /** @} */ 176 177