This file contains all protocol stack configuration parameters. Every project must contain such a file in its source directory.
Link Layer Definitions
Baud Rate
#define LNK_BAUD_RATE 9600
Specifies your desired baud rate.
Note that the actual baud rate may differ. (see avr-manual) Also keep in mind that high rates may not be feasible due to crc generation, protocol processing time and other interrupts.
#define LNK_F_CLK 6000000
CPU clock frequency.
Used to calculate value of UBRR register.
Send Pin
The following definitions are used to specify which pin should be used to control the external bus driver.
#define LNK_SEND_PORT PORTD
#define LNK_SEND_DDR DDRD
#define LNK_SEND_PIN PD4
Receive Buffer Size
#define LNK_BUFFER_SIZE 64
Specifies how many bytes should be reserved as input buffer. Packets larger than this value cannot be received and will be dropped.
Bus Timing
Idle time to signal end of packet (BETA_1). Measured in time slots.
Minimum bus idle time after packet (BETA_2). Measured in time slots.
#define LNK_ALPHA_TIME 0xd0 // value loaded into TCNT0
#define LNK_ALPHA_PRESC 0x02 // timer 0 prescaler, written to TCCR0
These values adjust the slot time ALPHA. Use the lowest prescaler that is possible to reach a maximum resulution. Otherwise the timing is prone to jitter and might be inconsistent between different nodes in the network which increases the possibility of collisions!
#define LNK_EXT_INT INT0
#define LNK_EXT_ISCx1 ISC01
#define LNK_EXT_SIG SIG_INTERRUPT0
Network Layer Definitions
#define NET_PHYSICAL_ADDR 0x55500002
Physical address of node.
Transport Layer Definitions
If a timeout is running and tsp_check_timeout() is called TSP_TIMEOUT times then a timeout occurs. Range: 0..255
#define TSP_MAX_GROUPS 128
Highest group id supported. The transport layer cannot send packets to groups that have an id greater than TSP_MAX_GROUPS. Consumes one byte of eeprom for every supported group id.
#define TSP_CACHE_SIZE 4 // transaction cache size
#define TSP_REPLY_SIZE 8 // pending packets
Various buffer sizes. They must be a power of two!
Appliction Layer Definitions
Define the following token to compile the static version of the application layer. If you want to compile for the dynamic version undefine it.
#define APP_BUFFER_SIZE 64
Size of outgoing network buffer. Packets greater than this cannot be sent.
Number of entries in the association table. Consumes three bytes per entry.
#define APP_OBJECTS OBJECT(switch1, 2) OBJECT(switch2, 2)
Used to register application objects if compiling for the static version, otherwise it has no meaning. In the above example two objects are registered names "switch1" and "switch2" wich both have two events.
Number of maximum pending events. MUST be a power of two!
Generated on Fri Oct 17 16:45:55 2003 for OpenHome by
1.3.3