#ifndef __MAIN_H
#define __MAIN_H

#include "hw.h"
#include "string.h"
#include "radio.h"

#define FACTORY_TEST_VERSION    "V1.0"  

#define RF_BL_ADV_CHANNEL_38    2426000000

#define RF_FREQUENCY            RF_BL_ADV_CHANNEL_38 

#define TX_OUTPUT_POWER         13

#define BUFFER_SIZE             20

#define TX_TIMEOUT_VALUE        10000 // ms

#define RX_TIMEOUT_VALUE        1000  //ms

#define RX_TIMEOUT_TICK_SIZE    RADIO_TICK_SIZE_1000_US

#define PINGPONGSIZE            4


void OnTxDone( void );
void OnRxDone( void );
void OnTxTimeout( void );
void OnRxTimeout( void );
void OnRxError( IrqErrorCode_t );
typedef enum
{
    APP_LOWPOWER,
    APP_RX,
    APP_RX_TIMEOUT,
    APP_RX_ERROR,
    APP_TX,
    APP_TX_TIMEOUT,
}AppStates_t;


uint8_t BufferSize = BUFFER_SIZE;
uint8_t Buffer[BUFFER_SIZE];
uint16_t RxIrqMask = IRQ_RX_DONE | IRQ_RX_TX_TIMEOUT;
uint16_t TxIrqMask = IRQ_TX_DONE | IRQ_RX_TX_TIMEOUT;


AppStates_t AppState = APP_LOWPOWER;

PacketParams_t packetParams;
PacketStatus_t packetStatus;

RadioCallbacks_t Callbacks =
{
    &OnTxDone,        // txDone
    &OnRxDone,        // rxDone
    NULL,             // syncWordDone
    NULL,             // headerDone
    &OnTxTimeout,     // txTimeout
    &OnRxTimeout,     // rxTimeout
    &OnRxError,       // rxError
    NULL,             // cadDone
};





#endif
