]> git.sur5r.net Git - freertos/blob - FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_scu.c
Update copyright date ready for tagging V10.1.0.
[freertos] / FreeRTOS-Plus / Demo / FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC / ThirdParty / CMSISv2p10_LPC18xx_DriverLib / src / lpc18xx_scu.c
1 /**********************************************************************\r
2 * $Id$          lpc18xx_scu.c           2011-06-02\r
3 *//**\r
4 * @file         lpc18xx_scu.c\r
5 * @brief        Contains all functions support for SCU firmware library on LPC18xx\r
6 * @version      1.0\r
7 * @date         02. June. 2011\r
8 * @author       NXP MCU SW Application Team\r
9 *\r
10 * Copyright(C) 2011, NXP Semiconductor\r
11 * All rights reserved.\r
12 *\r
13 ***********************************************************************\r
14 * Software that is described herein is for illustrative purposes only\r
15 * which provides customers with programming information regarding the\r
16 * products. This software is supplied "AS IS" without any warranties.\r
17 * NXP Semiconductors assumes no responsibility or liability for the\r
18 * use of the software, conveys no license or title under any patent,\r
19 * copyright, or mask work right to the product. NXP Semiconductors\r
20 * reserves the right to make changes in the software without\r
21 * notification. NXP Semiconductors also make no representation or\r
22 * warranty that such application will be suitable for the specified\r
23 * use without further testing or modification.\r
24 **********************************************************************/\r
25 \r
26 /* Peripheral group ----------------------------------------------------------- */\r
27 /** @addtogroup SCU\r
28  * @{\r
29  */\r
30 \r
31 /* Includes ------------------------------------------------------------------- */\r
32 #include "LPC18xx.h"                    /* LPC18xx definitions                */\r
33 #include "lpc_types.h"\r
34 #include "lpc18xx_scu.h"\r
35 \r
36 \r
37 /*********************************************************************//**\r
38  * @brief               Configure pin function\r
39  * @param[in]   port    Port number, should be: 0..15\r
40  * @param[in]   pin             Pin number, should be: 0..31\r
41  * @param[in]   mode    Pin mode, should be:\r
42  *                                      - MD_PUP        :Pull-up enabled\r
43  *                                      - MD_BUK        :Plain input\r
44  *                                      - MD_PLN        :Repeater mode\r
45  *                                      - MD_PDN        :Pull-down enabled\r
46  * @param[in]   func    Function mode, should be:\r
47  *                                      - FUNC0         :Function 0\r
48  *                                      - FUNC1         :Function 1\r
49  *                                      - FUNC2         :Function 2\r
50  *                                      - FUNC3         :Function 3\r
51  * @return              None\r
52  **********************************************************************/\r
53 void scu_pinmux(uint8_t port, uint8_t pin, uint8_t mode, uint8_t func)\r
54 {\r
55   uint32_t * scu_base=(uint32_t*)(LPC_SCU_BASE);\r
56   scu_base[(PORT_OFFSET*port+PIN_OFFSET*pin)/4]=mode+func;\r
57 } /* scu_pinmux */\r
58 \r
59 /**\r
60  * @}\r
61  */\r
62 /* --------------------------------- End Of File ------------------------------ */\r