1 **HEADER
********************************************************************
3 * Copyright (c
) 2013 Freescale Semiconductor
;
6 ***************************************************************************
8 * THIS SOFTWARE IS PROVIDED BY FREESCALE
"AS IS" AND ANY EXPRESSED OR
9 * IMPLIED WARRANTIES
, INCLUDING
, BUT NOT LIMITED TO
, THE IMPLIED WARRANTIES
10 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED
.
11 * IN NO EVENT SHALL FREESCALE OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT
,
12 * INDIRECT
, INCIDENTAL
, SPECIAL
, EXEMPLARY
, OR CONSEQUENTIAL DAMAGES
13 * (INCLUDING
, BUT NOT LIMITED TO
, PROCUREMENT OF SUBSTITUTE GOODS OR
14 * SERVICES
; LOSS OF USE
, DATA
, OR PROFITS
; OR BUSINESS INTERRUPTION
)
15 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY
, WHETHER IN CONTRACT
,
16 * STRICT LIABILITY
, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE
) ARISING
17 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE
, EVEN IF ADVISED OF
18 * THE POSSIBILITY OF SUCH DAMAGE
.
20 **************************************************************************
22 * $FileName
: edma_mk60f
.c$
24 * $Date
: May
-14-2013$
28 * This file contains CPU specific eDMA functions
.
30 *END
************************************************************************/
37 static const uint_32
/*PSP_INTERRUPT_TABLE_INDEX*/ edma_done_vectors
[][16] =
61 static const uint_32
/*PSP_INTERRUPT_TABLE_INDEX*/ edma_error_vectors
[][1] =
70 /*FUNCTION*-------------------------------------------------------------------
72 * Function Name : _bsp_get_edma_done_vectors
73 * Returned Value : Number of vectors associated with the peripheral
75 * This function returns desired interrupt vector table indices for specified module.
77 *END*----------------------------------------------------------------------*/
79 int _bsp_get_edma_done_vectors(uint_32 dev_num
, const uint_32 _PTR_ _PTR_ vectors_ptr
)
81 if (dev_num
< ELEMENTS_OF(edma_done_vectors
)) {
82 *vectors_ptr
= edma_done_vectors
[dev_num
];
83 return ELEMENTS_OF(edma_done_vectors
[0]);
89 /*FUNCTION*-------------------------------------------------------------------
91 * Function Name : _bsp_get_edma_error_vector
92 * Returned Value : Number of vectors associated with the peripheral
94 * This function returns desired interrupt vector table indices for specified module.
96 *END*----------------------------------------------------------------------*/
98 int _bsp_get_edma_error_vectors(uint_32 dev_num
, const uint_32 _PTR_ _PTR_ vectors_ptr
)
100 if (dev_num
< ELEMENTS_OF(edma_error_vectors
)) {
101 *vectors_ptr
= edma_error_vectors
[dev_num
];
102 return ELEMENTS_OF(edma_error_vectors
[0]);
108 /*FUNCTION*-------------------------------------------------------------------
110 * Function Name : _bsp_edma_enable
113 * The function performs necessary operations to enable eDMA module
115 *END*----------------------------------------------------------------------*/
117 int _bsp_edma_enable(uint_32 dev_num
)
119 /* Enable DMAMUX clock */
120 SIM_SCGC6
|= SIM_SCGC6_DMAMUX0_MASK
;
121 SIM_SCGC6
|= SIM_SCGC6_DMAMUX1_MASK
;
123 /* Enable DMA clock */
124 SIM_SCGC7
|= SIM_SCGC7_DMA_MASK
;