/**
  ************************************* Copyright ****************************** 
  *
  *                 Copyright (C), 2012-2016, Radioway Tech. Co., Ltd.
  *                            All Rights Reserved
  *
  *    
  * FileName   : main.c
  * Version    : v1.0
  * Author     : Heb
  * Date       : 2024-06-24
  * Description: 
  * Function List: 
  	1. ....
          <version>: 
     <modify staff>: 
             <data>: 
      <description>: 
  	2. ...
  ******************************************************************************
 */

#include "board.h"
#include "rf.h"

#define RF_CARRIER_OPEN                    0
#define RF_TX_ROLE                         1
uint8_t  len = 0;
uint8_t  rf_rx_buf[32];
uint8_t  rf_tx_buf[32];

int main()
{
    board_init();
    
    
    hs6220_init();
    
    
#if  RF_CARRIER_OPEN
    hs6220_ce_low();
    hs6220_write(HS6220_BANK0_RF_CH, 02);
    hs6220_mode_switch(HS6220_Carrier_Mode);
    hs6220_ce_high();
    while(1);
#endif    
    
#if RF_TX_ROLE    
    for (uint8_t i=0;i<32;i++)
    {
        rf_tx_buf[i] = i+1;
    }
#endif
    
    while(1)
    {
#if RF_TX_ROLE
        hs6220_send(rf_tx_buf, 16);
        delay_ms(1000);
#else
        len =  hs6220_receive_pack(rf_rx_buf);
        
        if(len != 0)
        {
            
        }        
#endif
    }
}

    
