An API for interacting with the MSP430 microcontroller family with Atom.
atom-msp430
wraps common interactions with the 430 in Atom's type-safe and beautiful Haskell DSL.
For a quick demonstration, have a read of ledblink.lhs.
More examples will come soon!
To see the current status and goals, have a look at the roadmap.
Make sure you have the Haskell Platform installed.
cabal install atom-msp430
git clone [email protected]:eightyeight/atom-msp430
cd atom-msp430
cabal install
- Because Atom is cool, and Haskell is a great macro language.
- Because type-safety can mean more efficient learning as well as safer code.
- Because I'm sick of seeing code like this:
void initUART(void) {
P1SEL = BIT1 + BIT2; // P1.1 = RXD, P1.2=TXD
P1SEL2 = BIT1 + BIT2; // P1.1 = RXD, P1.2=TXD
UCA0CTL1 |= UCSSEL_1; // CLK = ACLK
UCA0BR0 = 0x03; // 32kHz/9600 = 3.41
UCA0BR1 = 0x00;
UCA0MCTL = UCBRS1 + UCBRS0; // Modulation UCBRSx = 3
UCA0CTL1 &= ~UCSWRST; // **Initialize USCI state machine**
IE2 |= UCA0RXIE; // Enable USCI_A0 RX interrupt
}
(Example by oPossum via msp430launchpad.com with no malice intended. Those guys taught me everything I know about the 430!)