//******************************************************* //----------------- Appcfg Configuration ----------------- //******************************************************** //Define if this application has an 8 bit ADC converter, 10 bit ADC converter or none at all. //#define APP_USE_ADC8 //#define APP_USE_ADC10 //Define buffer space that is reserved for ADC conversion values. For a 8 bit ADC converted, 1 byte //is reserved per channel. For an 10 bit ADC, 2 bytes are reserved per channel. //#define ADC_CHANNELS 12
#include "net\ip.h"
| #define APPCFG_NETFLAGS_DHCP 0x01 |
Mask for bits in APPCFG_NETFLAGS config byte.
| #define APPCFG_SMALLER_256 |
Define this if APP_CONFIG is smaller then 256 bytes. When this is defined the code knows that it only need 1 byte to address all configuration bytes. This produces smaller and faster code.
| #define APPCFG_USERNAME_LEN 9 |
| #define appcfgGetcAtField | ( | field | ) | appcfgGetc(offsetof(APP_CONFIG, field)) |
Gets a specified byte from the APP_CONFIG configuration structure
| field | The byte to get from the APP_CONFIG structure. For example "MyMask.v[0]" |
| #define appcfgPutc | ( | offset, | |||
| value | ) | EEDATA = (value); _appcfgPutc(offset) |
Set a specified byte in the APP_CONFIG configuration structure to a given value. This function will only update the EEPROM if the given new value is different from the current old value. This saves the EEPROM, and increases it's live!
| offset | The byte to set in the APP_CONFIG structure. Use the APPCFG_X defines | |
| value | Contains the value to set the given byte to |
| #define appcfgPutcAtField | ( | field, | |||
| value | ) | EEDATA = (value); _appcfgPutc(offsetof(APP_CONFIG, field)) |
Set a specified byte from the APP_CONFIG configuration structure to a given value.
| field | The byte to set in the APP_CONFIG structure. For example "MyMask.v[0]" | |
| value | Contains the value to set the given byte to |
| #define BAUD_115200 8 |
| #define BAUD_1200 1 |
| #define BAUD_19200 5 |
| #define BAUD_230400 9 |
| #define BAUD_2400 2 |
| #define BAUD_300 0 |
| #define BAUD_38400 6 |
| #define BAUD_460800 10 |
| #define BAUD_4800 3 |
| #define BAUD_57600 7 |
| #define BAUD_921600 11 |
| #define BAUD_9600 4 |
Structure for storing ADC configuration data. Data is stored in internal EEPROM
| typedef struct _APP_CONFIG APP_CONFIG |
Structure for storing application configuration data that needs fast access. This structure is created in the processors internal RAM, and is initialized with the contents of the corresponding bytes in EEPROM at startup. Whenever the application needs to access any of these variables, it will read them straight from this RAM structure in stead of reading them from the EEPROM.
Structure for storing port configuration data. Data is stored in internal EEPROM
| typedef struct _PORT_VALUES PORT_VALUE |
Structure for storing default port value. Data is stored in internal EEPROM
| typedef struct _USART_CFG USART_CFG |
Structure for storing USART configuration data. Data is stored in internal EEPROM
| enum APP_CONFIG_ENUM |
Main application config structure. This structure lives in the internal EEPROM, starting at address 0.
!!! IMPORTANT - Only add to end the of this structure!!!
This structure can NOT get larger then 256 bytes. If it does, some code will have to be changed!
| void _appcfgPutc | ( | BYTE | offset | ) |
Set a specified byte from the APP_CONFIG configuration structure with the data contained in the EEDATA byte.
| offset | Contains the offset in the APP_CONFIG structure of the byte to get |
| void appcfgADC | ( | void | ) |
Configure the ADC unit
| void appcfgCpuIO | ( | void | ) |
Configure the CPU I/O ports
| void appcfgCpuIOValues | ( | void | ) |
Configure the CPU I/O ports to have the configured default values
Get a specified byte from the APP_CONFIG configuration structure
| offset | Contains the offset in the APP_CONFIG structure of the byte to get. Use the APPCFG_X defines |
| void appcfgInit | ( | void | ) |
| void appcfgSave | ( | void | ) |
Save Application Configuartion data to EEPROM
| void appcfgUSART | ( | void | ) |
Configure USART with AppConfig data
1.4.7