//-------------------------------------------------------------------------- // // Header file for the bind functions // //-------------------------------------------------------------------------- // $Archive: /WirelessUSB/WUSB Kits/CY4632 LS KBM RDK/DocSrc/CD_Root/Firmware/Source Code/RDK Keyboard/bind.h $ // $Modtime: 6/16/04 2:06p10/01/04 8:38a $ // $Revision: 78 $ //-------------------------------------------------------------------------- // // Copyright 2003-2004, Cypress Semiconductor Corporation. // // This software is owned by Cypress Semiconductor Corporation (Cypress) // and is protected by and subject to worldwide patent protection (United // States and foreign), United States copyright laws and international // treaty provisions. Cypress hereby grants to licensee a personal, // non-exclusive, non-transferable license to copy, use, modify, create // derivative works of, and compile the Cypress Source Code and derivative // works for the sole purpose of creating custom software in support of // licensee product to be used only in conjunction with a Cypress integrated // circuit as specified in the applicable agreement. Any reproduction, // modification, translation, compilation, or representation of this // software except as specified above is prohibited without the express // written permission of Cypress. // // Disclaimer: CYPRESS MAKES NO WARRANTY OF ANY KIND,EXPRESS OR IMPLIED, // WITH REGARD TO THIS MATERIAL, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. // Cypress reserves the right to make changes without further notice to the // materials described herein. Cypress does not assume any liability arising // out of the application or use of any product or circuit described herein. // Cypress does not authorize its products for use as critical components in // life-support systems where a malfunction or failure may reasonably be // expected to result in significant injury to the user. The inclusion of // Cypress’ product in a life-support systems application implies that the // manufacturer assumes all risk of such use and in doing so indemnifies // Cypress against all charges. // // Use may be limited by and subject to the applicable Cypress software // license agreement. // //-------------------------------------------------------------------------- #ifndef _BIND_H_ #define _BIND_H_ #include "ls_config.h" // define Bind modes #define DISCONNECTED_STATE 1 #define CONNECTED_STATE 2 // setup 2 way timeouts //#define INIT_TIMEOUT 32000 // Delay in milliseconds #define SUBSET_CHANNELS 13 // number of channels in usable set #define ORIGINAL_CHAN_RECONNECT_COUNT 5 // number of reconnects on original channel #ifdef DATA_RATE_16 #define BIND_ACK_TIMEOUT 180 #define CONN_ACK_TIMEOUT 100 #endif #ifdef DATA_RATE_32 #define BIND_ACK_TIMEOUT 220 #define CONN_ACK_TIMEOUT 75 #endif #ifdef DATA_RATE_64 #define BIND_ACK_TIMEOUT 2250 #define CONN_ACK_TIMEOUT 50 #endif #define BIND_TIMEOUT SUBSET_CHANNELS*10 // 10 number of loops through the channels during bind (max = 255) #define CONNECT_TIMEOUT SUBSET_CHANNELS*20 // 4 19 // number of loops through the channels during reconnect (max = 255) #ifndef AGC_TOGGLE_COUNT #define AGC_TOGGLE_COUNT 5 // number of loops through the channels before toggling AGC #endif #define BIND_MAX_TRANSMITS 4 // number of time to wait for bind ack #define BIND_SEED 0 #define BIND_PNCODE 0 #define BIND_PIN 0 // setup packet types #define BIND_REQUEST 0x0 #define BIND_RESPONSE 0x0 #define CONN_REQUEST 0x1 #define CONN_RESPONSE 0x2 #define PING_PACKET 0x3 #define DATA_PACKET 0x4 #define ACK_PACKET 0x5 #define DATA_ACK_PACKET 0x6 #define NULL_PACKET 0x7 #ifdef ENCRYPT_DATA #define KEY_PACKET 0x8 #define MAX_NUM_TYPES 0x8 // needs to point to last used packet type #else #define MAX_NUM_TYPES 0x7 // needs to point to last used packet type #endif // ENCRYPT_DATA #define NO_PACKET 0xFF #define PING_REQUEST 0x00 #define PING_RESPONSE 0x01 #define ACK_RESPONSE 0x01 #define NACK_RESPONSE 0x00 #define BRIDGE_PING_TIME 30 #ifdef BIND_BASIC extern void protocol_bind_init(void); extern void protocol_bind(UINT8 channel, UINT8 pnCode); #endif #ifdef BIND_AUTO extern void protocol_bind_init(void); extern UINT8 protocol_bind(void); extern UINT8 protocol_reconnect(void); extern void init_channel(void); extern void get_next_channel(void); extern UINT8 gBindMode; #endif #endif // _BIND_H_