Contiki 3.x
radioeng.h
Go to the documentation of this file.
1 /**
2  * Copyright (c) 2014, Analog Devices, Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted (subject to the limitations in the
6  * disclaimer below) provided that the following conditions are met:
7  *
8  * - Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *
11  * - Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the
14  * distribution.
15  *
16  * - Neither the name of Analog Devices, Inc. nor the names of its
17  * contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
21  * GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
22  * HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
23  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
24  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
26  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
29  * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
30  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
31  * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
32  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33  */
34 /**
35 @file radioeng.h
36 @brief Radio Interface Engine Functions
37 @version v1.0
38 @author PAD CSE group, Analog Devices Inc
39 @date May 08th 2013
40 **/
41 
42 #define RIE_U32 unsigned long
43 #define RIE_U16 unsigned short int
44 #define RIE_U8 unsigned char
45 #define RIE_S8 signed char
46 
47 /*! \enum RIE_BaseConfigs
48  * Variables of this type are used to define the Base Configuration
49  */
50 /*! \var RIE_BaseConfigs DR_1_0kbps_Dev10_0kHz
51  * Base configuration of 1 kbps datarate, 10.0 kHz frequency deviation.
52  Use for achieving longer distances.
53  */
54 /*! \var RIE_BaseConfigs DR_38_4kbps_Dev20kHz
55  * Base configuration of 38.4 kbps datarate, 20 kHz frequency deviation.
56  Use as a compromise of distance and power.
57  */
58 /*! \var RIE_BaseConfigs DR_300_0kbps_Dev75_0kHz
59  * Base configuration of 300 kbps datarate, 75 kHz frequency deviation.
60  Use for achieving faster transmission times hence lower power.
61  */
62 typedef enum
63 {
67  UnsupportedDRDev
69 
70 /*! \enum RIE_ModulationTypes
71  * Variables of this type are used to define a tx modulation type
72  */
73 /*! \var RIE_ModulationTypes FSK_Modulation
74  * FSK Modulation
75  */
76 /*! \var RIE_ModulationTypes GFSK_Modulation
77  * GFSK Modulation
78  */
80 
81 /*! \enum RIE_PATypes
82  * Variables of this type are used to define a PA type
83  */
84 /*! \var RIE_PATypes DifferentialPA
85  * Differential PA
86  */
87 /*! \var RIE_PATypes SingleEndedPA
88  * Single Ended PA
89  */
90 typedef enum {DifferentialPA = 0, SingleEndedPA = 1} RIE_PATypes;
91 
92 
93 
94 typedef enum {PowerLevel0 ,PowerLevel1 ,PowerLevel2 ,PowerLevel3,
95  PowerLevel4 ,PowerLevel5 ,PowerLevel6 ,PowerLevel7,
96  PowerLevel8 ,PowerLevel9 ,PowerLevel10,PowerLevel11,
97  PowerLevel12,PowerLevel13,PowerLevel14,PowerLevel15
98  } RIE_PAPowerLevel;
99 
100 
101 /*! \enum RIE_BOOL
102  * Variables of this type are used to define a TRUE or FALSE condition
103  */
104 /*! \var RIE_BOOL RIE_TRUE
105  * TRUE condition
106  */
107 /*! \var RIE_BOOL RIE_FALSE
108  * FALSE condition
109  */
110 typedef enum {RIE_FALSE = 0, RIE_TRUE = !RIE_FALSE} RIE_BOOL;
111 
112 
113 /*! \enum RIE_Responses
114  * Variables of this type are used to define the return value from functions
115  */
116 /*! \var RIE_Responses RIE_Success
117  * Successful completion
118  */
119 /*! \var RIE_Responses RIE_RadioSPICommsFail
120  * SPI communications with the radio failure.
121  */
122 /*! \var RIE_Responses RIE_UnsupportedRadioConfig
123  * This is an unsupported radio configuration
124  */
125 /*! \var RIE_Responses RIE_Unimplemented
126  * This feature has not been implemented
127  */
128 /*! \var RIE_Responses RIE_InvalidParamter
129  * An invaild parameter was passed
130  */
131 typedef enum
132 {
133  RIE_Success = 0x0,
138 } RIE_Responses;
139 
140 // Added in Radio Interface Engine v0.1
141 RIE_Responses RadioGetAPIVersion (RIE_U32 *pVersion);
145 RIE_Responses RadioSetFrequency (RIE_U32 Frequency);
149 RIE_Responses RadioTxPacketFixedLen (RIE_U8 Len, RIE_U8 *pData);
151 RIE_Responses RadioTxSetPA (RIE_PATypes PAType,RIE_PAPowerLevel Power);
156 RIE_Responses RadioRxPacketRead (RIE_U8 BufferLen,RIE_U8 *pPktLen,RIE_U8 *pData,RIE_S8 *pRSSIdBm);
158 
159 // Added in Radio Interface Engine v0.2
161 RIE_Responses RadioRadioGetRSSI (RIE_S8 *pRSSIdBm);
162 RIE_Responses RadioTxSetPower (RIE_PAPowerLevel Power);
163 
164 // Added in Radio Interface Engine v0.3
165 RIE_Responses RadioTxPacketVariableLen (RIE_U8 Len, RIE_U8 *pData);
167 
168 // Added in Radio Interface Engine v0.5
170 
171 
172 
173 
174 
RIE_Responses RadioTxCarrier(void)
Transmit a carrier tone using the current radio configuration.
Definition: radioeng.c:959
RIE_BOOL
Definition: radioeng.h:110
RIE_BOOL RadioTxPacketComplete(void)
Checks if a packet has finished transmitting.
Definition: radioeng.c:858
RIE_Responses RadioTerminateRadioOp(void)
Terminate a currently running radio RX or TX operation.
Definition: radioeng.c:551
RIE_Responses RadioRxBERTestMode(void)
Enter receiver Bit Error Rate (BER) test mode where the clock and data appear on GPIO pins...
Definition: radioeng.c:1185
RIE_Responses RadioTxPreamble(void)
Transmit a pre-amble (alternating ones and zeros) using the current radio configuration.
Definition: radioeng.c:987
RIE_Responses RadioDeInit(void)
Deinitialise the Radio, and power it down.
Definition: radioeng.c:472
RIE_Responses RadioRxPacketRead(RIE_U8 BufferLen, RIE_U8 *pPktLen, RIE_U8 *pData, RIE_S8 *pRSSIdBm)
Read the packet that was received by the radio.
Definition: radioeng.c:1125
RIE_BOOL RadioRxPacketAvailable(void)
Checks if a packet has been received.
Definition: radioeng.c:1092
RIE_Responses RadioSetModulationType(RIE_ModulationTypes ModulationType)
Set the Radio Transmitter Modulation Type.
Definition: radioeng.c:612
RIE_Responses
Definition: radioeng.h:131
RIE_Responses RadioPowerOff(void)
Shutdown the radio and place it in its lowest power sleep mode.
Definition: radioeng.c:521
RIE_Responses RadioRadioGetRSSI(RIE_S8 *pRSSIdBm)
Return a Received Signal Strength Indicator value.
Definition: radioeng.c:1692
RIE_Responses RadioSwitchConfig(RIE_BaseConfigs BaseConfig)
Change the Radio to using specified configuration.
Definition: radioeng.c:369
RIE_Responses RadioPayldManchesterEncode(RIE_BOOL bEnable)
Enable or Disable Manchester Encoding of payload data.
Definition: radioeng.c:670
RIE_Responses RadioSetFrequency(RIE_U32 Frequency)
Set frequency for radio communications.
Definition: radioeng.c:574
RIE_Responses RadioTxSetPower(RIE_PAPowerLevel Power)
Set the Transmit Power Level for Radio Transmission.
Definition: radioeng.c:1727
RIE_Responses RadioRxPacketFixedLen(RIE_U8 Len)
Enter receive mode and wait for a packet to be received.
Definition: radioeng.c:1017
RIE_Responses RadioGetAPIVersion(RIE_U32 *pVersion)
Return the Radio Interface Engine API Version.
Definition: radioeng.c:347
RIE_PATypes
Definition: radioeng.h:90
RIE_Responses RadioRxPacketVariableLen(void)
Enter receive mode and wait for a packet to be received.
Definition: radioeng.c:1050
RIE_Responses RadioTxSetPA(RIE_PATypes PAType, RIE_PAPowerLevel Power)
Set PA Type and the Transmit Power Level for Radio Transmission.
Definition: radioeng.c:879
RIE_ModulationTypes
Definition: radioeng.h:79
RIE_Responses RadioTxPacketVariableLen(RIE_U8 Len, RIE_U8 *pData)
Transmit a Variable length packet.
Definition: radioeng.c:813
RIE_Responses RadioInit(RIE_BaseConfigs BaseConfig)
Initialise the Radio, using specified configuration.
Definition: radioeng.c:396
RIE_Responses RadioPayldDataWhitening(RIE_BOOL bEnable)
Enable or Disable Data Whitening of payload data.
Definition: radioeng.c:729
RIE_Responses RadioTxPacketFixedLen(RIE_U8 Len, RIE_U8 *pData)
Transmit a fixed length packet.
Definition: radioeng.c:772
RIE_BaseConfigs
Definition: radioeng.h:62