/*
+ * Copyright (c) 2000-2005 The Regents of the University of California.
+ * All rights reserved.
+ *
* Copyright (c) 2008, Titanium Mirror, Inc.
* All rights reserved.
*
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * - Neither the name of the Technische Universität Berlin nor the names
+ * - Neither the name of the Titanium Mirror, Inc. nor the names
* of its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-
- /**
- * @author R. Steve McKown <smckown@gmail.com>
+
+/**
+ * Modified from the original HplMsp430GeneralIOP to provide resistor enable
+ * support available on some msp430 parts.
+ *
+ * @author R. Steve McKown <rsmckown@gmail.com>
*/
-
+
#include "msp430regtypes.h"
generic module HplMsp430GeneralIORenP(
async command void IO.set() { atomic PORTx |= (0x01 << pin); }
async command void IO.clr() { atomic PORTx &= ~(0x01 << pin); }
async command void IO.toggle() { atomic PORTx ^= (0x01 << pin); }
+ async command uint8_t IO.getOutRaw() { return PORTx & (0x01 << pin); }
+ async command bool IO.getOut() { return (call IO.getOutRaw() != 0); }
async command uint8_t IO.getRaw() { return PORTxIN & (0x01 << pin); }
async command bool IO.get() { return (call IO.getRaw() != 0); }
async command void IO.makeInput() { atomic PORTxDIR &= ~(0x01 << pin); }
async command bool IO.isIOFunc() { return (PORTxSEL & (0x01<<pin)) == 0; }
async command void IO.enableRen() { atomic PORTxREN |= (0x01 << pin); }
async command void IO.disableRen() { atomic PORTxREN &= ~(0x01 << pin); }
+ async command bool IO.isRen() { return PORTxREN = (0x01 << pin) != 0; }
}