//-------------------------------------------------------------------------- // // This module provides a radio control interface using an SPI port. // //-------------------------------------------------------------------------- // Copyright (c) 2003-2004, Cypress Semiconductor Corporation // // // This software is owned by Cypress Semiconductor Corporation (Cypress)and // is protected by 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 // ("Licensee Product") to be used only in conjunction with a Cypress // integrated circuit. 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' // products described herein are not authorized for use as components in // life-support devices. // // This software is protected by and subject to worldwide patent coverage, // including U.S. and foreign patents. Use may be limited by and subject to // the Cypress Software License Agreement. // //-------------------------------------------------------------------------- #ifndef _SPI_H_SPI_H #define _SPI_H_SPI_H //-------------------------------------- // Included files //-------------------------------------- #ifndef SPIM_MODE_0 #define SPIM_MODE_0 SPIM_1_SPIM_MODE_0 #endif #ifndef SPIM_MSB_FIRST #define SPIM_MSB_FIRST SPIM_1_SPIM_MSB_FIRST #endif #ifndef SPIM_SPI_COMPLETE #define SPIM_SPI_COMPLETE SPIM_1_SPIM_SPI_COMPLETE #endif #define mSPI_ADDRESS 0x3F //-------------------------------------- // API Defines and Types //-------------------------------------- #define bSPI_WRITE 0x80 #define bSPI_AUTO_INC 0x40 #define spi_radio_put(addr, data) spi_radio_access((addr | bSPI_WRITE), data) #define spi_radio_get(addr) spi_radio_access(addr, 0xFF) //-------------------------------------- // API Function Declarations //-------------------------------------- voidextern void spi_radio_on(void); void spi_radio_reset(void); void spi_radio_put(UINT8 address, UINT8 data); UINT8 spi_radio_get(UINT8 address); extern void spi_radio_off(void); extern void spi_radio_reset(void); extern UINT8 spi_radio_access(UINT8 address, UINT8 data); #endif // _SPI_H_SPI_H