#ifndef	_EsbProcess_H_
#define	_EsbProcess_H_

#include "nrf_esb.h"

#define	RX					0
#define	TX					1

// Definition of the data received callback, which is used to relay packets back to the application
typedef void (*esb_packet_received_t)(uint8_t *packet, uint32_t packet_length);

extern	nrf_esb_payload_t			rx_payload;
extern	nrf_esb_payload_t			tx_payload;
extern	unsigned long	PacketSendCnt;
extern	unsigned long	PacketSendOKCnt;
extern	unsigned long	PacketSentNGCnt;
extern	unsigned long	PacketReceiveOKCnt;
extern	unsigned long	PacketReceiveNGCnt;

#define	EsbPacketLength				250
#define	Network_ID					0x12
#define	Esb_Address_0				0x80808080
#define	Esb_Address_1				0x11111111

extern	uint32_t esb_init(uint16_t network_id, uint32_t Address_0, uint32_t Address_1, esb_packet_received_t esb_received_callback);
extern	bool esb_packet_send(uint8_t *packet, uint32_t packet_length);

#define	EsbTestUartEnsable							// 有定義 -> UART 印出送收封包的訊息
#endif		// _EsbProcess_H_
