Application module


Detailed Description

This module manages the application stuff from bringing up the TCPIP Stack, doing all the user interactions for this and initializing and handle the child modules.


Files

file  adc.c
 Implementation of ADC conversion.
file  adc.h
 API for analog channel access.
file  appl.c
 This file implements the Netzer application module.
file  timer.asm
 This file handles the low priority interrupt and the tick counter.
file  appl.h
 This file includes the Netzer application module API.
file  flash.c
 Implementation of flash routines.
file  flash.h
 API for accessing the internal flash memory.
file  helper.h
 API for misc helper functions.
file  helper.h
 API for misc helper functions.
file  netzerTypedefs.h
 Defines common typedefs for use in Netzer projects.
file  time.h
 API fo using the time module.
file  toa.h
 API fo using the assembler conversion routines.

Defines

#define BOOTUP_EEPROM_ADD   (0x0000u)
 EEPROM byte address for application network data.
#define PROJECT_EEPROM_ADD   (0x0030u)
 EEPROM byte address for application data.
#define SNTP_EEPROM_ADD   (0x0070u)
 EEPROM byte address for SNTP server URL.
#define AUTHENT_EEPROM_ADD   (0x0090u)
 EEPROM byte address for authentication data.
#define MAC_EEPROM_ADD   (0x00FAu)
 This EEPROM address stores the predefined 6 byte IEEE MAC address which is used by the TCP/IP stack.

Enumerations

enum  ApplCommands_t {
  APPL_CMD_IDLE = 0, APPL_CMD_RESTART, APPL_CMD_RESET_TO_FACTORY, APPL_CMD_SHUTDOWN,
  APPL_CMD_BOOTLOADER, APPL_CMD_BLINK, APPL_CMD_COUNT
}
 This typedef defines some common commands for the application. More...
enum  NetzerState_t {
  NETZER_STARTING = 0, NETZER_NOLINK, NETZER_IP_ERROR, NETZER_READY,
  NETZER_SHUTDOWN
}
 The device states as enumerator. More...

Functions

BOOL ApplInit (void)
 Call this function to initialize the application module.
void ApplMain (void)
 Call this function periodically to execute the application module.
void ApplResetToFactory (void)
 This function restores the EEPROM content to a well known state.
BOOL ApplIsRunning (void)
 The function is the indicator for the running application.
void ApplStop (void)
 This function finally stops the application, i.e.
void ApplCommand (ApplCommands_t Command)
 Call this function to execute several application commands.
void ApplStateChanged (NetzerState_t NewState)
 This function is called by different core modules to indicate Netzer state changes.
NetzerState_t ApplGetCurrentState (void)
 This function can be called to obtain the current state of Netzer.


Define Documentation

#define AUTHENT_EEPROM_ADD   (0x0090u)

EEPROM byte address for authentication data.

The data consists of one user/password combination which is stored here. Each, user and password can have a length of 8 bytes.

#define BOOTUP_EEPROM_ADD   (0x0000u)

EEPROM byte address for application network data.

See CommonConfig_t for a detailed documentation of the structure elements. On startup the data is loaded into RAM (sPCommonConfig).

#define PROJECT_EEPROM_ADD   (0x0030u)

EEPROM byte address for application data.

Each Netzer project is free to use the EEPROM space from this address. The boot module checks for different project contents and migrates the EEPROM content if necessary.

#define SNTP_EEPROM_ADD   (0x0070u)

EEPROM byte address for SNTP server URL.

Server name can be up to 32 bytes.


Enumeration Type Documentation

This typedef defines some common commands for the application.

This commands can executed with the ApplCommand function.

Enumerator:
APPL_CMD_IDLE  This command is used as a NOP command.
APPL_CMD_RESTART  Restarts the device.
APPL_CMD_RESET_TO_FACTORY  Restartes the device and loads default values to EEPROM.
APPL_CMD_SHUTDOWN  Shuts down the device.
APPL_CMD_BOOTLOADER  Restarts the device and enters bootloader.
APPL_CMD_BLINK  Starts or stops the blinking of the network LED.
APPL_CMD_COUNT  Dummy for getting the count of all commands.

The device states as enumerator.

Enumerator:
NETZER_STARTING  Netzer is starting, bootup.
NETZER_NOLINK  Netzer is idle but has no network link.
NETZER_IP_ERROR  Netzer has network link but no valid IP address.
NETZER_READY  Netzer is ready and has a valid IP address.
NETZER_SHUTDOWN  Netzer currently is shutting down.


Function Documentation

void ApplCommand ( ApplCommands_t  Command  ) 

Call this function to execute several application commands.

Parameters:
Command The command which should be executed.

NetzerState_t ApplGetCurrentState ( void   ) 

This function can be called to obtain the current state of Netzer.

Returns:
The current state as enumerated value.

BOOL ApplInit ( void   ) 

Call this function to initialize the application module.

Return values:
TRUE Initialization was successful.
FALSE Initialization failed.

BOOL ApplIsRunning ( void   ) 

The function is the indicator for the running application.

Return values:
TRUE The application module is running.
FALSE The application has reached the final state (shut down).

void ApplMain ( void   ) 

Call this function periodically to execute the application module.

void ApplResetToFactory ( void   ) 

This function restores the EEPROM content to a well known state.

void ApplStateChanged ( NetzerState_t  NewState  ) 

This function is called by different core modules to indicate Netzer state changes.

Note:
There is an implementation hook PROJECT_STATE_CHANGED for handle this in several projects.
Parameters:
NewState New Netzer state as enumerated value.

void ApplStop ( void   ) 

This function finally stops the application, i.e.

in case of shut down.


Generated on Fri Mar 29 10:34:28 2013 for Netzer by  doxygen 1.5.5