Skip to content

Commit b2302da

Browse files
committed
Initial checkin of AIR430Boost library
This is the Library for the Anaran AIR430Boost. The library was contributed by Anaren with.
1 parent acfa78a commit b2302da

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+14441
-0
lines changed
191 KB
Binary file not shown.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#ifndef AIR_430BOOST_ETSI_H
2+
#define AIR_430BOOST_ETSI_H
3+
/**
4+
* ----------------------------------------------------------------------------
5+
* AIR430BoostETSI.h - AIR430Boost A110x2500 radio ETSI library.
6+
* Copyright (C) 2012-2013 Anaren Microwave, Inc.
7+
*
8+
* This library is free software; you can redistribute it and/or
9+
* modify it under the terms of the GNU Lesser General Public
10+
* License as published by the Free Software Foundation; either
11+
* version 2.1 of the License, or (at your option) any later version.
12+
*
13+
* This library is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16+
* Lesser General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU Lesser General Public
19+
* License along with this library; if not, write to the Free Software
20+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21+
*
22+
* This example demonstrates usage of the AIR430BoostETSI library which uses
23+
* the 430Boost-CC110L AIR Module BoosterPack created by Anaren Microwave, Inc.
24+
* and available through the TI eStore, for the European Union.
25+
* ----------------------------------------------------------------------------
26+
*
27+
* Note: This file is part of AIR430Boost.
28+
*/
29+
#include "utility/A110x2500Radio.h"
30+
#endif /* AIR_430BOOST_ETSI_H */

hardware/msp430/libraries/AIR430BoostEuropeETSI/COPYING.LESSER.txt

Lines changed: 502 additions & 0 deletions
Large diffs are not rendered by default.

hardware/msp430/libraries/AIR430BoostEuropeETSI/COPYING.txt

Lines changed: 339 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Software End User License Agreement (EULA)
2+
Copyright (C) 2012-2013 Anaren Microwave, Inc.
3+
4+
This library is free software; you can redistribute it and/or
5+
modify it under the terms of the GNU Lesser General Public
6+
License as published by the Free Software Foundation; either
7+
version 2.1 of the License, or (at your option) any later version.
8+
9+
This library is distributed in the hope that it will be useful,
10+
but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12+
Lesser General Public License for more details.
13+
14+
You should have received a copy of the GNU Lesser General Public
15+
License along with this library; if not, write to the Free Software
16+
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17+
18+
Please contact air@anaren.com with any comments or questions for this document.

hardware/msp430/libraries/AIR430BoostEuropeETSI/SPI.h

Whitespace-only changes.
Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
/**
2+
* ----------------------------------------------------------------------------
3+
* WirelessControl.ino - wireless controller sketch using AIR430Boost ETSI driver.
4+
* Copyright (C) 2012-2013 Anaren Microwave, Inc.
5+
*
6+
* This library is free software; you can redistribute it and/or
7+
* modify it under the terms of the GNU Lesser General Public
8+
* License as published by the Free Software Foundation; either
9+
* version 2.1 of the License, or (at your option) any later version.
10+
*
11+
* This library is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14+
* Lesser General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU Lesser General Public
17+
* License along with this library; if not, write to the Free Software
18+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19+
*
20+
* This example demonstrates usage of the AIR430BoostETSI library which uses
21+
* the 430Boost-CC110L AIR Module BoosterPack created by Anaren Microwave, Inc.
22+
* and available through the TI eStore, for the European Union.
23+
*
24+
* ----------------------------------------------------------------------------
25+
*
26+
* Note: This file is part of AIR430Boost.
27+
*
28+
* ----------------------------------------------------------------------------
29+
*
30+
* Description
31+
* ===========
32+
*
33+
* On each loop cycle, a message is transmitted and a message is received from
34+
* a remote node or a timeout occurs. The message contains a control command.
35+
* The control command turns the red LED on or off. Both nodes can control
36+
* each others red LED through a button press. When the button on one node is
37+
* pressed or held down, the red LED should light up on the remote node, and
38+
* vice versa.
39+
*
40+
* ----------------------------------------------------------------------------
41+
*
42+
* This example assumes that two BoosterPacks will be used to showcase the
43+
* wireless radio communication functionality. This same code should be
44+
* programmed to both LaunchPad development kits.
45+
*
46+
* This BoosterPack relies on the SPI hardware peripheral and two additional
47+
* GPIO lines for SPI chip-select and GDO0 for packet handling. They use pins 18
48+
* and 19 respectively.
49+
*
50+
* In the default configuration, this BoosterPack is not compatible with an
51+
* external crystal oscillator. This can be changed, if necessary, and would
52+
* require reconfiguration of the BoosterPack hardware and changes to the
53+
* AIR430BoostETSI library. Refer to the BoosterPack User's Manual if necessary.
54+
*
55+
* ETSI regulations must be followed when using this library. This example
56+
* limits the wireless duty cycle to 0.1% per ETSI.
57+
*
58+
* For complete information, please refer to the BoosterPack User's Manual
59+
* available at:
60+
* https://www.anaren.com/air/cc110l-air-module-boosterpack-embedded-antenna-module-anaren
61+
*
62+
* To purchase the 430Boost-CC110L AIR module BoosterPack kit, please visit the
63+
* TI eStore at:
64+
* https://estore.ti.com/430BOOST-CC110L-CC110L-RF-Module-BoosterPack-P2734.aspx
65+
*/
66+
67+
// The AIR430BoostETSI library uses the SPI library internally. Energia does not
68+
// copy the library to the output folder unless it is referenced here.
69+
// The order of includes is also important due to this fact.
70+
#include <SPI.h>
71+
#include <AIR430BoostETSI.h>
72+
73+
// -----------------------------------------------------------------------------
74+
/**
75+
* Defines, enumerations, and structure definitions
76+
*/
77+
78+
#define CMD_OFF 0
79+
#define CMD_ON 1
80+
81+
/**
82+
* sControl - control packet.
83+
*/
84+
struct sControl
85+
{
86+
unsigned char cmd;
87+
};
88+
89+
// -----------------------------------------------------------------------------
90+
/**
91+
* Global data
92+
*/
93+
94+
struct sControl txControl = { CMD_OFF }; // TX control packet
95+
struct sControl rxControl = { CMD_OFF }; // RX control packet
96+
97+
// -----------------------------------------------------------------------------
98+
// Debug print functions
99+
100+
void printRxData()
101+
{
102+
// Print the last received command to the serial port.
103+
Serial.print("RX Command: ");
104+
Serial.println(rxControl.cmd);
105+
}
106+
107+
// -----------------------------------------------------------------------------
108+
// Main example
109+
110+
void setup()
111+
{
112+
// The radio library uses the SPI library internally, this call initializes
113+
// SPI/CSn and GDO0 lines. Also setup initial address, channel, and TX power.
114+
Radio.begin(0x01, CHANNEL_1, POWER_MAX);
115+
116+
// Setup serial for debug printing.
117+
Serial.begin(9600);
118+
119+
/**
120+
* Setup LED for example demonstration purposes.
121+
*
122+
* Note: Set radio first to ensure that GDO2 line isn't being driven by the
123+
* MCU as it is an output from the radio.
124+
*/
125+
pinMode(RED_LED, OUTPUT);
126+
digitalWrite(RED_LED, LOW);
127+
128+
// Setup push button.
129+
pinMode(PUSH2, INPUT_PULLUP);
130+
}
131+
132+
void loop()
133+
{
134+
// Check for a button press. If the button is being pressed, load the txControl
135+
// into the radio TX FIFO and transmit it to the broadcast address.
136+
if (digitalRead(PUSH2) == LOW)
137+
{
138+
txControl.cmd = CMD_ON;
139+
}
140+
else
141+
{
142+
txControl.cmd = CMD_OFF;
143+
}
144+
Radio.transmit(ADDRESS_BROADCAST, (unsigned char*)&txControl, sizeof(txControl));
145+
146+
/**
147+
* The radio transmitter and receiver cannot be operated at the same time.
148+
* Wait until transmit completes before turning on the receiver. Please note
149+
* that the radio is considered busy when it is transmitting.
150+
*
151+
* WARNING: If busy is not checked between two successive radio operations
152+
* receiverOn/transmit, the radio may not perform the specified task. The
153+
* radio must be complete with the transmission before it can begin the next
154+
*/
155+
while (Radio.busy());
156+
157+
// Turn on the receiver and listen for incoming data. Timeout after 1 seconds.
158+
// The receiverOn() method returns the number of bytes copied to rxData.
159+
if (Radio.receiverOn((unsigned char*)&rxControl, sizeof(rxControl), 1000) > 0)
160+
{
161+
// Perform action based on incoming command: turn on/off red LED.
162+
if (rxControl.cmd == CMD_ON)
163+
{
164+
digitalWrite(RED_LED, HIGH);
165+
}
166+
else
167+
{
168+
digitalWrite(RED_LED, LOW);
169+
}
170+
171+
printRxData(); // RX debug information
172+
}
173+
174+
/**
175+
* Warning: ETSI regulations require duty cycling of 0.1% per hour. Changing
176+
* this may invalidate ETSI compliance. Some margin has been added. Please
177+
* refer to Anaren's A110LR09 User's Manual for more information.
178+
*/
179+
delay(500);
180+
}
181+
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
/**
2+
* ----------------------------------------------------------------------------
3+
* WirelessMonitorHub.ino - wireless monitor hub sketch using AIR430Boost ETSI driver.
4+
* Copyright (C) 2012-2013 Anaren Microwave, Inc.
5+
*
6+
* This library is free software; you can redistribute it and/or
7+
* modify it under the terms of the GNU Lesser General Public
8+
* License as published by the Free Software Foundation; either
9+
* version 2.1 of the License, or (at your option) any later version.
10+
*
11+
* This library is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14+
* Lesser General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU Lesser General Public
17+
* License along with this library; if not, write to the Free Software
18+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19+
*
20+
* This example demonstrates usage of the AIR430BoostETSI library which uses
21+
* the 430Boost-CC110L AIR Module BoosterPack created by Anaren Microwave, Inc.
22+
* and available through the TI eStore, for the European Union.
23+
*
24+
* ----------------------------------------------------------------------------
25+
*
26+
* Note: This file is part of AIR430Boost.
27+
*
28+
* ----------------------------------------------------------------------------
29+
*
30+
* Description
31+
* ===========
32+
*
33+
* Acts as a simple receiver for a star network. The hub node can receive both
34+
* broadcast messages and messages directed to its assigned address. The hub
35+
* node should not be assigned to address 0 (broadcast address). To create an
36+
* additional network, simply change the hub address.
37+
*
38+
* ----------------------------------------------------------------------------
39+
*
40+
* This example assumes that two BoosterPacks will be used to showcase the
41+
* wireless radio communication functionality. This same code should be
42+
* programmed to both LaunchPad development kits.
43+
*
44+
* This BoosterPack relies on the SPI hardware peripheral and two additional
45+
* GPIO lines for SPI chip-select and GDO0 for packet handling. They use pins 18
46+
* and 19 respectively.
47+
*
48+
* In the default configuration, this BoosterPack is not compatible with an
49+
* external crystal oscillator. This can be changed, if necessary, and would
50+
* require reconfiguration of the BoosterPack hardware and changes to the
51+
* AIR430BoostETSI library. Refer to the BoosterPack User's Manual if necessary.
52+
*
53+
* ETSI regulations must be followed when using this library. This example
54+
* limits the wireless duty cycle to 0.1% per ETSI.
55+
*
56+
* For complete information, please refer to the BoosterPack User's Manual
57+
* available at:
58+
* https://www.anaren.com/air/cc110l-air-module-boosterpack-embedded-antenna-module-anaren
59+
*
60+
* To purchase the 430Boost-CC110L AIR module BoosterPack kit, please visit the
61+
* TI eStore at:
62+
* https://estore.ti.com/430BOOST-CC110L-CC110L-RF-Module-BoosterPack-P2734.aspx
63+
*/
64+
65+
/**
66+
* The AIR430BoostETSI library uses the SPI library internally. Energia does not
67+
* copy the library to the output folder unless it is referenced here. The order
68+
* of includes is also important due to this fact.
69+
*/
70+
#include <SPI.h>
71+
#include <AIR430BoostETSI.h>
72+
73+
// -----------------------------------------------------------------------------
74+
/**
75+
* Defines, enumerations, and structure definitions
76+
*/
77+
78+
#define ADDRESS_LOCAL 0x01
79+
80+
/**
81+
* sPacket - packet format.
82+
*/
83+
struct sPacket
84+
{
85+
uint8_t from; // Local node address that message originated from
86+
uint8_t message[59]; // Local node message [MAX. 59 bytes]
87+
};
88+
89+
// -----------------------------------------------------------------------------
90+
/**
91+
* Global data
92+
*/
93+
94+
struct sPacket rxPacket;
95+
96+
// -----------------------------------------------------------------------------
97+
// Main example
98+
99+
void setup()
100+
{
101+
// The radio library uses the SPI library internally, this call initializes
102+
// SPI/CSn and GDO0 lines. Also setup initial address, channel, and TX power.
103+
Radio.begin(ADDRESS_LOCAL, CHANNEL_1, POWER_MAX);
104+
105+
rxPacket.from = 0;
106+
memset(rxPacket.message, 0, sizeof(rxPacket.message));
107+
108+
// Setup serial for debug printing.
109+
Serial.begin(9600);
110+
111+
/**
112+
* Setup LED for example demonstration purposes.
113+
*
114+
* Note: Set radio first to ensure that GDO2 line isn't being driven by the
115+
* MCU as it is an output from the radio.
116+
*/
117+
pinMode(RED_LED, OUTPUT); // Use red LED to display message reception
118+
digitalWrite(RED_LED, LOW);
119+
}
120+
121+
void loop()
122+
{
123+
// Turn on the receiver and listen for incoming data. Timeout after 1 seconds.
124+
// The receiverOn() method returns the number of bytes copied to rxData.
125+
if (Radio.receiverOn((unsigned char*)&rxPacket, sizeof(rxPacket), 1000) > 0)
126+
{
127+
digitalWrite(RED_LED, HIGH);
128+
Serial.print("FROM: ");
129+
Serial.print(rxPacket.from);
130+
Serial.print(" MSG: ");
131+
Serial.println((char*)rxPacket.message);
132+
digitalWrite(RED_LED, LOW);
133+
}
134+
135+
// Note: This sketch never transmits so no additional delay required to meet ETSI
136+
// requirements.
137+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
To add more sensors to a network, change the ADDRESS_LOCAL definition.
2+
Be sure to give each node in the network a unique address. Do not use
3+
0 as it is the broadcast address.

0 commit comments

Comments
 (0)