]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_A9_RZ_R7S72100_IAR_DS-5/Source/RenesasFiles/drivers/scif_uart/scif_uart_driver/scif_uart.c
Add missing +TCP code.
[freertos] / FreeRTOS / Demo / CORTEX_A9_RZ_R7S72100_IAR_DS-5 / Source / RenesasFiles / drivers / scif_uart / scif_uart_driver / scif_uart.c
1 /*******************************************************************************\r
2 * DISCLAIMER\r
3 * This software is supplied by Renesas Electronics Corporation and is only\r
4 * intended for use with Renesas products. No other uses are authorized. This\r
5 * software is owned by Renesas Electronics Corporation and is protected under\r
6 * all applicable laws, including copyright laws.\r
7 * THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING\r
8 * THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT\r
9 * LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE\r
10 * AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.\r
11 * TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS\r
12 * ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE\r
13 * FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR\r
14 * ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE\r
15 * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\r
16 * Renesas reserves the right, without notice, to make changes to this software\r
17 * and to discontinue the availability of this software. By using this software,\r
18 * you agree to the additional terms and conditions found by accessing the\r
19 * following link:\r
20 * http://www.renesas.com/disclaimer\r
21 *\r
22 * Copyright (C) 2012 Renesas Electronics Corporation. All rights reserved.\r
23 *******************************************************************************/\r
24 /*******************************************************************************\r
25 * File Name   : scif_uart_initialize.c\r
26 * $Rev: $\r
27 * $Date::                           $\r
28 * Description : Aragon Sample Program - SCIF UART device driver (Initialize process)\r
29 *******************************************************************************/\r
30 \r
31 /******************************************************************************\r
32 Includes   <System Includes> , "Project Includes"\r
33 ******************************************************************************/\r
34 #include "r_typedefs.h"\r
35 #include "dev_drv.h"                /* Device Driver common header */\r
36 #include "devdrv_scif_uart.h"       /* UART Driver header */\r
37 #include "iodefine.h"\r
38 \r
39 /******************************************************************************\r
40 Typedef definitions\r
41 ******************************************************************************/\r
42 \r
43 /******************************************************************************\r
44 Macro definitions\r
45 ******************************************************************************/\r
46 #define SCIF_UART_CH_TOTAL      (8)\r
47 \r
48 /******************************************************************************\r
49 Imported global variables and functions (from other files)\r
50 ******************************************************************************/\r
51 \r
52 /******************************************************************************\r
53 Exported global variables and functions (to be accessed by other files)\r
54 ******************************************************************************/\r
55 \r
56 /******************************************************************************\r
57 Private global variables and functions\r
58 ******************************************************************************/\r
59 \r
60 /******************************************************************************\r
61 * Function Name: R_SCIF_UART_Init\r
62 * Description  :\r
63 * Arguments    : uint32_t channel\r
64 *              : uint32_t mode\r
65 *              :                  :   SCIF_UART_MODE_W\r
66 *              :                  :   SCIF_UART_MODE_R\r
67 *              :                  :   SCIF_UART_MODE_RW\r
68 *              : uint16_t cks\r
69 *              : uint8_t scbrr\r
70 * Return Value : DEVDRV_SUCCESS   : Success\r
71 *              : DEVDRV_ERROR     : Error\r
72 ******************************************************************************/\r
73 int32_t R_SCIF_UART_Init(uint32_t channel, uint32_t mode, uint16_t cks, uint8_t scbrr)\r
74 {\r
75     if ((channel >= SCIF_UART_CH_TOTAL) || (mode < SCIF_UART_MODE_W) || (mode > SCIF_UART_MODE_RW) || (cks > 3))\r
76     {\r
77         return DEVDRV_ERROR;\r
78     }\r
79 \r
80     switch (channel)\r
81     {\r
82         case DEVDRV_CH_2:\r
83             Userdef_SCIF2_UART_Init(mode, cks, scbrr);\r
84         break;\r
85         default:\r
86             /* Do Nothing */\r
87         break;\r
88     }\r
89 \r
90     return DEVDRV_SUCCESS;\r
91 }\r
92 \r
93 /* End of File */\r
94 \r