//-------------------------------------------------------------------------- // // Configure All Global Compile Options // // These items are usually set in the sources files, but can be over-ridden // here by using 'define' or 'undefine'. // //-------------------------------------------------------------------------- // $Archive: /WirelessUSB/WUSB Kits/CY4632 LS KBM RDK/DocSrc/CD_Root/Firmware/Source Code/RDK Keyboard/ls_config.h $ // $Modtime: 6/16/04 3:56p9/30/04 12:01p $ // $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 _LS_CONFIG_H_ #define _LS_CONFIG_H_ // PROTOCOL PARAMTERS #define DATA_RATE_64 #define TWO_WAY //#define ONE_WAY // BIND SCHEMES #ifdef TWO_WAY #define BIND_AUTO #else // ONE_WAY #define BIND_BASIC #define TX_NUM_TRANS 5 #endif // TWO_WAY #define PROTOCOL_1_1 // Default parameters #define DEFAULT_PNCODE 1 #define DEFAULT_CHAN 5 // RADIO PARAMETERS #define DEFAULT_XTL 0x1A #define PA_BIAS 0x07 #define BIND_PA 0x04 // AGC SupportDyanmic PA #define AGCDYNAMIC_PA_SUPPORT // Sleep radio #define SLEEP_ENABLED // Allow Back Channel Data #define BACK_CHANNEL_DATA // Null Packet Data //#define NULL_PACKET_DATA // Checksum ALL packets //#define CHECKSUM_ALL_PACKETS // Application Backoff flag #define ACK_BACKOFF // Application Backoff #define ACK_BACKOFF_DELAY() M8C_ClearWDTAndSleep;\ timer_delay_msec(2);\ scan_keyboard();\ if (timer_time_elapsed(last_transfer_ts, KEY_DOWN_DELAY_SAMPLE_PERIOD))\ {\ age_debounce_queue();\ last_transfer_ts = timer_get_time_stamp();\ }; // Application Callback flag #define APP_CALLBACK // Application Callback #define APP_CALLBACK_FUNC() M8C_ClearWDTAndSleep;\ if (!(hid.status & BIND_BUTTON))\ {\ isr_disable(INT_ISR_DISABLE(GPIO_ISR_RADIO | INT_BIND_IE_PORT, GPIO_ISR_RADIO_INT | GPIO_ISR_BIND_INT);\ scan_keyboard();\ if (timer_time_elapsed(last_transfer_ts, KEY_DOWN_DELAY_SAMPLE_PERIOD))\ {\ age_debounce_queue();\ last_transfer_ts = timer_get_time_stamp();\ }\ isr_enable(INT_ISR_ENABLE(GPIO_ISR_RADIO | INT_BIND_IE_PORT, GPIO_ISR_RADIO_INT | GPIO_ISR_BIND_INT);\ }; // Indicates a combo device #define COMBO_DEVICE // KEYBOARD SPECIFIC DEFINES #define KEYBOARD_DEVICE_TYPE 0x02 #define MOUSE_DEVICE_TYPE 0x03 #define DEVICE_TYPE KEYBOARD_DEVICE_TYPE #define APP_TX_PACKET_SIZE sizeof(APP_TX_PACKET) #define APP_RX_PACKET_SIZE 1 // Ack Data Filter Value #define DATA_ACK_FILTER_VALUE 0x74 // Number of retries #define TX_TIMEOUT 10 // API Macro's #define LS_IRQ_ASSERTED (PRT1DR & IRQ_MASK) #ifdef SLEEP_ENABLED #define RADIO_ISR_ENABLE(SLEEP() isr_enable( INT_RADIO radio_sleep() #define RADIO_ISR_DISABLE(WAKEUP() isr_disable( INT_RADIO radio_wakeup() #else #define RADIO_SLEEP() #define RADIO_WAKEUP() #endif #define RADIO_ISR_ENABLE() ISR_ENABLE(GPIO_ISR_RADIO_IE_PORT, GPIO_ISR_RADIO_INT) #define RADIO_ISR_DISABLE() ISR_DISABLE(GPIO_ISR_RADIO_IE_PORT, GPIO_ISR_RADIO_INT) #define SPI_RADIO_ON() spi_radio_on() #ifdef RADIO_DEFAULT_ON #define SPI_RADIO_OFF() #else #define SPI_RADIO_OFF() spi_radio_off() #endif #define SPI_RADIO_RESET() spi_radio_reset() #define SPI_RADIO_PUT(addr, data) spi_radio_put(addr, data) #define SPI_RADIO_GET(data) spi_radio_get(data) // Flash Block location of the System Parameters #define SYS_PARAM_LOC 0xfa // 250 // set near the end of 16K flash memory, 3e80. #define NVRAM_READ(data, len) nvram_readflash_read_lite(SYS_PARAM_LOC, data, len) #define NVRAM_WRITE(data) nvram_flash_write_lite(SYS_PARAM_LOC, data) #define ENCRYPT_NVRAM_READ(addr, data, len) flash_read_lite(addr, data, len) #define ENCRYPT_NVRAM_WRITE(addr, data) flash_write_lite(addr, data) #define TIMER_DELAY_10_USEC() timer_delay_10_usec() #define TIMER_DELAY_50_USEC() timer_delay_50_usec() #define TIMER_DELAY_MSEC(cnt) timer_delay_msec(cnt) #define TIMER_GET_TIME_STAMP() timer_get_time_stamp() // Include files #include "appconfig.h" #include "psocgpioint.h" #include "cypdef.h" #include "nvramflash.h" #include "timer.h" #include "spi.h" #include "isr.h" #include "keyboard.h" #include PLATFORM_H #include "debug.h" #include "encrypt.h" #include "mfgtest.h" #endif // _LS_CONFIG_H_