atom-msp430 0.5.2 → 0.5.3
raw patch · 5 files changed
+57/−51 lines, 5 files
Files
- Language/Atom/MSP430/DigitalIO.hs +16/−16
- Language/Atom/MSP430/Interrupts.hs +2/−2
- Language/Atom/MSP430/TimerA.hs +24/−18
- Language/Atom/MSP430/Watchdog.hs +14/−14
- atom-msp430.cabal +1/−1
Language/Atom/MSP430/DigitalIO.hs view
@@ -2,23 +2,23 @@ import Language.Atom -port1In = word8' "P1IN" -- ^ Read the value of PORT1 pins when used in input mode. -port1Out = word8' "P1OUT" -- ^ Set the values of PORT1 pins when used in output mode. -port1Dir = word8' "P1DIR" -- ^ Choose the input/output modes of PORT1 pins (1 = output). -port1Resistors = word8' "P1REN" -- ^ Enable pullup/pulldown resistors of PORT1 pins. -port1Function = word8' "P1SEL" -- ^ +port1In = word8' "P1IN" -- Read the value of PORT1 pins when used in input mode. +port1Out = word8' "P1OUT" -- Set the values of PORT1 pins when used in output mode. +port1Dir = word8' "P1DIR" -- Choose the input/output modes of PORT1 pins (1 = output). +port1Resistors = word8' "P1REN" -- Enable pullup/pulldown resistors of PORT1 pins. +port1Function = word8' "P1SEL" -- -port1InterruptEnable = word8' "P1IE" -- ^ Enable interrupts for PORT1 pins in input mode. -port1InterruptFlags = word8' "P1IFG" -- ^ Interrupt flags for PORT1 pins. A flag is set when an interrupt occurs; you should clear it manually. -port1InterruptEdgeSelect = word8' "P1IES" -- ^ Interrupt edge select: if set to 1, the pin responds to a falling edge. +port1InterruptEnable = word8' "P1IE" -- Enable interrupts for PORT1 pins in input mode. +port1InterruptFlags = word8' "P1IFG" -- Interrupt flags for PORT1 pins. A flag is set when an interrupt occurs; you should clear it manually. +port1InterruptEdgeSelect = word8' "P1IES" -- Interrupt edge select: if set to 1, the pin responds to a falling edge. -port2In = word8' "P2IN" -- ^ Read the value of PORT2 pins when used in input mode. -port2Out = word8' "P2OUT" -- ^ Set the values of PORT2 pins when used in output mode. -port2Dir = word8' "P2DIR" -- ^ Choose the input/output modes of PORT2 pins (2 = output). -port2Resistors = word8' "P2REN" -- ^ Enable pullup/pulldown resistors of PORT2 pins. -port2Function = word8' "P2SEL" -- ^ +port2In = word8' "P2IN" -- Read the value of PORT2 pins when used in input mode. +port2Out = word8' "P2OUT" -- Set the values of PORT2 pins when used in output mode. +port2Dir = word8' "P2DIR" -- Choose the input/output modes of PORT2 pins (2 = output). +port2Resistors = word8' "P2REN" -- Enable pullup/pulldown resistors of PORT2 pins. +port2Function = word8' "P2SEL" -- -port2InterruptEnable = word8' "P2IE" -- ^ Enable interrupts for PORT2 pins in input mode. -port2InterruptFlags = word8' "P2IFG" -- ^ Interrupt flags for PORT2 pins. A flag is set when an interrupt occurs; you should clear it manually. -port2InterruptEdgeSelect = word8' "P2IES" -- ^ Interrupt edge select: if set to 2, the pin responds to a falling edge. +port2InterruptEnable = word8' "P2IE" -- Enable interrupts for PORT2 pins in input mode. +port2InterruptFlags = word8' "P2IFG" -- Interrupt flags for PORT2 pins. A flag is set when an interrupt occurs; you should clear it manually. +port2InterruptEdgeSelect = word8' "P2IES" -- Interrupt edge select: if set to 2, the pin responds to a falling edge.
Language/Atom/MSP430/Interrupts.hs view
@@ -2,5 +2,5 @@ import Language.Atom -interruptEnable = word8' "IE1" -- ^ Global interrupt vector. -interruptFlags = word8' "IFG1" -- ^ Global interrupt flags. +interruptEnable = word8' "IE1" -- Global interrupt vector. +interruptFlags = word8' "IFG1" -- Global interrupt flags.
Language/Atom/MSP430/TimerA.hs view
@@ -3,23 +3,29 @@ import Language.Atom import Data.Word -taSource = 0x0000 :: Word16 -- ^ Source Timer A from TACLK. -taSourceACLK = 0x0100 :: Word16 -- ^ Source Timer A from ACLK. -taSourceSMCLK = 0x0200 :: Word16 -- ^ Source Timer A from SMCLK. -taSourceINCLK = 0x0300 :: Word16 -- ^ Source Timer A from INCLK. -taClear = 0x0004 :: Word16 -- ^ Clear Timer A (reset it to 0). -taInterruptEnabled = 0x0002 :: Word16 -- ^ Enable the Timer A interrupt. -taStopMode = 0x0000 :: Word16 -- ^ Stop the timer from counting. -taUpMode = 0x0010 :: Word16 -- ^ Timer counts from 0 to TACCR0. -taContinuousMode = 0x0020 :: Word16 -- ^ Timer counts from 0 to 0xFFFF. -taUpDownMode = 0x0030 :: Word16 -- ^ Timer counts from 0 to TACCR0 to 0. -taSourceDiv1 = 0x0000 :: Word16 -- ^ Divide timer input source by 1. -taSourceDiv2 = 0x0040 :: Word16 -- ^ Divide timer input source by 2. -taSourceDiv4 = 0x0080 :: Word16 -- ^ Divide timer input source by 4. -taSourceDiv8 = 0x00C0 :: Word16 -- ^ Divide timer input source by 8. +taSource = 0x0000 :: Word16 -- Source Timer A from TACLK. +taSourceACLK = 0x0100 :: Word16 -- Source Timer A from ACLK. +taSourceSMCLK = 0x0200 :: Word16 -- Source Timer A from SMCLK. +taSourceINCLK = 0x0300 :: Word16 -- Source Timer A from INCLK. +taClear = 0x0004 :: Word16 -- Clear Timer A (reset it to 0). +taInterruptEnabled = 0x0002 :: Word16 -- Enable the Timer A interrupt. +taStopMode = 0x0000 :: Word16 -- Stop the timer from counting. +taUpMode = 0x0010 :: Word16 -- Timer counts from 0 to TACCR0. +taContinuousMode = 0x0020 :: Word16 -- Timer counts from 0 to 0xFFFF. +taUpDownMode = 0x0030 :: Word16 -- Timer counts from 0 to TACCR0 to 0. +taSourceDiv1 = 0x0000 :: Word16 -- Divide timer input source by 1. +taSourceDiv2 = 0x0040 :: Word16 -- Divide timer input source by 2. +taSourceDiv4 = 0x0080 :: Word16 -- Divide timer input source by 4. +taSourceDiv8 = 0x00C0 :: Word16 -- Divide timer input source by 8. -taCCRInterrupt = 0x0010 :: Word16 -- ^ Interrupt on a Timer A CCR. +taCaptureRising = 0x4000 :: Word16 +taCaptureFalling = 0x8000 :: Word16 +taCaptureBoth = 0xC000 :: Word16 +taSyncCapture = 0x0800 :: Word16 +taCCRInterrupt = 0x0010 :: Word16 -- Interrupt on a Timer A CCR. -timerAControl = word16' "TACTL" -- ^ Timer A control register. -timerACCR0 = word16' "TACCR0" -- ^ Timer A capture/compare register 0. -timerACCC0 = word16' "TACCTL0" -- ^ Timer A capture/compare control register 0. +timerAControl = word16' "TACTL" -- Timer A control register. +timerACCR0 = word16' "TACCR0" -- Timer A capture/compare register 0. +timerACCC0 = word16' "TACCTL0" -- Timer A capture/compare control register 0. +timerACCR1 = word16' "TACCR1" -- Timer A capture/compare register 1. +timerACCC1 = word16' "TACCTL1" -- Timer A capture/compare control register 1.
Language/Atom/MSP430/Watchdog.hs view
@@ -3,19 +3,19 @@ import Language.Atom import Data.Word -wdtPassword = 0x5A00 :: Word16 -- ^ Password bits to change the waychdog settings. Include this in every write to 'watchdog'. -wdtHold = 0x0080 :: Word16 -- ^ Stop the watchdog timer. -wdtNMIFalling = 0x0040 :: Word16 -- ^ NMI interrupt on falling edge. -wdtNMI = 0x0020 :: Word16 -- ^ NMI interrupt. -wdtIntervalMode = 0x0010 :: Word16 -- ^ Use the timer as an interval counter with interrupt. -wdtClearCounter = 0x0008 :: Word16 -- ^ Clear the WDT counter when in interval mode. -wdtUseAuxClock = 0x0004 :: Word16 -- ^ Source WDT from ACLK. -wdtSourceDiv15 = 0x0000 :: Word16 -- ^ Divide the timer input by 2^15. -wdtSourceDiv13 = 0x0001 :: Word16 -- ^ Divide the timer input by 2^13. -wdtSourceDiv9 = 0x0002 :: Word16 -- ^ Divide the timer input by 2^9. -wdtSourceDiv6 = 0x0003 :: Word16 -- ^ Divide the timer input by 2^6. +wdtPassword = 0x5A00 :: Word16 -- Password bits to change the waychdog settings. Include this in every write to 'watchdog'. +wdtHold = 0x0080 :: Word16 -- Stop the watchdog timer. +wdtNMIFalling = 0x0040 :: Word16 -- NMI interrupt on falling edge. +wdtNMI = 0x0020 :: Word16 -- NMI interrupt. +wdtIntervalMode = 0x0010 :: Word16 -- Use the timer as an interval counter with interrupt. +wdtClearCounter = 0x0008 :: Word16 -- Clear the WDT counter when in interval mode. +wdtUseAuxClock = 0x0004 :: Word16 -- Source WDT from ACLK. +wdtSourceDiv15 = 0x0000 :: Word16 -- Divide the timer input by 2^15. +wdtSourceDiv13 = 0x0001 :: Word16 -- Divide the timer input by 2^13. +wdtSourceDiv9 = 0x0002 :: Word16 -- Divide the timer input by 2^9. +wdtSourceDiv6 = 0x0003 :: Word16 -- Divide the timer input by 2^6. -wdtInterruptEnable = 0x01 :: Word8 -- ^ Enable the WDT interrupt in 'interruptEnable'. -wdtNMIInterruptEnable = 0x10 :: Word8 -- ^ Enable the WDT's NMI interrupt in 'interruptEnable'. +wdtInterruptEnable = 0x01 :: Word8 -- Enable the WDT interrupt in 'interruptEnable'. +wdtNMIInterruptEnable = 0x10 :: Word8 -- Enable the WDT's NMI interrupt in 'interruptEnable'. -watchdog = word16' "WDTCTL" -- ^ Watchdog control register. +watchdog = word16' "WDTCTL" -- Watchdog control register.
atom-msp430.cabal view
@@ -1,5 +1,5 @@ name: atom-msp430 -version: 0.5.2 +version: 0.5.3 synopsis: Convenience functions for using Atom with the MSP430 microcontroller family. -- description: homepage: https://github.com/eightyeight/atom-msp430