uint16_t captureControl(uint8_t l_cm)
{
cc_t x = {
- cm : l_cm & 0x03, // capture on rising edge
+ cm : l_cm & 0x03, // capture on none, rising, falling or both edges
ccis : 0, // capture/compare input select
clld : 0, // TBCL1 loads on write to TBCCR1
cap : 1, // compare mode
async command bool isInterruptPending();
async command void clearPendingInterrupt();
- async command void setControl(msp430_compare_control_t control );
+ async command void setControl(msp430_compare_control_t control);
async command void setControlAsCompare();
- async command void setControlAsCapture(bool low_to_high);
+
+ /**
+ * Sets the timer in capture mode.
+ * @param cm configures the capture to occur on none, rising, falling or rising_and_falling edges
+ * Msp430Timer.h has convenience definitions:
+ * MSP430TIMER_CM_NONE, MSP430TIMER_CM_RISING, MSP430TIMER_CM_FALLING, MSP430TIMER_CM_BOTH
+ */
+ async command void setControlAsCapture(uint8_t cm);
async command void enableEvents();
async command void disableEvents();