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

projects/nrfgo_sdk/gazell_examples/gzll_device_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 
00031 //lint -e534
00032 
00033 #include "gzll_mcu.h"
00034 #include "gzll.h"
00035 
00036 void main(void)
00037 {
00038   uint8_t payload[GZLL_MAX_PAYLOAD_LENGTH];
00039   uint8_t packet_cnt = 0;
00040   uint8_t rx_packet_cnt = 0;
00041   uint8_t rx_packet_byte0 = 0;
00042 
00043   mcu_init();
00044   gzll_init();
00045 
00046   // Set P0 as output
00047   P0DIR = 0;    
00048 
00049   EA = 1;
00050 
00051   for(;;)
00052   {      
00053     // If gazell link layer idle
00054     if(gzll_get_state() == GZLL_IDLE)
00055     {
00056       if(gzll_rx_fifo_read(payload, NULL, NULL))
00057       {
00058         P0 = ~payload[0];
00059       }
00060 
00061       // Put P0 contents in payload[0]
00062       payload[0] = P2;
00063        
00064       // Transmits payload[] to pipe 0 address
00065       gzll_tx_data(payload, 1, 0);   
00066     }
00067   }  
00068 }
00069 

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