#ifndef __ALPS_H__
#define __ALPS_H__

#ifdef __cplusplus
extern "C" {
#endif
#include "alps_config.h"
#include "nrf_gpio.h"

// ALPS board mappings

#ifdef ALPS_IN_PCA10040
#define LEDS_NUMBER             3

//#define LED_START               17
//#define LED_1                   17
#define LED_2                   18
#define LED_3                   19
#define LED_4                   20
#define LED_STOP                20

#define LEDS_ACTIVE_STATE       0

#define LEDS_INV_MASK           LEDS_MASK

#define LEDS_LIST               {LED_2, LED_3, LED_4 }

//#define BSP_LED_0               LED_1
#define BSP_LED_1               LED_2
#define BSP_LED_2               LED_3
#define BSP_LED_3               LED_4
#endif // ALPS_IN_PCA10040

#ifdef ALPS_IN_PCA10040
#define BUTTONS_NUMBER          3

#define BUTTON_A                13    // P0_13
#define BUTTON_B                14     // P0_14
#define BUTTON_MENU             15     // P0_15
#elif defined(BOARD_ALPS)
#define BUTTONS_NUMBER          3

#define BUTTON_A                16    // P0_16
#define BUTTON_B                0     // P0_00
#define BUTTON_MENU             1     // P0_01
#endif

#define BUTTON_PULL             NRF_GPIO_PIN_PULLUP

#define BUTTONS_ACTIVE_STATE    0

#define BUTTONS_LIST            { BUTTON_A, BUTTON_B, BUTTON_MENU}

/* define for DV7280-00FV2 */
#define GPI_O_PWM_PIN           (28)  // P0_28
#define HATPIC_NIRQ_PIN         (25)  // P0_25

/* I2C Pin Configure */
#define CS_SCL_PIN              (23)  //  CS,P0_23
#define SDA_SDA_PIN             (24)  //  CS,P0_24

#define HATPIC_SDA_PIN          (27)  // P0_27
#define HATPIC_SCL_PIN          (26)  // P0_26

/* ADC Pin*/
#define JOY_VRY_PIN             (NRF_SAADC_INPUT_AIN5)
#define JOY_VRX_PIN             (NRF_SAADC_INPUT_AIN6)
#define DRY_BAT_V_C_PIN         (NRF_SAADC_INPUT_AIN2)
#define LI_BAT_V_C_PIN          (NRF_SAADC_INPUT_AIN3)
#define LIBAT_L_C
/* interrupt gpio pin */
#define BAT_CHG_INT_PIN         (8)   // P0_08
#define IMU_RDY_INT_PIN         (17)  // P0_17
#define NVBUS_DET_INT_PIN       (10)  // P0_10

/* output ctrl pin */
#define DRY_BAT_CTRL_PIN        (19)  // P0_19
#define LI_BAT_CTRL_PIN         (20)  // P0_20
#define BAT_CHARGE_CTRL_PIN     (9)   // P0_09
/* uart pin */
//#define RX_PIN_NUMBER           8
//#define TX_PIN_NUMBER           6
//#define CTS_PIN_NUMBER          7
//#define RTS_PIN_NUMBER          5
//#define HWFC           true

//#define SPIS_MISO_PIN   28  // SPI MISO signal.
//#define SPIS_CSN_PIN    12  // SPI CSN signal.
//#define SPIS_MOSI_PIN   25  // SPI MOSI signal.
//#define SPIS_SCK_PIN    29  // SPI SCK signal.

//#define SPIM0_SCK_PIN   29  // SPI clock GPIO pin number.
//#define SPIM0_MOSI_PIN  25  // SPI Master Out Slave In GPIO pin number.
//#define SPIM0_MISO_PIN  28  // SPI Master In Slave Out GPIO pin number.
//#define SPIM0_SS_PIN    12  // SPI Slave Select GPIO pin number.

//#define SPIM1_SCK_PIN   2   // SPI clock GPIO pin number.
//#define SPIM1_MOSI_PIN  3   // SPI Master Out Slave In GPIO pin number.
//#define SPIM1_MISO_PIN  4   // SPI Master In Slave Out GPIO pin number.
//#define SPIM1_SS_PIN    5   // SPI Slave Select GPIO pin number.

#define SPIM2_SCK_PIN   14  // SPI clock GPIO pin number.
#define SPIM2_MOSI_PIN  12  // SPI Master Out Slave In GPIO pin number.
#define SPIM2_MISO_PIN  13  // SPI Master In Slave Out GPIO pin number.
#define SPIM2_SS_PIN    11  // SPI Slave Select GPIO pin number.

//// serialization APPLICATION board - temp. setup for running serialized MEMU tests
//#define SER_APP_RX_PIN              23    // UART RX pin number.
//#define SER_APP_TX_PIN              24    // UART TX pin number.
//#define SER_APP_CTS_PIN             2     // UART Clear To Send pin number.
//#define SER_APP_RTS_PIN             25    // UART Request To Send pin number.

//#define SER_APP_SPIM0_SCK_PIN       27     // SPI clock GPIO pin number.
//#define SER_APP_SPIM0_MOSI_PIN      2      // SPI Master Out Slave In GPIO pin number
//#define SER_APP_SPIM0_MISO_PIN      26     // SPI Master In Slave Out GPIO pin number
//#define SER_APP_SPIM0_SS_PIN        23     // SPI Slave Select GPIO pin number
//#define SER_APP_SPIM0_RDY_PIN       25     // SPI READY GPIO pin number
//#define SER_APP_SPIM0_REQ_PIN       24     // SPI REQUEST GPIO pin number

//// serialization CONNECTIVITY board
//#define SER_CON_RX_PIN              24    // UART RX pin number.
//#define SER_CON_TX_PIN              23    // UART TX pin number.
//#define SER_CON_CTS_PIN             25    // UART Clear To Send pin number. Not used if HWFC is set to false.
//#define SER_CON_RTS_PIN             2     // UART Request To Send pin number. Not used if HWFC is set to false.


//#define SER_CON_SPIS_SCK_PIN        27    // SPI SCK signal.
//#define SER_CON_SPIS_MOSI_PIN       2     // SPI MOSI signal.
//#define SER_CON_SPIS_MISO_PIN       26    // SPI MISO signal.
//#define SER_CON_SPIS_CSN_PIN        23    // SPI CSN signal.
//#define SER_CON_SPIS_RDY_PIN        25    // SPI READY GPIO pin number.
//#define SER_CON_SPIS_REQ_PIN        24    // SPI REQUEST GPIO pin number.

//#define SER_CONN_CHIP_RESET_PIN     11    // Pin used to reset connectivity chip


#ifdef __cplusplus
}
#endif

#endif // PCA10040_H
