LMS 2012
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
suart_utils.h
Go to the documentation of this file.
1 /*
2  * linux/<file location within the kernel tree>
3  *
4  * Copyright (C) 2010 Texas Instruments Incorporated
5  * Author: Ganeshan N
6  *
7  * Based on <Give reference of old kernel file from which this file is derived from>
8  *
9  * This program is free software; you can redistribute it and/or modify it
10  * under the terms of the GNU General Public License as published by the
11  * Free Software Foundation version 2.
12  *
13  * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
14  * whether express or implied; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * General Public License for more details.
17  */
18 
19 #ifndef _SUART_UTILS_H_
20 #define _SUART_UTILS_H_
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 /*
27  *====================
28  * Includes
29  *====================
30  */
31 #include "tistdtypes.h"
32 
33 /* ************ Serializers ***************** */
34 #define PRU_SUART_SERIALIZER_0 (0u)
35 
36 #define PRU_SUART_SERIALIZER_1 (1u)
37 
38 #define PRU_SUART_SERIALIZER_2 (2u)
39 
40 #define PRU_SUART_SERIALIZER_3 (3u)
41 
42 #define PRU_SUART_SERIALIZER_4 (4u)
43 
44 #define PRU_SUART_SERIALIZER_5 (5u)
45 
46 #define PRU_SUART_SERIALIZER_6 (6u)
47 
48 #define PRU_SUART_SERIALIZER_7 (7u)
49 
50 #define PRU_SUART_SERIALIZER_8 (8u)
51 
52 #define PRU_SUART_SERIALIZER_9 (9u)
53 
54 #define PRU_SUART_SERIALIZER_10 (10u)
55 
56 #define PRU_SUART_SERIALIZER_11 (11u)
57 
58 #define PRU_SUART_SERIALIZER_12 (12u)
59 
60 #define PRU_SUART_SERIALIZER_13 (13u)
61 
62 #define PRU_SUART_SERIALIZER_14 (14u)
63 
64 #define PRU_SUART_SERIALIZER_15 (15u)
65 
66 #define PRU_SUART_SERIALIZER_NONE (16u)
67 
68 /* Total number of baud rates supported */
69 #define SUART_NUM_OF_BAUDS_SUPPORTED 13
70 
71 #define MCASP_PDIR_VAL ( \
72  CSL_MCASP_PDIR_AFSR_OUTPUT<<CSL_MCASP_PDIR_AFSR_SHIFT | \
73  CSL_MCASP_PDIR_AHCLKR_OUTPUT<<CSL_MCASP_PDIR_AHCLKR_SHIFT | \
74  CSL_MCASP_PDIR_ACLKR_OUTPUT<<CSL_MCASP_PDIR_ACLKR_SHIFT | \
75  CSL_MCASP_PDIR_AFSX_OUTPUT<<CSL_MCASP_PDIR_AFSX_SHIFT | \
76  CSL_MCASP_PDIR_AHCLKX_OUTPUT<<CSL_MCASP_PDIR_AHCLKX_SHIFT | \
77  CSL_MCASP_PDIR_ACLKX_OUTPUT<<CSL_MCASP_PDIR_ACLKX_SHIFT)
78 
79  extern void suart_mcasp_reset (arm_pru_iomap * pru_arm_iomap);
80  extern void suart_mcasp_config(unsigned int mcasp_addr,
81  unsigned int txBaudValue,
82  unsigned int rxBaudValue,
83  unsigned int oversampling,
84  arm_pru_iomap * pru_arm_iomap);
85 
86  extern short suart_asp_baud_set(unsigned int txBaudValue,
87  unsigned int rxBaudValue,
88  unsigned int oversampling,
89  arm_pru_iomap * pru_arm_iomap);
90 
91  extern void suart_mcasp_psc_disable(unsigned int psc1_addr);
92  extern void suart_mcasp_psc_enable(unsigned int psc1_addr);
93  extern short suart_asp_serializer_deactivate (unsigned short u16srNum,
94  arm_pru_iomap * pru_arm_iomap);
95 
96  extern void suart_mcasp_tx_serialzier_set(unsigned int serializerNum,
97  arm_pru_iomap * pru_arm_iomap);
98 #ifdef __cplusplus
99 } /* End of extern C */
100 #endif /* #ifdef __cplusplus */
101 #endif
short suart_asp_baud_set(unsigned int txBaudValue, unsigned int rxBaudValue, unsigned int oversampling, arm_pru_iomap *pru_arm_iomap)
Definition: suart_utils.c:374
void suart_mcasp_psc_disable(unsigned int psc1_addr)
Definition: suart_utils.c:455
void suart_mcasp_tx_serialzier_set(unsigned int serializerNum, arm_pru_iomap *pru_arm_iomap)
Definition: suart_utils.c:252
void suart_mcasp_config(unsigned int mcasp_addr, unsigned int txBaudValue, unsigned int rxBaudValue, unsigned int oversampling, arm_pru_iomap *pru_arm_iomap)
Definition: suart_utils.c:154
void suart_mcasp_psc_enable(unsigned int psc1_addr)
Definition: suart_utils.c:426
short suart_asp_serializer_deactivate(unsigned short u16srNum, arm_pru_iomap *pru_arm_iomap)
Definition: suart_utils.c:392
void suart_mcasp_reset(arm_pru_iomap *pru_arm_iomap)
Definition: suart_utils.c:140