<commit_before>/*
  ************************************************************************
  *	pins_energia.h
  *
  *	Pin definition functions for LaunchPad w/ msp430fr5969
  *		Copyright (c) 2012 <NAME>. All right reserved.
  *
  *     Contribution: <NAME>
  *
  ***********************************************************************
  Derived from:
  pins_arduino.h - Pin definition functions for Arduino
  Part of Arduino - http://www.arduino.cc/

  Copyright (c) 2007 <NAME>

  This library is free software; you can redistribute it and/or
  modify it under the terms of the GNU Lesser General Public
  License as published by the Free Software Foundation; either
  version 2.1 of the License, or (at your option) any later version.

  This library is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  Lesser General Public License for more details.

  You should have received a copy of the GNU Lesser General
  Public License along with this library; if not, write to the
  Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  Boston, MA  02111-1307  USA
*/

#ifndef Pins_Energia_h
#define Pins_Energia_h
#ifndef BV
#define BV(x) (1 << (x))
#endif


#if defined(__MSP430_HAS_EUSCI_B0__)
static const uint8_t SS      = 9;   /* P1.3 */
static const uint8_t SCK     = 26;  /* P2.2 */
static const uint8_t MOSI    = 31;  /* P1.6 aka SIMO */
static const uint8_t MISO    = 32;  /* P1.7 aka SOMI */
static const uint8_t TWISDA  = 31;  /* P1.6 */
static const uint8_t TWISCL  = 32;  /* P1.7 */
#define TWISDA_SET_MODE  (PORT_SELECTION1 | INPUT_PULLUP)
#define TWISCL_SET_MODE  (PORT_SELECTION1 | INPUT_PULLUP)
#define SPISCK_SET_MODE  (PORT_SELECTION1)
#define SPIMOSI_SET_MODE (PORT_SELECTION1)
#define SPIMISO_SET_MODE (PORT_SELECTION1)
#endif

#if defined(__MSP430_HAS_EUSCI_A0__) || defined(__MSP430_HAS_EUSCI_A1__)
static const uint8_t DEBUG_UARTRXD = 25;  /* Receive  Data (RXD) at P2.1 */
static const uint8_t DEBUG_UARTTXD = 24;  /* Transmit Data (TXD) at P2.0 */
#define DEBUG_UARTRXD_SET_MODE (PORT_SELECTION1 | INPUT)
#define DEBUG_UARTTXD_SET_MODE (PORT_SELECTION1 | OUTPUT)
#define DEBUG_UART_MODULE_OFFSET 0x00
#endif


/* Analog pins */
static const uint8_t A0  = 1;  /* 1 - P1.0 */
static const uint8_t A1  = 2;  /* 2 - P1.1 */
static const uint8_t A2  = 3;  /* 2 - P1.3 */
static const uint8_t A3  = 9;  /* 9 - P1.3 */
static const uint8_t A4  = 10; /* 10 - P1.4 */
static const uint8_t A5  = 11; /* 11 - P1.5 */
static const uint8_t A6  = 39; /* 39 - P2.3 */
static const uint8_t A7  = 40; /* 40 - P2.4 */
static const uint8_t A8  = 16; /* 16 - P4.0 */
static const uint8_t A9  = 17; /* 17 - P4.1 */
static const uint8_t A10 = 18; /* 18 - P4.2 */
static const uint8_t A11 = 19; /* 19 - P4.3 */
static const uint8_t A12 = 4;  /* 4 - P3.0 */
static const uint8_t A13 = 5;  /* 5 - P3.1 */
static const uint8_t A14 = 6;  /* 6 - P3.2 */
static const uint8_t A15 = 7;  /* 7 - P3.3 */


/* Layout of the 2 - 10 pin headers.

   All pins support digitalWrite() and attachInterrupt()
   Pins marked with PWM support anaglogWrite()
   Pins marked with Ax support analogRead()

                                          +---\/---+
                                   VCC0  1|        |20  GND
                            (A10)  P4.2  2|        |19  P1.2                 (PWM)
(PWM)                              P2.6  3|        |18  P3.0            (A12)(PWM)
(PWM)                              P2.5  4|        |17  TEST
                            (A11)  P4.3  5|        |16  RST         
(PWM)                              P2.4  6|        |15  P1.6                 (PWM)
(PWM)                              P2.2  7|        |14  P1.7                 (PWM)
(PWM)                              P3.4  8|        |13  P1.5                 (PWM)
(PWM)                              P3.5  9|        |12  P1.4                 (PWM)
(PWM)                              P3.6 10|        |11  P1.3                 (PWM)
                                          +--------+


                                               ----+
                                                   |21  DebugUART TX  (P2.0) (PWM)
                     J13 eZ-FET Connector          |22  DebugUART RX  (P2.1) (PWM)
                                                   |23  DebugUART CTS (P4.0) (A8)
                                                   |24  DebugUART RTS (P4.1) (A9)
                                               ----+
                                               ----+
                                                   |25  LED1       (P4.6)
                     Extra LED's and Switches      |26  LED2       (P1.0)
                                                   |27  PUSH1      (P4.5)
                                                   |28  PUSH2      (P1.1)
                                               ----+
                                               ----+
                                                   |29  TDO        (PJ.0)
                     JTAG Connector J3             |30  TDI        (PJ.1)
                                                   |31  TMS        (PJ.2)
                                                   |32  TCK        (PJ.3)
                                               ----+
*/

// Pin names based on the silkscreen
//<commit_msg>Fix pin numbers for debug UART<commit_after>/*
  ************************************************************************
  *	pins_energia.h
  *
  *	Pin definition functions for LaunchPad w/ msp430fr5969
  *		Copyright (c) 2012 <NAME>. All right reserved.
  *
  *     Contribution: <NAME>
  *
  ***********************************************************************
  Derived from:
  pins_arduino.h - Pin definition functions for Arduino
  Part of Arduino - http://www.arduino.cc/

  Copyright (c) 2007 <NAME>

  This library is free software; you can redistribute it and/or
  modify it under the terms of the GNU Lesser General Public
  License as published by the Free Software Foundation; either
  version 2.1 of the License, or (at your option) any later version.

  This library is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  Lesser General Public License for more details.

  You should have received a copy of the GNU Lesser General
  Public License along with this library; if not, write to the
  Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  Boston, MA  02111-1307  USA
*/

#ifndef Pins_Energia_h
#define Pins_Energia_h
#ifndef BV
#define BV(x) (1 << (x))
#endif


#if defined(__MSP430_HAS_EUSCI_B0__)
static const uint8_t SS      = 9;   /* P1.3 */
static const uint8_t SCK     = 26;  /* P2.2 */
static const uint8_t MOSI    = 31;  /* P1.6 aka SIMO */
static const uint8_t MISO    = 32;  /* P1.7 aka SOMI */
static const uint8_t TWISDA  = 31;  /* P1.6 */
static const uint8_t TWISCL  = 32;  /* P1.7 */
#define TWISDA_SET_MODE  (PORT_SELECTION1 | INPUT_PULLUP)
#define TWISCL_SET_MODE  (PORT_SELECTION1 | INPUT_PULLUP)
#define SPISCK_SET_MODE  (PORT_SELECTION1)
#define SPIMOSI_SET_MODE (PORT_SELECTION1)
#define SPIMISO_SET_MODE (PORT_SELECTION1)
#endif

#if defined(__MSP430_HAS_EUSCI_A0__) || defined(__MSP430_HAS_EUSCI_A1__)
static const uint8_t DEBUG_UARTRXD = 22;  /* Receive  Data (RXD) at P2.1 */
static const uint8_t DEBUG_UARTTXD = 21;  /* Transmit Data (TXD) at P2.0 */
#define DEBUG_UARTRXD_SET_MODE (PORT_SELECTION1 | INPUT)
#define DEBUG_UARTTXD_SET_MODE (PORT_SELECTION1 | OUTPUT)
#define DEBUG_UART_MODULE_OFFSET 0x00
#endif


/* Analog pins */
static const uint8_t A0  = 1;  /* 1 - P1.0 */
static const uint8_t A1  = 2;  /* 2 - P1.1 */
static const uint8_t A2  = 3;  /* 2 - P1.3 */
static const uint8_t A3  = 9;  /* 9 - P1.3 */
static const uint8_t A4  = 10; /* 10 - P1.4 */
static const uint8_t A5  = 11; /* 11 - P1.5 */
static const uint8_t A6  = 39; /* 39 - P2.3 */
static const uint8_t A7  = 40; /* 40 - P2.4 */
static const uint8_t A8  = 16; /* 16 - P4.0 */
static const uint8_t A9  = 17; /* 17 - P4.1 */
static const uint8_t A10 = 18; /* 18 - P4.2 */
static const uint8_t A11 = 19; /* 19 - P4.3 */
static const uint8_t A12 = 4;  /* 4 - P3.0 */
static const uint8_t A13 = 5;  /* 5 - P3.1 */
static const uint8_t A14 = 6;  /* 6 - P3.2 */
static const uint8_t A15 = 7;  /* 7 - P3.3 */


/* Layout of the 2 - 10 pin headers.

   All pins support digitalWrite() and attachInterrupt()
   Pins marked with PWM support anaglogWrite()
   Pins marked with Ax support analogRead()

                                          +---\/---+
                                   VCC0  1|        |20  GND
                            (A10)  P4.2  2|        |19  P1.2            (A2) (PWM)
(PWM)                              P2.6  3|        |18  P3.0            (A12)(PWM)
(PWM)  (UCA1RXD -> Serial1)        P2.5  4|        |17  TEST
       (UCA1TXD -> Serial1) (A11)  P4.3  5|        |16  RST
(PWM)                              P2.4  6|        |15  P1.6 (SDA) (MOSI)    (PWM)
(PWM)                              P2.2  7|        |14  P1.7 (SCL) (MISO)    (PWM)
(PWM)                              P3.4  8|        |13  P1.5            (A5) (PWM)
(PWM)                              P3.5  9|        |12  P1.4            (A4) (PWM)
(PWM)                              P3.6 10|        |11  P1.3            (A3) (PWM)
                                          +--------+


                                               ----+
                                                   |21  DebugUART TX  (P2.0) (PWM)
                     J13 eZ-FET Connector          |22  DebugUART RX  (P2.1) (PWM)
                                                   |23  DebugUART CTS (P4.0) (A8)
                                                   |24  DebugUART RTS (P4.1) (A9)
                                               ----+
                                               ----+
                                                   |25  LED1       (P4.6)
                     Extra LED's and Switches      |26  LED2       (P1.0)
                                                   |27  PUSH1      (P4.5)
                                                   |28  PUSH2      (P1.1)
                                               ----+
                                               ----+
                                                   |29  TDO        (PJ.0)
                     JTAG Connector J3             |30  TDI        (PJ.1)
                                                   |31  TMS        (PJ.2)
                                                   |32  TCK        (PJ.3)
                                               ----+
*/

// Pin names based on the silkscreen
//
{'fraction_non_alphanumeric': 0.12095431847604957, 'fraction_numerical': 0.06306639541335306, 'mean_word_length': 1.2601880877742946, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 85, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5034534', 'n_tokens_mistral': 3737, 'n_tokens_neox': 3375, 'n_words': 1039}