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