S32 SDK
port_hal.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 - 2014, Freescale Semiconductor, Inc.
3  * Copyright 2016 NXP
4  * All rights reserved.
5  *
6  * THIS SOFTWARE IS PROVIDED BY NXP "AS IS" AND ANY EXPRESSED OR
7  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
8  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
9  * IN NO EVENT SHALL NXP OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
10  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
11  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
12  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
13  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
14  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
15  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
16  * THE POSSIBILITY OF SUCH DAMAGE.
17  */
18 
19 #include "port_hal.h"
20 
30 #if FEATURE_SOC_PORT_COUNT > 0
31 
32 /*******************************************************************************
33  * Code
34  ******************************************************************************/
35 
36 /*FUNCTION**********************************************************************
37  *
38  * Function Name : PORT_HAL_SetLowGlobalPinCtrlCmd
39  * Description : Configure low half of pin control register for the same settings,
40  * this function operates pin 0 -15 of one specific port.
41  *
42  * Implements : PORT_HAL_SetLowGlobalPinCtrlCmd_Activity
43  *END**************************************************************************/
44 void PORT_HAL_SetLowGlobalPinCtrlCmd(PORT_Type* const base, const uint16_t lowPinSelect, const uint16_t config)
45 {
46  uint32_t combine = lowPinSelect;
47  combine = (combine << 16U) + config;
48  base->GPCLR = combine;
49 }
50 
51 /*FUNCTION**********************************************************************
52  *
53  * Function Name : PORT_HAL_SetHighGlobalPinCtrlCmd
54  * Description : Configure high half of pin control register for the same
55  * settings, this function operates pin 16 -31 of one specific port.
56  *
57  * Implements : PORT_HAL_SetHighGlobalPinCtrlCmd_Activity
58  *END**************************************************************************/
59 void PORT_HAL_SetHighGlobalPinCtrlCmd(PORT_Type* const base, const uint16_t highPinSelect, const uint16_t config)
60 {
61  uint32_t combine = highPinSelect;
62  combine = (combine << 16U) + config;
63  base->GPCHR = combine;
64 }
65 
66 #endif /* FEATURE_SOC_PORT_COUNT */
67 /*******************************************************************************
68  * EOF
69  ******************************************************************************/
70 
__O uint32_t GPCHR
Definition: S32K144.h:8552
void PORT_HAL_SetHighGlobalPinCtrlCmd(PORT_Type *const base, const uint16_t highPinSelect, const uint16_t config)
Configures the high half of pin control register for the same settings. This function operates pin 16...
void PORT_HAL_SetLowGlobalPinCtrlCmd(PORT_Type *const base, const uint16_t lowPinSelect, const uint16_t config)
Configures the low half of the pin control register for the same settings. This function operates pin...
__O uint32_t GPCLR
Definition: S32K144.h:8551