X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=tos%2Fchips%2Fmsp430%2Fpins%2FHplMsp430GeneralIORenP.nc;h=5e272b39ca5aab434bd4678990a14c8e2d88bcf5;hb=e9bfab607e051bae6afb47b44892ce37541d1b44;hp=82cb01486c488326d9695e69f8b6aeca9f1ce83e;hpb=3837bacf0d2200b43265648ed5537d2b9cd88a77;p=tinyos-2.x.git diff --git a/tos/chips/msp430/pins/HplMsp430GeneralIORenP.nc b/tos/chips/msp430/pins/HplMsp430GeneralIORenP.nc index 82cb0148..5e272b39 100644 --- a/tos/chips/msp430/pins/HplMsp430GeneralIORenP.nc +++ b/tos/chips/msp430/pins/HplMsp430GeneralIORenP.nc @@ -1,4 +1,7 @@ /* + * Copyright (c) 2000-2005 The Regents of the University of California. + * All rights reserved. + * * Copyright (c) 2008, Titanium Mirror, Inc. * All rights reserved. * @@ -26,11 +29,14 @@ * (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 + +/** + * Modified from the original HplMsp430GeneralIOP to provide resistor enable + * support available on some msp430 parts. + * + * @author R. Steve McKown */ - + #include "msp430regtypes.h" generic module HplMsp430GeneralIORenP( @@ -55,6 +61,8 @@ implementation 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); } @@ -67,4 +75,5 @@ implementation async command bool IO.isIOFunc() { return (PORTxSEL & (0x01<