パラメータを適応変化させる事により圧縮率を向上させた動的ライス・ゴロム符号を利用した可逆圧縮方式。圧縮ソフト、圧縮率のMATLABシミュレーションは詳細はInterface誌2011年8月号に掲載されるRX62Nマイコン連動特集にて掲載予定。

Dependencies:   mbed

Committer:
lynxeyed_atsu
Date:
Wed Mar 30 06:05:24 2011 +0000
Revision:
0:d920d64db582
alpha

Who changed what in which revision?

UserRevisionLine numberNew contents of line
lynxeyed_atsu 0:d920d64db582 1 /***********************************************************************//**
lynxeyed_atsu 0:d920d64db582 2 * @file lpc17xx_pinsel.c
lynxeyed_atsu 0:d920d64db582 3 * @brief Contains all functions support for Pin connect block firmware
lynxeyed_atsu 0:d920d64db582 4 * library on LPC17xx
lynxeyed_atsu 0:d920d64db582 5 * @version 2.0
lynxeyed_atsu 0:d920d64db582 6 * @date 21. May. 2010
lynxeyed_atsu 0:d920d64db582 7 * @author NXP MCU SW Application Team
lynxeyed_atsu 0:d920d64db582 8 **************************************************************************
lynxeyed_atsu 0:d920d64db582 9 * Software that is described herein is for illustrative purposes only
lynxeyed_atsu 0:d920d64db582 10 * which provides customers with programming information regarding the
lynxeyed_atsu 0:d920d64db582 11 * products. This software is supplied "AS IS" without any warranties.
lynxeyed_atsu 0:d920d64db582 12 * NXP Semiconductors assumes no responsibility or liability for the
lynxeyed_atsu 0:d920d64db582 13 * use of the software, conveys no license or title under any patent,
lynxeyed_atsu 0:d920d64db582 14 * copyright, or mask work right to the product. NXP Semiconductors
lynxeyed_atsu 0:d920d64db582 15 * reserves the right to make changes in the software without
lynxeyed_atsu 0:d920d64db582 16 * notification. NXP Semiconductors also make no representation or
lynxeyed_atsu 0:d920d64db582 17 * warranty that such application will be suitable for the specified
lynxeyed_atsu 0:d920d64db582 18 * use without further testing or modification.
lynxeyed_atsu 0:d920d64db582 19 **********************************************************************/
lynxeyed_atsu 0:d920d64db582 20
lynxeyed_atsu 0:d920d64db582 21 /* Peripheral group ----------------------------------------------------------- */
lynxeyed_atsu 0:d920d64db582 22 /** @addtogroup PINSEL
lynxeyed_atsu 0:d920d64db582 23 * @{
lynxeyed_atsu 0:d920d64db582 24 */
lynxeyed_atsu 0:d920d64db582 25
lynxeyed_atsu 0:d920d64db582 26 /* Includes ------------------------------------------------------------------- */
lynxeyed_atsu 0:d920d64db582 27 #include "lpc17xx_pinsel.h"
lynxeyed_atsu 0:d920d64db582 28
lynxeyed_atsu 0:d920d64db582 29 /* Public Functions ----------------------------------------------------------- */
lynxeyed_atsu 0:d920d64db582 30
lynxeyed_atsu 0:d920d64db582 31 static void set_PinFunc ( uint8_t portnum, uint8_t pinnum, uint8_t funcnum);
lynxeyed_atsu 0:d920d64db582 32 static void set_ResistorMode ( uint8_t portnum, uint8_t pinnum, uint8_t modenum);
lynxeyed_atsu 0:d920d64db582 33 static void set_OpenDrainMode( uint8_t portnum, uint8_t pinnum, uint8_t modenum);
lynxeyed_atsu 0:d920d64db582 34
lynxeyed_atsu 0:d920d64db582 35 /*********************************************************************//**
lynxeyed_atsu 0:d920d64db582 36 * @brief Setup the pin selection function
lynxeyed_atsu 0:d920d64db582 37 * @param[in] portnum PORT number,
lynxeyed_atsu 0:d920d64db582 38 * should be one of the following:
lynxeyed_atsu 0:d920d64db582 39 * - PINSEL_PORT_0 : Port 0
lynxeyed_atsu 0:d920d64db582 40 * - PINSEL_PORT_1 : Port 1
lynxeyed_atsu 0:d920d64db582 41 * - PINSEL_PORT_2 : Port 2
lynxeyed_atsu 0:d920d64db582 42 * - PINSEL_PORT_3 : Port 3
lynxeyed_atsu 0:d920d64db582 43 *
lynxeyed_atsu 0:d920d64db582 44 * @param[in] pinnum Pin number,
lynxeyed_atsu 0:d920d64db582 45 * should be one of the following:
lynxeyed_atsu 0:d920d64db582 46 - PINSEL_PIN_0 : Pin 0
lynxeyed_atsu 0:d920d64db582 47 - PINSEL_PIN_1 : Pin 1
lynxeyed_atsu 0:d920d64db582 48 - PINSEL_PIN_2 : Pin 2
lynxeyed_atsu 0:d920d64db582 49 - PINSEL_PIN_3 : Pin 3
lynxeyed_atsu 0:d920d64db582 50 - PINSEL_PIN_4 : Pin 4
lynxeyed_atsu 0:d920d64db582 51 - PINSEL_PIN_5 : Pin 5
lynxeyed_atsu 0:d920d64db582 52 - PINSEL_PIN_6 : Pin 6
lynxeyed_atsu 0:d920d64db582 53 - PINSEL_PIN_7 : Pin 7
lynxeyed_atsu 0:d920d64db582 54 - PINSEL_PIN_8 : Pin 8
lynxeyed_atsu 0:d920d64db582 55 - PINSEL_PIN_9 : Pin 9
lynxeyed_atsu 0:d920d64db582 56 - PINSEL_PIN_10 : Pin 10
lynxeyed_atsu 0:d920d64db582 57 - PINSEL_PIN_11 : Pin 11
lynxeyed_atsu 0:d920d64db582 58 - PINSEL_PIN_12 : Pin 12
lynxeyed_atsu 0:d920d64db582 59 - PINSEL_PIN_13 : Pin 13
lynxeyed_atsu 0:d920d64db582 60 - PINSEL_PIN_14 : Pin 14
lynxeyed_atsu 0:d920d64db582 61 - PINSEL_PIN_15 : Pin 15
lynxeyed_atsu 0:d920d64db582 62 - PINSEL_PIN_16 : Pin 16
lynxeyed_atsu 0:d920d64db582 63 - PINSEL_PIN_17 : Pin 17
lynxeyed_atsu 0:d920d64db582 64 - PINSEL_PIN_18 : Pin 18
lynxeyed_atsu 0:d920d64db582 65 - PINSEL_PIN_19 : Pin 19
lynxeyed_atsu 0:d920d64db582 66 - PINSEL_PIN_20 : Pin 20
lynxeyed_atsu 0:d920d64db582 67 - PINSEL_PIN_21 : Pin 21
lynxeyed_atsu 0:d920d64db582 68 - PINSEL_PIN_22 : Pin 22
lynxeyed_atsu 0:d920d64db582 69 - PINSEL_PIN_23 : Pin 23
lynxeyed_atsu 0:d920d64db582 70 - PINSEL_PIN_24 : Pin 24
lynxeyed_atsu 0:d920d64db582 71 - PINSEL_PIN_25 : Pin 25
lynxeyed_atsu 0:d920d64db582 72 - PINSEL_PIN_26 : Pin 26
lynxeyed_atsu 0:d920d64db582 73 - PINSEL_PIN_27 : Pin 27
lynxeyed_atsu 0:d920d64db582 74 - PINSEL_PIN_28 : Pin 28
lynxeyed_atsu 0:d920d64db582 75 - PINSEL_PIN_29 : Pin 29
lynxeyed_atsu 0:d920d64db582 76 - PINSEL_PIN_30 : Pin 30
lynxeyed_atsu 0:d920d64db582 77 - PINSEL_PIN_31 : Pin 31
lynxeyed_atsu 0:d920d64db582 78
lynxeyed_atsu 0:d920d64db582 79 * @param[in] funcnum Function number,
lynxeyed_atsu 0:d920d64db582 80 * should be one of the following:
lynxeyed_atsu 0:d920d64db582 81 * - PINSEL_FUNC_0 : default function
lynxeyed_atsu 0:d920d64db582 82 * - PINSEL_FUNC_1 : first alternate function
lynxeyed_atsu 0:d920d64db582 83 * - PINSEL_FUNC_2 : second alternate function
lynxeyed_atsu 0:d920d64db582 84 * - PINSEL_FUNC_3 : third alternate function
lynxeyed_atsu 0:d920d64db582 85 *
lynxeyed_atsu 0:d920d64db582 86 * @return None
lynxeyed_atsu 0:d920d64db582 87 **********************************************************************/
lynxeyed_atsu 0:d920d64db582 88 static void set_PinFunc ( uint8_t portnum, uint8_t pinnum, uint8_t funcnum)
lynxeyed_atsu 0:d920d64db582 89 {
lynxeyed_atsu 0:d920d64db582 90 uint32_t pinnum_t = pinnum;
lynxeyed_atsu 0:d920d64db582 91 uint32_t pinselreg_idx = 2 * portnum;
lynxeyed_atsu 0:d920d64db582 92 uint32_t *pPinCon = (uint32_t *)&LPC_PINCON->PINSEL0;
lynxeyed_atsu 0:d920d64db582 93
lynxeyed_atsu 0:d920d64db582 94 if (pinnum_t >= 16) {
lynxeyed_atsu 0:d920d64db582 95 pinnum_t -= 16;
lynxeyed_atsu 0:d920d64db582 96 pinselreg_idx++;
lynxeyed_atsu 0:d920d64db582 97 }
lynxeyed_atsu 0:d920d64db582 98 *(uint32_t *)(pPinCon + pinselreg_idx) &= ~(0x03UL << (pinnum_t * 2));
lynxeyed_atsu 0:d920d64db582 99 *(uint32_t *)(pPinCon + pinselreg_idx) |= ((uint32_t)funcnum) << (pinnum_t * 2);
lynxeyed_atsu 0:d920d64db582 100 }
lynxeyed_atsu 0:d920d64db582 101
lynxeyed_atsu 0:d920d64db582 102 /*********************************************************************//**
lynxeyed_atsu 0:d920d64db582 103 * @brief Setup resistor mode for each pin
lynxeyed_atsu 0:d920d64db582 104 * @param[in] portnum PORT number,
lynxeyed_atsu 0:d920d64db582 105 * should be one of the following:
lynxeyed_atsu 0:d920d64db582 106 * - PINSEL_PORT_0 : Port 0
lynxeyed_atsu 0:d920d64db582 107 * - PINSEL_PORT_1 : Port 1
lynxeyed_atsu 0:d920d64db582 108 * - PINSEL_PORT_2 : Port 2
lynxeyed_atsu 0:d920d64db582 109 * - PINSEL_PORT_3 : Port 3
lynxeyed_atsu 0:d920d64db582 110 * @param[in] pinnum Pin number,
lynxeyed_atsu 0:d920d64db582 111 * should be one of the following:
lynxeyed_atsu 0:d920d64db582 112 - PINSEL_PIN_0 : Pin 0
lynxeyed_atsu 0:d920d64db582 113 - PINSEL_PIN_1 : Pin 1
lynxeyed_atsu 0:d920d64db582 114 - PINSEL_PIN_2 : Pin 2
lynxeyed_atsu 0:d920d64db582 115 - PINSEL_PIN_3 : Pin 3
lynxeyed_atsu 0:d920d64db582 116 - PINSEL_PIN_4 : Pin 4
lynxeyed_atsu 0:d920d64db582 117 - PINSEL_PIN_5 : Pin 5
lynxeyed_atsu 0:d920d64db582 118 - PINSEL_PIN_6 : Pin 6
lynxeyed_atsu 0:d920d64db582 119 - PINSEL_PIN_7 : Pin 7
lynxeyed_atsu 0:d920d64db582 120 - PINSEL_PIN_8 : Pin 8
lynxeyed_atsu 0:d920d64db582 121 - PINSEL_PIN_9 : Pin 9
lynxeyed_atsu 0:d920d64db582 122 - PINSEL_PIN_10 : Pin 10
lynxeyed_atsu 0:d920d64db582 123 - PINSEL_PIN_11 : Pin 11
lynxeyed_atsu 0:d920d64db582 124 - PINSEL_PIN_12 : Pin 12
lynxeyed_atsu 0:d920d64db582 125 - PINSEL_PIN_13 : Pin 13
lynxeyed_atsu 0:d920d64db582 126 - PINSEL_PIN_14 : Pin 14
lynxeyed_atsu 0:d920d64db582 127 - PINSEL_PIN_15 : Pin 15
lynxeyed_atsu 0:d920d64db582 128 - PINSEL_PIN_16 : Pin 16
lynxeyed_atsu 0:d920d64db582 129 - PINSEL_PIN_17 : Pin 17
lynxeyed_atsu 0:d920d64db582 130 - PINSEL_PIN_18 : Pin 18
lynxeyed_atsu 0:d920d64db582 131 - PINSEL_PIN_19 : Pin 19
lynxeyed_atsu 0:d920d64db582 132 - PINSEL_PIN_20 : Pin 20
lynxeyed_atsu 0:d920d64db582 133 - PINSEL_PIN_21 : Pin 21
lynxeyed_atsu 0:d920d64db582 134 - PINSEL_PIN_22 : Pin 22
lynxeyed_atsu 0:d920d64db582 135 - PINSEL_PIN_23 : Pin 23
lynxeyed_atsu 0:d920d64db582 136 - PINSEL_PIN_24 : Pin 24
lynxeyed_atsu 0:d920d64db582 137 - PINSEL_PIN_25 : Pin 25
lynxeyed_atsu 0:d920d64db582 138 - PINSEL_PIN_26 : Pin 26
lynxeyed_atsu 0:d920d64db582 139 - PINSEL_PIN_27 : Pin 27
lynxeyed_atsu 0:d920d64db582 140 - PINSEL_PIN_28 : Pin 28
lynxeyed_atsu 0:d920d64db582 141 - PINSEL_PIN_29 : Pin 29
lynxeyed_atsu 0:d920d64db582 142 - PINSEL_PIN_30 : Pin 30
lynxeyed_atsu 0:d920d64db582 143 - PINSEL_PIN_31 : Pin 31
lynxeyed_atsu 0:d920d64db582 144
lynxeyed_atsu 0:d920d64db582 145 * @param[in] modenum: Mode number,
lynxeyed_atsu 0:d920d64db582 146 * should be one of the following:
lynxeyed_atsu 0:d920d64db582 147 - PINSEL_PINMODE_PULLUP : Internal pull-up resistor
lynxeyed_atsu 0:d920d64db582 148 - PINSEL_PINMODE_TRISTATE : Tri-state
lynxeyed_atsu 0:d920d64db582 149 - PINSEL_PINMODE_PULLDOWN : Internal pull-down resistor
lynxeyed_atsu 0:d920d64db582 150
lynxeyed_atsu 0:d920d64db582 151 * @return None
lynxeyed_atsu 0:d920d64db582 152 **********************************************************************/
lynxeyed_atsu 0:d920d64db582 153 void set_ResistorMode ( uint8_t portnum, uint8_t pinnum, uint8_t modenum)
lynxeyed_atsu 0:d920d64db582 154 {
lynxeyed_atsu 0:d920d64db582 155 uint32_t pinnum_t = pinnum;
lynxeyed_atsu 0:d920d64db582 156 uint32_t pinmodereg_idx = 2 * portnum;
lynxeyed_atsu 0:d920d64db582 157 uint32_t *pPinCon = (uint32_t *)&LPC_PINCON->PINMODE0;
lynxeyed_atsu 0:d920d64db582 158
lynxeyed_atsu 0:d920d64db582 159 if (pinnum_t >= 16) {
lynxeyed_atsu 0:d920d64db582 160 pinnum_t -= 16;
lynxeyed_atsu 0:d920d64db582 161 pinmodereg_idx++ ;
lynxeyed_atsu 0:d920d64db582 162 }
lynxeyed_atsu 0:d920d64db582 163
lynxeyed_atsu 0:d920d64db582 164 *(uint32_t *)(pPinCon + pinmodereg_idx) &= ~(0x03UL << (pinnum_t * 2));
lynxeyed_atsu 0:d920d64db582 165 *(uint32_t *)(pPinCon + pinmodereg_idx) |= ((uint32_t)modenum) << (pinnum_t * 2);
lynxeyed_atsu 0:d920d64db582 166 }
lynxeyed_atsu 0:d920d64db582 167
lynxeyed_atsu 0:d920d64db582 168 /*********************************************************************//**
lynxeyed_atsu 0:d920d64db582 169 * @brief Setup Open drain mode for each pin
lynxeyed_atsu 0:d920d64db582 170 * @param[in] portnum PORT number,
lynxeyed_atsu 0:d920d64db582 171 * should be one of the following:
lynxeyed_atsu 0:d920d64db582 172 * - PINSEL_PORT_0 : Port 0
lynxeyed_atsu 0:d920d64db582 173 * - PINSEL_PORT_1 : Port 1
lynxeyed_atsu 0:d920d64db582 174 * - PINSEL_PORT_2 : Port 2
lynxeyed_atsu 0:d920d64db582 175 * - PINSEL_PORT_3 : Port 3
lynxeyed_atsu 0:d920d64db582 176 *
lynxeyed_atsu 0:d920d64db582 177 * @param[in] pinnum Pin number,
lynxeyed_atsu 0:d920d64db582 178 * should be one of the following:
lynxeyed_atsu 0:d920d64db582 179 - PINSEL_PIN_0 : Pin 0
lynxeyed_atsu 0:d920d64db582 180 - PINSEL_PIN_1 : Pin 1
lynxeyed_atsu 0:d920d64db582 181 - PINSEL_PIN_2 : Pin 2
lynxeyed_atsu 0:d920d64db582 182 - PINSEL_PIN_3 : Pin 3
lynxeyed_atsu 0:d920d64db582 183 - PINSEL_PIN_4 : Pin 4
lynxeyed_atsu 0:d920d64db582 184 - PINSEL_PIN_5 : Pin 5
lynxeyed_atsu 0:d920d64db582 185 - PINSEL_PIN_6 : Pin 6
lynxeyed_atsu 0:d920d64db582 186 - PINSEL_PIN_7 : Pin 7
lynxeyed_atsu 0:d920d64db582 187 - PINSEL_PIN_8 : Pin 8
lynxeyed_atsu 0:d920d64db582 188 - PINSEL_PIN_9 : Pin 9
lynxeyed_atsu 0:d920d64db582 189 - PINSEL_PIN_10 : Pin 10
lynxeyed_atsu 0:d920d64db582 190 - PINSEL_PIN_11 : Pin 11
lynxeyed_atsu 0:d920d64db582 191 - PINSEL_PIN_12 : Pin 12
lynxeyed_atsu 0:d920d64db582 192 - PINSEL_PIN_13 : Pin 13
lynxeyed_atsu 0:d920d64db582 193 - PINSEL_PIN_14 : Pin 14
lynxeyed_atsu 0:d920d64db582 194 - PINSEL_PIN_15 : Pin 15
lynxeyed_atsu 0:d920d64db582 195 - PINSEL_PIN_16 : Pin 16
lynxeyed_atsu 0:d920d64db582 196 - PINSEL_PIN_17 : Pin 17
lynxeyed_atsu 0:d920d64db582 197 - PINSEL_PIN_18 : Pin 18
lynxeyed_atsu 0:d920d64db582 198 - PINSEL_PIN_19 : Pin 19
lynxeyed_atsu 0:d920d64db582 199 - PINSEL_PIN_20 : Pin 20
lynxeyed_atsu 0:d920d64db582 200 - PINSEL_PIN_21 : Pin 21
lynxeyed_atsu 0:d920d64db582 201 - PINSEL_PIN_22 : Pin 22
lynxeyed_atsu 0:d920d64db582 202 - PINSEL_PIN_23 : Pin 23
lynxeyed_atsu 0:d920d64db582 203 - PINSEL_PIN_24 : Pin 24
lynxeyed_atsu 0:d920d64db582 204 - PINSEL_PIN_25 : Pin 25
lynxeyed_atsu 0:d920d64db582 205 - PINSEL_PIN_26 : Pin 26
lynxeyed_atsu 0:d920d64db582 206 - PINSEL_PIN_27 : Pin 27
lynxeyed_atsu 0:d920d64db582 207 - PINSEL_PIN_28 : Pin 28
lynxeyed_atsu 0:d920d64db582 208 - PINSEL_PIN_29 : Pin 29
lynxeyed_atsu 0:d920d64db582 209 - PINSEL_PIN_30 : Pin 30
lynxeyed_atsu 0:d920d64db582 210 - PINSEL_PIN_31 : Pin 31
lynxeyed_atsu 0:d920d64db582 211
lynxeyed_atsu 0:d920d64db582 212 * @param[in] modenum Open drain mode number,
lynxeyed_atsu 0:d920d64db582 213 * should be one of the following:
lynxeyed_atsu 0:d920d64db582 214 * - PINSEL_PINMODE_NORMAL : Pin is in the normal (not open drain) mode
lynxeyed_atsu 0:d920d64db582 215 * - PINSEL_PINMODE_OPENDRAIN : Pin is in the open drain mode
lynxeyed_atsu 0:d920d64db582 216 *
lynxeyed_atsu 0:d920d64db582 217 * @return None
lynxeyed_atsu 0:d920d64db582 218 **********************************************************************/
lynxeyed_atsu 0:d920d64db582 219 void set_OpenDrainMode( uint8_t portnum, uint8_t pinnum, uint8_t modenum)
lynxeyed_atsu 0:d920d64db582 220 {
lynxeyed_atsu 0:d920d64db582 221 uint32_t *pPinCon = (uint32_t *)&LPC_PINCON->PINMODE_OD0;
lynxeyed_atsu 0:d920d64db582 222
lynxeyed_atsu 0:d920d64db582 223 if (modenum == PINSEL_PINMODE_OPENDRAIN){
lynxeyed_atsu 0:d920d64db582 224 *(uint32_t *)(pPinCon + portnum) |= (0x01UL << pinnum);
lynxeyed_atsu 0:d920d64db582 225 } else {
lynxeyed_atsu 0:d920d64db582 226 *(uint32_t *)(pPinCon + portnum) &= ~(0x01UL << pinnum);
lynxeyed_atsu 0:d920d64db582 227 }
lynxeyed_atsu 0:d920d64db582 228 }
lynxeyed_atsu 0:d920d64db582 229
lynxeyed_atsu 0:d920d64db582 230 /* End of Public Functions ---------------------------------------------------- */
lynxeyed_atsu 0:d920d64db582 231
lynxeyed_atsu 0:d920d64db582 232 /* Public Functions ----------------------------------------------------------- */
lynxeyed_atsu 0:d920d64db582 233 /** @addtogroup PINSEL_Public_Functions
lynxeyed_atsu 0:d920d64db582 234 * @{
lynxeyed_atsu 0:d920d64db582 235 */
lynxeyed_atsu 0:d920d64db582 236 /*********************************************************************//**
lynxeyed_atsu 0:d920d64db582 237 * @brief Configure trace function
lynxeyed_atsu 0:d920d64db582 238 * @param[in] NewState State of the Trace function configuration,
lynxeyed_atsu 0:d920d64db582 239 * should be one of the following:
lynxeyed_atsu 0:d920d64db582 240 * - ENABLE : Enable Trace Function
lynxeyed_atsu 0:d920d64db582 241 * - DISABLE : Disable Trace Function
lynxeyed_atsu 0:d920d64db582 242 *
lynxeyed_atsu 0:d920d64db582 243 * @return None
lynxeyed_atsu 0:d920d64db582 244 **********************************************************************/
lynxeyed_atsu 0:d920d64db582 245 void PINSEL_ConfigTraceFunc(FunctionalState NewState)
lynxeyed_atsu 0:d920d64db582 246 {
lynxeyed_atsu 0:d920d64db582 247 if (NewState == ENABLE) {
lynxeyed_atsu 0:d920d64db582 248 LPC_PINCON->PINSEL10 |= (0x01UL << 3);
lynxeyed_atsu 0:d920d64db582 249 } else if (NewState == DISABLE) {
lynxeyed_atsu 0:d920d64db582 250 LPC_PINCON->PINSEL10 &= ~(0x01UL << 3);
lynxeyed_atsu 0:d920d64db582 251 }
lynxeyed_atsu 0:d920d64db582 252 }
lynxeyed_atsu 0:d920d64db582 253
lynxeyed_atsu 0:d920d64db582 254 /*********************************************************************//**
lynxeyed_atsu 0:d920d64db582 255 * @brief Setup I2C0 pins
lynxeyed_atsu 0:d920d64db582 256 * @param[in] i2cPinMode I2C pin mode,
lynxeyed_atsu 0:d920d64db582 257 * should be one of the following:
lynxeyed_atsu 0:d920d64db582 258 * - PINSEL_I2C_Normal_Mode : The standard drive mode
lynxeyed_atsu 0:d920d64db582 259 * - PINSEL_I2C_Fast_Mode : Fast Mode Plus drive mode
lynxeyed_atsu 0:d920d64db582 260 *
lynxeyed_atsu 0:d920d64db582 261 * @param[in] filterSlewRateEnable should be:
lynxeyed_atsu 0:d920d64db582 262 * - ENABLE: Enable filter and slew rate.
lynxeyed_atsu 0:d920d64db582 263 * - DISABLE: Disable filter and slew rate.
lynxeyed_atsu 0:d920d64db582 264 *
lynxeyed_atsu 0:d920d64db582 265 * @return None
lynxeyed_atsu 0:d920d64db582 266 **********************************************************************/
lynxeyed_atsu 0:d920d64db582 267 void PINSEL_SetI2C0Pins(uint8_t i2cPinMode, FunctionalState filterSlewRateEnable)
lynxeyed_atsu 0:d920d64db582 268 {
lynxeyed_atsu 0:d920d64db582 269 uint32_t regVal = 0;
lynxeyed_atsu 0:d920d64db582 270
lynxeyed_atsu 0:d920d64db582 271 if (i2cPinMode == PINSEL_I2C_Fast_Mode){
lynxeyed_atsu 0:d920d64db582 272 regVal = PINSEL_I2CPADCFG_SCLDRV0 | PINSEL_I2CPADCFG_SDADRV0;
lynxeyed_atsu 0:d920d64db582 273 }
lynxeyed_atsu 0:d920d64db582 274
lynxeyed_atsu 0:d920d64db582 275 if (filterSlewRateEnable == DISABLE){
lynxeyed_atsu 0:d920d64db582 276 regVal = PINSEL_I2CPADCFG_SCLI2C0 | PINSEL_I2CPADCFG_SDAI2C0;
lynxeyed_atsu 0:d920d64db582 277 }
lynxeyed_atsu 0:d920d64db582 278 LPC_PINCON->I2CPADCFG = regVal;
lynxeyed_atsu 0:d920d64db582 279 }
lynxeyed_atsu 0:d920d64db582 280
lynxeyed_atsu 0:d920d64db582 281
lynxeyed_atsu 0:d920d64db582 282 /*********************************************************************//**
lynxeyed_atsu 0:d920d64db582 283 * @brief Configure Pin corresponding to specified parameters passed
lynxeyed_atsu 0:d920d64db582 284 * in the PinCfg
lynxeyed_atsu 0:d920d64db582 285 * @param[in] PinCfg Pointer to a PINSEL_CFG_Type structure
lynxeyed_atsu 0:d920d64db582 286 * that contains the configuration information for the
lynxeyed_atsu 0:d920d64db582 287 * specified pin.
lynxeyed_atsu 0:d920d64db582 288 * @return None
lynxeyed_atsu 0:d920d64db582 289 **********************************************************************/
lynxeyed_atsu 0:d920d64db582 290 void PINSEL_ConfigPin(PINSEL_CFG_Type *PinCfg)
lynxeyed_atsu 0:d920d64db582 291 {
lynxeyed_atsu 0:d920d64db582 292 set_PinFunc(PinCfg->Portnum, PinCfg->Pinnum, PinCfg->Funcnum);
lynxeyed_atsu 0:d920d64db582 293 set_ResistorMode(PinCfg->Portnum, PinCfg->Pinnum, PinCfg->Pinmode);
lynxeyed_atsu 0:d920d64db582 294 set_OpenDrainMode(PinCfg->Portnum, PinCfg->Pinnum, PinCfg->OpenDrain);
lynxeyed_atsu 0:d920d64db582 295 }
lynxeyed_atsu 0:d920d64db582 296
lynxeyed_atsu 0:d920d64db582 297
lynxeyed_atsu 0:d920d64db582 298 /**
lynxeyed_atsu 0:d920d64db582 299 * @}
lynxeyed_atsu 0:d920d64db582 300 */
lynxeyed_atsu 0:d920d64db582 301
lynxeyed_atsu 0:d920d64db582 302 /**
lynxeyed_atsu 0:d920d64db582 303 * @}
lynxeyed_atsu 0:d920d64db582 304 */
lynxeyed_atsu 0:d920d64db582 305
lynxeyed_atsu 0:d920d64db582 306 /* --------------------------------- End Of File ------------------------------ */