Appiko
hal_spi_rf.h
1 /******************************************************************************
2  * Filename: hal_spi_rf_trx.h
3  *
4  * Description: Implementation file for common spi access with the CCxxxx
5  * transceiver radios using trxeb. Supports CC1101/CC112X radios
6  *
7  * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
8  *
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions
12  * are met:
13  *
14  * Redistributions of source code must retain the above copyright
15  * notice, this list of conditions and the following disclaimer.
16  *
17  * Redistributions in binary form must reproduce the above copyright
18  * notice, this list of conditions and the following disclaimer in the
19  * documentation and/or other materials provided with the distribution.
20  *
21  * Neither the name of Texas Instruments Incorporated nor the names of
22  * its contributors may be used to endorse or promote products derived
23  * from this software without specific prior written permission.
24  *
25  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36  *
37  *******************************************************************************/
38 
39 
40 /******************************************************************************
41  * INCLUDES
42  */
43 #include "stdint.h"
44 
45 #if defined (__MSP430G2553__)
46  #include "hal_spi_rf_exp430g2.h"
47 #endif
48 #if defined (__MSP430F5438A__)
49  #include "hal_spi_rf_trxeb.h"
50 #endif
51 #if defined (__MSP430F5529__)
52  #include "hal_spi_rf_exp5529.h"
53 #endif
54 
55 #if defined NRF52810 || NRF52832 || NRF52840
56  #include "spi_rf_nrf52.h"
57 #endif
58 // CC Chip versions
59 #define DEV_UNKNOWN 10
60 #define DEV_CC1100 11
61 #define DEV_CC1101 12
62 #define DEV_CC2500 13
63 #define DEV_CC430x 14
64 #define DEV_CC1120 15
65 #define DEV_CC1121 16
66 #define DEV_CC1125 17
67 #define DEV_CC1200 18
68 #define DEV_CC1201 19
69 #define DEV_CC1175 20
70 
71 #define RADIO_GENERAL_ERROR 0x00
72 #define RADIO_CRC_OK 0x80
73 #define RADIO_IDLE 0x81
74 #define RADIO_RX_MODE 0x82
75 #define RADIO_TX_MODE 0x83
76 #define RADIO_RX_ACTIVE 0x84
77 #define RADIO_TX_ACTIVE 0x85
78 #define RADIO_SLEEP 0x86
79 #define RADIO_TX_PACKET_RDY 0x87
80 #define RADIO_CHANNEL_NOT_CLR 0x88
81 #define RADIO_CHANNEL_IS_CLR 0x89
82