summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
10acc57)
But there are times when PORTxIN and PORTx (PxOUT) may be different, such as
is the case when using pull-up or pull-down resistors via PORTxREN (PxREN)
available on newer msp430's.
*/
async command void toggle();
*/
async command void toggle();
+ /**
+ * Get the port OUT status that contains the pin.
+ *
+ * @return Status of the port that contains the given pin. The x'th
+ * pin on the port will be represented in the x'th bit.
+ */
+ async command uint8_t getOutRaw();
+
+ /**
+ * Read pin OUT value.
+ *
+ * @return TRUE if pin is high, FALSE otherwise.
+ */
+ async command bool getOut();
/**
* Get the port status that contains the pin.
*
/**
* Get the port status that contains the pin.
*
* Disable pullup/pulldown resistor.
*/
async command void disableRen();
* Disable pullup/pulldown resistor.
*/
async command void disableRen();
+
+ /**
+ * Return true if pullup/pulldown resistor is enabled
+ */
+ async command bool isRen();
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 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 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 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() {}
async command void IO.disableRen() {}
async command bool IO.isIOFunc() { return (PORTxSEL & (0x01<<pin)) == 0; }
async command void IO.enableRen() {}
async command void IO.disableRen() {}
+ async command bool IO.isRen() { return false; }
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 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 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.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 void IO.isRen() { return PORTxREN = (0x01 << pin) != 0; }