Atmel Software Framework

EdDemo.c File Reference

Energy Detection Demo application implementation.

Copyright (C) 2014-2015 Atmel Corporation. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. The name of Atmel may not be used to endorse or promote products derived from this software without specific prior written permission.
  4. This software may only be redistributed and used in connection with an Atmel microcontroller product.

THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "config.h"
#include "phy.h"
#include "sys.h"
#include "nwk.h"
#include "sysTimer.h"
#include "sio2host.h"
#include "led.h"
#include "sysclk.h"
#include "asf.h"

Typedefs

typedef enum AppState_t AppState_t
 

Enumerations

enum  AppState_t {
  APP_STATE_INITIAL,
  APP_STATE_IDLE,
  APP_STATE_INITIAL,
  APP_STATE_IDLE,
  APP_STATE_INITIAL,
  APP_STATE_MEASURE_ED,
  APP_STATE_WAIT_SCAN_TIMER,
  APP_STATE_INITIAL,
  APP_STATE_SEND,
  APP_STATE_WAIT_CONF,
  APP_STATE_SENDING_DONE,
  APP_STATE_WAIT_SEND_TIMER,
  APP_STATE_WAIT_COMMAND_TIMER,
  APP_STATE_PREPARE_TO_SLEEP,
  APP_STATE_SLEEP,
  APP_STATE_WAKEUP
}
 

Functions

static void APP_TaskHandler (void)
 
static void appInit (void)
 
static void appPrintEdValues (void)
 
static void appScanTimerHandler (SYS_Timer_t *timer)
 
int main (void)
 

Variables

static uint8_t appEdValue [APP_LAST_CHANNEL-APP_FIRST_CHANNEL+1]
 
static SYS_Timer_t appScanTimer
 
static AppState_t appState = APP_STATE_INITIAL
 

typedef enum AppState_t AppState_t

enum AppState_t
Enumerator
APP_STATE_INITIAL 
APP_STATE_IDLE 
APP_STATE_INITIAL 
APP_STATE_IDLE 
APP_STATE_INITIAL 
APP_STATE_MEASURE_ED 
APP_STATE_WAIT_SCAN_TIMER 
APP_STATE_INITIAL 
APP_STATE_SEND 
APP_STATE_WAIT_CONF 
APP_STATE_SENDING_DONE 
APP_STATE_WAIT_SEND_TIMER 
APP_STATE_WAIT_COMMAND_TIMER 
APP_STATE_PREPARE_TO_SLEEP 
APP_STATE_SLEEP 
APP_STATE_WAKEUP 

static void appPrintEdValues ( void  )
static
static void appScanTimerHandler ( SYS_Timer_t timer)
static

References APP_STATE_MEASURE_ED, and appState.

Referenced by appInit().

uint8_t appEdValue[APP_LAST_CHANNEL-APP_FIRST_CHANNEL+1]
static
SYS_Timer_t appScanTimer
static