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