Easily add all supported connectivity methods to your mbed OS project

Dependencies:   type-yd-driver

Committer:
MACRUM
Date:
Wed Jul 12 10:52:58 2017 +0000
Revision:
0:615f90842ce8
Initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
MACRUM 0:615f90842ce8 1 /*!
MACRUM 0:615f90842ce8 2 * Copyright (c) 2015, Freescale Semiconductor, Inc.
MACRUM 0:615f90842ce8 3 * All rights reserved.
MACRUM 0:615f90842ce8 4 *
MACRUM 0:615f90842ce8 5 * \file XcvrSpi.h
MACRUM 0:615f90842ce8 6 *
MACRUM 0:615f90842ce8 7 * Redistribution and use in source and binary forms, with or without modification,
MACRUM 0:615f90842ce8 8 * are permitted provided that the following conditions are met:
MACRUM 0:615f90842ce8 9 *
MACRUM 0:615f90842ce8 10 * o Redistributions of source code must retain the above copyright notice, this list
MACRUM 0:615f90842ce8 11 * of conditions and the following disclaimer.
MACRUM 0:615f90842ce8 12 *
MACRUM 0:615f90842ce8 13 * o Redistributions in binary form must reproduce the above copyright notice, this
MACRUM 0:615f90842ce8 14 * list of conditions and the following disclaimer in the documentation and/or
MACRUM 0:615f90842ce8 15 * other materials provided with the distribution.
MACRUM 0:615f90842ce8 16 *
MACRUM 0:615f90842ce8 17 * o Neither the name of Freescale Semiconductor, Inc. nor the names of its
MACRUM 0:615f90842ce8 18 * contributors may be used to endorse or promote products derived from this
MACRUM 0:615f90842ce8 19 * software without specific prior written permission.
MACRUM 0:615f90842ce8 20 *
MACRUM 0:615f90842ce8 21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
MACRUM 0:615f90842ce8 22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
MACRUM 0:615f90842ce8 23 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
MACRUM 0:615f90842ce8 24 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
MACRUM 0:615f90842ce8 25 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
MACRUM 0:615f90842ce8 26 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
MACRUM 0:615f90842ce8 27 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
MACRUM 0:615f90842ce8 28 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
MACRUM 0:615f90842ce8 29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
MACRUM 0:615f90842ce8 30 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
MACRUM 0:615f90842ce8 31 */
MACRUM 0:615f90842ce8 32
MACRUM 0:615f90842ce8 33 #ifndef __XCVR_SPI_H__
MACRUM 0:615f90842ce8 34 #define __XCVR_SPI_H__
MACRUM 0:615f90842ce8 35
MACRUM 0:615f90842ce8 36
MACRUM 0:615f90842ce8 37 /*****************************************************************************
MACRUM 0:615f90842ce8 38 * INCLUDED HEADERS *
MACRUM 0:615f90842ce8 39 *---------------------------------------------------------------------------*
MACRUM 0:615f90842ce8 40 * Add to this section all the headers that this module needs to include. *
MACRUM 0:615f90842ce8 41 * Note that it is not a good practice to include header files into header *
MACRUM 0:615f90842ce8 42 * files, so use this section only if there is no other better solution. *
MACRUM 0:615f90842ce8 43 *---------------------------------------------------------------------------*
MACRUM 0:615f90842ce8 44 *****************************************************************************/
MACRUM 0:615f90842ce8 45
MACRUM 0:615f90842ce8 46
MACRUM 0:615f90842ce8 47 /*****************************************************************************
MACRUM 0:615f90842ce8 48 * PUBLIC MACROS *
MACRUM 0:615f90842ce8 49 *---------------------------------------------------------------------------*
MACRUM 0:615f90842ce8 50 * Add to this section all the access macros, registers mappings, bit access *
MACRUM 0:615f90842ce8 51 * macros, masks, flags etc ...
MACRUM 0:615f90842ce8 52 *---------------------------------------------------------------------------*
MACRUM 0:615f90842ce8 53 *****************************************************************************/
MACRUM 0:615f90842ce8 54 #define gXcvrSpiInstance_c 0
MACRUM 0:615f90842ce8 55
MACRUM 0:615f90842ce8 56 /*****************************************************************************
MACRUM 0:615f90842ce8 57 * PUBLIC FUNCTIONS *
MACRUM 0:615f90842ce8 58 *---------------------------------------------------------------------------*
MACRUM 0:615f90842ce8 59 * Add to this section all the global functions prototype preceded (as a *
MACRUM 0:615f90842ce8 60 * good practice) by the keyword 'extern' *
MACRUM 0:615f90842ce8 61 *---------------------------------------------------------------------------*
MACRUM 0:615f90842ce8 62 *****************************************************************************/
MACRUM 0:615f90842ce8 63
MACRUM 0:615f90842ce8 64 #if defined(__cplusplus)
MACRUM 0:615f90842ce8 65 extern "C" {
MACRUM 0:615f90842ce8 66 #endif /* __cplusplus */
MACRUM 0:615f90842ce8 67
MACRUM 0:615f90842ce8 68 void RF_RST_Set(int state);
MACRUM 0:615f90842ce8 69 void RF_CS_Set(int state);
MACRUM 0:615f90842ce8 70 void RF_IRQ_Init(void);
MACRUM 0:615f90842ce8 71 void RF_IRQ_Disable(void);
MACRUM 0:615f90842ce8 72 void RF_IRQ_Enable(void);
MACRUM 0:615f90842ce8 73 uint8_t RF_isIRQ_Pending(void);
MACRUM 0:615f90842ce8 74
MACRUM 0:615f90842ce8 75 void gXcvrAssertCS_d(void);
MACRUM 0:615f90842ce8 76 void gXcvrDeassertCS_d(void);
MACRUM 0:615f90842ce8 77
MACRUM 0:615f90842ce8 78 void xcvr_spi_init(uint32_t instance);
MACRUM 0:615f90842ce8 79 void xcvr_spi_configure_speed(uint32_t instance, uint32_t freq);
MACRUM 0:615f90842ce8 80 void xcvr_spi_transfer(uint32_t instance,
MACRUM 0:615f90842ce8 81 uint8_t * sendBuffer,
MACRUM 0:615f90842ce8 82 uint8_t * receiveBuffer,
MACRUM 0:615f90842ce8 83 uint32_t transferByteCount);
MACRUM 0:615f90842ce8 84
MACRUM 0:615f90842ce8 85 #if defined(__cplusplus)
MACRUM 0:615f90842ce8 86 }
MACRUM 0:615f90842ce8 87 #endif /* __cplusplus */
MACRUM 0:615f90842ce8 88
MACRUM 0:615f90842ce8 89 #endif /* __XCVR_SPI_H__ */