NXP / fsl_phy_mcr20a

Fork of fsl_phy_mcr20a by Freescale

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers XcvrSpi.h Source File

XcvrSpi.h

Go to the documentation of this file.
00001 /*!
00002 * Copyright (c) 2015, Freescale Semiconductor, Inc.
00003 * All rights reserved.
00004 *
00005 * \file XcvrSpi.h
00006 *
00007 * Redistribution and use in source and binary forms, with or without modification,
00008 * are permitted provided that the following conditions are met:
00009 *
00010 * o Redistributions of source code must retain the above copyright notice, this list
00011 *   of conditions and the following disclaimer.
00012 *
00013 * o Redistributions in binary form must reproduce the above copyright notice, this
00014 *   list of conditions and the following disclaimer in the documentation and/or
00015 *   other materials provided with the distribution.
00016 *
00017 * o Neither the name of Freescale Semiconductor, Inc. nor the names of its
00018 *   contributors may be used to endorse or promote products derived from this
00019 *   software without specific prior written permission.
00020 *
00021 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
00022 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00023 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00024 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
00025 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00026 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00027 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
00028 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00029 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00030 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00031 */
00032 
00033 #ifndef __XCVR_SPI_H__
00034 #define __XCVR_SPI_H__
00035 
00036 
00037 /*****************************************************************************
00038  *                               INCLUDED HEADERS                            *
00039  *---------------------------------------------------------------------------*
00040  * Add to this section all the headers that this module needs to include.    *
00041  * Note that it is not a good practice to include header files into header   *
00042  * files, so use this section only if there is no other better solution.     *
00043  *---------------------------------------------------------------------------*
00044  *****************************************************************************/
00045  
00046 #include "EmbeddedTypes.h "
00047 //#include "board.h"
00048 
00049 
00050 /*****************************************************************************
00051  *                             PUBLIC MACROS                                 *
00052  *---------------------------------------------------------------------------*
00053  * Add to this section all the access macros, registers mappings, bit access *
00054  * macros, masks, flags etc ...
00055  *---------------------------------------------------------------------------*
00056  *****************************************************************************/
00057 //#define gXcvrAssertCS_d()   GPIO_DRV_ClearPinOutput(kGpioXcvrSpiCsPin)
00058 //#define gXcvrDeassertCS_d() GPIO_DRV_SetPinOutput(kGpioXcvrSpiCsPin)
00059 
00060 #define gXcvrSpiInstance_c              0
00061 
00062 /*****************************************************************************
00063  *                            PUBLIC FUNCTIONS                               *
00064  *---------------------------------------------------------------------------*
00065  * Add to this section all the global functions prototype preceded (as a     *
00066  * good practice) by the keyword 'extern'                                    *
00067  *---------------------------------------------------------------------------*
00068  *****************************************************************************/
00069 void RF_RST_Set(int state);
00070 void RF_SLP_TR_Set(int state);
00071 void RF_CS_while_active(void);
00072 void RF_CS_Set(int state);
00073 void RF_IRQ_Init(void);
00074 void RF_IRQ_Disable(void);
00075 void RF_IRQ_Enable(void);
00076 bool_t RF_isIRQ_Pending(void);
00077 
00078 void gXcvrAssertCS_d(void);
00079 void gXcvrDeassertCS_d(void);
00080 
00081 void spi_master_init(uint32_t instance);
00082 void spi_master_configure_speed(uint32_t instance, uint32_t freq);
00083 void spi_master_transfer(uint32_t instance,
00084                          uint8_t * sendBuffer,
00085                          uint8_t * receiveBuffer,
00086                          uint32_t transferByteCount);
00087 
00088 #endif /* __XCVR_SPI_H__ */