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