Fork of the official mbed C/C SDK provides the software platform and libraries to build your applications for RenBED.

Dependents:   1-RenBuggyTimed RenBED_RGB RenBED_RGB_PWM RenBED_RGB

Fork of mbed by mbed official

Committer:
Kojto
Date:
Wed May 13 08:08:21 2015 +0200
Revision:
99:dbbf35b96557
Release 99 of the mbed library

Changes:
- new targets - MAXWSNENV, DISCO_L053C8
- STM32F4xx - ST Cube driver
- KSDK mcu - SPI timing fix
- Nordic - update to softdevice s130

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 99:dbbf35b96557 1 /*******************************************************************************
Kojto 99:dbbf35b96557 2 * Copyright (C) 2015 Maxim Integrated Products, Inc., All Rights Reserved.
Kojto 99:dbbf35b96557 3 *
Kojto 99:dbbf35b96557 4 * Permission is hereby granted, free of charge, to any person obtaining a
Kojto 99:dbbf35b96557 5 * copy of this software and associated documentation files (the "Software"),
Kojto 99:dbbf35b96557 6 * to deal in the Software without restriction, including without limitation
Kojto 99:dbbf35b96557 7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
Kojto 99:dbbf35b96557 8 * and/or sell copies of the Software, and to permit persons to whom the
Kojto 99:dbbf35b96557 9 * Software is furnished to do so, subject to the following conditions:
Kojto 99:dbbf35b96557 10 *
Kojto 99:dbbf35b96557 11 * The above copyright notice and this permission notice shall be included
Kojto 99:dbbf35b96557 12 * in all copies or substantial portions of the Software.
Kojto 99:dbbf35b96557 13 *
Kojto 99:dbbf35b96557 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
Kojto 99:dbbf35b96557 15 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
Kojto 99:dbbf35b96557 16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
Kojto 99:dbbf35b96557 17 * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
Kojto 99:dbbf35b96557 18 * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
Kojto 99:dbbf35b96557 19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
Kojto 99:dbbf35b96557 20 * OTHER DEALINGS IN THE SOFTWARE.
Kojto 99:dbbf35b96557 21 *
Kojto 99:dbbf35b96557 22 * Except as contained in this notice, the name of Maxim Integrated
Kojto 99:dbbf35b96557 23 * Products, Inc. shall not be used except as stated in the Maxim Integrated
Kojto 99:dbbf35b96557 24 * Products, Inc. Branding Policy.
Kojto 99:dbbf35b96557 25 *
Kojto 99:dbbf35b96557 26 * The mere transfer of this software does not imply any licenses
Kojto 99:dbbf35b96557 27 * of trade secrets, proprietary technology, copyrights, patents,
Kojto 99:dbbf35b96557 28 * trademarks, maskwork rights, or any other form of intellectual
Kojto 99:dbbf35b96557 29 * property whatsoever. Maxim Integrated Products, Inc. retains all
Kojto 99:dbbf35b96557 30 * ownership rights.
Kojto 99:dbbf35b96557 31 *******************************************************************************
Kojto 99:dbbf35b96557 32 */
Kojto 99:dbbf35b96557 33
Kojto 99:dbbf35b96557 34 #ifndef _MXC_WDT_REGS_H_
Kojto 99:dbbf35b96557 35 #define _MXC_WDT_REGS_H_
Kojto 99:dbbf35b96557 36
Kojto 99:dbbf35b96557 37 #ifdef __cplusplus
Kojto 99:dbbf35b96557 38 extern "C" {
Kojto 99:dbbf35b96557 39 #endif
Kojto 99:dbbf35b96557 40
Kojto 99:dbbf35b96557 41 #include <stdint.h>
Kojto 99:dbbf35b96557 42
Kojto 99:dbbf35b96557 43 /**
Kojto 99:dbbf35b96557 44 * @file wdt_regs.h
Kojto 99:dbbf35b96557 45 * @addtogroup wdt WDT
Kojto 99:dbbf35b96557 46 * @{
Kojto 99:dbbf35b96557 47 */
Kojto 99:dbbf35b96557 48
Kojto 99:dbbf35b96557 49 /**
Kojto 99:dbbf35b96557 50 * @brief Defines watchdog timer periods
Kojto 99:dbbf35b96557 51 */
Kojto 99:dbbf35b96557 52 typedef enum {
Kojto 99:dbbf35b96557 53 /** 2^31 cycle period */
Kojto 99:dbbf35b96557 54 MXC_E_WDT_PERIOD_2_31_CLKS = 0,
Kojto 99:dbbf35b96557 55 /** 2^30 cycle period */
Kojto 99:dbbf35b96557 56 MXC_E_WDT_PERIOD_2_30_CLKS,
Kojto 99:dbbf35b96557 57 /** 2^29 cycle period */
Kojto 99:dbbf35b96557 58 MXC_E_WDT_PERIOD_2_29_CLKS,
Kojto 99:dbbf35b96557 59 /** 2^28 cycle period */
Kojto 99:dbbf35b96557 60 MXC_E_WDT_PERIOD_2_28_CLKS,
Kojto 99:dbbf35b96557 61 /** 2^27 cycle period */
Kojto 99:dbbf35b96557 62 MXC_E_WDT_PERIOD_2_27_CLKS,
Kojto 99:dbbf35b96557 63 /** 2^26 cycle period */
Kojto 99:dbbf35b96557 64 MXC_E_WDT_PERIOD_2_26_CLKS,
Kojto 99:dbbf35b96557 65 /** 2^25 cycle period */
Kojto 99:dbbf35b96557 66 MXC_E_WDT_PERIOD_2_25_CLKS,
Kojto 99:dbbf35b96557 67 /** 2^24 cycle period */
Kojto 99:dbbf35b96557 68 MXC_E_WDT_PERIOD_2_24_CLKS,
Kojto 99:dbbf35b96557 69 /** 2^23 cycle period */
Kojto 99:dbbf35b96557 70 MXC_E_WDT_PERIOD_2_23_CLKS,
Kojto 99:dbbf35b96557 71 /** 2^22 cycle period */
Kojto 99:dbbf35b96557 72 MXC_E_WDT_PERIOD_2_22_CLKS,
Kojto 99:dbbf35b96557 73 /** 2^21 cycle period */
Kojto 99:dbbf35b96557 74 MXC_E_WDT_PERIOD_2_21_CLKS,
Kojto 99:dbbf35b96557 75 /** 2^20 cycle period */
Kojto 99:dbbf35b96557 76 MXC_E_WDT_PERIOD_2_20_CLKS,
Kojto 99:dbbf35b96557 77 /** 2^19 cycle period */
Kojto 99:dbbf35b96557 78 MXC_E_WDT_PERIOD_2_19_CLKS,
Kojto 99:dbbf35b96557 79 /** 2^18 cycle period */
Kojto 99:dbbf35b96557 80 MXC_E_WDT_PERIOD_2_18_CLKS,
Kojto 99:dbbf35b96557 81 /** 2^17 cycle period */
Kojto 99:dbbf35b96557 82 MXC_E_WDT_PERIOD_2_17_CLKS,
Kojto 99:dbbf35b96557 83 /** 2^16 cycle period */
Kojto 99:dbbf35b96557 84 MXC_E_WDT_PERIOD_2_16_CLKS,
Kojto 99:dbbf35b96557 85 } mxc_wdt_period_t;
Kojto 99:dbbf35b96557 86
Kojto 99:dbbf35b96557 87 /* Offset Register Description
Kojto 99:dbbf35b96557 88 ====== ================================================ */
Kojto 99:dbbf35b96557 89 typedef struct {
Kojto 99:dbbf35b96557 90 __IO uint32_t ctrl; /* 0x0000 Watchdog Timer Control Register */
Kojto 99:dbbf35b96557 91 __IO uint32_t clear; /* 0x0004 Watchdog Clear Register (Feed Dog) */
Kojto 99:dbbf35b96557 92 __IO uint32_t int_rst_fl; /* 0x0008 Watchdog Interrupt/Reset Flags */
Kojto 99:dbbf35b96557 93 __IO uint32_t int_rst_en; /* 0x000C Interrupt/Reset Enable/Disable Controls */
Kojto 99:dbbf35b96557 94 __I uint32_t rsv0010; /* 0x0010 */
Kojto 99:dbbf35b96557 95 __IO uint32_t lock_ctrl; /* 0x0014 Lock Register Setting for WDT CTRL */
Kojto 99:dbbf35b96557 96 } mxc_wdt_regs_t;
Kojto 99:dbbf35b96557 97
Kojto 99:dbbf35b96557 98 /*
Kojto 99:dbbf35b96557 99 Register offsets for module WDT.
Kojto 99:dbbf35b96557 100 */
Kojto 99:dbbf35b96557 101 #define MXC_R_WDT_OFFS_CTRL ((uint32_t)0x00000000UL)
Kojto 99:dbbf35b96557 102 #define MXC_R_WDT_OFFS_CLEAR ((uint32_t)0x00000004UL)
Kojto 99:dbbf35b96557 103 #define MXC_R_WDT_OFFS_INT_RST_FL ((uint32_t)0x00000008UL)
Kojto 99:dbbf35b96557 104 #define MXC_R_WDT_OFFS_INT_RST_EN ((uint32_t)0x0000000CUL)
Kojto 99:dbbf35b96557 105 #define MXC_R_WDT_OFFS_LOCK_CTRL ((uint32_t)0x00000014UL)
Kojto 99:dbbf35b96557 106
Kojto 99:dbbf35b96557 107 #define MXC_V_WDT_WDLOCK_LOCK_KEY ((uint8_t)0x24)
Kojto 99:dbbf35b96557 108 #define MXC_V_WDT_WDLOCK_UNLOCK_KEY ((uint8_t)0x42)
Kojto 99:dbbf35b96557 109
Kojto 99:dbbf35b96557 110
Kojto 99:dbbf35b96557 111 /*
Kojto 99:dbbf35b96557 112 Field positions and masks for module WDT.
Kojto 99:dbbf35b96557 113 */
Kojto 99:dbbf35b96557 114 #define MXC_F_WDT_CTRL_INT_PERIOD_POS 0
Kojto 99:dbbf35b96557 115 #define MXC_F_WDT_CTRL_INT_PERIOD ((uint32_t)(0x0000000FUL << MXC_F_WDT_CTRL_INT_PERIOD_POS))
Kojto 99:dbbf35b96557 116 #define MXC_F_WDT_CTRL_RST_PERIOD_POS 4
Kojto 99:dbbf35b96557 117 #define MXC_F_WDT_CTRL_RST_PERIOD ((uint32_t)(0x0000000FUL << MXC_F_WDT_CTRL_RST_PERIOD_POS))
Kojto 99:dbbf35b96557 118 #define MXC_F_WDT_CTRL_EN_TIMER_POS 8
Kojto 99:dbbf35b96557 119 #define MXC_F_WDT_CTRL_EN_TIMER ((uint32_t)(0x00000001UL << MXC_F_WDT_CTRL_EN_TIMER_POS))
Kojto 99:dbbf35b96557 120 #define MXC_F_WDT_CTRL_EN_CLOCK_POS 9
Kojto 99:dbbf35b96557 121 #define MXC_F_WDT_CTRL_EN_CLOCK ((uint32_t)(0x00000001UL << MXC_F_WDT_CTRL_EN_CLOCK_POS))
Kojto 99:dbbf35b96557 122 #define MXC_F_WDT_CTRL_WAIT_PERIOD_POS 12
Kojto 99:dbbf35b96557 123 #define MXC_F_WDT_CTRL_WAIT_PERIOD ((uint32_t)(0x0000000FUL << MXC_F_WDT_CTRL_WAIT_PERIOD_POS))
Kojto 99:dbbf35b96557 124
Kojto 99:dbbf35b96557 125 #define MXC_F_WDT_FLAGS_TIMEOUT_POS 0
Kojto 99:dbbf35b96557 126 #define MXC_F_WDT_FLAGS_TIMEOUT ((uint32_t)(0x00000001UL << MXC_F_WDT_FLAGS_TIMEOUT_POS))
Kojto 99:dbbf35b96557 127 #define MXC_F_WDT_FLAGS_PRE_WIN_POS 1
Kojto 99:dbbf35b96557 128 #define MXC_F_WDT_FLAGS_PRE_WIN ((uint32_t)(0x00000001UL << MXC_F_WDT_FLAGS_PRE_WIN_POS))
Kojto 99:dbbf35b96557 129 #define MXC_F_WDT_FLAGS_RESET_OUT_POS 2
Kojto 99:dbbf35b96557 130 #define MXC_F_WDT_FLAGS_RESET_OUT ((uint32_t)(0x00000001UL << MXC_F_WDT_FLAGS_RESET_OUT_POS))
Kojto 99:dbbf35b96557 131
Kojto 99:dbbf35b96557 132 #define MXC_F_WDT_ENABLE_TIMEOUT_POS 0
Kojto 99:dbbf35b96557 133 #define MXC_F_WDT_ENABLE_TIMEOUT ((uint32_t)(0x00000001UL << MXC_F_WDT_ENABLE_TIMEOUT_POS))
Kojto 99:dbbf35b96557 134 #define MXC_F_WDT_ENABLE_PRE_WIN_POS 1
Kojto 99:dbbf35b96557 135 #define MXC_F_WDT_ENABLE_PRE_WIN ((uint32_t)(0x00000001UL << MXC_F_WDT_ENABLE_PRE_WIN_POS))
Kojto 99:dbbf35b96557 136 #define MXC_F_WDT_ENABLE_RESET_OUT_POS 2
Kojto 99:dbbf35b96557 137 #define MXC_F_WDT_ENABLE_RESET_OUT ((uint32_t)(0x00000001UL << MXC_F_WDT_ENABLE_RESET_OUT_POS))
Kojto 99:dbbf35b96557 138
Kojto 99:dbbf35b96557 139 #define MXC_F_WDT_LOCK_CTRL_WDLOCK_POS 0
Kojto 99:dbbf35b96557 140 #define MXC_F_WDT_LOCK_CTRL_WDLOCK ((uint32_t)(0x000000FFUL << MXC_F_WDT_LOCK_CTRL_WDLOCK_POS))
Kojto 99:dbbf35b96557 141
Kojto 99:dbbf35b96557 142 #ifdef __cplusplus
Kojto 99:dbbf35b96557 143 }
Kojto 99:dbbf35b96557 144 #endif
Kojto 99:dbbf35b96557 145
Kojto 99:dbbf35b96557 146 /**
Kojto 99:dbbf35b96557 147 * @}
Kojto 99:dbbf35b96557 148 */
Kojto 99:dbbf35b96557 149
Kojto 99:dbbf35b96557 150 #endif /* _MXC_WDT_REGS_H_ */