// Set all MOSFET pins for output
  P1DIR |= 0x2A;                                    // P1.1, P1.3, P1.5
  P2DIR |= 0x80;                                    // P2.7
  P4DIR |= 0x67;                                    // P4.0, P4.1, P4.2, P4.5, P4.6
  
  // Turn off all NMOS (Logic 0)
  P4OUT &= ~0x21;                                   // P4.0, P4.5
  P1OUT &= ~0x0A;                                   // P1.1, P1.3
  
  // Turn off all PMOS (Logic 1)
  P1OUT |= 0x20;                                    // P1.5
  P2OUT |= 0x80;                                    // P2.7
  P4OUT |= 0x42;                                    // P4.1, P4.6