1 /* 2 * Copyright 2017-2022 NXP 3 * All rights reserved. 4 * 5 * 6 * SPDX-License-Identifier: BSD-3-Clause 7 */ 8 #ifndef _FSL_SWM_H_ 9 #define _FSL_SWM_H_ 10 11 #include "fsl_swm_connections.h" 12 13 /*! 14 * @addtogroup swm 15 * @{ 16 */ 17 18 /*! @file */ 19 20 /******************************************************************************* 21 * Definitions 22 ******************************************************************************/ 23 24 /*! @name Driver version */ 25 /*@{*/ 26 /*! @brief LPC SWM driver version. */ 27 #define FSL_SWM_DRIVER_VERSION (MAKE_VERSION(2, 1, 2)) 28 /*@}*/ 29 30 /******************************************************************************* 31 * API 32 ******************************************************************************/ 33 34 #if defined(__cplusplus) 35 extern "C" { 36 #endif 37 38 /*! 39 * @brief Assignment of digital peripheral functions to pins. 40 * 41 * This function will selects a pin (designated by its GPIO port and 42 * bit numbers) to a function. 43 * 44 * @param base SWM peripheral base address. 45 * @param func any function name that is movable. 46 * @param swm_port_pin any pin which has a GPIO port number and bit number. 47 */ 48 void SWM_SetMovablePinSelect(SWM_Type *base, swm_select_movable_t func, swm_port_pin_type_t swm_port_pin); 49 50 #if (defined(FSL_FEATURE_SWM_HAS_PINASSIGNFIXED0_REGISTER) && (FSL_FEATURE_SWM_HAS_PINASSIGNFIXED0_REGISTER == 1)) 51 /*! 52 * @brief Assignment of digital peripheral functions to pins. 53 * 54 * This function will selects a pin (designated by its GPIO port and 55 * bit numbers) to a function. 56 * 57 * @param base SWM peripheral base address. 58 * @param func any function name that is movable. 59 * @param swm_port_pin any pin which has a GPIO port number and bit number. 60 */ 61 void SWM_SetFixedMovablePinSelect(SWM_Type *base, 62 swm_select_fixed_movable_t func, 63 swm_fixed_port_pin_type_t swm_port_pin); 64 #endif /* FSL_FEATURE_SWM_HAS_PINASSIGNFIXED0_REGISTER */ 65 66 /*! 67 * @brief Enable the fixed-pin function. 68 * 69 * This function will enables a fixed-pin function in PINENABLE0 or PINENABLE1. 70 * 71 * @param base SWM peripheral base address. 72 * @param func any function name that is fixed pin. 73 * @param enable enable or disable. 74 */ 75 void SWM_SetFixedPinSelect(SWM_Type *base, swm_select_fixed_pin_t func, bool enable); 76 77 #if (defined(FSL_FEATURE_SWM_HAS_FLEXTIMER_PINASSIGN_REGISTER) && \ 78 (FSL_FEATURE_SWM_HAS_FLEXTIMER_PINASSIGN_REGISTER == 1)) 79 /*! 80 * @brief Enable the flextimer function. 81 * 82 * This function will enables a flextimer function in FTM_PINASSIGN0 or FTM_PINASSIGN1. 83 * 84 * @param base SWM peripheral base address. 85 * @param func any function name that is flextimer. 86 * @param selection flextimer pin selection. 87 */ 88 void SWM_SetFlextimerPinSelect(SWM_Type *base, swm_flextimer_pin_func_t func, swm_flextimer_pin_sel_t selection); 89 #endif /* FSL_FEATURE_SWM_HAS_PINASSIGNFIXED0_REGISTER */ 90 91 #if defined(__cplusplus) 92 } 93 #endif 94 95 /*! @}*/ 96 97 #endif /* _FSL_SWM_H_ */ 98