| 1 |
610 |
jeremybenn |
//*****************************************************************************
|
| 2 |
|
|
//
|
| 3 |
|
|
// hw_gpio.h - Defines and Macros for GPIO hardware.
|
| 4 |
|
|
//
|
| 5 |
|
|
// Copyright (c) 2005-2008 Luminary Micro, Inc. All rights reserved.
|
| 6 |
|
|
//
|
| 7 |
|
|
// Software License Agreement
|
| 8 |
|
|
//
|
| 9 |
|
|
// Luminary Micro, Inc. (LMI) is supplying this software for use solely and
|
| 10 |
|
|
// exclusively on LMI's microcontroller products.
|
| 11 |
|
|
//
|
| 12 |
|
|
// The software is owned by LMI and/or its suppliers, and is protected under
|
| 13 |
|
|
// applicable copyright laws. All rights are reserved. You may not combine
|
| 14 |
|
|
// this software with "viral" open-source software in order to form a larger
|
| 15 |
|
|
// program. Any use in violation of the foregoing restrictions may subject
|
| 16 |
|
|
// the user to criminal sanctions under applicable laws, as well as to civil
|
| 17 |
|
|
// liability for the breach of the terms and conditions of this license.
|
| 18 |
|
|
//
|
| 19 |
|
|
// THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
|
| 20 |
|
|
// OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
|
| 21 |
|
|
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
|
| 22 |
|
|
// LMI SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
|
| 23 |
|
|
// CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
|
| 24 |
|
|
//
|
| 25 |
|
|
// This is part of revision 2523 of the Stellaris Peripheral Driver Library.
|
| 26 |
|
|
//
|
| 27 |
|
|
//*****************************************************************************
|
| 28 |
|
|
|
| 29 |
|
|
#ifndef __HW_GPIO_H__
|
| 30 |
|
|
#define __HW_GPIO_H__
|
| 31 |
|
|
|
| 32 |
|
|
//*****************************************************************************
|
| 33 |
|
|
//
|
| 34 |
|
|
// The following are defines for the GPIO Register offsets.
|
| 35 |
|
|
//
|
| 36 |
|
|
//*****************************************************************************
|
| 37 |
|
|
#define GPIO_O_DATA 0x00000000 // Data register.
|
| 38 |
|
|
#define GPIO_O_DIR 0x00000400 // Data direction register.
|
| 39 |
|
|
#define GPIO_O_IS 0x00000404 // Interrupt sense register.
|
| 40 |
|
|
#define GPIO_O_IBE 0x00000408 // Interrupt both edges register.
|
| 41 |
|
|
#define GPIO_O_IEV 0x0000040C // Interrupt event register.
|
| 42 |
|
|
#define GPIO_O_IM 0x00000410 // Interrupt mask register.
|
| 43 |
|
|
#define GPIO_O_RIS 0x00000414 // Raw interrupt status register.
|
| 44 |
|
|
#define GPIO_O_MIS 0x00000418 // Masked interrupt status reg.
|
| 45 |
|
|
#define GPIO_O_ICR 0x0000041C // Interrupt clear register.
|
| 46 |
|
|
#define GPIO_O_AFSEL 0x00000420 // Mode control select register.
|
| 47 |
|
|
#define GPIO_O_DR2R 0x00000500 // 2ma drive select register.
|
| 48 |
|
|
#define GPIO_O_DR4R 0x00000504 // 4ma drive select register.
|
| 49 |
|
|
#define GPIO_O_DR8R 0x00000508 // 8ma drive select register.
|
| 50 |
|
|
#define GPIO_O_ODR 0x0000050C // Open drain select register.
|
| 51 |
|
|
#define GPIO_O_PUR 0x00000510 // Pull up select register.
|
| 52 |
|
|
#define GPIO_O_PDR 0x00000514 // Pull down select register.
|
| 53 |
|
|
#define GPIO_O_SLR 0x00000518 // Slew rate control enable reg.
|
| 54 |
|
|
#define GPIO_O_DEN 0x0000051C // Digital input enable register.
|
| 55 |
|
|
#define GPIO_O_LOCK 0x00000520 // Lock register.
|
| 56 |
|
|
#define GPIO_O_CR 0x00000524 // Commit register.
|
| 57 |
|
|
#define GPIO_O_AMSEL 0x00000528 // GPIO Analog Mode Select
|
| 58 |
|
|
|
| 59 |
|
|
//*****************************************************************************
|
| 60 |
|
|
//
|
| 61 |
|
|
// The following are defines for the bit fields in the GPIO_LOCK register.
|
| 62 |
|
|
//
|
| 63 |
|
|
//*****************************************************************************
|
| 64 |
|
|
#define GPIO_LOCK_M 0xFFFFFFFF // GPIO Lock.
|
| 65 |
|
|
#define GPIO_LOCK_UNLOCKED 0x00000000 // GPIO_CR register is unlocked
|
| 66 |
|
|
#define GPIO_LOCK_LOCKED 0x00000001 // GPIO_CR register is locked
|
| 67 |
|
|
#define GPIO_LOCK_KEY 0x1ACCE551 // Unlocks the GPIO_CR register
|
| 68 |
|
|
#define GPIO_LOCK_KEY_DD 0x4C4F434B // Unlocks the GPIO_CR register on
|
| 69 |
|
|
// DustDevil-class devices and
|
| 70 |
|
|
// later.
|
| 71 |
|
|
|
| 72 |
|
|
//*****************************************************************************
|
| 73 |
|
|
//
|
| 74 |
|
|
// The following definitions are deprecated.
|
| 75 |
|
|
//
|
| 76 |
|
|
//*****************************************************************************
|
| 77 |
|
|
#ifndef DEPRECATED
|
| 78 |
|
|
|
| 79 |
|
|
//*****************************************************************************
|
| 80 |
|
|
//
|
| 81 |
|
|
// The following are deprecated defines for the GPIO Register offsets.
|
| 82 |
|
|
//
|
| 83 |
|
|
//*****************************************************************************
|
| 84 |
|
|
#define GPIO_O_PeriphID4 0x00000FD0
|
| 85 |
|
|
#define GPIO_O_PeriphID5 0x00000FD4
|
| 86 |
|
|
#define GPIO_O_PeriphID6 0x00000FD8
|
| 87 |
|
|
#define GPIO_O_PeriphID7 0x00000FDC
|
| 88 |
|
|
#define GPIO_O_PeriphID0 0x00000FE0
|
| 89 |
|
|
#define GPIO_O_PeriphID1 0x00000FE4
|
| 90 |
|
|
#define GPIO_O_PeriphID2 0x00000FE8
|
| 91 |
|
|
#define GPIO_O_PeriphID3 0x00000FEC
|
| 92 |
|
|
#define GPIO_O_PCellID0 0x00000FF0
|
| 93 |
|
|
#define GPIO_O_PCellID1 0x00000FF4
|
| 94 |
|
|
#define GPIO_O_PCellID2 0x00000FF8
|
| 95 |
|
|
#define GPIO_O_PCellID3 0x00000FFC
|
| 96 |
|
|
|
| 97 |
|
|
//*****************************************************************************
|
| 98 |
|
|
//
|
| 99 |
|
|
// The following are deprecated defines for the GPIO Register reset values.
|
| 100 |
|
|
//
|
| 101 |
|
|
//*****************************************************************************
|
| 102 |
|
|
#define GPIO_RV_DEN 0x000000FF // Digital input enable reg RV.
|
| 103 |
|
|
#define GPIO_RV_PUR 0x000000FF // Pull up select reg RV.
|
| 104 |
|
|
#define GPIO_RV_DR2R 0x000000FF // 2ma drive select reg RV.
|
| 105 |
|
|
#define GPIO_RV_PCellID1 0x000000F0
|
| 106 |
|
|
#define GPIO_RV_PCellID3 0x000000B1
|
| 107 |
|
|
#define GPIO_RV_PeriphID0 0x00000061
|
| 108 |
|
|
#define GPIO_RV_PeriphID1 0x00000010
|
| 109 |
|
|
#define GPIO_RV_PCellID0 0x0000000D
|
| 110 |
|
|
#define GPIO_RV_PCellID2 0x00000005
|
| 111 |
|
|
#define GPIO_RV_PeriphID2 0x00000004
|
| 112 |
|
|
#define GPIO_RV_LOCK 0x00000001 // Lock register RV.
|
| 113 |
|
|
#define GPIO_RV_PeriphID7 0x00000000
|
| 114 |
|
|
#define GPIO_RV_PDR 0x00000000 // Pull down select reg RV.
|
| 115 |
|
|
#define GPIO_RV_IC 0x00000000 // Interrupt clear reg RV.
|
| 116 |
|
|
#define GPIO_RV_SLR 0x00000000 // Slew rate control enable reg RV.
|
| 117 |
|
|
#define GPIO_RV_ODR 0x00000000 // Open drain select reg RV.
|
| 118 |
|
|
#define GPIO_RV_IBE 0x00000000 // Interrupt both edges reg RV.
|
| 119 |
|
|
#define GPIO_RV_AFSEL 0x00000000 // Mode control select reg RV.
|
| 120 |
|
|
#define GPIO_RV_IS 0x00000000 // Interrupt sense reg RV.
|
| 121 |
|
|
#define GPIO_RV_IM 0x00000000 // Interrupt mask reg RV.
|
| 122 |
|
|
#define GPIO_RV_PeriphID4 0x00000000
|
| 123 |
|
|
#define GPIO_RV_PeriphID5 0x00000000
|
| 124 |
|
|
#define GPIO_RV_DR8R 0x00000000 // 8ma drive select reg RV.
|
| 125 |
|
|
#define GPIO_RV_RIS 0x00000000 // Raw interrupt status reg RV.
|
| 126 |
|
|
#define GPIO_RV_DR4R 0x00000000 // 4ma drive select reg RV.
|
| 127 |
|
|
#define GPIO_RV_IEV 0x00000000 // Intterupt event reg RV.
|
| 128 |
|
|
#define GPIO_RV_DIR 0x00000000 // Data direction reg RV.
|
| 129 |
|
|
#define GPIO_RV_PeriphID6 0x00000000
|
| 130 |
|
|
#define GPIO_RV_PeriphID3 0x00000000
|
| 131 |
|
|
#define GPIO_RV_DATA 0x00000000 // Data register reset value.
|
| 132 |
|
|
#define GPIO_RV_MIS 0x00000000 // Masked interrupt status reg RV.
|
| 133 |
|
|
|
| 134 |
|
|
#endif
|
| 135 |
|
|
|
| 136 |
|
|
#endif // __HW_GPIO_H__
|