
#ifndef BOARD_ISP160902_H
#define BOARD_ISP160902_H


#include <stdbool.h>
#include <stdint.h>

/** @file
* @brief isp160902 testboard hardware setup and power supply control
*
*/

// *****************************//
// LEDs definitions
// *****************************//
#define 	LEDS_NUMBER   		2

#define LED_START      11
#define LED_1          11
#define LED_2          18
#define LED_STOP       18

#define LEDS_LIST { LED_1, LED_2 }

#define BSP_LED_0      LED_2
#define BSP_LED_1      LED_1

#define BSP_LED_0_MASK (1<<BSP_LED_0)
#define BSP_LED_1_MASK (1<<BSP_LED_1)

#define LEDS_MASK      (BSP_LED_0_MASK | BSP_LED_1_MASK)
/* all LEDs are lit when GPIO is low */
#define LEDS_INV_MASK  LEDS_MASK

// *****************************//
// Buttons definitions
// *****************************//
#define BUTTONS_NUMBER 0

//#define BUTTON_START   13
//#define BUTTON_1       13
//#define BUTTON_2       14
//#define BUTTON_3       15
//#define BUTTON_4       16
//#define BUTTON_STOP    16
//#define BUTTON_PULL    NRF_GPIO_PIN_PULLUP

// *****************************//
// UART definitions
// *****************************//
#define FTDI_RX_PIN_NUMBER  14
#define FTDI_TX_PIN_NUMBER  16

#define RX_PIN_NUMBER  20
#define TX_PIN_NUMBER  18	
#define CTS_PIN_NUMBER 7	
#define RTS_PIN_NUMBER 5	
#define HWFC           false
	
// *****************************//
// SPI definitions
// *****************************//
#define SPIM0_SCK_PIN   8	// SPI clock GPIO pin number.
#define SPIM0_MOSI_PIN  17  // SPI Master Out Slave In GPIO pin number.
#define SPIM0_MISO_PIN  24	// SPI Master In Slave Out GPIO pin number.
#define SPIM0_SS_PIN    23	// SPI Slave Select GPIO pin number.

// *****************************//
// GPIOs definitions
// *****************************//
#define 	PIN_DECA_WAKEUP	 	13	 	//	Type : O	Default : O logic 0
#define 	PIN_DECA_INT	 	22	 	//	Type : I	Default : I
	
// Low frequency clock source to be used by the SoftDevice (SDK 12)
#define NRF_CLOCK_LFCLKSRC      {.source        = NRF_CLOCK_LF_SRC_XTAL,            \
                                 .rc_ctiv       = 0,                                \
                                 .rc_temp_ctiv  = 0,                                \
                                 .xtal_accuracy = NRF_CLOCK_LF_XTAL_ACCURACY_20_PPM}

#endif 
