/*******************************************************************************
 * @file	meas_pd_voltage_custom.h

 ******************************************************************************/

#ifndef _MEAS_PD_VOLTAGE_CUSTOM_H__
#define _MEAS_PD_VOLTAGE_CUSTOM_H__

#include "sdk_common.h"
#include "nrf_drv_saadc.h"

#ifndef ADA2200_SYNCO_PIN
#define ADA2200_SYNCO_PIN		NRF_GPIO_PIN_MAP(0,17)
#endif


#define CUSTOM_PD_NO				4
#define CUSTOM_LED_NO				5
#define CUSTOM_CYCLE_CNT 			32


void custom_ppi_init(void);
void custom_ppi_uninit(void);
void custom_sampling_event_enable(void);
void custom_sampling_event_disable(void);

/**@brief Function for handling the ADC interrupt.
 *
 * @details  This function will fetch the conversion result from the ADC, convert the value into
 *           percentage and send it to peer.
 */
static void imm_voltage_handler(nrf_drv_saadc_evt_t const * p_event);	/* PD Voltage reading */
void custom_adc_start(void);
void custom_adc_start2(void);
void custom_adc_total_start(void);
void custom_adc_end(void);
void custom_adc_end_2(void);
void custom_adc_init(void);
void custom_adc_uninit(void);
#if !FEATURE_PRINTF
void custom_irq_init(void);
void custom_irq_uninit(void);
#endif
void custom_send_start(void);



void custom_send_loop(void * p_context);	/* For x ms */
void custom_send_timer_start(void);
void custom_send_timer_stop(void);;
void custom_send_timer_init(void);


void custom_check_loop(void * p_context);	
void custom_check_timer_start(void);
void custom_check_timer_stop(void);;
void custom_check_timer_init(void);

#endif /* _MEAS_PD_VOLTAGE_CUSTOM_H__ */

