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

projects/nrfgo_sdk/gazell_examples/gzll_host/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 void main(void)
00034 {
00035   uint8_t payload[GZLL_MAX_PAYLOAD_LENGTH];
00036 
00037   mcu_init();
00038   gzll_init();
00039 
00040   // Set P0 as output
00041   P0DIR = 0;                                          
00042 
00043   EA = 1;
00044   
00045   // Enter host mode (start monitoring for data)
00046   gzll_rx_start();                                          
00047   
00048   for(;;)
00049   {      
00050     // If data received
00051     if(gzll_rx_fifo_read(payload, NULL, NULL))
00052     {
00053       // Write received payload[0] to port 0
00054       P0 = payload[0];
00055     }
00056   } 
00057 }
00058 

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