• Main Page
  • Modules
  • Index
  • File List
  • Globals

projects/nrfgo_sdk/gazell_examples/gzll_host_ack_payload/main.c

Go to the documentation of this file.
00001 /* Copyright (c) 2009 Nordic Semiconductor. All Rights Reserved.
00002  *
00003  * The information contained herein is confidential property of Nordic 
00004  * Semiconductor ASA.Terms and conditions of usage are described in detail 
00005  * in NORDIC SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. 
00006  *
00007  * Licensees are granted free, non-transferable use of the information. NO
00008  * WARRENTY of ANY KIND is provided. This heading must NOT be removed from
00009  * the file.
00010  *              
00011  * $LastChangedRevision: 133 $
00012  */
00013 
00030 #include "gzll_mcu.h"
00031 #include "gzll.h"
00032 
00033 uint8_t packet_cnt = 0;
00034 
00035 void main(void)
00036 {
00037   uint8_t payload[GZLL_MAX_PAYLOAD_LENGTH];
00038 
00039   mcu_init();
00040   gzll_init();
00041 
00042   // Set P0 as output
00043   P0DIR = 0;                                          
00044 
00045   EA = 1;
00046   
00047   // Enter host mode (start monitoring for data)
00048   gzll_rx_start();                                          
00049   
00050   for(;;)
00051   {      
00052     // If data received
00053     if(gzll_rx_fifo_read(payload, NULL, NULL))
00054     {
00055        P0 = ~payload[0];
00056         
00057        payload[0] = P2;
00058        gzll_ack_payload_write(payload, 1, 0);
00059     }
00060   } 
00061 }
00062 

Generated on Fri Apr 20 2012 14:11:45 for nRFGo SDK by  doxygen 1.7.2