A metronome using the FRDM K64F board

Committer:
ram54288
Date:
Sun May 14 18:40:18 2017 +0000
Revision:
0:a7a43371b306
Initial commit

Who changed what in which revision?

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