Skip to content

Commit

Permalink
Merge pull request #104 from Terrapin-Rocket-Team/69-basic-raspberry-…
Browse files Browse the repository at this point in the history
…pi-radio-code

Basic Raspberry Pi Teensy Interface and Live Video Radio Code
  • Loading branch information
varun-un authored Jul 20, 2024
2 parents b5212c1 + 8afed98 commit 1965fae
Show file tree
Hide file tree
Showing 487 changed files with 94,154 additions and 416,302 deletions.
12 changes: 6 additions & 6 deletions Side_Projects/Live Video/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
*.mp4
*.av1
*.ivf
/.vscode
/build
/radio-interface/build
/aom
/bcm2835*
/RadioHead
*.log
.vscode/
build/
aom/
bcm2835*/
RadioHead/
22 changes: 0 additions & 22 deletions Side_Projects/Live Video/.vscode/c_cpp_properties.json

This file was deleted.

83 changes: 0 additions & 83 deletions Side_Projects/Live Video/.vscode/settings.json

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed Side_Projects/Live Video/CAD/PCB, RPi4ModelB.SLDPRT
Binary file not shown.
Binary file modified Side_Projects/Live Video/CAD/Raspberry Pi 4 Model B.SLDASM
Binary file not shown.
415,879 changes: 0 additions & 415,879 deletions Side_Projects/Live Video/CAD/Raspberry Pi 4 Model B.STEP

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file removed Side_Projects/Live Video/CAD/TopView, RPi4ModelB.PNG
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion Side_Projects/Live Video/crontab-config
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h dom mon dow command
@reboot python ~/lv-github/scripts/video_handler.py
@reboot python ~/lv-github/scripts/live_video_handler.py
6 changes: 6 additions & 0 deletions Side_Projects/Live Video/live-video-teensy/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.pio
.vscode/.browse.c_cpp.db*
.vscode/c_cpp_properties.json
.vscode/launch.json
.vscode/ipch
serial_logs/
39 changes: 39 additions & 0 deletions Side_Projects/Live Video/live-video-teensy/include/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@

This directory is intended for project header files.

A header file is a file containing C declarations and macro definitions
to be shared between several project source files. You request the use of a
header file in your project source file (C, C++, etc) located in `src` folder
by including it, with the C preprocessing directive `#include'.

```src/main.c

#include "header.h"

int main (void)
{
...
}
```

Including a header file produces the same results as copying the header file
into each source file that needs it. Such copying would be time-consuming
and error-prone. With a header file, the related declarations appear
in only one place. If they need to be changed, they can be changed in one
place, and programs that include the header file will automatically use the
new version when next recompiled. The header file eliminates the labor of
finding and changing all the copies as well as the risk that a failure to
find one copy will result in inconsistencies within a program.

In C, the usual convention is to give header files names that end with `.h'.
It is most portable to use only letters, digits, dashes, and underscores in
header file names, and at most one dot.

Read more about using header files in official GCC documentation:

* Include Syntax
* Include Operation
* Once-Only Headers
* Computed Includes

https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html
45 changes: 45 additions & 0 deletions Side_Projects/Live Video/live-video-teensy/include/Radio.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#ifndef RADIO_H
#define RADIO_H

#if defined(ARDUINO)
#include <Arduino.h>
#elif defined(_WIN32) || defined(_WIN64) // Windows
#include <cstdint>
#include <string>
#include <cstring>
#elif defined(__unix__) // Linux
// TODO
#elif defined(__APPLE__) // OSX
// TODO
#endif

/*
Types:
- ENCT_TELEMETRY: latitude,longitude,altitude,speed,heading,precision,stage,t0 <-> APRS message
- ENCT_VIDEO: char* filled with raw bytes <-> Raw byte array
- ENCT_GROUNDSTATION: Source:Value,Destination:Value,Path:Value,Type:Value,Body:Value <-> APRS message
- ENCT_NONE: no encoding is applied, same as using tx()
*/
enum EncodingType
{
ENCT_TELEMETRY,
ENCT_VIDEO,
ENCT_GROUNDSTATION,
ENCT_NONE
};

class Radio
{
public:
virtual ~Radio(){}; // Virtual descructor. Very important
virtual bool begin() = 0;
virtual bool tx(const char *message, int len = -1) = 0;
virtual const char *rx() = 0;
virtual bool encode(char *message, EncodingType type, int len = -1) = 0;
virtual bool decode(char *message, EncodingType type, int len = -1) = 0;
virtual bool send(const char *message, EncodingType type, int len = -1) = 0;
virtual const char *receive(EncodingType type) = 0;
virtual int RSSI() = 0;
};

#endif // RADIO_H
46 changes: 46 additions & 0 deletions Side_Projects/Live Video/live-video-teensy/lib/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@

This directory is intended for project specific (private) libraries.
PlatformIO will compile them to static libraries and link into executable file.

The source code of each library should be placed in an own separate directory
("lib/your_library_name/[here are source files]").

For example, see a structure of the following two libraries `Foo` and `Bar`:

|--lib
| |
| |--Bar
| | |--docs
| | |--examples
| | |--src
| | |- Bar.c
| | |- Bar.h
| | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html
| |
| |--Foo
| | |- Foo.c
| | |- Foo.h
| |
| |- README --> THIS FILE
|
|- platformio.ini
|--src
|- main.c

and a contents of `src/main.c`:
```
#include <Foo.h>
#include <Bar.h>

int main (void)
{
...
}

```

PlatformIO Library Dependency Finder will find automatically dependent
libraries scanning project source files.

More information about PlatformIO Library Dependency Finder
- https://docs.platformio.org/page/librarymanager/ldf.html
17 changes: 17 additions & 0 deletions Side_Projects/Live Video/live-video-teensy/lib/RadioHead/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
This software is Copyright (C) Mike McCauley. Use is subject to license
conditions. The main licensing options available are GPL V3 or Commercial:

Open Source Licensing GPL V3

This is the appropriate option if you want to share the source code of your
application with everyone you distribute it to, and you also want to give them
the right to share who uses it. If you wish to use this software under Open
Source Licensing, you must contribute all your source code to the open source
community in accordance with the GPL Version 3 when your application is
distributed. See http://www.gnu.org/copyleft/gpl.html

Commercial Licensing

This is the appropriate option if you are creating proprietary applications
and you are not prepared to distribute and share the source code of your
application. Contact info@airspayce for details.
Loading

0 comments on commit 1965fae

Please sign in to comment.