RZ/A1H CMSIS-RTOS RTX BSP for GR-PEACH.

Dependents:   R_BSP_SSIF_HelloWorld GR-PEACH_Azure_Speech ImageZoomInout_Sample ImageRotaion_Sample ... more

Fork of R_BSP by Daiki Kato

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers scux_board.c Source File

scux_board.c

Go to the documentation of this file.
00001 /*******************************************************************************
00002 * DISCLAIMER
00003 * This software is supplied by Renesas Electronics Corporation and is only
00004 * intended for use with Renesas products. No other uses are authorized. This
00005 * software is owned by Renesas Electronics Corporation and is protected under
00006 * all applicable laws, including copyright laws.
00007 * THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
00008 * THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT
00009 * LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
00010 * AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
00011 * TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS
00012 * ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE
00013 * FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR
00014 * ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE
00015 * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
00016 * Renesas reserves the right, without notice, to make changes to this software
00017 * and to discontinue the availability of this software. By using this software,
00018 * you agree to the additional terms and conditions found by accessing the
00019 * following link:
00020 * http://www.renesas.com/disclaimer
00021 * Copyright (C) 2013-2014 Renesas Electronics Corporation. All rights reserved.
00022 *******************************************************************************/
00023 
00024 /**************************************************************************//**
00025 * @file         scux_board.c
00026 * $Rev: 891 $
00027 * $Date:: 2014-06-27 10:40:52 +0900#$
00028 * @brief        SCUX functions depending on borad 
00029 ******************************************************************************/
00030 
00031 /*******************************************************************************
00032 Includes <System Includes>, "Project Includes"
00033 *******************************************************************************/
00034 
00035 #include "scux.h"
00036 
00037 /******************************************************************************
00038 Exported global variables (to be accessed by other files)
00039 ******************************************************************************/
00040 
00041 /**************************************************************************//**
00042 * Function Name: SCUX_CheckSsifClockDiv
00043 * @brief         Check SSIF clock divide rate.
00044 *
00045 *                Description:<br>
00046 *                
00047 * @param[in]     *p_scux_info_ch : SCUX channel information.
00048 * @param[in]     ssif_ch : Used ssif channel number.
00049 * @retval        ESUCCESS : Parameter is no problems.
00050 *                EPERM : Parameter is unexpected value.
00051 *                EFAULT : Internal error is occured.
00052 ******************************************************************************/
00053 
00054 int_t SCUX_CheckSsifClockDiv(const scux_info_ch_t * const p_scux_info_ch, const uint32_t ssif_ch_num)
00055 {
00056     int_t retval = ESUCCESS;
00057     uint32_t input_clk;
00058     uint32_t dot_clk;
00059     uint32_t n_syswd_per_smp;
00060     uint32_t syswd_len =0;
00061     uint32_t smp_freq;
00062     uint32_t result;
00063     uint32_t division;
00064     scux_ssif_info_t * p_ssif_ch;
00065     
00066     p_ssif_ch = SCUX_GetSsifChInfo((int_t)ssif_ch_num);
00067 
00068     if ((NULL == p_scux_info_ch) || (NULL == p_ssif_ch))
00069     {
00070         retval = EFAULT;
00071     }
00072     else
00073     {
00074         if (false == p_ssif_ch->ssif_cfg.mode_master)
00075         {
00076             /* In slave mode, a temporary value is to SCUX_SSIF_CKDIV_1 (0) */
00077             p_ssif_ch->clk_div = SCUX_SSIF_CKDIV_1;         
00078         }
00079         else
00080         {
00081             /* check only SSIF master mode */
00082             /* get source clock */
00083             if (false == p_ssif_ch->ssif_cfg.select_audio_clk)
00084             {
00085                 input_clk = SCUX_AUDIO_X1;
00086             }
00087             else
00088             {
00089                 input_clk = SCUX_AUDIO_CLK;
00090             }
00091             
00092             if (0u == input_clk)
00093             {
00094                 retval = EPERM;
00095             }
00096         
00097             if (ESUCCESS == retval)
00098             {
00099                 switch (p_ssif_ch->ssif_cfg.system_word)
00100                 {
00101                     case SCUX_SSIF_SYSTEM_LEN_16 :
00102                         syswd_len = SCUX_SYSTEMWORD_16;
00103                     break;
00104                     
00105                     case SCUX_SSIF_SYSTEM_LEN_24 :
00106                         syswd_len = SCUX_SYSTEMWORD_24;
00107                     break;
00108         
00109                     case SCUX_SSIF_SYSTEM_LEN_32 :
00110                         syswd_len = SCUX_SYSTEMWORD_32;
00111                     break;
00112         
00113                     case SCUX_SSIF_SYSTEM_LEN_48 :
00114                         syswd_len = SCUX_SYSTEMWORD_48;
00115                     break;
00116                             
00117                     case SCUX_SSIF_SYSTEM_LEN_64 :
00118                         syswd_len = SCUX_SYSTEMWORD_64;
00119                     break;
00120         
00121                     case SCUX_SSIF_SYSTEM_LEN_128 :
00122                         syswd_len = SCUX_SYSTEMWORD_128;
00123                     break;
00124         
00125                     case SCUX_SSIF_SYSTEM_LEN_256 :
00126                         syswd_len = SCUX_SYSTEMWORD_256;
00127                     break;
00128                             
00129                     default :
00130                         retval = EPERM;
00131                     break;
00132                 }
00133         
00134                 smp_freq = p_scux_info_ch->src_cfg.output_ws;
00135             
00136                 if (false == p_ssif_ch->ssif_cfg.use_tdm)
00137                 {
00138                     n_syswd_per_smp = SCUX_USE_CH_2;
00139                 }
00140                 else
00141                 {
00142                     n_syswd_per_smp = p_scux_info_ch->src_cfg.use_ch;
00143                 }
00144         
00145                 dot_clk = syswd_len * n_syswd_per_smp * smp_freq;
00146                 if (0u == dot_clk)
00147                 {
00148                     retval = EPERM;
00149                 }
00150                 else
00151                 {
00152                     /* check if input audio clock can be divided by dotclock */
00153                     result = input_clk % dot_clk;
00154         
00155                     if (0U != result)
00156                     {
00157                         /* cannot create dotclock from input audio clock */
00158                         retval = EPERM;
00159                     }
00160                     else
00161                     {
00162                         division = input_clk / dot_clk;
00163         
00164                         switch (division)
00165                         {
00166                             case SCUX_SSIF_CLK_DIV1:
00167                                 p_ssif_ch->clk_div = SCUX_SSIF_CKDIV_1;
00168                             break;
00169                             
00170                             case SCUX_SSIF_CLK_DIV2:
00171                                 p_ssif_ch->clk_div = SCUX_SSIF_CKDIV_2;
00172                             break;
00173                             
00174                             case SCUX_SSIF_CLK_DIV4:
00175                                 p_ssif_ch->clk_div = SCUX_SSIF_CKDIV_4;
00176                             break;
00177                             
00178                             case SCUX_SSIF_CLK_DIV8:
00179                                 p_ssif_ch->clk_div = SCUX_SSIF_CKDIV_8;
00180                             break;
00181                             
00182                             case SCUX_SSIF_CLK_DIV16:
00183                                 p_ssif_ch->clk_div = SCUX_SSIF_CKDIV_16;
00184                             break;
00185                             
00186                             case SCUX_SSIF_CLK_DIV32:
00187                                 p_ssif_ch->clk_div = SCUX_SSIF_CKDIV_32;
00188                             break;
00189                             
00190                             case SCUX_SSIF_CLK_DIV64:
00191                                 p_ssif_ch->clk_div = SCUX_SSIF_CKDIV_64;
00192                             break;
00193                             
00194                             case SCUX_SSIF_CLK_DIV128:
00195                                 p_ssif_ch->clk_div = SCUX_SSIF_CKDIV_128;
00196                             break;
00197                             
00198                             case SCUX_SSIF_CLK_DIV6:
00199                                 p_ssif_ch->clk_div = SCUX_SSIF_CKDIV_6;
00200                             break;
00201                             
00202                             case SCUX_SSIF_CLK_DIV12:
00203                                 p_ssif_ch->clk_div = SCUX_SSIF_CKDIV_12;
00204                             break;
00205                             
00206                             case SCUX_SSIF_CLK_DIV24:
00207                                 p_ssif_ch->clk_div = SCUX_SSIF_CKDIV_24;
00208                             break;
00209                             
00210                             case SCUX_SSIF_CLK_DIV48:
00211                                 p_ssif_ch->clk_div = SCUX_SSIF_CKDIV_48;
00212                             break;
00213                             
00214                             case SCUX_SSIF_CLK_DIV96:
00215                                 p_ssif_ch->clk_div = SCUX_SSIF_CKDIV_96;
00216                             break;
00217                             
00218                             default:
00219                                 retval = EPERM;
00220                             break;
00221                         }
00222                     }
00223                 }
00224             }
00225         }
00226     }
00227     
00228     return retval;
00229 }
00230 
00231 /******************************************************************************
00232 End of function SCUX_CheckSsifClockDiv
00233 ******************************************************************************/
00234 
00235 /**************************************************************************//**
00236 * Function Name: SCUX_SetupSsifGpio
00237 * @brief         GPIO of SSIF module setup.
00238 
00239 *                Description:<br>
00240 *                R7S72100 Boards depended pin connections bellow<br>
00241 *                Clock settings<br>
00242 *                  AUDIO_X1 : Private use pin(nothing to do)<br>
00243 *                  AUDIO_X2 : No connection<br>
00244 *                  AUDIO_CLK: Working with SSIF5<br>
00245 *                Channel settings<br>
00246 *                  SSIF0    : Fully connected to WM8978<br>
00247 *                  SSIF1    : Read only (NC:SSITxD1) connected to CD Deck<br>
00248 *                  SSIF2    : No connection<br>
00249 *                  SSIF3    : Write only (NC:SSIRxD3) connected to AK4353<br>
00250 *                  SSIF4    : Fully connected to AK4353<br>
00251 *                  SSIF5    : Fully connected to HCI
00252 *                
00253 * @param[in]     ssif_ch :SSIF channel number.
00254 * @retval        None.
00255 ******************************************************************************/
00256 
00257 void SCUX_SetupSsifGpio(const scux_ssif_ch_num_t ssif_ch)
00258 {
00259     switch (ssif_ch)
00260     {
00261         case SCUX_SSIF_CH_0:
00262             /* SSISCK0(P4_4, Alternative Mode 5,InputOutput) */
00263             GPIO.PIBC4  &= (uint16_t)~(GPIO_BIT_N4);
00264             GPIO.PBDC4  &= (uint16_t)~(GPIO_BIT_N4);
00265             GPIO.PM4    |= (uint16_t) (GPIO_BIT_N4);
00266             GPIO.PMC4   &= (uint16_t)~(GPIO_BIT_N4);
00267             GPIO.PIPC4  &= (uint16_t)~(GPIO_BIT_N4);
00268 
00269             GPIO.PBDC4  |= (uint16_t) (GPIO_BIT_N4);
00270             GPIO.PFC4   &= (uint16_t)~(GPIO_BIT_N4);
00271             GPIO.PFCE4  &= (uint16_t)~(GPIO_BIT_N4);
00272             GPIO.PFCAE4 |= (uint16_t) (GPIO_BIT_N4);
00273 
00274             GPIO.PIPC4  |= (uint16_t) (GPIO_BIT_N4);
00275             GPIO.PMC4   |= (uint16_t) (GPIO_BIT_N4);
00276 
00277             /* SSIWS0(P4_5, Alternative Mode 5,InputOutput) */
00278             GPIO.PIBC4  &= (uint16_t)~(GPIO_BIT_N5);
00279             GPIO.PBDC4  &= (uint16_t)~(GPIO_BIT_N5);
00280             GPIO.PM4    |= (uint16_t) (GPIO_BIT_N5);
00281             GPIO.PMC4   &= (uint16_t)~(GPIO_BIT_N5);
00282             GPIO.PIPC4  &= (uint16_t)~(GPIO_BIT_N5);
00283 
00284             GPIO.PBDC4  |= (uint16_t) (GPIO_BIT_N5);
00285             GPIO.PFC4   &= (uint16_t)~(GPIO_BIT_N5);
00286             GPIO.PFCE4  &= (uint16_t)~(GPIO_BIT_N5);
00287             GPIO.PFCAE4 |= (uint16_t) (GPIO_BIT_N5);
00288 
00289             GPIO.PIPC4  |= (uint16_t) (GPIO_BIT_N5);
00290             GPIO.PMC4   |= (uint16_t) (GPIO_BIT_N5);
00291 
00292             /* SSIRxD0(P4_6, Alternative Mode 5,Input) */
00293             GPIO.PIBC4  &= (uint16_t)~(GPIO_BIT_N6);
00294             GPIO.PBDC4  &= (uint16_t)~(GPIO_BIT_N6);
00295             GPIO.PM4    |= (uint16_t) (GPIO_BIT_N6);
00296             GPIO.PMC4   &= (uint16_t)~(GPIO_BIT_N6);
00297             GPIO.PIPC4  &= (uint16_t)~(GPIO_BIT_N6);
00298 
00299             GPIO.PBDC4  &= (uint16_t)~(GPIO_BIT_N6);
00300             GPIO.PFC4   &= (uint16_t)~(GPIO_BIT_N6);
00301             GPIO.PFCE4  &= (uint16_t)~(GPIO_BIT_N6);
00302             GPIO.PFCAE4 |= (uint16_t) (GPIO_BIT_N6);
00303 
00304             GPIO.PIPC4  |= (uint16_t) (GPIO_BIT_N6);
00305             GPIO.PMC4   |= (uint16_t) (GPIO_BIT_N6);
00306 
00307             /* SSITxD0(P4_7, Alternative Mode 5,Output) */
00308             GPIO.PIBC4  &= (uint16_t)~(GPIO_BIT_N7);
00309             GPIO.PBDC4  &= (uint16_t)~(GPIO_BIT_N7);
00310             GPIO.PM4    |= (uint16_t) (GPIO_BIT_N7);
00311             GPIO.PMC4   &= (uint16_t)~(GPIO_BIT_N7);
00312             GPIO.PIPC4  &= (uint16_t)~(GPIO_BIT_N7);
00313 
00314             GPIO.PBDC4  &= (uint16_t)~(GPIO_BIT_N7);
00315             GPIO.PFC4   &= (uint16_t)~(GPIO_BIT_N7);
00316             GPIO.PFCE4  &= (uint16_t)~(GPIO_BIT_N7);
00317             GPIO.PFCAE4 |= (uint16_t) (GPIO_BIT_N7);
00318 
00319             GPIO.PMC4   |= (uint16_t) (GPIO_BIT_N7);
00320             GPIO.PM4    &= (uint16_t)~(GPIO_BIT_N7);
00321         break;
00322 
00323         case SCUX_SSIF_CH_1:
00324             /* SSISCK1(P3_4, Alternative Mode 3,InputOutput) */
00325             GPIO.PIBC3  &= (uint16_t)~(GPIO_BIT_N4);
00326             GPIO.PBDC3  &= (uint16_t)~(GPIO_BIT_N4);
00327             GPIO.PM3    |= (uint16_t) (GPIO_BIT_N4);
00328             GPIO.PMC3   &= (uint16_t)~(GPIO_BIT_N4);
00329             GPIO.PIPC3  &= (uint16_t)~(GPIO_BIT_N4);
00330 
00331             GPIO.PBDC3  |= (uint16_t) (GPIO_BIT_N4);
00332             GPIO.PFC3   &= (uint16_t)~(GPIO_BIT_N4);
00333             GPIO.PFCE3  |= (uint16_t) (GPIO_BIT_N4);
00334             GPIO.PFCAE3 &= (uint16_t)~(GPIO_BIT_N4);
00335 
00336             GPIO.PIPC3  |= (uint16_t) (GPIO_BIT_N4);
00337             GPIO.PMC3   |= (uint16_t) (GPIO_BIT_N4);
00338 
00339             /* SSIWS1(P3_5, Alternative Mode 3,InputOutput) */
00340             GPIO.PIBC3  &= (uint16_t)~(GPIO_BIT_N5);
00341             GPIO.PBDC3  &= (uint16_t)~(GPIO_BIT_N5);
00342             GPIO.PM3    |= (uint16_t) (GPIO_BIT_N5);
00343             GPIO.PMC3   &= (uint16_t)~(GPIO_BIT_N5);
00344             GPIO.PIPC3  &= (uint16_t)~(GPIO_BIT_N5);
00345 
00346             GPIO.PBDC3  |= (uint16_t) (GPIO_BIT_N5);
00347             GPIO.PFC3   &= (uint16_t)~(GPIO_BIT_N5);
00348             GPIO.PFCE3  |= (uint16_t) (GPIO_BIT_N5);
00349             GPIO.PFCAE3 &= (uint16_t)~(GPIO_BIT_N5);
00350 
00351             GPIO.PIPC3 |=  (uint16_t) (GPIO_BIT_N5);
00352             GPIO.PMC3   |= (uint16_t) (GPIO_BIT_N5);
00353 
00354             /* SSIRxD1(P3_6, Alternative Mode 3,Input) */
00355             GPIO.PIBC3  &= (uint16_t)~(GPIO_BIT_N6);
00356             GPIO.PBDC3  &= (uint16_t)~(GPIO_BIT_N6);
00357             GPIO.PM3    |= (uint16_t) (GPIO_BIT_N6);
00358             GPIO.PMC3   &= (uint16_t)~(GPIO_BIT_N6);
00359             GPIO.PIPC3  &= (uint16_t)~(GPIO_BIT_N6);
00360 
00361             GPIO.PBDC3  &= (uint16_t)~(GPIO_BIT_N6);
00362             GPIO.PFC3   &= (uint16_t)~(GPIO_BIT_N6);
00363             GPIO.PFCE3  |= (uint16_t) (GPIO_BIT_N6);
00364             GPIO.PFCAE3 &= (uint16_t)~(GPIO_BIT_N6);
00365 
00366             GPIO.PIPC3  |= (uint16_t) (GPIO_BIT_N6);
00367             GPIO.PMC3   |= (uint16_t) (GPIO_BIT_N6);
00368 
00369             /* SSITxD1:  no connection */
00370         break;
00371 
00372         case SCUX_SSIF_CH_2:
00373             /* SSISCK2:  no connection */
00374             /* SSIWS2:   no connection */
00375             /* SSIDATA2: no connection */
00376             break;
00377 
00378         case SCUX_SSIF_CH_3:
00379             /* SSISCK3(P4_12, Alternative Mode 6,InputOutput) */
00380             GPIO.PIBC4  &= (uint16_t)~(GPIO_BIT_N12);
00381             GPIO.PBDC4  &= (uint16_t)~(GPIO_BIT_N12);
00382             GPIO.PM4    |= (uint16_t) (GPIO_BIT_N12);
00383             GPIO.PMC4   &= (uint16_t)~(GPIO_BIT_N12);
00384             GPIO.PIPC4  &= (uint16_t)~(GPIO_BIT_N12);
00385 
00386             GPIO.PBDC4  |= (uint16_t) (GPIO_BIT_N12);
00387             GPIO.PFC4   |= (uint16_t) (GPIO_BIT_N12);
00388             GPIO.PFCE4  &= (uint16_t)~(GPIO_BIT_N12);
00389             GPIO.PFCAE4 |= (uint16_t) (GPIO_BIT_N12);
00390 
00391             GPIO.PIPC4  |= (uint16_t) GPIO_BIT_N12;
00392             GPIO.PMC4   |= (uint16_t) (GPIO_BIT_N12);
00393 
00394             /* SSIWS3(P4_13, Alternative Mode 6,InputOutput) */
00395             GPIO.PIBC4  &= (uint16_t)~(GPIO_BIT_N13);
00396             GPIO.PBDC4  &= (uint16_t)~(GPIO_BIT_N13);
00397             GPIO.PM4    |= (uint16_t) (GPIO_BIT_N13);
00398             GPIO.PMC4   &= (uint16_t)~(GPIO_BIT_N13);
00399             GPIO.PIPC4  &= (uint16_t)~(GPIO_BIT_N13);
00400 
00401             GPIO.PBDC4  |= (uint16_t) (GPIO_BIT_N13);
00402             GPIO.PFC4   |= (uint16_t) (GPIO_BIT_N13);
00403             GPIO.PFCE4  &= (uint16_t)~(GPIO_BIT_N13);
00404             GPIO.PFCAE4 |= (uint16_t) (GPIO_BIT_N13);
00405 
00406             GPIO.PIPC4  |= (uint16_t) (GPIO_BIT_N13);
00407             GPIO.PMC4   |= (uint16_t) (GPIO_BIT_N13);
00408 
00409             /* SSIRxD3:  no connection */
00410 
00411             /* SSITxD3(P4_15, Alternative Mode 6,Output) */
00412             GPIO.PIBC4  &= (uint16_t)~(GPIO_BIT_N15);
00413             GPIO.PBDC4  &= (uint16_t)~(GPIO_BIT_N15);
00414             GPIO.PM4    |= (uint16_t) (GPIO_BIT_N15);
00415             GPIO.PMC4   &= (uint16_t)~(GPIO_BIT_N15);
00416             GPIO.PIPC4  &= (uint16_t)~(GPIO_BIT_N15);
00417 
00418             GPIO.PBDC4  &= (uint16_t)~(GPIO_BIT_N15);
00419             GPIO.PFC4   |= (uint16_t) (GPIO_BIT_N15);
00420             GPIO.PFCE4  &= (uint16_t)~(GPIO_BIT_N15);
00421             GPIO.PFCAE4 |= (uint16_t) (GPIO_BIT_N15);
00422 
00423             GPIO.PMC4   |= (uint16_t) (GPIO_BIT_N15);
00424             GPIO.PM4    &= (uint16_t)~(GPIO_BIT_N15);
00425         break;
00426 
00427         case SCUX_SSIF_CH_4:
00428             /* SSISCK4(P11_4, Alternative Mode 3,InputOutput) */
00429             GPIO.PIBC11  &= (uint16_t)~(GPIO_BIT_N4);
00430             GPIO.PBDC11  &= (uint16_t)~(GPIO_BIT_N4);
00431             GPIO.PM11    |= (uint16_t) (GPIO_BIT_N4);
00432             GPIO.PMC11   &= (uint16_t)~(GPIO_BIT_N4);
00433             GPIO.PIPC11  &= (uint16_t)~(GPIO_BIT_N4);
00434 
00435             GPIO.PBDC11  |= (uint16_t) (GPIO_BIT_N4);
00436             GPIO.PFC11   &= (uint16_t)~(GPIO_BIT_N4);
00437             GPIO.PFCE11  |= (uint16_t) (GPIO_BIT_N4);
00438             GPIO.PFCAE11 &= (uint16_t)~(GPIO_BIT_N4);
00439 
00440             GPIO.PIPC11  |= (uint16_t) (GPIO_BIT_N4);
00441             GPIO.PMC11   |= (uint16_t) (GPIO_BIT_N4);
00442 
00443             /* SSIWS4(P11_5, Alternative Mode 3,InputOutput) */
00444             GPIO.PIBC11  &= (uint16_t)~(GPIO_BIT_N5);
00445             GPIO.PBDC11  &= (uint16_t)~(GPIO_BIT_N5);
00446             GPIO.PM11    |= (uint16_t) (GPIO_BIT_N5);
00447             GPIO.PMC11   &= (uint16_t)~(GPIO_BIT_N5);
00448             GPIO.PIPC11  &= (uint16_t)~(GPIO_BIT_N5);
00449 
00450             GPIO.PBDC11  |= (uint16_t) (GPIO_BIT_N5);
00451             GPIO.PFC11   &= (uint16_t)~(GPIO_BIT_N5);
00452             GPIO.PFCE11  |= (uint16_t) (GPIO_BIT_N5);
00453             GPIO.PFCAE11 &= (uint16_t)~(GPIO_BIT_N5);
00454 
00455             GPIO.PIPC11  |= (uint16_t) GPIO_BIT_N5;
00456             GPIO.PMC11   |= (uint16_t) (GPIO_BIT_N5);
00457 
00458             /* SSIDATA4(P11_6, Alternative Mode 3,InputOutput) */
00459             GPIO.PIBC11  &= (uint16_t)~(GPIO_BIT_N6);
00460             GPIO.PBDC11  &= (uint16_t)~(GPIO_BIT_N6);
00461             GPIO.PM11    |= (uint16_t) (GPIO_BIT_N6);
00462             GPIO.PMC11   &= (uint16_t)~(GPIO_BIT_N6);
00463             GPIO.PIPC11  &= (uint16_t)~(GPIO_BIT_N6);
00464 
00465             GPIO.PBDC11  |= (uint16_t) (GPIO_BIT_N6);
00466             GPIO.PFC11   &= (uint16_t)~(GPIO_BIT_N6);
00467             GPIO.PFCE11  |= (uint16_t) (GPIO_BIT_N6);
00468             GPIO.PFCAE11 &= (uint16_t)~(GPIO_BIT_N6);
00469 
00470             GPIO.PIPC11  |= (uint16_t) (GPIO_BIT_N6);
00471             GPIO.PMC11   |= (uint16_t) (GPIO_BIT_N6);
00472         break;
00473 
00474         case SCUX_SSIF_CH_5:
00475             /* SSISCK5(P2_4, Alternative Mode 4,InputOutput) */
00476             GPIO.PIBC2  &= (uint16_t)~(GPIO_BIT_N4);
00477             GPIO.PBDC2  &= (uint16_t)~(GPIO_BIT_N4);
00478             GPIO.PM2    |= (uint16_t) (GPIO_BIT_N4);
00479             GPIO.PMC2   &= (uint16_t)~(GPIO_BIT_N4);
00480             GPIO.PIPC2  &= (uint16_t)~(GPIO_BIT_N4);
00481 
00482             GPIO.PBDC2  |= (uint16_t) (GPIO_BIT_N4);
00483             GPIO.PFC2   |= (uint16_t) (GPIO_BIT_N4);
00484             GPIO.PFCE2  |= (uint16_t) (GPIO_BIT_N4);
00485             GPIO.PFCAE2 &= (uint16_t)~(GPIO_BIT_N4);
00486 
00487             GPIO.PIPC2  |= (uint16_t) (GPIO_BIT_N4);
00488             GPIO.PMC2   |= (uint16_t) (GPIO_BIT_N4);
00489 
00490             /* SSIWS5(P2_5, Alternative Mode 4,InputOutput) */
00491             GPIO.PIBC2  &= (uint16_t)~(GPIO_BIT_N5);
00492             GPIO.PBDC2  &= (uint16_t)~(GPIO_BIT_N5);
00493             GPIO.PM2    |= (uint16_t) (GPIO_BIT_N5);
00494             GPIO.PMC2   &= (uint16_t)~(GPIO_BIT_N5);
00495             GPIO.PIPC2  &= (uint16_t)~(GPIO_BIT_N5);
00496 
00497             GPIO.PBDC2  |= (uint16_t) (GPIO_BIT_N5);
00498             GPIO.PFC2   |= (uint16_t) (GPIO_BIT_N5);
00499             GPIO.PFCE2  |= (uint16_t) (GPIO_BIT_N5);
00500             GPIO.PFCAE2 &= (uint16_t)~(GPIO_BIT_N5);
00501 
00502             GPIO.PIPC2  |= (uint16_t) (GPIO_BIT_N5);
00503             GPIO.PMC2   |= (uint16_t) (GPIO_BIT_N5);
00504 
00505             /* SSIRxD5(P2_6, Alternative Mode 4,Input) */
00506             GPIO.PIBC2  &= (uint16_t)~(GPIO_BIT_N6);
00507             GPIO.PBDC2  &= (uint16_t)~(GPIO_BIT_N6);
00508             GPIO.PM2    |= (uint16_t) (GPIO_BIT_N6);
00509             GPIO.PMC2   &= (uint16_t)~(GPIO_BIT_N6);
00510             GPIO.PIPC2  &= (uint16_t)~(GPIO_BIT_N6);
00511 
00512             GPIO.PBDC2  &= (uint16_t)~(GPIO_BIT_N6);
00513             GPIO.PFC2   |= (uint16_t) (GPIO_BIT_N6);
00514             GPIO.PFCE2  |= (uint16_t) (GPIO_BIT_N6);
00515             GPIO.PFCAE2 &= (uint16_t)~(GPIO_BIT_N6);
00516 
00517             GPIO.PIPC2  |= (uint16_t) (GPIO_BIT_N6);
00518             GPIO.PMC2   |= (uint16_t) (GPIO_BIT_N6);
00519 
00520             /* SSITxD5(P2_7, Alternative Mode 4,Output) */
00521             GPIO.PIBC2  &= (uint16_t)~(GPIO_BIT_N7);
00522             GPIO.PBDC2  &= (uint16_t)~(GPIO_BIT_N7);
00523             GPIO.PM2    |= (uint16_t) (GPIO_BIT_N7);
00524             GPIO.PMC2   &= (uint16_t)~(GPIO_BIT_N7);
00525             GPIO.PIPC2  &= (uint16_t)~(GPIO_BIT_N7);
00526 
00527             GPIO.PBDC2  &= (uint16_t)~(GPIO_BIT_N7);
00528             GPIO.PFC2   |= (uint16_t) (GPIO_BIT_N7);
00529             GPIO.PFCE2  |= (uint16_t) (GPIO_BIT_N7);
00530             GPIO.PFCAE2 &= (uint16_t)~(GPIO_BIT_N7);
00531 
00532             GPIO.PMC2   |= (uint16_t) (GPIO_BIT_N7);
00533             GPIO.PM2    &= (uint16_t)~(GPIO_BIT_N7);
00534 
00535             /* AUDIO_CLK(P3_1, Alternative Mode 6,Input) */
00536             GPIO.PIBC3  &= (uint16_t)~(GPIO_BIT_N1);
00537             GPIO.PBDC3  &= (uint16_t)~(GPIO_BIT_N1);
00538             GPIO.PM3    |= (uint16_t) (GPIO_BIT_N1);
00539             GPIO.PMC3   &= (uint16_t)~(GPIO_BIT_N1);
00540             GPIO.PIPC3  &= (uint16_t)~(GPIO_BIT_N1);
00541 
00542             GPIO.PBDC3  &= (uint16_t)~(GPIO_BIT_N1);
00543             GPIO.PFC3   |= (uint16_t) (GPIO_BIT_N1);
00544             GPIO.PFCE3  &= (uint16_t)~(GPIO_BIT_N1);
00545             GPIO.PFCAE3 |= (uint16_t) (GPIO_BIT_N1);
00546 
00547             GPIO.PIPC3  |= (uint16_t) (GPIO_BIT_N1);
00548             GPIO.PMC3   |= (uint16_t) (GPIO_BIT_N1);
00549         break;
00550 
00551         default:
00552             /* ->IPA R3.5.2 Nothing is being processed intentionally. */
00553             /* <-IPA R3.5.2 */
00554             /* NOTREACHED on At the time of a normal performance */
00555         break;
00556     }
00557     
00558     return;
00559 }
00560 
00561 /******************************************************************************
00562 End of function SCUX_SetupSsifGpio
00563 ******************************************************************************/
00564