■ ■ ■ ■ ■ ■
firmwareSAMD/SerialPassthrough/SerialPassthrough.ino
1 | 1 | | /* |
2 | | - | SerialPassthrough - Use tool to flash the CC1352 module |
| 2 | + | SerialPassthrough - Use SerialPassthrough for communication with the CC1352 module |
| 3 | + | Andres Sabas @ Electronic Cats |
| 4 | + | Original Creation Date: Jal 23, 2021 |
3 | 5 | | |
4 | | - | Copyright (c) 2018 Electronic Cats SAPI de CV. All rights reserved. |
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 St, Fifth Floor, Boston, MA 02110-1301 USA |
| 6 | + | This code is beerware; if you see me (or any other Electronic Cats |
| 7 | + | member) at the local, and you've found our code helpful, |
| 8 | + | please buy us a round! |
| 9 | + | Distributed as-is; no warranty is given. |
19 | 10 | | */ |
20 | 11 | | unsigned long baud = 921600;//Baud for SmartRF Sniffer 2 also works with Smart RF Flash Programmer 2 |
21 | 12 | | //unsigned long baud = 115200;//Baud for Zigbee2MQTT |
22 | 13 | | |
| 14 | + | #define CTF1 14 |
| 15 | + | #define CTF2 11 |
| 16 | + | #define CTF3 10 |
| 17 | + | |
23 | 18 | | void setup() { |
24 | 19 | | //Begin Serial ports |
25 | 20 | | Serial.begin(baud); |
26 | 21 | | Serial1.begin(baud); |
| 22 | + | |
| 23 | + | pinMode(CTF1, OUTPUT); |
| 24 | + | pinMode(CTF2, OUTPUT); |
| 25 | + | pinMode(CTF3, OUTPUT); |
| 26 | + | |
| 27 | + | //Switch Radio for 2.4Ghz BLE/WIFI |
| 28 | + | digitalWrite(CTF1, LOW); |
| 29 | + | digitalWrite(CTF2, HIGH); |
| 30 | + | digitalWrite(CTF3, LOW); |
| 31 | + | |
| 32 | + | //Switch Radio for 1Ghz-Sub |
| 33 | + | //digitalWrite(CTF1, LOW); |
| 34 | + | //digitalWrite(CTF2, LOW); |
| 35 | + | //digitalWrite(CTF3, HIGH); |
27 | 36 | | |
28 | 37 | | } |
29 | 38 | | |
| skipped 17 lines |