BA / SerialCom

Fork of OmniWheels by Gustav Atmel

Committer:
gustavatmel
Date:
Tue May 01 15:47:08 2018 +0000
Revision:
1:9c5af431a1f1
sdf

Who changed what in which revision?

UserRevisionLine numberNew contents of line
gustavatmel 1:9c5af431a1f1 1 /**
gustavatmel 1:9c5af431a1f1 2 * @file
gustavatmel 1:9c5af431a1f1 3 * @brief This file contains the function implementations for the
gustavatmel 1:9c5af431a1f1 4 * Instruction Cache Controller.
gustavatmel 1:9c5af431a1f1 5 */
gustavatmel 1:9c5af431a1f1 6
gustavatmel 1:9c5af431a1f1 7 /* ****************************************************************************
gustavatmel 1:9c5af431a1f1 8 * Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved.
gustavatmel 1:9c5af431a1f1 9 *
gustavatmel 1:9c5af431a1f1 10 * Permission is hereby granted, free of charge, to any person obtaining a
gustavatmel 1:9c5af431a1f1 11 * copy of this software and associated documentation files (the "Software"),
gustavatmel 1:9c5af431a1f1 12 * to deal in the Software without restriction, including without limitation
gustavatmel 1:9c5af431a1f1 13 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
gustavatmel 1:9c5af431a1f1 14 * and/or sell copies of the Software, and to permit persons to whom the
gustavatmel 1:9c5af431a1f1 15 * Software is furnished to do so, subject to the following conditions:
gustavatmel 1:9c5af431a1f1 16 *
gustavatmel 1:9c5af431a1f1 17 * The above copyright notice and this permission notice shall be included
gustavatmel 1:9c5af431a1f1 18 * in all copies or substantial portions of the Software.
gustavatmel 1:9c5af431a1f1 19 *
gustavatmel 1:9c5af431a1f1 20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
gustavatmel 1:9c5af431a1f1 21 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
gustavatmel 1:9c5af431a1f1 22 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
gustavatmel 1:9c5af431a1f1 23 * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
gustavatmel 1:9c5af431a1f1 24 * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
gustavatmel 1:9c5af431a1f1 25 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
gustavatmel 1:9c5af431a1f1 26 * OTHER DEALINGS IN THE SOFTWARE.
gustavatmel 1:9c5af431a1f1 27 *
gustavatmel 1:9c5af431a1f1 28 * Except as contained in this notice, the name of Maxim Integrated
gustavatmel 1:9c5af431a1f1 29 * Products, Inc. shall not be used except as stated in the Maxim Integrated
gustavatmel 1:9c5af431a1f1 30 * Products, Inc. Branding Policy.
gustavatmel 1:9c5af431a1f1 31 *
gustavatmel 1:9c5af431a1f1 32 * The mere transfer of this software does not imply any licenses
gustavatmel 1:9c5af431a1f1 33 * of trade secrets, proprietary technology, copyrights, patents,
gustavatmel 1:9c5af431a1f1 34 * trademarks, maskwork rights, or any other form of intellectual
gustavatmel 1:9c5af431a1f1 35 * property whatsoever. Maxim Integrated Products, Inc. retains all
gustavatmel 1:9c5af431a1f1 36 * ownership rights.
gustavatmel 1:9c5af431a1f1 37 *
gustavatmel 1:9c5af431a1f1 38 * $Date: 2016-09-08 17:45:25 -0500 (Thu, 08 Sep 2016) $
gustavatmel 1:9c5af431a1f1 39 * $Revision: 24331 $
gustavatmel 1:9c5af431a1f1 40 *
gustavatmel 1:9c5af431a1f1 41 *************************************************************************** */
gustavatmel 1:9c5af431a1f1 42
gustavatmel 1:9c5af431a1f1 43
gustavatmel 1:9c5af431a1f1 44 /* **** Includes **** */
gustavatmel 1:9c5af431a1f1 45 #include "mxc_config.h"
gustavatmel 1:9c5af431a1f1 46 #include "icc.h"
gustavatmel 1:9c5af431a1f1 47 /**
gustavatmel 1:9c5af431a1f1 48 * @ingroup icc
gustavatmel 1:9c5af431a1f1 49 * @{
gustavatmel 1:9c5af431a1f1 50 */
gustavatmel 1:9c5af431a1f1 51
gustavatmel 1:9c5af431a1f1 52 /* **** Definitions **** */
gustavatmel 1:9c5af431a1f1 53
gustavatmel 1:9c5af431a1f1 54 /* **** Globals **** */
gustavatmel 1:9c5af431a1f1 55
gustavatmel 1:9c5af431a1f1 56 /* **** Functions **** */
gustavatmel 1:9c5af431a1f1 57
gustavatmel 1:9c5af431a1f1 58 /* ************************************************************************* */
gustavatmel 1:9c5af431a1f1 59 void ICC_Enable(void)
gustavatmel 1:9c5af431a1f1 60 {
gustavatmel 1:9c5af431a1f1 61 /* Invalidate cache and wait until ready */
gustavatmel 1:9c5af431a1f1 62 MXC_ICC->invdt_all = 1;
gustavatmel 1:9c5af431a1f1 63 while (!(MXC_ICC->ctrl_stat & MXC_F_ICC_CTRL_STAT_READY));
gustavatmel 1:9c5af431a1f1 64
gustavatmel 1:9c5af431a1f1 65 /* Enable cache */
gustavatmel 1:9c5af431a1f1 66 MXC_ICC->ctrl_stat |= MXC_F_ICC_CTRL_STAT_ENABLE;
gustavatmel 1:9c5af431a1f1 67
gustavatmel 1:9c5af431a1f1 68 /* Must invalidate a second time for proper use */
gustavatmel 1:9c5af431a1f1 69 MXC_ICC->invdt_all = 1;
gustavatmel 1:9c5af431a1f1 70 }
gustavatmel 1:9c5af431a1f1 71
gustavatmel 1:9c5af431a1f1 72 /* ************************************************************************* */
gustavatmel 1:9c5af431a1f1 73 void ICC_Disable(void)
gustavatmel 1:9c5af431a1f1 74 {
gustavatmel 1:9c5af431a1f1 75 MXC_ICC->ctrl_stat &= ~MXC_F_ICC_CTRL_STAT_ENABLE;
gustavatmel 1:9c5af431a1f1 76 }
gustavatmel 1:9c5af431a1f1 77 /**@} end of group icc */