#include "msp430tools.h" const char shift_table[8] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 }; void delay_ms(int ms) { while (ms-- > 0) __delay_cycles(MHZ * 1000); } char pin_dir_dynamic_(char pin, char dir) { if (dir) pin_dir_port_(pin) |= pin_bit_mask_(pin); else pin_dir_port_(pin) &= ~pin_bit_mask_(pin); } char pin_read_dynamic_(char pin) { return (pin_in_port_(pin) & 1) > 0; } char pin_write_dynamic_(uint16_t pin, char value) { if (value) pin_out_port_(pin) |= pin_bit_mask_(pin); else pin_out_port_(pin) &= ~pin_bit_mask_(pin); }