mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-06-23 22:34:29 -04:00
Merge branch 'next' into feature/disableTouch
This commit is contained in:
commit
a9d2b2ff8a
84 changed files with 37068 additions and 35942 deletions
28
.github/workflows/changelog.py
vendored
Normal file
28
.github/workflows/changelog.py
vendored
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
import os
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
|
||||||
|
raw_git = os.popen('git log next --since="24 hours" --pretty=format:"- %h - {USERNAME}*+%al-%an*: %s"').read()
|
||||||
|
|
||||||
|
|
||||||
|
def compute_username(line):
|
||||||
|
stripped = re.search(r'(?<=\*)(.*?)(?=\*)', line).group(0)
|
||||||
|
|
||||||
|
pattern = re.compile("[$@+&?].*[$@+&?]")
|
||||||
|
if pattern.match(stripped):
|
||||||
|
stripped = re.sub("[$@+&?].*[$@+&?]", "", stripped)
|
||||||
|
stripped = re.match(r'.+?(?=-)', stripped).group(0)
|
||||||
|
else:
|
||||||
|
stripped = re.sub(r'^.*?-', "", stripped)
|
||||||
|
return "@" + stripped
|
||||||
|
|
||||||
|
|
||||||
|
def compile_line(line):
|
||||||
|
username = compute_username(line)
|
||||||
|
line = re.sub(r'[*].*[*]', "", line)
|
||||||
|
line = line.replace("{USERNAME}", username)
|
||||||
|
return line
|
||||||
|
|
||||||
|
|
||||||
|
for row in raw_git.splitlines():
|
||||||
|
print(compile_line(row))
|
99
.github/workflows/create_nightly_release.yml
vendored
Normal file
99
.github/workflows/create_nightly_release.yml
vendored
Normal file
|
@ -0,0 +1,99 @@
|
||||||
|
name: Nightly Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: "0 0 * * *"
|
||||||
|
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check_date:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: Check latest commit
|
||||||
|
outputs:
|
||||||
|
should_run: ${{ steps.should_run.outputs.should_run }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: print latest_commit
|
||||||
|
run: echo ${{ github.sha }}
|
||||||
|
|
||||||
|
- name: check latest commit is less than a day
|
||||||
|
id: should_run
|
||||||
|
continue-on-error: true
|
||||||
|
run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "::set-output name=should_run::false"
|
||||||
|
build:
|
||||||
|
needs: check_date
|
||||||
|
if: ${{ needs.check_date.outputs.should_run != 'false' }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Get current date
|
||||||
|
id: date
|
||||||
|
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
|
||||||
|
- name: Get version date
|
||||||
|
id: version_date
|
||||||
|
run: echo "::set-output name=date::n_$(date +'%y%m%d')"
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@master
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
ref: next
|
||||||
|
submodules: true
|
||||||
|
- name: Git Sumbodule Update
|
||||||
|
run: |
|
||||||
|
git submodule update --init --recursive
|
||||||
|
- name: Build the Docker image
|
||||||
|
run: docker build -t portapack-dev -f dockerfile-nogit . --tag my-image-name:$(date +%s)
|
||||||
|
- name: Make build folder
|
||||||
|
run: mkdir ${{ github.workspace }}/build
|
||||||
|
- name: Run the Docker image
|
||||||
|
run: docker run -e VERSION_STRING=${{ steps.version_date.outputs.date }} -i -v ${{ github.workspace }}:/havoc portapack-dev
|
||||||
|
- name: Create Firmware ZIP
|
||||||
|
run: |
|
||||||
|
zip -j firmware.zip build/firmware/portapack-h1_h2-mayhem.bin && cd flashing && zip -r ../firmware.zip *
|
||||||
|
- name: Create SD Card ZIP
|
||||||
|
run: |
|
||||||
|
zip -r sdcard.zip sdcard
|
||||||
|
- name: Create changelog
|
||||||
|
run: |
|
||||||
|
CHANGELOG=$(python3 .github/workflows/changelog.py)
|
||||||
|
CHANGELOG="${CHANGELOG//'%'/'%25'}"
|
||||||
|
CHANGELOG="${CHANGELOG//$'\n'/'%0A'}"
|
||||||
|
CHANGELOG="${CHANGELOG//$'\r'/'%0D'}"
|
||||||
|
echo "::set-output name=content::$CHANGELOG"
|
||||||
|
id: changelog
|
||||||
|
- name: Create Release
|
||||||
|
id: create_release
|
||||||
|
uses: actions/create-release@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
tag_name: nightly-tag-${{ steps.date.outputs.date }}
|
||||||
|
release_name: Nightly Release - ${{ steps.date.outputs.date }}
|
||||||
|
body: |
|
||||||
|
**Nightly release - ${{ steps.date.outputs.date }}**
|
||||||
|
This build is the latest and greatest, although may not be the most stable as this is a nightly release.
|
||||||
|
## Release notes
|
||||||
|
### Revision (${{ steps.version_date.outputs.date }}):
|
||||||
|
${{ steps.changelog.outputs.content }}
|
||||||
|
draft: false
|
||||||
|
prerelease: true
|
||||||
|
- name: Upload Firmware Asset
|
||||||
|
id: upload-firmware-asset
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
asset_path: ./firmware.zip
|
||||||
|
asset_name: mayhem_nightly_${{ steps.version_date.outputs.date }}_FIRMWARE.zip
|
||||||
|
asset_content_type: application/zip
|
||||||
|
- name: Upload SD Card Assets
|
||||||
|
id: upload-sd-card-asset
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
asset_path: ./sdcard.zip
|
||||||
|
asset_name: mayhem_nightly_${{ steps.version_date.outputs.date }}_COPY_TO_SDCARD.zip
|
||||||
|
asset_content_type: application/zip
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -39,7 +39,6 @@
|
||||||
*.lib
|
*.lib
|
||||||
|
|
||||||
# Executables
|
# Executables
|
||||||
*.exe
|
|
||||||
*.out
|
*.out
|
||||||
*.app
|
*.app
|
||||||
/firmware/baseband/*.bin
|
/firmware/baseband/*.bin
|
||||||
|
|
|
@ -25,8 +25,8 @@ set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_LIST_DIR}/firmware/toolchain-arm-cortex
|
||||||
|
|
||||||
project(portapack-h1)
|
project(portapack-h1)
|
||||||
|
|
||||||
#set(VERSION "")
|
set(VERSION "$ENV{VERSION_STRING}")
|
||||||
if (NOT DEFINED VERSION)
|
if ("$ENV{VERSION_STRING}" STREQUAL "")
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND git log -n 1 --format=%h
|
COMMAND git log -n 1 --format=%h
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
|
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
|
||||||
|
@ -38,7 +38,7 @@ if (NOT DEFINED VERSION)
|
||||||
if (GIT_VERSION_FOUND)
|
if (GIT_VERSION_FOUND)
|
||||||
set(VERSION "unknown")
|
set(VERSION "unknown")
|
||||||
else (GIT_VERSION_FOUND)
|
else (GIT_VERSION_FOUND)
|
||||||
set(VERSION "local-${GIT_VERSION}")
|
set(VERSION "${GIT_VERSION}")
|
||||||
endif (GIT_VERSION_FOUND)
|
endif (GIT_VERSION_FOUND)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,9 @@ To support the people behind the hardware, please buy a genuine [HackRF](https:/
|
||||||
|
|
||||||
## Where is the latest firmware?
|
## Where is the latest firmware?
|
||||||
|
|
||||||
The current stable release is on the [](https://github.com/eried/portapack-mayhem/releases/latest) page. Follow the instructions you can find in the release description.
|
The **latest (nightly) release** can be found [here](https://github.com/eried/portapack-mayhem/releases/).
|
||||||
|
|
||||||
|
The current **stable release** is on the [](https://github.com/eried/portapack-mayhem/releases/latest) page. Follow the instructions you can find in the release description.
|
||||||
|
|
||||||
## Is this the newest firmware for my PortaPack?
|
## Is this the newest firmware for my PortaPack?
|
||||||
Most probably: **YES**. *If you find new features somewhere else, please [suggest](https://github.com/eried/portapack-mayhem/issues/new/choose) them*.
|
Most probably: **YES**. *If you find new features somewhere else, please [suggest](https://github.com/eried/portapack-mayhem/issues/new/choose) them*.
|
||||||
|
|
|
@ -159,6 +159,7 @@ set(CPPSRC
|
||||||
capture_thread.cpp
|
capture_thread.cpp
|
||||||
clock_manager.cpp
|
clock_manager.cpp
|
||||||
core_control.cpp
|
core_control.cpp
|
||||||
|
database.cpp
|
||||||
de_bruijn.cpp
|
de_bruijn.cpp
|
||||||
#emu_cc1101.cpp
|
#emu_cc1101.cpp
|
||||||
rfm69.cpp
|
rfm69.cpp
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
#include "ais_app.hpp"
|
#include "ais_app.hpp"
|
||||||
|
|
||||||
#include "string_format.hpp"
|
#include "string_format.hpp"
|
||||||
|
#include "database.hpp"
|
||||||
|
|
||||||
#include "baseband_api.hpp"
|
#include "baseband_api.hpp"
|
||||||
|
|
||||||
|
@ -62,6 +63,25 @@ static std::string mmsi(
|
||||||
return to_string_dec_uint(mmsi, 9, '0'); // MMSI is always is always 9 characters pre-padded with zeros
|
return to_string_dec_uint(mmsi, 9, '0'); // MMSI is always is always 9 characters pre-padded with zeros
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static std::string mid(
|
||||||
|
const ais::MMSI& mmsi
|
||||||
|
) {
|
||||||
|
std::database db;
|
||||||
|
std::string mid_code = "";
|
||||||
|
std::database::MidDBRecord mid_record = {};
|
||||||
|
int return_code = 0;
|
||||||
|
|
||||||
|
// Try getting the country name from mids.db using MID code for given MMSI
|
||||||
|
mid_code = to_string_dec_uint(mmsi, 9, ' ').substr(0, 3);
|
||||||
|
return_code = db.retrieve_mid_record(&mid_record, mid_code);
|
||||||
|
switch(return_code) {
|
||||||
|
case DATABASE_RECORD_FOUND: return mid_record.country;
|
||||||
|
case DATABASE_NOT_FOUND: return "No mids.db file";
|
||||||
|
default: return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static std::string navigational_status(const unsigned int value) {
|
static std::string navigational_status(const unsigned int value) {
|
||||||
switch(value) {
|
switch(value) {
|
||||||
case 0: return "under way w/engine";
|
case 0: return "under way w/engine";
|
||||||
|
@ -271,6 +291,7 @@ void AISRecentEntryDetailView::paint(Painter& painter) {
|
||||||
auto field_rect = Rect { rect.left(), rect.top() + 16, rect.width(), 16 };
|
auto field_rect = Rect { rect.left(), rect.top() + 16, rect.width(), 16 };
|
||||||
|
|
||||||
field_rect = draw_field(painter, field_rect, s, "MMSI", ais::format::mmsi(entry_.mmsi));
|
field_rect = draw_field(painter, field_rect, s, "MMSI", ais::format::mmsi(entry_.mmsi));
|
||||||
|
field_rect = draw_field(painter, field_rect, s, "Ctry", ais::format::mid(entry_.mmsi));
|
||||||
field_rect = draw_field(painter, field_rect, s, "Name", entry_.name);
|
field_rect = draw_field(painter, field_rect, s, "Name", entry_.name);
|
||||||
field_rect = draw_field(painter, field_rect, s, "Call", entry_.call_sign);
|
field_rect = draw_field(painter, field_rect, s, "Call", entry_.call_sign);
|
||||||
field_rect = draw_field(painter, field_rect, s, "Dest", entry_.destination);
|
field_rect = draw_field(painter, field_rect, s, "Dest", entry_.destination);
|
||||||
|
@ -308,7 +329,12 @@ AISAppView::AISAppView(NavigationView& nav) : nav_ { nav } {
|
||||||
|
|
||||||
target_frequency_ = initial_target_frequency;
|
target_frequency_ = initial_target_frequency;
|
||||||
|
|
||||||
radio::enable({
|
receiver_model.set_tuning_frequency(tuning_frequency());
|
||||||
|
receiver_model.set_sampling_rate(sampling_rate);
|
||||||
|
receiver_model.set_baseband_bandwidth(baseband_bandwidth);
|
||||||
|
receiver_model.enable(); // Before using radio::enable(), but not updating Ant.DC-Bias.
|
||||||
|
|
||||||
|
/* radio::enable({ // this can be removed, previous version,no DC-bias control.
|
||||||
tuning_frequency(),
|
tuning_frequency(),
|
||||||
sampling_rate,
|
sampling_rate,
|
||||||
baseband_bandwidth,
|
baseband_bandwidth,
|
||||||
|
@ -316,7 +342,7 @@ AISAppView::AISAppView(NavigationView& nav) : nav_ { nav } {
|
||||||
receiver_model.rf_amp(),
|
receiver_model.rf_amp(),
|
||||||
static_cast<int8_t>(receiver_model.lna()),
|
static_cast<int8_t>(receiver_model.lna()),
|
||||||
static_cast<int8_t>(receiver_model.vga()),
|
static_cast<int8_t>(receiver_model.vga()),
|
||||||
});
|
}); */
|
||||||
|
|
||||||
options_channel.on_change = [this](size_t, OptionsField::value_t v) {
|
options_channel.on_change = [this](size_t, OptionsField::value_t v) {
|
||||||
this->on_frequency_changed(v);
|
this->on_frequency_changed(v);
|
||||||
|
@ -337,7 +363,8 @@ AISAppView::AISAppView(NavigationView& nav) : nav_ { nav } {
|
||||||
}
|
}
|
||||||
|
|
||||||
AISAppView::~AISAppView() {
|
AISAppView::~AISAppView() {
|
||||||
radio::disable();
|
/* radio::disable(); */
|
||||||
|
receiver_model.disable(); // to switch off all, including DC bias.
|
||||||
|
|
||||||
baseband::shutdown();
|
baseband::shutdown();
|
||||||
}
|
}
|
||||||
|
|
|
@ -131,11 +131,11 @@ private:
|
||||||
AISRecentEntry entry_ { };
|
AISRecentEntry entry_ { };
|
||||||
|
|
||||||
Button button_done {
|
Button button_done {
|
||||||
{ 125, 216, 96, 24 },
|
{ 125, 224, 96, 24 },
|
||||||
"Done"
|
"Done"
|
||||||
};
|
};
|
||||||
Button button_see_map {
|
Button button_see_map {
|
||||||
{ 19, 216, 96, 24 },
|
{ 19, 224, 96, 24 },
|
||||||
"See on map"
|
"See on map"
|
||||||
};
|
};
|
||||||
GeoMapView* geomap_view { nullptr };
|
GeoMapView* geomap_view { nullptr };
|
||||||
|
@ -169,6 +169,7 @@ private:
|
||||||
static constexpr uint32_t initial_target_frequency = 162025000;
|
static constexpr uint32_t initial_target_frequency = 162025000;
|
||||||
static constexpr uint32_t sampling_rate = 2457600;
|
static constexpr uint32_t sampling_rate = 2457600;
|
||||||
static constexpr uint32_t baseband_bandwidth = 1750000;
|
static constexpr uint32_t baseband_bandwidth = 1750000;
|
||||||
|
|
||||||
NavigationView& nav_;
|
NavigationView& nav_;
|
||||||
|
|
||||||
AISRecentEntries recent { };
|
AISRecentEntries recent { };
|
||||||
|
|
|
@ -129,6 +129,9 @@ AnalogAudioView::AnalogAudioView(
|
||||||
&waterfall
|
&waterfall
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//Filename Datetime and Frequency
|
||||||
|
record_view.set_filename_date_frequency(true);
|
||||||
|
|
||||||
field_frequency.set_value(receiver_model.tuning_frequency());
|
field_frequency.set_value(receiver_model.tuning_frequency());
|
||||||
field_frequency.set_step(receiver_model.frequency_step());
|
field_frequency.set_step(receiver_model.frequency_step());
|
||||||
field_frequency.on_change = [this](rf::Frequency f) {
|
field_frequency.on_change = [this](rf::Frequency f) {
|
||||||
|
|
|
@ -28,11 +28,11 @@
|
||||||
#include "ui_receiver.hpp"
|
#include "ui_receiver.hpp"
|
||||||
#include "ui_spectrum.hpp"
|
#include "ui_spectrum.hpp"
|
||||||
#include "ui_record_view.hpp"
|
#include "ui_record_view.hpp"
|
||||||
|
|
||||||
#include "ui_font_fixed_8x16.hpp"
|
#include "ui_font_fixed_8x16.hpp"
|
||||||
|
|
||||||
#include "tone_key.hpp"
|
#include "tone_key.hpp"
|
||||||
|
|
||||||
|
|
||||||
namespace ui {
|
namespace ui {
|
||||||
|
|
||||||
constexpr Style style_options_group {
|
constexpr Style style_options_group {
|
||||||
|
@ -216,7 +216,10 @@ private:
|
||||||
|
|
||||||
RecordView record_view {
|
RecordView record_view {
|
||||||
{ 0 * 8, 2 * 16, 30 * 8, 1 * 16 },
|
{ 0 * 8, 2 * 16, 30 * 8, 1 * 16 },
|
||||||
u"AUD_????", RecordView::FileType::WAV, 4096, 4
|
u"AUD",
|
||||||
|
RecordView::FileType::WAV,
|
||||||
|
4096,
|
||||||
|
4
|
||||||
};
|
};
|
||||||
|
|
||||||
spectrum::WaterfallWidget waterfall { true };
|
spectrum::WaterfallWidget waterfall { true };
|
||||||
|
|
|
@ -75,8 +75,8 @@ CaptureAppView::CaptureAppView(NavigationView& nav) {
|
||||||
option_bandwidth.on_change = [this](size_t, uint32_t base_rate) {
|
option_bandwidth.on_change = [this](size_t, uint32_t base_rate) {
|
||||||
sampling_rate = 8 * base_rate; // Decimation by 8 done on baseband side
|
sampling_rate = 8 * base_rate; // Decimation by 8 done on baseband side
|
||||||
/* base_rate is used for FFT calculation and display LCD, and also in recording writing SD Card rate. */
|
/* base_rate is used for FFT calculation and display LCD, and also in recording writing SD Card rate. */
|
||||||
/* ex. sampling_rate values, 4Mhz, when recording 500 khz (BW) and fs 8 Mhz , when selected 1 Mhz BW ...*/
|
/* ex. sampling_rate values, 4Mhz, when recording 500 kHz (BW) and fs 8 Mhz , when selected 1 Mhz BW ...*/
|
||||||
/* ex. recording 500khz BW to .C16 file, base_rate clock 500khz x2(I,Q) x 2 bytes (int signed) =2MB/sec rate SD Card */
|
/* ex. recording 500kHz BW to .C16 file, base_rate clock 500kHz x2(I,Q) x 2 bytes (int signed) =2MB/sec rate SD Card */
|
||||||
|
|
||||||
waterfall.on_hide();
|
waterfall.on_hide();
|
||||||
record_view.set_sampling_rate(sampling_rate);
|
record_view.set_sampling_rate(sampling_rate);
|
||||||
|
@ -85,12 +85,12 @@ CaptureAppView::CaptureAppView(NavigationView& nav) {
|
||||||
|
|
||||||
switch(sampling_rate) { // we use the var fs (sampling_rate) , to set up BPF aprox < fs_max/2 by Nyquist theorem.
|
switch(sampling_rate) { // we use the var fs (sampling_rate) , to set up BPF aprox < fs_max/2 by Nyquist theorem.
|
||||||
|
|
||||||
case 0 ... 2000000: // BW Captured range (0 <= 250Khz max ) fs = 8 x 250 Khz
|
case 0 ... 2000000: // BW Captured range (0 <= 250kHz max ) fs = 8 x 250 kHz
|
||||||
anti_alias_baseband_bandwidth_filter = 1750000; // Minimum BPF MAX2837 for all those lower BW options.
|
anti_alias_baseband_bandwidth_filter = 1750000; // Minimum BPF MAX2837 for all those lower BW options.
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 4000000 ... 6000000: // BW capture range (500k ... 750Khz max ) fs_max = 8 x 750Khz = 6Mhz
|
case 4000000 ... 6000000: // BW capture range (500k ... 750kHz max ) fs_max = 8 x 750kHz = 6Mhz
|
||||||
// BW 500k ... 750khz , ex. 500khz (fs = 8*BW = 4Mhz) , BW 600Khz (fs = 4,8Mhz) , BW 750 Khz (fs = 6Mhz)
|
// BW 500k ... 750kHz , ex. 500kHz (fs = 8*BW = 4Mhz) , BW 600kHz (fs = 4,8Mhz) , BW 750 kHz (fs = 6Mhz)
|
||||||
anti_alias_baseband_bandwidth_filter = 2500000; // in some IC MAX2837 appear 2250000 , but both works similar.
|
anti_alias_baseband_bandwidth_filter = 2500000; // in some IC MAX2837 appear 2250000 , but both works similar.
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -123,7 +123,7 @@ CaptureAppView::CaptureAppView(NavigationView& nav) {
|
||||||
waterfall.on_show();
|
waterfall.on_show();
|
||||||
};
|
};
|
||||||
|
|
||||||
option_bandwidth.set_selected_index(7); // 500k, Preselected starting default option 500khz
|
option_bandwidth.set_selected_index(7); // 500k, Preselected starting default option 500kHz
|
||||||
|
|
||||||
receiver_model.set_modulation(ReceiverModel::Mode::Capture);
|
receiver_model.set_modulation(ReceiverModel::Mode::Capture);
|
||||||
receiver_model.enable();
|
receiver_model.enable();
|
||||||
|
|
|
@ -140,13 +140,24 @@ void GpsSimAppView::start() {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
field_rfgain.on_change = [this](int32_t v) {
|
||||||
|
tx_gain = v;
|
||||||
|
};
|
||||||
|
field_rfgain.set_value(tx_gain);
|
||||||
|
receiver_model.set_tx_gain(tx_gain);
|
||||||
|
|
||||||
|
|
||||||
|
field_rfamp.on_change = [this](int32_t v) {
|
||||||
|
rf_amp = (bool)v;
|
||||||
|
};
|
||||||
|
field_rfamp.set_value(rf_amp ? 14 : 0);
|
||||||
|
|
||||||
radio::enable({
|
radio::enable({
|
||||||
receiver_model.tuning_frequency(),
|
receiver_model.tuning_frequency(),
|
||||||
sample_rate ,
|
sample_rate ,
|
||||||
baseband_bandwidth,
|
baseband_bandwidth,
|
||||||
rf::Direction::Transmit,
|
rf::Direction::Transmit,
|
||||||
receiver_model.rf_amp(),
|
rf_amp, // previous code line : "receiver_model.rf_amp()," was passing the same rf_amp of all Receiver Apps
|
||||||
static_cast<int8_t>(receiver_model.lna()),
|
static_cast<int8_t>(receiver_model.lna()),
|
||||||
static_cast<int8_t>(receiver_model.vga())
|
static_cast<int8_t>(receiver_model.vga())
|
||||||
});
|
});
|
||||||
|
@ -181,6 +192,9 @@ GpsSimAppView::GpsSimAppView(
|
||||||
NavigationView& nav
|
NavigationView& nav
|
||||||
) : nav_ (nav)
|
) : nav_ (nav)
|
||||||
{
|
{
|
||||||
|
tx_gain = 35;field_rfgain.set_value(tx_gain); // Initial default value (-12 dB's max 47dBs ).
|
||||||
|
field_rfamp.set_value(rf_amp ? 14 : 0); // Initial default value True. (TX RF amp on , +14dB's)
|
||||||
|
|
||||||
baseband::run_image(portapack::spi_flash::image_tag_gps);
|
baseband::run_image(portapack::spi_flash::image_tag_gps);
|
||||||
|
|
||||||
add_children({
|
add_children({
|
||||||
|
@ -191,8 +205,8 @@ GpsSimAppView::GpsSimAppView(
|
||||||
&text_duration,
|
&text_duration,
|
||||||
&progressbar,
|
&progressbar,
|
||||||
&field_frequency,
|
&field_frequency,
|
||||||
&field_lna,
|
&field_rfgain,
|
||||||
&field_rf_amp,
|
&field_rfamp, // let's not use common persistent rf_amp , local rfamp is enough
|
||||||
&check_loop,
|
&check_loop,
|
||||||
&button_play,
|
&button_play,
|
||||||
&waterfall,
|
&waterfall,
|
||||||
|
|
|
@ -52,6 +52,8 @@ private:
|
||||||
static constexpr ui::Dim header_height = 3 * 16;
|
static constexpr ui::Dim header_height = 3 * 16;
|
||||||
|
|
||||||
uint32_t sample_rate = 0;
|
uint32_t sample_rate = 0;
|
||||||
|
int32_t tx_gain { 47 };
|
||||||
|
bool rf_amp { true }; // aux private var to store temporal, same as Replay App rf_amp user selection.
|
||||||
static constexpr uint32_t baseband_bandwidth = 3000000; //filter bandwidth
|
static constexpr uint32_t baseband_bandwidth = 3000000; //filter bandwidth
|
||||||
const size_t read_size { 16384 };
|
const size_t read_size { 16384 };
|
||||||
const size_t buffer_count { 3 };
|
const size_t buffer_count { 3 };
|
||||||
|
@ -76,7 +78,7 @@ private:
|
||||||
bool ready_signal { false };
|
bool ready_signal { false };
|
||||||
|
|
||||||
Labels labels {
|
Labels labels {
|
||||||
{ { 10 * 8, 2 * 16 }, "LNA: A:", Color::light_grey() }
|
{ { 10 * 8, 2 * 16 }, "GAIN A:", Color::light_grey() }
|
||||||
};
|
};
|
||||||
|
|
||||||
Button button_open {
|
Button button_open {
|
||||||
|
@ -104,11 +106,19 @@ private:
|
||||||
FrequencyField field_frequency {
|
FrequencyField field_frequency {
|
||||||
{ 0 * 8, 2 * 16 },
|
{ 0 * 8, 2 * 16 },
|
||||||
};
|
};
|
||||||
LNAGainField field_lna {
|
NumberField field_rfgain {
|
||||||
{ 14 * 8, 2 * 16 }
|
{ 14 * 8, 2 * 16 },
|
||||||
|
2,
|
||||||
|
{ 0, 47 },
|
||||||
|
1,
|
||||||
|
' '
|
||||||
};
|
};
|
||||||
RFAmpField field_rf_amp {
|
NumberField field_rfamp { // previously we were using "RFAmpField field_rf_amp" but that is general Receiver amp setting.
|
||||||
{ 19 * 8, 2 * 16 }
|
{ 19 * 8, 2 * 16 },
|
||||||
|
2,
|
||||||
|
{ 0, 14 }, // this time we will display GUI , 0 or 14 dBs same as Mic and Replay App
|
||||||
|
14,
|
||||||
|
' '
|
||||||
};
|
};
|
||||||
Checkbox check_loop {
|
Checkbox check_loop {
|
||||||
{ 21 * 8, 2 * 16 },
|
{ 21 * 8, 2 * 16 },
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2016 Jared Boone, ShareBrained Technology, Inc.
|
* Copyright (C) 2016 Jared Boone, ShareBrained Technology, Inc.
|
||||||
* Copyright (C) 2016 Furrtek
|
* Copyright (C) 2016 Furrtek
|
||||||
|
* Copyleft (ↄ) 2022 NotPike
|
||||||
*
|
*
|
||||||
* This file is part of PortaPack.
|
* This file is part of PortaPack.
|
||||||
*
|
*
|
||||||
|
@ -121,6 +122,7 @@ void ReplayAppView::start() {
|
||||||
auto open_error = p->open(file_path);
|
auto open_error = p->open(file_path);
|
||||||
if( open_error.is_valid() ) {
|
if( open_error.is_valid() ) {
|
||||||
file_error();
|
file_error();
|
||||||
|
return; // Fixes TX bug if there's a file error
|
||||||
} else {
|
} else {
|
||||||
reader = std::move(p);
|
reader = std::move(p);
|
||||||
}
|
}
|
||||||
|
@ -151,16 +153,18 @@ void ReplayAppView::start() {
|
||||||
};
|
};
|
||||||
field_rfamp.set_value(rf_amp ? 14 : 0);
|
field_rfamp.set_value(rf_amp ? 14 : 0);
|
||||||
|
|
||||||
|
//Enable Bias Tee if selected
|
||||||
|
radio::set_antenna_bias(portapack::get_antenna_bias());
|
||||||
|
|
||||||
radio::enable({
|
radio::enable({
|
||||||
receiver_model.tuning_frequency(),
|
receiver_model.tuning_frequency(),
|
||||||
sample_rate * 8 ,
|
sample_rate * 8,
|
||||||
baseband_bandwidth,
|
baseband_bandwidth,
|
||||||
rf::Direction::Transmit,
|
rf::Direction::Transmit,
|
||||||
rf_amp, // previous code line : "receiver_model.rf_amp()," was passing the same rf_amp of all Receiver Apps
|
rf_amp, // previous code line : "receiver_model.rf_amp()," was passing the same rf_amp of all Receiver Apps
|
||||||
static_cast<int8_t>(receiver_model.lna()),
|
static_cast<int8_t>(receiver_model.lna()),
|
||||||
static_cast<int8_t>(receiver_model.vga())
|
static_cast<int8_t>(receiver_model.vga())
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReplayAppView::stop(const bool do_loop) {
|
void ReplayAppView::stop(const bool do_loop) {
|
||||||
|
@ -170,6 +174,7 @@ void ReplayAppView::stop(const bool do_loop) {
|
||||||
if (do_loop && check_loop.value()) {
|
if (do_loop && check_loop.value()) {
|
||||||
start();
|
start();
|
||||||
} else {
|
} else {
|
||||||
|
radio::set_antenna_bias(false); //Turn off Bias Tee
|
||||||
radio::disable();
|
radio::disable();
|
||||||
button_play.set_bitmap(&bitmap_play);
|
button_play.set_bitmap(&bitmap_play);
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,6 +34,8 @@ namespace tpms {
|
||||||
|
|
||||||
namespace format {
|
namespace format {
|
||||||
|
|
||||||
|
static bool use_kpa = true;
|
||||||
|
|
||||||
std::string type(Reading::Type type) {
|
std::string type(Reading::Type type) {
|
||||||
return to_string_dec_uint(toUType(type), 2);
|
return to_string_dec_uint(toUType(type), 2);
|
||||||
}
|
}
|
||||||
|
@ -43,7 +45,11 @@ std::string id(TransponderID id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string pressure(Pressure pressure) {
|
std::string pressure(Pressure pressure) {
|
||||||
|
if(use_kpa){
|
||||||
return to_string_dec_int(pressure.kilopascal(), 3);
|
return to_string_dec_int(pressure.kilopascal(), 3);
|
||||||
|
}
|
||||||
|
return to_string_dec_int(pressure.psi(), 3);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string temperature(Temperature temperature) {
|
std::string temperature(Temperature temperature) {
|
||||||
|
@ -142,7 +148,7 @@ TPMSAppView::TPMSAppView(NavigationView&) {
|
||||||
&field_rf_amp,
|
&field_rf_amp,
|
||||||
&field_lna,
|
&field_lna,
|
||||||
&field_vga,
|
&field_vga,
|
||||||
&recent_entries_view,
|
&options_type,
|
||||||
});
|
});
|
||||||
|
|
||||||
radio::enable({
|
radio::enable({
|
||||||
|
@ -160,6 +166,17 @@ TPMSAppView::TPMSAppView(NavigationView&) {
|
||||||
};
|
};
|
||||||
options_band.set_by_value(target_frequency());
|
options_band.set_by_value(target_frequency());
|
||||||
|
|
||||||
|
options_type.on_change = [this](size_t, int32_t i) {
|
||||||
|
if (i == 0){
|
||||||
|
tpms::format::use_kpa = true;
|
||||||
|
} else if (i == 1){
|
||||||
|
tpms::format::use_kpa = false;
|
||||||
|
}
|
||||||
|
update_type();
|
||||||
|
};
|
||||||
|
|
||||||
|
options_type.set_selected_index(0, true);
|
||||||
|
|
||||||
logger = std::make_unique<TPMSLogger>();
|
logger = std::make_unique<TPMSLogger>();
|
||||||
if( logger ) {
|
if( logger ) {
|
||||||
logger->append(u"tpms.txt");
|
logger->append(u"tpms.txt");
|
||||||
|
@ -176,9 +193,24 @@ void TPMSAppView::focus() {
|
||||||
options_band.focus();
|
options_band.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TPMSAppView::update_type() {
|
||||||
|
if (tpms::format::use_kpa){
|
||||||
|
remove_child(&recent_entries_view_psi);
|
||||||
|
add_child(&recent_entries_view_kpa);
|
||||||
|
recent_entries_view_kpa.set_parent_rect(view_normal_rect);
|
||||||
|
} else {
|
||||||
|
remove_child(&recent_entries_view_kpa);
|
||||||
|
add_child(&recent_entries_view_psi);
|
||||||
|
recent_entries_view_psi.set_parent_rect(view_normal_rect);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void TPMSAppView::set_parent_rect(const Rect new_parent_rect) {
|
void TPMSAppView::set_parent_rect(const Rect new_parent_rect) {
|
||||||
View::set_parent_rect(new_parent_rect);
|
View::set_parent_rect(new_parent_rect);
|
||||||
recent_entries_view.set_parent_rect({ 0, header_height, new_parent_rect.width(), new_parent_rect.height() - header_height });
|
|
||||||
|
view_normal_rect = { 0, header_height, new_parent_rect.width(), new_parent_rect.height() - header_height };
|
||||||
|
|
||||||
|
update_type();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TPMSAppView::on_packet(const tpms::Packet& packet) {
|
void TPMSAppView::on_packet(const tpms::Packet& packet) {
|
||||||
|
@ -191,13 +223,23 @@ void TPMSAppView::on_packet(const tpms::Packet& packet) {
|
||||||
const auto reading = reading_opt.value();
|
const auto reading = reading_opt.value();
|
||||||
auto& entry = ::on_packet(recent, TPMSRecentEntry::Key { reading.type(), reading.id() });
|
auto& entry = ::on_packet(recent, TPMSRecentEntry::Key { reading.type(), reading.id() });
|
||||||
entry.update(reading);
|
entry.update(reading);
|
||||||
recent_entries_view.set_dirty();
|
|
||||||
|
if(tpms::format::use_kpa){
|
||||||
|
recent_entries_view_kpa.set_dirty();
|
||||||
|
} else {
|
||||||
|
recent_entries_view_psi.set_dirty();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TPMSAppView::on_show_list() {
|
void TPMSAppView::on_show_list() {
|
||||||
recent_entries_view.hidden(false);
|
if(tpms::format::use_kpa){
|
||||||
recent_entries_view.focus();
|
recent_entries_view_kpa.hidden(false);
|
||||||
|
recent_entries_view_kpa.focus();
|
||||||
|
} else {
|
||||||
|
recent_entries_view_psi.hidden(false);
|
||||||
|
recent_entries_view_psi.focus();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TPMSAppView::on_band_changed(const uint32_t new_band_frequency) {
|
void TPMSAppView::on_band_changed(const uint32_t new_band_frequency) {
|
||||||
|
|
|
@ -121,6 +121,8 @@ private:
|
||||||
|
|
||||||
static constexpr ui::Dim header_height = 1 * 16;
|
static constexpr ui::Dim header_height = 1 * 16;
|
||||||
|
|
||||||
|
ui::Rect view_normal_rect { };
|
||||||
|
|
||||||
RSSI rssi {
|
RSSI rssi {
|
||||||
{ 21 * 8, 0, 6 * 8, 4 },
|
{ 21 * 8, 0, 6 * 8, 4 },
|
||||||
};
|
};
|
||||||
|
@ -134,7 +136,16 @@ private:
|
||||||
3,
|
3,
|
||||||
{
|
{
|
||||||
{ "315", 315000000 },
|
{ "315", 315000000 },
|
||||||
{ "434", 433920000 },
|
{ "433", 433920000 },
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
OptionsField options_type {
|
||||||
|
{ 5 * 8, 0 * 16 },
|
||||||
|
3,
|
||||||
|
{
|
||||||
|
{ "kPa", 0 },
|
||||||
|
{ "PSI", 1 }
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -153,7 +164,7 @@ private:
|
||||||
TPMSRecentEntries recent { };
|
TPMSRecentEntries recent { };
|
||||||
std::unique_ptr<TPMSLogger> logger { };
|
std::unique_ptr<TPMSLogger> logger { };
|
||||||
|
|
||||||
const RecentEntriesColumns columns { {
|
const RecentEntriesColumns columns_kpa { {
|
||||||
{ "Tp", 2 },
|
{ "Tp", 2 },
|
||||||
{ "ID", 8 },
|
{ "ID", 8 },
|
||||||
{ "kPa", 3 },
|
{ "kPa", 3 },
|
||||||
|
@ -161,12 +172,23 @@ private:
|
||||||
{ "Cnt", 3 },
|
{ "Cnt", 3 },
|
||||||
{ "Fl", 2 },
|
{ "Fl", 2 },
|
||||||
} };
|
} };
|
||||||
TPMSRecentEntriesView recent_entries_view { columns, recent };
|
TPMSRecentEntriesView recent_entries_view_kpa { columns_kpa, recent };
|
||||||
|
|
||||||
|
const RecentEntriesColumns columns_psi { {
|
||||||
|
{ "Tp", 2 },
|
||||||
|
{ "ID", 8 },
|
||||||
|
{ "PSI", 3 },
|
||||||
|
{ "C", 3 },
|
||||||
|
{ "Cnt", 3 },
|
||||||
|
{ "Fl", 2 },
|
||||||
|
} };
|
||||||
|
TPMSRecentEntriesView recent_entries_view_psi { columns_psi, recent };
|
||||||
|
|
||||||
uint32_t target_frequency_ = initial_target_frequency;
|
uint32_t target_frequency_ = initial_target_frequency;
|
||||||
|
|
||||||
void on_packet(const tpms::Packet& packet);
|
void on_packet(const tpms::Packet& packet);
|
||||||
void on_show_list();
|
void on_show_list();
|
||||||
|
void update_type();
|
||||||
|
|
||||||
void on_band_changed(const uint32_t new_band_frequency);
|
void on_band_changed(const uint32_t new_band_frequency);
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,8 @@ namespace ui
|
||||||
console.writeln("vXxOinvizioNxX,teixeluis");
|
console.writeln("vXxOinvizioNxX,teixeluis");
|
||||||
console.writeln("Brumi-2021,texasyojimbo");
|
console.writeln("Brumi-2021,texasyojimbo");
|
||||||
console.writeln("heurist1,intoxsick,ckuethe");
|
console.writeln("heurist1,intoxsick,ckuethe");
|
||||||
console.writeln("notpike");
|
console.writeln("notpike,jLynx,zigad");
|
||||||
|
console.writeln("MichalLeonBorsuk");
|
||||||
console.writeln("");
|
console.writeln("");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -108,10 +108,6 @@ ADSBRxAircraftDetailsView::ADSBRxAircraftDetailsView(
|
||||||
) : entry_copy(entry),
|
) : entry_copy(entry),
|
||||||
on_close_(on_close)
|
on_close_(on_close)
|
||||||
{
|
{
|
||||||
char file_buffer[32] { 0 };
|
|
||||||
bool found = false;
|
|
||||||
size_t number_of_icao_codes = 0;
|
|
||||||
std::string icao_code;
|
|
||||||
|
|
||||||
add_children({
|
add_children({
|
||||||
&labels,
|
&labels,
|
||||||
|
@ -130,46 +126,22 @@ ADSBRxAircraftDetailsView::ADSBRxAircraftDetailsView(
|
||||||
std::unique_ptr<ADSBLogger> logger { };
|
std::unique_ptr<ADSBLogger> logger { };
|
||||||
//update(entry_copy);
|
//update(entry_copy);
|
||||||
|
|
||||||
|
|
||||||
|
icao_code = to_string_hex(entry_copy.ICAO_address, 6);
|
||||||
text_icao_address.set(to_string_hex(entry_copy.ICAO_address, 6));
|
text_icao_address.set(to_string_hex(entry_copy.ICAO_address, 6));
|
||||||
|
|
||||||
|
|
||||||
// Try getting the aircraft information from icao24.db
|
// Try getting the aircraft information from icao24.db
|
||||||
auto result = db_file.open("ADSB/icao24.db");
|
return_code = db.retrieve_aircraft_record(&aircraft_record, icao_code);
|
||||||
if (!result.is_valid()) {
|
switch(return_code) {
|
||||||
// determine number of ICAO24 codes in file, total size / (single index + record size)
|
case DATABASE_RECORD_FOUND:
|
||||||
number_of_icao_codes = (db_file.size() / 153);
|
text_registration.set(aircraft_record.aircraft_registration);
|
||||||
icao_code = to_string_hex(entry_copy.ICAO_address, 6);
|
text_manufacturer.set(aircraft_record.aircraft_manufacturer);
|
||||||
|
text_model.set(aircraft_record.aircraft_model);
|
||||||
// binary search
|
text_owner.set(aircraft_record.aircraft_owner);
|
||||||
int first = 0, // First search element
|
text_operator.set(aircraft_record.aircraft_operator);
|
||||||
last = number_of_icao_codes - 1, // Last search element
|
// Check for ICAO type, e.g. L2J
|
||||||
middle, // Mid point of search
|
if(strlen(aircraft_record.icao_type) == 3) {
|
||||||
position = -1; // Position of search value
|
switch(aircraft_record.icao_type[0]) {
|
||||||
while (!found && first <= last) {
|
|
||||||
middle = (first + last) / 2; // Calculate mid point
|
|
||||||
db_file.seek(middle * 7);
|
|
||||||
db_file.read(file_buffer, 6);
|
|
||||||
if (file_buffer == icao_code) { // If value is found at mid
|
|
||||||
found = true;
|
|
||||||
position = middle;
|
|
||||||
}
|
|
||||||
else if (file_buffer > icao_code) // If value is in lower half
|
|
||||||
last = middle - 1;
|
|
||||||
else
|
|
||||||
first = middle + 1; // If value is in upper half
|
|
||||||
}
|
|
||||||
|
|
||||||
if (position > -1) {
|
|
||||||
db_file.seek((number_of_icao_codes * 7) + (position * 146)); // seek starting after index
|
|
||||||
db_file.read(file_buffer, 9);
|
|
||||||
text_registration.set(file_buffer);
|
|
||||||
db_file.read(file_buffer, 33);
|
|
||||||
text_manufacturer.set(file_buffer);
|
|
||||||
db_file.read(file_buffer, 33);
|
|
||||||
text_model.set(file_buffer);
|
|
||||||
db_file.read(file_buffer, 5); // ICAO type decripton
|
|
||||||
if(strlen(file_buffer) == 3) {
|
|
||||||
switch(file_buffer[0]) {
|
|
||||||
case 'L':
|
case 'L':
|
||||||
text_type.set("Landplane");
|
text_type.set("Landplane");
|
||||||
break;
|
break;
|
||||||
|
@ -189,8 +161,8 @@ ADSBRxAircraftDetailsView::ADSBRxAircraftDetailsView(
|
||||||
text_type.set("Tilt-wing aircraft");
|
text_type.set("Tilt-wing aircraft");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
text_number_of_engines.set(std::string(1, file_buffer[1]));
|
text_number_of_engines.set(std::string(1, aircraft_record.icao_type[1]));
|
||||||
switch(file_buffer[2]) {
|
switch(aircraft_record.icao_type[2]) {
|
||||||
case 'P':
|
case 'P':
|
||||||
text_engine_type.set("Piston engine");
|
text_engine_type.set("Piston engine");
|
||||||
break;
|
break;
|
||||||
|
@ -206,30 +178,22 @@ ADSBRxAircraftDetailsView::ADSBRxAircraftDetailsView(
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// check for ICAO type designator
|
// Check for ICAO type designator
|
||||||
else if(strlen(file_buffer) == 4) {
|
else if(strlen(aircraft_record.icao_type) == 4) {
|
||||||
if(strcmp(file_buffer,"SHIP") == 0) text_type.set("Airship");
|
if(strcmp(aircraft_record.icao_type,"SHIP") == 0) text_type.set("Airship");
|
||||||
else if(strcmp(file_buffer,"BALL") == 0) text_type.set("Balloon");
|
else if(strcmp(aircraft_record.icao_type,"BALL") == 0) text_type.set("Balloon");
|
||||||
else if(strcmp(file_buffer,"GLID") == 0) text_type.set("Glider / sailplane");
|
else if(strcmp(aircraft_record.icao_type,"GLID") == 0) text_type.set("Glider / sailplane");
|
||||||
else if(strcmp(file_buffer,"ULAC") == 0) text_type.set("Micro/ultralight aircraft");
|
else if(strcmp(aircraft_record.icao_type,"ULAC") == 0) text_type.set("Micro/ultralight aircraft");
|
||||||
else if(strcmp(file_buffer,"GYRO") == 0) text_type.set("Micro/ultralight autogyro");
|
else if(strcmp(aircraft_record.icao_type,"GYRO") == 0) text_type.set("Micro/ultralight autogyro");
|
||||||
else if(strcmp(file_buffer,"UHEL") == 0) text_type.set("Micro/ultralight helicopter");
|
else if(strcmp(aircraft_record.icao_type,"UHEL") == 0) text_type.set("Micro/ultralight helicopter");
|
||||||
else if(strcmp(file_buffer,"SHIP") == 0) text_type.set("Airship");
|
else if(strcmp(aircraft_record.icao_type,"SHIP") == 0) text_type.set("Airship");
|
||||||
else if(strcmp(file_buffer,"PARA") == 0) text_type.set("Powered parachute/paraplane");
|
else if(strcmp(aircraft_record.icao_type,"PARA") == 0) text_type.set("Powered parachute/paraplane");
|
||||||
}
|
}
|
||||||
db_file.read(file_buffer, 33);
|
break;
|
||||||
text_owner.set(file_buffer);
|
case DATABASE_NOT_FOUND:
|
||||||
db_file.read(file_buffer, 33);
|
|
||||||
text_operator.set(file_buffer);
|
|
||||||
} else {
|
|
||||||
text_registration.set("Unknown");
|
|
||||||
text_manufacturer.set("Unknown");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
text_manufacturer.set("No icao24.db file");
|
text_manufacturer.set("No icao24.db file");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
button_close.on_select = [&nav](Button&){
|
button_close.on_select = [&nav](Button&){
|
||||||
nav.pop();
|
nav.pop();
|
||||||
};
|
};
|
||||||
|
@ -275,10 +239,6 @@ ADSBRxDetailsView::ADSBRxDetailsView(
|
||||||
) : entry_copy(entry),
|
) : entry_copy(entry),
|
||||||
on_close_(on_close)
|
on_close_(on_close)
|
||||||
{
|
{
|
||||||
char file_buffer[32] { 0 };
|
|
||||||
bool found = false;
|
|
||||||
size_t number_of_airlines = 0;
|
|
||||||
std::string airline_code;
|
|
||||||
|
|
||||||
add_children({
|
add_children({
|
||||||
&labels,
|
&labels,
|
||||||
|
@ -300,46 +260,19 @@ ADSBRxDetailsView::ADSBRxDetailsView(
|
||||||
|
|
||||||
// The following won't (shouldn't !) change for a given airborne aircraft
|
// The following won't (shouldn't !) change for a given airborne aircraft
|
||||||
// Try getting the airline's name from airlines.db
|
// Try getting the airline's name from airlines.db
|
||||||
auto result = db_file.open("ADSB/airlines.db");
|
|
||||||
if (!result.is_valid()) {
|
|
||||||
// Search for 3-letter code
|
|
||||||
number_of_airlines = (db_file.size() / 68); // determine number of airlines in file
|
|
||||||
airline_code = entry_copy.callsign.substr(0, 3);
|
airline_code = entry_copy.callsign.substr(0, 3);
|
||||||
|
return_code = db.retrieve_airline_record(&airline_record, airline_code);
|
||||||
// binary search
|
switch(return_code) {
|
||||||
int first = 0, // First search element
|
case DATABASE_RECORD_FOUND:
|
||||||
last = number_of_airlines - 1, // Last search element
|
text_airline.set(airline_record.airline);
|
||||||
middle, // Mid point of search
|
text_country.set(airline_record.country);
|
||||||
position = -1; // Position of search value
|
break;
|
||||||
while (!found && first <= last) {
|
case DATABASE_NOT_FOUND:
|
||||||
middle = (first + last) / 2; // Calculate mid point
|
|
||||||
db_file.seek(middle * 4);
|
|
||||||
db_file.read(file_buffer, 3);
|
|
||||||
if (file_buffer == airline_code) { // If value is found at mid
|
|
||||||
found = true;
|
|
||||||
position = middle;
|
|
||||||
}
|
|
||||||
else if (file_buffer > airline_code) // If value is in lower half
|
|
||||||
last = middle - 1;
|
|
||||||
else
|
|
||||||
first = middle + 1; // If value is in upper half
|
|
||||||
}
|
|
||||||
|
|
||||||
if (position > -1) {
|
|
||||||
db_file.seek((number_of_airlines * 4) + (position << 6)); // seek starting after index
|
|
||||||
db_file.read(file_buffer, 32);
|
|
||||||
text_airline.set(file_buffer);
|
|
||||||
db_file.read(file_buffer, 32);
|
|
||||||
text_country.set(file_buffer);
|
|
||||||
} else {
|
|
||||||
text_airline.set("Unknown");
|
|
||||||
text_country.set("Unknown");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
text_airline.set("No airlines.db file");
|
text_airline.set("No airlines.db file");
|
||||||
text_country.set("No airlines.db file");
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
text_callsign.set(entry_copy.callsign);
|
text_callsign.set(entry_copy.callsign);
|
||||||
text_icao_address.set(to_string_hex(entry_copy.ICAO_address, 6));
|
text_icao_address.set(to_string_hex(entry_copy.ICAO_address, 6));
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#include "ui_font_fixed_8x16.hpp"
|
#include "ui_font_fixed_8x16.hpp"
|
||||||
|
|
||||||
#include "file.hpp"
|
#include "file.hpp"
|
||||||
|
#include "database.hpp"
|
||||||
#include "recent_entries.hpp"
|
#include "recent_entries.hpp"
|
||||||
#include "log_file.hpp"
|
#include "log_file.hpp"
|
||||||
#include "adsb.hpp"
|
#include "adsb.hpp"
|
||||||
|
@ -177,11 +178,15 @@ public:
|
||||||
|
|
||||||
AircraftRecentEntry get_current_entry() { return entry_copy; }
|
AircraftRecentEntry get_current_entry() { return entry_copy; }
|
||||||
|
|
||||||
|
std::database::AircraftDBRecord aircraft_record = {};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
AircraftRecentEntry entry_copy { 0 };
|
AircraftRecentEntry entry_copy { 0 };
|
||||||
std::function<void(void)> on_close_ { };
|
std::function<void(void)> on_close_ { };
|
||||||
bool send_updates { false };
|
bool send_updates { false };
|
||||||
File db_file { };
|
std::database db;
|
||||||
|
std::string icao_code = "";
|
||||||
|
int return_code = 0;
|
||||||
|
|
||||||
Labels labels {
|
Labels labels {
|
||||||
{ { 0 * 8, 1 * 16 }, "ICAO:", Color::light_grey() },
|
{ { 0 * 8, 1 * 16 }, "ICAO:", Color::light_grey() },
|
||||||
|
@ -265,13 +270,18 @@ public:
|
||||||
|
|
||||||
AircraftRecentEntry get_current_entry() { return entry_copy; }
|
AircraftRecentEntry get_current_entry() { return entry_copy; }
|
||||||
|
|
||||||
|
|
||||||
|
std::database::AirlinesDBRecord airline_record = {};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
AircraftRecentEntry entry_copy { 0 };
|
AircraftRecentEntry entry_copy { 0 };
|
||||||
std::function<void(void)> on_close_ { };
|
std::function<void(void)> on_close_ { };
|
||||||
GeoMapView* geomap_view { nullptr };
|
GeoMapView* geomap_view { nullptr };
|
||||||
ADSBRxAircraftDetailsView* aircraft_details_view { nullptr };
|
ADSBRxAircraftDetailsView* aircraft_details_view { nullptr };
|
||||||
bool send_updates { false };
|
bool send_updates { false };
|
||||||
File db_file { };
|
std::database db;
|
||||||
|
std::string airline_code = "";
|
||||||
|
int return_code = 0;
|
||||||
|
|
||||||
Labels labels {
|
Labels labels {
|
||||||
{ { 0 * 8, 1 * 16 }, "ICAO:", Color::light_grey() },
|
{ { 0 * 8, 1 * 16 }, "ICAO:", Color::light_grey() },
|
||||||
|
|
|
@ -108,12 +108,12 @@ APRSRxView::APRSRxView(NavigationView& nav, Rect parent_rect) : View(parent_rect
|
||||||
options_region.on_change = [this](size_t, int32_t i) {
|
options_region.on_change = [this](size_t, int32_t i) {
|
||||||
if (i == 0){
|
if (i == 0){
|
||||||
field_frequency.set_value(144390000);
|
field_frequency.set_value(144390000);
|
||||||
}
|
} else if(i == 1){
|
||||||
if(i == 1){
|
|
||||||
field_frequency.set_value(144800000);
|
field_frequency.set_value(144800000);
|
||||||
}
|
} else if(i == 2){
|
||||||
if(i == 2){
|
|
||||||
field_frequency.set_value(145175000);
|
field_frequency.set_value(145175000);
|
||||||
|
} else if(i == 3){
|
||||||
|
field_frequency.set_value(144575000);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -217,7 +217,8 @@ private:
|
||||||
{
|
{
|
||||||
{ "NA ", 0 },
|
{ "NA ", 0 },
|
||||||
{ "EUR", 1 },
|
{ "EUR", 1 },
|
||||||
{ "AUS", 2 }
|
{ "AUS", 2 },
|
||||||
|
{ "NZ ", 3 }
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,10 @@
|
||||||
|
|
||||||
#include "baseband_api.hpp"
|
#include "baseband_api.hpp"
|
||||||
#include "audio.hpp"
|
#include "audio.hpp"
|
||||||
|
|
||||||
|
#include "wm8731.hpp"
|
||||||
|
using wolfson::wm8731::WM8731;
|
||||||
|
|
||||||
#include "tonesets.hpp"
|
#include "tonesets.hpp"
|
||||||
#include "portapack_hal.hpp"
|
#include "portapack_hal.hpp"
|
||||||
#include "string_format.hpp"
|
#include "string_format.hpp"
|
||||||
|
@ -34,6 +38,10 @@
|
||||||
using namespace tonekey;
|
using namespace tonekey;
|
||||||
using namespace portapack;
|
using namespace portapack;
|
||||||
|
|
||||||
|
|
||||||
|
WM8731 audio_codec_wm8731 { i2c0, 0x1a };
|
||||||
|
|
||||||
|
|
||||||
namespace ui {
|
namespace ui {
|
||||||
|
|
||||||
void MicTXView::focus() {
|
void MicTXView::focus() {
|
||||||
|
@ -178,7 +186,7 @@ void MicTXView::rxaudio(bool is_on) {
|
||||||
|
|
||||||
baseband::run_image(portapack::spi_flash::image_tag_mic_tx);
|
baseband::run_image(portapack::spi_flash::image_tag_mic_tx);
|
||||||
audio::output::stop();
|
audio::output::stop();
|
||||||
audio::input::start();
|
audio::input::start(ak4951_alc_GUI_selected); // set up audio input = mic config of any audio coded AK4951/WM8731, (in WM8731 parameter will be ignored)
|
||||||
portapack::pin_i2s0_rx_sda.mode(3);
|
portapack::pin_i2s0_rx_sda.mode(3);
|
||||||
configure_baseband();
|
configure_baseband();
|
||||||
}
|
}
|
||||||
|
@ -203,10 +211,12 @@ MicTXView::MicTXView(
|
||||||
|
|
||||||
baseband::run_image(portapack::spi_flash::image_tag_mic_tx);
|
baseband::run_image(portapack::spi_flash::image_tag_mic_tx);
|
||||||
|
|
||||||
|
|
||||||
|
if ( audio_codec_wm8731.detected() ) {
|
||||||
add_children({
|
add_children({
|
||||||
&labels,
|
&labels_WM8731, // we have audio codec WM8731, same MIC menu as original.
|
||||||
&vumeter,
|
&vumeter,
|
||||||
&options_gain,
|
&options_gain, // MIC GAIN float factor on the GUI.
|
||||||
// &check_va,
|
// &check_va,
|
||||||
&field_va,
|
&field_va,
|
||||||
&field_va_level,
|
&field_va_level,
|
||||||
|
@ -230,6 +240,37 @@ MicTXView::MicTXView(
|
||||||
&tx_button
|
&tx_button
|
||||||
});
|
});
|
||||||
|
|
||||||
|
} else {
|
||||||
|
add_children({
|
||||||
|
&labels_AK4951, // we have audio codec AK4951, enable Automatic Level Control
|
||||||
|
&vumeter,
|
||||||
|
&options_gain,
|
||||||
|
&options_ak4951_alc_mode,
|
||||||
|
// &check_va,
|
||||||
|
&field_va,
|
||||||
|
&field_va_level,
|
||||||
|
&field_va_attack,
|
||||||
|
&field_va_decay,
|
||||||
|
&field_bw,
|
||||||
|
&field_rfgain,
|
||||||
|
&field_rfamp,
|
||||||
|
&options_mode,
|
||||||
|
&field_frequency,
|
||||||
|
&options_tone_key,
|
||||||
|
&check_rogerbeep,
|
||||||
|
&check_rxactive,
|
||||||
|
&field_volume,
|
||||||
|
&field_rxbw,
|
||||||
|
&field_squelch,
|
||||||
|
&field_rxfrequency,
|
||||||
|
&field_rxlna,
|
||||||
|
&field_rxvga,
|
||||||
|
&field_rxamp,
|
||||||
|
&tx_button
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
tone_keys_populate(options_tone_key);
|
tone_keys_populate(options_tone_key);
|
||||||
options_tone_key.on_change = [this](size_t i, int32_t) {
|
options_tone_key.on_change = [this](size_t i, int32_t) {
|
||||||
tone_key_index = i;
|
tone_key_index = i;
|
||||||
|
@ -242,6 +283,12 @@ MicTXView::MicTXView(
|
||||||
};
|
};
|
||||||
options_gain.set_selected_index(1); // x1.0
|
options_gain.set_selected_index(1); // x1.0
|
||||||
|
|
||||||
|
options_ak4951_alc_mode.on_change = [this](size_t, int8_t v) {
|
||||||
|
ak4951_alc_GUI_selected = v;
|
||||||
|
audio::input::start(ak4951_alc_GUI_selected);
|
||||||
|
};
|
||||||
|
// options_ak4951_alc_mode.set_selected_index(0);
|
||||||
|
|
||||||
tx_frequency = transmitter_model.tuning_frequency();
|
tx_frequency = transmitter_model.tuning_frequency();
|
||||||
field_frequency.set_value(transmitter_model.tuning_frequency());
|
field_frequency.set_value(transmitter_model.tuning_frequency());
|
||||||
field_frequency.set_step(receiver_model.frequency_step());
|
field_frequency.set_step(receiver_model.frequency_step());
|
||||||
|
@ -478,7 +525,7 @@ MicTXView::MicTXView(
|
||||||
set_tx(false);
|
set_tx(false);
|
||||||
|
|
||||||
audio::set_rate(audio::Rate::Hz_24000);
|
audio::set_rate(audio::Rate::Hz_24000);
|
||||||
audio::input::start();
|
audio::input::start(ak4951_alc_GUI_selected); // originally , audio::input::start(); (we added parameter)
|
||||||
}
|
}
|
||||||
|
|
||||||
MicTXView::~MicTXView() {
|
MicTXView::~MicTXView() {
|
||||||
|
|
|
@ -83,6 +83,7 @@ private:
|
||||||
bool rx_enabled { false };
|
bool rx_enabled { false };
|
||||||
uint32_t tone_key_index { };
|
uint32_t tone_key_index { };
|
||||||
float mic_gain { 1.0 };
|
float mic_gain { 1.0 };
|
||||||
|
uint8_t ak4951_alc_GUI_selected { 0 };
|
||||||
uint32_t audio_level { 0 };
|
uint32_t audio_level { 0 };
|
||||||
uint32_t va_level { };
|
uint32_t va_level { };
|
||||||
uint32_t attack_ms { };
|
uint32_t attack_ms { };
|
||||||
|
@ -106,8 +107,8 @@ private:
|
||||||
bool enable_lsb { false };
|
bool enable_lsb { false };
|
||||||
|
|
||||||
|
|
||||||
Labels labels {
|
Labels labels_WM8731 {
|
||||||
{ { 3 * 8, 1 * 8 }, "MIC. GAIN:", Color::light_grey() },
|
{ { 3 * 8, 1 * 8 }, "MIC-GAIN:", Color::light_grey() },
|
||||||
{ { 3 * 8, 3 * 8 }, "F:", Color::light_grey() },
|
{ { 3 * 8, 3 * 8 }, "F:", Color::light_grey() },
|
||||||
{ { 15 * 8, 3 * 8 }, "BW: FM kHz", Color::light_grey() },
|
{ { 15 * 8, 3 * 8 }, "BW: FM kHz", Color::light_grey() },
|
||||||
{ { 3 * 8, 5 * 8 }, "GAIN:", Color::light_grey() },
|
{ { 3 * 8, 5 * 8 }, "GAIN:", Color::light_grey() },
|
||||||
|
@ -118,8 +119,29 @@ private:
|
||||||
{ {12 * 8, 10 * 8 }, "ATT:", Color::light_grey() },
|
{ {12 * 8, 10 * 8 }, "ATT:", Color::light_grey() },
|
||||||
{ {20 * 8, 10 * 8 }, "DEC:", Color::light_grey() },
|
{ {20 * 8, 10 * 8 }, "DEC:", Color::light_grey() },
|
||||||
{ { 4 * 8, ( 13 * 8 ) - 2 }, "TONE KEY:", Color::light_grey() },
|
{ { 4 * 8, ( 13 * 8 ) - 2 }, "TONE KEY:", Color::light_grey() },
|
||||||
{ { 9 * 8, 23 * 8 }, "VOL:", Color::light_grey() },
|
{ { 7 * 8, 23 * 8 }, "VOL:", Color::light_grey() },
|
||||||
{ {17 * 8, 23 * 8 }, "FM RXBW:", Color::light_grey() },
|
{ {15 * 8, 23 * 8 }, "FM RXBW:", Color::light_grey() },
|
||||||
|
{ {17 * 8, 25 * 8 }, "SQ:", Color::light_grey() },
|
||||||
|
{ { 5 * 8, 25 * 8 }, "F:", Color::light_grey() },
|
||||||
|
{ { 5 * 8, 27 * 8 }, "LNA:", Color::light_grey()},
|
||||||
|
{ {12 * 8, 27 * 8 }, "VGA:", Color::light_grey()},
|
||||||
|
{ {19 * 8, 27 * 8 }, "AMP:", Color::light_grey()}
|
||||||
|
};
|
||||||
|
Labels labels_AK4951 {
|
||||||
|
{ { 3 * 8, 1 * 8 }, "MIC-GAIN:", Color::light_grey() },
|
||||||
|
{ { 17 * 8, 1 * 8 }, "ALC", Color::light_grey() },
|
||||||
|
{ { 3 * 8, 3 * 8 }, "F:", Color::light_grey() },
|
||||||
|
{ { 15 * 8, 3 * 8 }, "BW: FM kHz", Color::light_grey() },
|
||||||
|
{ { 3 * 8, 5 * 8 }, "GAIN:", Color::light_grey() },
|
||||||
|
{ {11 * 8, 5 * 8 }, "Amp:", Color::light_grey() },
|
||||||
|
{ { 18 * 8, (5 * 8) }, "Mode:", Color::light_grey() },
|
||||||
|
{ { 3 * 8, 8 * 8 }, "TX Activation:", Color::light_grey() },
|
||||||
|
{ { 4 * 8, 10 * 8 }, "LVL:", Color::light_grey() },
|
||||||
|
{ {12 * 8, 10 * 8 }, "ATT:", Color::light_grey() },
|
||||||
|
{ {20 * 8, 10 * 8 }, "DEC:", Color::light_grey() },
|
||||||
|
{ { 4 * 8, ( 13 * 8 ) - 2 }, "TONE KEY:", Color::light_grey() },
|
||||||
|
{ { 7 * 8, 23 * 8 }, "VOL:", Color::light_grey() },
|
||||||
|
{ {15 * 8, 23 * 8 }, "FM RXBW:", Color::light_grey() },
|
||||||
{ {17 * 8, 25 * 8 }, "SQ:", Color::light_grey() },
|
{ {17 * 8, 25 * 8 }, "SQ:", Color::light_grey() },
|
||||||
{ { 5 * 8, 25 * 8 }, "F:", Color::light_grey() },
|
{ { 5 * 8, 25 * 8 }, "F:", Color::light_grey() },
|
||||||
{ { 5 * 8, 27 * 8 }, "LNA:", Color::light_grey()},
|
{ { 5 * 8, 27 * 8 }, "LNA:", Color::light_grey()},
|
||||||
|
@ -135,7 +157,7 @@ private:
|
||||||
|
|
||||||
|
|
||||||
OptionsField options_gain {
|
OptionsField options_gain {
|
||||||
{ 13 * 8, 1 * 8 },
|
{ 12 * 8, 1 * 8 },
|
||||||
4,
|
4,
|
||||||
{
|
{
|
||||||
{ "x0.5", 5 },
|
{ "x0.5", 5 },
|
||||||
|
@ -145,6 +167,25 @@ private:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
OptionsField options_ak4951_alc_mode {
|
||||||
|
{ 20 * 8, 1 * 8 }, // Coordinates are: int:x (px), int:y (px)
|
||||||
|
11,
|
||||||
|
{
|
||||||
|
{ " OFF-20kHz", 0 }, // Nothing changed from ORIGINAL,keeping ALL programm. AK4951 Dig. block->OFF)
|
||||||
|
{ "+12dB-6kHz", 1 }, // ALC-> on, (+12dB's) Auto Vol max + Wind Noise cancel + LPF 6kHz + Pre-amp Mic (+21dB=original)
|
||||||
|
{ "+09dB-6kHz", 2 }, // ALC-> on, (+09dB's) Auto Vol max + Wind Noise cancel + LPF 6kHz + Pre-amp Mic (+21dB=original)
|
||||||
|
{ "+06dB-6kHz", 3 }, // ALC-> on, (+06dB's) Auto Vol max + Wind Noise cancel + LPF 6kHz + Pre-amp Mic (+21dB=original)
|
||||||
|
{ "+03dB-2kHz", 4 }, // ALC-> on, (+03dB's) Auto Vol max + Wind Noise cancel + LPF 3,5k + Pre-amp Mic (+21dB=original)+ EQ boosting ~<2kHz (f0~1k1,fb:1,7K, k=1,8)
|
||||||
|
{ "+03dB-4kHz", 5 }, // ALC-> on, (+03dB's) Auto Vol max + Wind Noise cancel + LPF 4kHz + Pre-amp Mic (+21dB=original)+ EQ boosting ~<3kHz (f0~1k4,fb~2,4k, k=1,8)
|
||||||
|
{ "+03dB-6kHz", 6 }, // ALC-> on, (+03dB's) Auto Vol max + Wind Noise cancel + LPF 6kHz + Pre-amp Mic (+21dB=original)
|
||||||
|
{ "+00dB-6kHz", 7 }, // ALC-> on, (+00dB's) Auto Vol max + Wind Noise cancel + LPF 6kHz + Pre-amp Mic (+21dB=original)
|
||||||
|
{ "-03dB-6kHz", 8 }, // ALC-> on, (-03dB's) Auto Vol max + Wind Noise cancel + LPF 6kHz + Pre-amp Mic (+21dB=original)
|
||||||
|
{ "-06dB-6kHz", 9 }, // ALC-> on, (-06dB's) Auto Vol max + Wind Noise cancel + LPF 6kHz + Pre-amp Mic (+21dB=original)
|
||||||
|
{ "-09dB-6kHz", 10 }, // ALC-> on, (-09dB's) Auto Vol max + Wind Noise cancel + LPF 6kHz - Pre-amp MIC -3dB (18dB's)
|
||||||
|
{ "-12dB-6kHz", 11 }, // ALC-> on, (-12dB's) Auto Vol max + Wind Noise cancel + LPF 6kHz - Pre-amp MIC -6dB (15dB's)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
FrequencyField field_frequency {
|
FrequencyField field_frequency {
|
||||||
{ 5 * 8, 3 * 8 },
|
{ 5 * 8, 3 * 8 },
|
||||||
};
|
};
|
||||||
|
@ -244,7 +285,7 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
NumberField field_volume {
|
NumberField field_volume {
|
||||||
{ 13 * 8, 23 * 8 },
|
{ 11* 8, 23 * 8 },
|
||||||
2,
|
2,
|
||||||
{ 0, 99 },
|
{ 0, 99 },
|
||||||
1,
|
1,
|
||||||
|
@ -252,7 +293,7 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
OptionsField field_rxbw {
|
OptionsField field_rxbw {
|
||||||
{ 25 * 8, 23 * 8},
|
{ 23* 8, 23 * 8},
|
||||||
3,
|
3,
|
||||||
{
|
{
|
||||||
{"8k5", 0},
|
{"8k5", 0},
|
||||||
|
|
|
@ -484,6 +484,7 @@ void ScannerView::scan_pause() {
|
||||||
scan_thread->set_freq_lock(0); //Reset the scanner lock (because user paused, or MAX_FREQ_LOCK reached) for next freq scan
|
scan_thread->set_freq_lock(0); //Reset the scanner lock (because user paused, or MAX_FREQ_LOCK reached) for next freq scan
|
||||||
scan_thread->set_scanning(false); // WE STOP SCANNING
|
scan_thread->set_scanning(false); // WE STOP SCANNING
|
||||||
audio::output::start();
|
audio::output::start();
|
||||||
|
on_headphone_volume_changed(field_volume.value()); // quick fix to make sure WM8731S chips don't stay silent after pause
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -242,16 +242,16 @@ private:
|
||||||
{ 17 * 8, (26 * 8) + 4 },
|
{ 17 * 8, (26 * 8) + 4 },
|
||||||
12,
|
12,
|
||||||
{
|
{
|
||||||
{ "5Khz (SA AM)", 5000 },
|
{ "5kHz (SA AM)", 5000 },
|
||||||
{ "9Khz (EU AM)", 9000 },
|
{ "9kHz (EU AM)", 9000 },
|
||||||
{ "10Khz(US AM)", 10000 },
|
{ "10kHz(US AM)", 10000 },
|
||||||
{ "50Khz (FM1)", 50000 },
|
{ "50kHz (FM1)", 50000 },
|
||||||
{ "100Khz(FM2)", 100000 },
|
{ "100kHz(FM2)", 100000 },
|
||||||
{ "6.25khz(NFM)", 6250 },
|
{ "6.25kHz(NFM)", 6250 },
|
||||||
{ "12.5khz(NFM)", 12500 },
|
{ "12.5kHz(NFM)", 12500 },
|
||||||
{ "25khz (N1)", 25000 },
|
{ "25kHz (N1)", 25000 },
|
||||||
{ "250khz (N2)", 250000 },
|
{ "250kHz (N2)", 250000 },
|
||||||
{ "8.33khz(AIR)", 8330 }
|
{ "8.33kHz(AIR)", 8330 }
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -224,59 +224,6 @@ SetFrequencyCorrectionModel SetRadioView::form_collect() {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
SetPlayDeadView::SetPlayDeadView(NavigationView& nav) {
|
|
||||||
add_children({
|
|
||||||
&text_sequence,
|
|
||||||
&button_enter,
|
|
||||||
&button_cancel
|
|
||||||
});
|
|
||||||
|
|
||||||
button_enter.on_select = [this, &nav](Button&){
|
|
||||||
if (!entermode) {
|
|
||||||
sequence = 0;
|
|
||||||
keycount = 0;
|
|
||||||
memset(sequence_txt, '-', 10);
|
|
||||||
text_sequence.set(sequence_txt);
|
|
||||||
entermode = true;
|
|
||||||
button_cancel.hidden(true);
|
|
||||||
set_dirty();
|
|
||||||
} else {
|
|
||||||
if (sequence == 0x8D1) // U D L R
|
|
||||||
nav.display_modal("Warning", "Default sequence entered !", ABORT, nullptr);
|
|
||||||
else {
|
|
||||||
persistent_memory::set_playdead_sequence(sequence);
|
|
||||||
nav.pop();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
button_enter.on_dir = [this](Button&, KeyEvent key){
|
|
||||||
if ((entermode == true) && (keycount < 10)) {
|
|
||||||
key_code = static_cast<std::underlying_type<KeyEvent>::type>(key);
|
|
||||||
if (key_code == 0)
|
|
||||||
sequence_txt[keycount] = 'R';
|
|
||||||
else if (key_code == 1)
|
|
||||||
sequence_txt[keycount] = 'L';
|
|
||||||
else if (key_code == 2)
|
|
||||||
sequence_txt[keycount] = 'D';
|
|
||||||
else if (key_code == 3)
|
|
||||||
sequence_txt[keycount] = 'U';
|
|
||||||
text_sequence.set(sequence_txt);
|
|
||||||
sequence = (sequence << 3) | (key_code + 1);
|
|
||||||
keycount++;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
};
|
|
||||||
|
|
||||||
button_cancel.on_select = [&nav](Button&){ nav.pop(); };
|
|
||||||
}
|
|
||||||
|
|
||||||
void SetPlayDeadView::focus() {
|
|
||||||
button_cancel.focus();
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
SetUIView::SetUIView(NavigationView& nav) {
|
SetUIView::SetUIView(NavigationView& nav) {
|
||||||
add_children({
|
add_children({
|
||||||
|
@ -295,7 +242,6 @@ SetUIView::SetUIView(NavigationView& nav) {
|
||||||
checkbox_speaker.set_value(persistent_memory::config_speaker());
|
checkbox_speaker.set_value(persistent_memory::config_speaker());
|
||||||
checkbox_showsplash.set_value(persistent_memory::config_splash());
|
checkbox_showsplash.set_value(persistent_memory::config_splash());
|
||||||
checkbox_showclock.set_value(!persistent_memory::hide_clock());
|
checkbox_showclock.set_value(!persistent_memory::hide_clock());
|
||||||
//checkbox_login.set_value(persistent_memory::config_login());
|
|
||||||
|
|
||||||
uint32_t backlight_timer = persistent_memory::config_backlight_timer();
|
uint32_t backlight_timer = persistent_memory::config_backlight_timer();
|
||||||
if (backlight_timer) {
|
if (backlight_timer) {
|
||||||
|
@ -348,209 +294,58 @@ SetAudioView::SetAudioView(NavigationView& nav) {
|
||||||
add_children({
|
add_children({
|
||||||
&labels,
|
&labels,
|
||||||
&field_tone_mix,
|
&field_tone_mix,
|
||||||
&button_ok
|
&button_save,
|
||||||
|
&button_cancel
|
||||||
});
|
});
|
||||||
|
|
||||||
field_tone_mix.set_value(persistent_memory::tone_mix());
|
field_tone_mix.set_value(persistent_memory::tone_mix());
|
||||||
|
|
||||||
button_ok.on_select = [&nav, this](Button&) {
|
button_save.on_select = [&nav, this](Button&) {
|
||||||
persistent_memory::set_tone_mix(field_tone_mix.value());
|
persistent_memory::set_tone_mix(field_tone_mix.value());
|
||||||
nav.pop();
|
nav.pop();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
button_cancel.on_select = [&nav, this](Button&) {
|
||||||
|
nav.pop();
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetAudioView::focus() {
|
void SetAudioView::focus() {
|
||||||
field_tone_mix.focus();
|
button_save.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*void ModInfoView::on_show() {
|
SetQRCodeView::SetQRCodeView(NavigationView& nav) {
|
||||||
if (modules_nb) update_infos(0);
|
add_children({
|
||||||
}
|
&checkbox_bigger_qr,
|
||||||
|
&button_save,
|
||||||
|
&button_cancel
|
||||||
|
});
|
||||||
|
|
||||||
void ModInfoView::update_infos(uint8_t modn) {
|
checkbox_bigger_qr.set_value(persistent_memory::show_bigger_qr_code());
|
||||||
char info_str[27];
|
|
||||||
char ch;
|
|
||||||
uint8_t c;
|
|
||||||
Point pos = { 0, 0 };
|
|
||||||
Rect rect = { { 16, 144 }, { 208, 144 } };
|
|
||||||
|
|
||||||
info_str[0] = 0;
|
button_save.on_select = [&nav, this](Button&) {
|
||||||
strcat(info_str, module_list[modn].name);
|
persistent_memory::set_show_bigger_qr_code(checkbox_bigger_qr.value());
|
||||||
text_namestr.set(info_str);
|
|
||||||
|
|
||||||
info_str[0] = 0;
|
|
||||||
strcat(info_str, to_string_dec_uint(module_list[modn].size).c_str());
|
|
||||||
strcat(info_str, " bytes");
|
|
||||||
text_sizestr.set(info_str);
|
|
||||||
|
|
||||||
info_str[0] = 0;
|
|
||||||
for (c = 0; c < 8; c++)
|
|
||||||
strcat(info_str, to_string_hex(module_list[modn].md5[c], 2).c_str());
|
|
||||||
text_md5_a.set(info_str);
|
|
||||||
|
|
||||||
info_str[0] = 0;
|
|
||||||
for (c = 8; c < 16; c++)
|
|
||||||
strcat(info_str, to_string_hex(module_list[modn].md5[c], 2).c_str());
|
|
||||||
text_md5_b.set(info_str);
|
|
||||||
|
|
||||||
// TODO: Use ui_console
|
|
||||||
display.fill_rectangle(rect, Color::black());
|
|
||||||
|
|
||||||
const Font& font = font::fixed_8x16;
|
|
||||||
const auto line_height = font.line_height();
|
|
||||||
c = 0;
|
|
||||||
while((ch = module_list[modn].description[c++])) {
|
|
||||||
const auto glyph = font.glyph(ch);
|
|
||||||
const auto advance = glyph.advance();
|
|
||||||
if((pos.x + advance.x) > rect.width()) {
|
|
||||||
pos.x = 0;
|
|
||||||
pos.y += line_height;
|
|
||||||
}
|
|
||||||
const Point pos_glyph {
|
|
||||||
static_cast<Coord>(rect.pos.x + pos.x),
|
|
||||||
static_cast<Coord>(rect.pos.y + pos.y)
|
|
||||||
};
|
|
||||||
display.draw_glyph(pos_glyph, glyph, Color::white(), Color::black());
|
|
||||||
pos.x += advance.x;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ModInfoView::ModInfoView(NavigationView& nav) {
|
|
||||||
const char magic[4] = {'P', 'P', 'M', ' '};
|
|
||||||
UINT bw;
|
|
||||||
uint8_t i;
|
|
||||||
char read_buf[16];
|
|
||||||
char info_str[25];
|
|
||||||
FILINFO modinfo;
|
|
||||||
FIL modfile;
|
|
||||||
DIR rootdir;
|
|
||||||
FRESULT res;
|
|
||||||
uint8_t c;
|
|
||||||
|
|
||||||
using option_t = std::pair<std::string, int32_t>;
|
|
||||||
using options_t = std::vector<option_t>;
|
|
||||||
option_t opt;
|
|
||||||
options_t opts;
|
|
||||||
|
|
||||||
static constexpr Style style_orange {
|
|
||||||
.font = font::fixed_8x16,
|
|
||||||
.background = Color::black(),
|
|
||||||
.foreground = Color::orange(),
|
|
||||||
};
|
|
||||||
|
|
||||||
add_children({{
|
|
||||||
&text_modcount,
|
|
||||||
&text_name,
|
|
||||||
&text_namestr,
|
|
||||||
&text_size,
|
|
||||||
&text_sizestr,
|
|
||||||
&text_md5,
|
|
||||||
&text_md5_a,
|
|
||||||
&text_md5_b,
|
|
||||||
&button_ok
|
|
||||||
}});
|
|
||||||
|
|
||||||
text_name.set_style(&style_orange);
|
|
||||||
text_size.set_style(&style_orange);
|
|
||||||
text_md5.set_style(&style_orange);
|
|
||||||
|
|
||||||
// TODO: Find a way to merge this with m4_load_image() in m4_startup.cpp
|
|
||||||
|
|
||||||
// Scan SD card root directory for files starting with the magic bytes
|
|
||||||
c = 0;
|
|
||||||
if (f_opendir(&rootdir, "/") == FR_OK) {
|
|
||||||
for (;;) {
|
|
||||||
res = f_readdir(&rootdir, &modinfo);
|
|
||||||
if (res != FR_OK || modinfo.fname[0] == 0) break; // Reached last file, abort
|
|
||||||
// Only care about files with .bin extension
|
|
||||||
if ((!(modinfo.fattrib & AM_DIR)) && (modinfo.fname[9] == 'B') && (modinfo.fname[10] == 'I') && (modinfo.fname[11] == 'N')) {
|
|
||||||
f_open(&modfile, modinfo.fname, FA_OPEN_EXISTING | FA_READ);
|
|
||||||
// Magic bytes check
|
|
||||||
f_read(&modfile, &read_buf, 4, &bw);
|
|
||||||
for (i = 0; i < 4; i++)
|
|
||||||
if (read_buf[i] != magic[i]) break;
|
|
||||||
if (i == 4) {
|
|
||||||
memcpy(&module_list[c].filename, modinfo.fname, 8);
|
|
||||||
module_list[c].filename[8] = 0;
|
|
||||||
|
|
||||||
f_lseek(&modfile, 4);
|
|
||||||
f_read(&modfile, &module_list[c].version, 2, &bw);
|
|
||||||
f_lseek(&modfile, 6);
|
|
||||||
f_read(&modfile, &module_list[c].size, 4, &bw);
|
|
||||||
f_lseek(&modfile, 10);
|
|
||||||
f_read(&modfile, &module_list[c].name, 16, &bw);
|
|
||||||
f_lseek(&modfile, 26);
|
|
||||||
f_read(&modfile, &module_list[c].md5, 16, &bw);
|
|
||||||
f_lseek(&modfile, 42);
|
|
||||||
f_read(&modfile, &module_list[c].description, 214, &bw);
|
|
||||||
f_lseek(&modfile, 256);
|
|
||||||
|
|
||||||
// Sanitize
|
|
||||||
module_list[c].name[15] = 0;
|
|
||||||
module_list[c].description[213] = 0;
|
|
||||||
|
|
||||||
memcpy(info_str, module_list[c].filename, 16);
|
|
||||||
strcat(info_str, "(V");
|
|
||||||
strcat(info_str, to_string_dec_uint(module_list[c].version, 4, '0').c_str());
|
|
||||||
strcat(info_str, ")");
|
|
||||||
while(strlen(info_str) < 24)
|
|
||||||
strcat(info_str, " ");
|
|
||||||
|
|
||||||
opt = std::make_pair(info_str, c);
|
|
||||||
opts.insert(opts.end(), opt);
|
|
||||||
|
|
||||||
c++;
|
|
||||||
}
|
|
||||||
f_close(&modfile);
|
|
||||||
}
|
|
||||||
if (c == 8) break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
f_closedir(&rootdir);
|
|
||||||
|
|
||||||
modules_nb = c;
|
|
||||||
|
|
||||||
if (modules_nb) {
|
|
||||||
strcpy(info_str, "Found ");
|
|
||||||
strcat(info_str, to_string_dec_uint(modules_nb, 1).c_str());
|
|
||||||
strcat(info_str, " module(s)");
|
|
||||||
|
|
||||||
text_modcount.set(info_str);
|
|
||||||
option_modules.set_options(opts);
|
|
||||||
|
|
||||||
add_child(&option_modules);
|
|
||||||
|
|
||||||
option_modules.on_change = [this](size_t n, OptionsField::value_t v) {
|
|
||||||
(void)n;
|
|
||||||
update_infos(v);
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
strcpy(info_str, "No modules found");
|
|
||||||
text_modcount.set(info_str);
|
|
||||||
}
|
|
||||||
|
|
||||||
button_ok.on_select = [&nav,this](Button&){
|
|
||||||
nav.pop();
|
nav.pop();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
button_cancel.on_select = [&nav, this](Button&) {
|
||||||
|
nav.pop();
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModInfoView::focus() {
|
void SetQRCodeView::focus() {
|
||||||
if (modules_nb)
|
button_save.focus();
|
||||||
option_modules.focus();
|
}
|
||||||
else
|
|
||||||
button_ok.focus();
|
|
||||||
}*/
|
|
||||||
|
|
||||||
SettingsMenuView::SettingsMenuView(NavigationView& nav) {
|
SettingsMenuView::SettingsMenuView(NavigationView& nav) {
|
||||||
add_items({
|
add_items({
|
||||||
//{ "..", ui::Color::light_grey(), &bitmap_icon_previous, [&nav](){ nav.pop(); } },
|
|
||||||
{ "Audio", ui::Color::dark_cyan(), &bitmap_icon_speaker, [&nav](){ nav.push<SetAudioView>(); } },
|
{ "Audio", ui::Color::dark_cyan(), &bitmap_icon_speaker, [&nav](){ nav.push<SetAudioView>(); } },
|
||||||
{ "Radio", ui::Color::dark_cyan(), &bitmap_icon_options_radio, [&nav](){ nav.push<SetRadioView>(); } },
|
{ "Radio", ui::Color::dark_cyan(), &bitmap_icon_options_radio, [&nav](){ nav.push<SetRadioView>(); } },
|
||||||
{ "Interface", ui::Color::dark_cyan(), &bitmap_icon_options_ui, [&nav](){ nav.push<SetUIView>(); } },
|
{ "Interface", ui::Color::dark_cyan(), &bitmap_icon_options_ui, [&nav](){ nav.push<SetUIView>(); } },
|
||||||
//{ "SD card modules", ui::Color::dark_cyan(), [&nav](){ nav.push<ModInfoView>(); } },
|
|
||||||
{ "Date/Time", ui::Color::dark_cyan(), &bitmap_icon_options_datetime, [&nav](){ nav.push<SetDateTimeView>(); } },
|
{ "Date/Time", ui::Color::dark_cyan(), &bitmap_icon_options_datetime, [&nav](){ nav.push<SetDateTimeView>(); } },
|
||||||
{ "Touchscreen", ui::Color::dark_cyan(), &bitmap_icon_options_touch, [&nav](){ nav.push<TouchCalibrationView>(); } },
|
{ "Touchscreen", ui::Color::dark_cyan(), &bitmap_icon_options_touch, [&nav](){ nav.push<TouchCalibrationView>(); } },
|
||||||
//{ "Play dead", ui::Color::dark_cyan(), &bitmap_icon_playdead, [&nav](){ nav.push<SetPlayDeadView>(); } }
|
{ "QR code", ui::Color::dark_cyan(), &bitmap_icon_qr_code, [&nav](){ nav.push<SetQRCodeView>(); } }
|
||||||
});
|
});
|
||||||
set_max_rows(2); // allow wider buttons
|
set_max_rows(2); // allow wider buttons
|
||||||
}
|
}
|
||||||
|
|
|
@ -219,11 +219,6 @@ public:
|
||||||
std::string title() const override { return "UI settings"; };
|
std::string title() const override { return "UI settings"; };
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/*Checkbox checkbox_login {
|
|
||||||
{ 3 * 8, 2 * 16 },
|
|
||||||
20,
|
|
||||||
"Login with play dead"
|
|
||||||
};*/
|
|
||||||
|
|
||||||
Checkbox checkbox_disable_touchscreen {
|
Checkbox checkbox_disable_touchscreen {
|
||||||
{ 3 * 8, 2 * 16 },
|
{ 3 * 8, 2 * 16 },
|
||||||
|
@ -304,111 +299,43 @@ private:
|
||||||
'0'
|
'0'
|
||||||
};
|
};
|
||||||
|
|
||||||
Button button_ok {
|
Button button_save {
|
||||||
{ 2 * 8, 16 * 16, 12 * 8, 32 },
|
{ 2 * 8, 16 * 16, 12 * 8, 32 },
|
||||||
"Save"
|
"Save"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Button button_cancel {
|
||||||
|
{ 16 * 8, 16 * 16, 12 * 8, 32 },
|
||||||
|
"Cancel",
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
|
||||||
class SetPlayDeadView : public View {
|
class SetQRCodeView : public View {
|
||||||
public:
|
public:
|
||||||
SetPlayDeadView(NavigationView& nav);
|
SetQRCodeView(NavigationView& nav);
|
||||||
|
|
||||||
void focus() override;
|
void focus() override;
|
||||||
|
|
||||||
std::string title() const override { return "Playdead settings"; };
|
std::string title() const override { return "QR code settings"; };
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool entermode = false;
|
Checkbox checkbox_bigger_qr {
|
||||||
uint32_t sequence { 0 };
|
{ 3 * 8, 9 * 16 },
|
||||||
uint8_t keycount { 0 }, key_code { };
|
20,
|
||||||
char sequence_txt[11] = { 0 };
|
"Show large QR code"
|
||||||
|
|
||||||
Text text_sequence {
|
|
||||||
{ 64, 32, 14 * 8, 16 },
|
|
||||||
"Enter sequence",
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Button button_enter {
|
Button button_save {
|
||||||
{ 16, 192, 96, 24 },
|
{ 2 * 8, 16 * 16, 12 * 8, 32 },
|
||||||
"Enter"
|
"Save"
|
||||||
};
|
};
|
||||||
|
|
||||||
Button button_cancel {
|
Button button_cancel {
|
||||||
{ 128, 192, 96, 24 },
|
{ 16 * 8, 16 * 16, 12 * 8, 32 },
|
||||||
"Cancel"
|
"Cancel",
|
||||||
};
|
};
|
||||||
};*/
|
};
|
||||||
|
|
||||||
/*class ModInfoView : public View {
|
|
||||||
public:
|
|
||||||
ModInfoView(NavigationView& nav);
|
|
||||||
void focus() override;
|
|
||||||
void on_show() override;
|
|
||||||
|
|
||||||
private:
|
|
||||||
void update_infos(uint8_t modn);
|
|
||||||
|
|
||||||
typedef struct moduleinfo_t{
|
|
||||||
char filename[9];
|
|
||||||
uint16_t version;
|
|
||||||
uint32_t size;
|
|
||||||
char md5[16];
|
|
||||||
char name[16];
|
|
||||||
char description[214];
|
|
||||||
} moduleinfo_t;
|
|
||||||
|
|
||||||
moduleinfo_t module_list[8]; // 8 max for now
|
|
||||||
|
|
||||||
uint8_t modules_nb;
|
|
||||||
|
|
||||||
Text text_modcount {
|
|
||||||
{ 2 * 8, 1 * 16, 18 * 8, 16 },
|
|
||||||
"Searching..."
|
|
||||||
};
|
|
||||||
|
|
||||||
OptionsField option_modules {
|
|
||||||
{ 2 * 8, 2 * 16 },
|
|
||||||
24,
|
|
||||||
{
|
|
||||||
{ "-", 0 }
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Text text_name {
|
|
||||||
{ 2 * 8, 4 * 16, 5 * 8, 16 },
|
|
||||||
"Name:"
|
|
||||||
};
|
|
||||||
Text text_namestr {
|
|
||||||
{ 8 * 8, 4 * 16, 16 * 8, 16 },
|
|
||||||
"..."
|
|
||||||
};
|
|
||||||
Text text_size {
|
|
||||||
{ 2 * 8, 5 * 16, 5 * 8, 16 },
|
|
||||||
"Size:"
|
|
||||||
};
|
|
||||||
Text text_sizestr {
|
|
||||||
{ 8 * 8, 5 * 16, 16 * 8, 16 },
|
|
||||||
"..."
|
|
||||||
};
|
|
||||||
Text text_md5 {
|
|
||||||
{ 2 * 8, 6 * 16, 4 * 8, 16 },
|
|
||||||
"MD5:"
|
|
||||||
};
|
|
||||||
Text text_md5_a {
|
|
||||||
{ 7 * 8, 6 * 16, 16 * 8, 16 },
|
|
||||||
"..."
|
|
||||||
};
|
|
||||||
Text text_md5_b {
|
|
||||||
{ 7 * 8, 7 * 16, 16 * 8, 16 },
|
|
||||||
"..."
|
|
||||||
};
|
|
||||||
|
|
||||||
Button button_ok {
|
|
||||||
{ 4 * 8, 272, 64, 24 },
|
|
||||||
"Ok"
|
|
||||||
};
|
|
||||||
};*/
|
|
||||||
|
|
||||||
class SettingsMenuView : public BtnGridView {
|
class SettingsMenuView : public BtnGridView {
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -100,7 +100,12 @@ SondeView::SondeView(NavigationView& nav) {
|
||||||
use_crc = v;
|
use_crc = v;
|
||||||
};
|
};
|
||||||
|
|
||||||
radio::enable({
|
receiver_model.set_tuning_frequency(tuning_frequency());
|
||||||
|
receiver_model.set_sampling_rate(sampling_rate);
|
||||||
|
receiver_model.set_baseband_bandwidth(baseband_bandwidth);
|
||||||
|
receiver_model.enable(); // Before using radio::enable(), but not updating Ant.DC-Bias.
|
||||||
|
|
||||||
|
/* radio::enable({ // this can be removed, previous version, no DC-bias ant. control.
|
||||||
tuning_frequency(),
|
tuning_frequency(),
|
||||||
sampling_rate,
|
sampling_rate,
|
||||||
baseband_bandwidth,
|
baseband_bandwidth,
|
||||||
|
@ -108,7 +113,7 @@ SondeView::SondeView(NavigationView& nav) {
|
||||||
receiver_model.rf_amp(),
|
receiver_model.rf_amp(),
|
||||||
static_cast<int8_t>(receiver_model.lna()),
|
static_cast<int8_t>(receiver_model.lna()),
|
||||||
static_cast<int8_t>(receiver_model.vga()),
|
static_cast<int8_t>(receiver_model.vga()),
|
||||||
});
|
}); */
|
||||||
|
|
||||||
|
|
||||||
// QR code with geo URI
|
// QR code with geo URI
|
||||||
|
@ -153,7 +158,8 @@ SondeView::SondeView(NavigationView& nav) {
|
||||||
|
|
||||||
SondeView::~SondeView() {
|
SondeView::~SondeView() {
|
||||||
baseband::set_pitch_rssi(0, false);
|
baseband::set_pitch_rssi(0, false);
|
||||||
radio::disable();
|
/* radio::disable(); */
|
||||||
|
receiver_model.disable(); // to switch off all, including DC bias.
|
||||||
baseband::shutdown();
|
baseband::shutdown();
|
||||||
audio::output::stop();
|
audio::output::stop();
|
||||||
}
|
}
|
||||||
|
|
|
@ -168,8 +168,8 @@ void speaker_mute() {
|
||||||
|
|
||||||
namespace input {
|
namespace input {
|
||||||
|
|
||||||
void start() {
|
void start(int8_t alc_mode) {
|
||||||
audio_codec->microphone_enable();
|
audio_codec->microphone_enable(alc_mode); // added user-GUI selection for AK4951, ALC mode parameter.
|
||||||
i2s::i2s0::rx_start();
|
i2s::i2s0::rx_start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ public:
|
||||||
virtual volume_range_t headphone_gain_range() const = 0;
|
virtual volume_range_t headphone_gain_range() const = 0;
|
||||||
virtual void set_headphone_volume(const volume_t volume) = 0;
|
virtual void set_headphone_volume(const volume_t volume) = 0;
|
||||||
|
|
||||||
virtual void microphone_enable() = 0;
|
virtual void microphone_enable(int8_t alc_mode) = 0; // added user-GUI AK4951 ,selected ALC mode.
|
||||||
virtual void microphone_disable() = 0;
|
virtual void microphone_disable() = 0;
|
||||||
|
|
||||||
virtual size_t reg_count() const = 0;
|
virtual size_t reg_count() const = 0;
|
||||||
|
@ -59,7 +59,7 @@ public:
|
||||||
|
|
||||||
namespace output {
|
namespace output {
|
||||||
|
|
||||||
void start();
|
void start(); // this other start(),no changed. ,in namespace output , used to config audio playback mode,
|
||||||
void stop();
|
void stop();
|
||||||
|
|
||||||
void mute();
|
void mute();
|
||||||
|
@ -72,7 +72,7 @@ void speaker_unmute();
|
||||||
|
|
||||||
namespace input {
|
namespace input {
|
||||||
|
|
||||||
void start();
|
void start(int8_t alc_mode); // added parameter user-GUI select AK4951-ALC mode for config mic path,(recording mode in datasheet),
|
||||||
void stop();
|
void stop();
|
||||||
|
|
||||||
} /* namespace input */
|
} /* namespace input */
|
||||||
|
|
|
@ -1285,6 +1285,28 @@ static constexpr Bitmap bitmap_icon_previous {
|
||||||
{ 16, 16 }, bitmap_icon_previous_data
|
{ 16, 16 }, bitmap_icon_previous_data
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static constexpr uint8_t bitmap_icon_qr_code_data[] = {
|
||||||
|
0x00, 0x00,
|
||||||
|
0xFE, 0x7E,
|
||||||
|
0xC6, 0x62,
|
||||||
|
0xFA, 0x5A,
|
||||||
|
0xFA, 0x5A,
|
||||||
|
0xDA, 0x5A,
|
||||||
|
0xFE, 0x7E,
|
||||||
|
0x7E, 0x7E,
|
||||||
|
0x00, 0x00,
|
||||||
|
0xFE, 0x46,
|
||||||
|
0xC2, 0x06,
|
||||||
|
0xFA, 0x18,
|
||||||
|
0xFA, 0x18,
|
||||||
|
0xC6, 0x60,
|
||||||
|
0xFE, 0x62,
|
||||||
|
0x00, 0x00,
|
||||||
|
};
|
||||||
|
static constexpr Bitmap bitmap_icon_qr_code {
|
||||||
|
{ 16, 16 }, bitmap_icon_qr_code_data
|
||||||
|
};
|
||||||
|
|
||||||
static constexpr uint8_t bitmap_icon_rds_data[] = {
|
static constexpr uint8_t bitmap_icon_rds_data[] = {
|
||||||
0x00, 0x00,
|
0x00, 0x00,
|
||||||
0x00, 0x00,
|
0x00, 0x00,
|
||||||
|
|
107
firmware/application/database.cpp
Normal file
107
firmware/application/database.cpp
Normal file
|
@ -0,0 +1,107 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc.
|
||||||
|
* Copyright (C) 2016 Furrtek
|
||||||
|
* Copyright (C) 2022 Arjan Onwezen
|
||||||
|
*
|
||||||
|
* This file is part of PortaPack.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2, or (at your option)
|
||||||
|
* any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; see the file COPYING. If not, write to
|
||||||
|
* the Free Software Foundation, Inc., 51 Franklin Street,
|
||||||
|
* Boston, MA 02110-1301, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "database.hpp"
|
||||||
|
#include "file.hpp"
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
|
namespace std {
|
||||||
|
|
||||||
|
int database::retrieve_mid_record(MidDBRecord* record, std::string search_term){
|
||||||
|
|
||||||
|
file_path = "AIS/mids.db";
|
||||||
|
index_item_length = 4;
|
||||||
|
record_length = 32;
|
||||||
|
|
||||||
|
result = std::database::retrieve_record(file_path, index_item_length, record_length, record, search_term);
|
||||||
|
|
||||||
|
return(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
int database::retrieve_airline_record(AirlinesDBRecord* record, std::string search_term){
|
||||||
|
|
||||||
|
file_path = "ADSB/airlines.db";
|
||||||
|
index_item_length = 4;
|
||||||
|
record_length = 64;
|
||||||
|
|
||||||
|
result = std::database::retrieve_record(file_path, index_item_length, record_length, record, search_term);
|
||||||
|
|
||||||
|
return(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
int database::retrieve_aircraft_record(AircraftDBRecord* record, std::string search_term){
|
||||||
|
|
||||||
|
file_path = "ADSB/icao24.db";
|
||||||
|
index_item_length = 7;
|
||||||
|
record_length = 146;
|
||||||
|
|
||||||
|
result = std::database::retrieve_record(file_path, index_item_length, record_length, record, search_term);
|
||||||
|
|
||||||
|
return(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int database::retrieve_record(std::string file_path, int index_item_length, int record_length, void* record, std::string search_term)
|
||||||
|
{
|
||||||
|
|
||||||
|
auto result = db_file.open(file_path);
|
||||||
|
if (!result.is_valid()) {
|
||||||
|
number_of_records = (db_file.size() / (index_item_length + record_length)); // determine number of records in file
|
||||||
|
// binary search tree
|
||||||
|
int first = 0, // First search element
|
||||||
|
last = number_of_records - 1, // Last search element
|
||||||
|
middle, // Mid point of search
|
||||||
|
position = -1; // Position of search value
|
||||||
|
|
||||||
|
while (!found && first <= last) {
|
||||||
|
middle = (first + last) / 2; // Calculate mid point
|
||||||
|
db_file.seek(middle * index_item_length);
|
||||||
|
db_file.read(file_buffer, search_term.length());
|
||||||
|
if (file_buffer == search_term) { // If value is found at mid
|
||||||
|
found = true;
|
||||||
|
position = middle;
|
||||||
|
}
|
||||||
|
else if (file_buffer > search_term) // If value is in lower half
|
||||||
|
last = middle - 1;
|
||||||
|
else
|
||||||
|
first = middle + 1; // If value is in upper half
|
||||||
|
}
|
||||||
|
|
||||||
|
if(found == true) {
|
||||||
|
|
||||||
|
db_file.seek((number_of_records * index_item_length) + (position * record_length)); // seek starting after index
|
||||||
|
db_file.read(record, record_length);
|
||||||
|
return(DATABASE_RECORD_FOUND);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return(DATABASE_RECORD_NOT_FOUND);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else return(DATABASE_NOT_FOUND);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} /* namespace std */
|
94
firmware/application/database.hpp
Normal file
94
firmware/application/database.hpp
Normal file
|
@ -0,0 +1,94 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc.
|
||||||
|
* Copyright (C) 2016 Furrtek
|
||||||
|
* Copyright (C) 2022 Arjan Onwezen
|
||||||
|
*
|
||||||
|
* This file is part of PortaPack.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2, or (at your option)
|
||||||
|
* any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; see the file COPYING. If not, write to
|
||||||
|
* the Free Software Foundation, Inc., 51 Franklin Street,
|
||||||
|
* Boston, MA 02110-1301, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __DATABASE_H__
|
||||||
|
#define __DATABASE_H__
|
||||||
|
|
||||||
|
|
||||||
|
#include <cstddef>
|
||||||
|
#include <cstdint>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
#include "file.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
namespace std {
|
||||||
|
class database {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
#define DATABASE_RECORD_FOUND 0 // record found in database
|
||||||
|
#define DATABASE_NOT_FOUND -1 // database not found / could not be opened
|
||||||
|
#define DATABASE_RECORD_NOT_FOUND -2 // record could not be found in database
|
||||||
|
|
||||||
|
struct MidDBRecord {
|
||||||
|
char country[32]; // country name
|
||||||
|
};
|
||||||
|
|
||||||
|
int retrieve_mid_record(MidDBRecord* record, std::string search_term);
|
||||||
|
|
||||||
|
struct AirlinesDBRecord {
|
||||||
|
char airline[32]; // airline name
|
||||||
|
char country[32]; // country name
|
||||||
|
};
|
||||||
|
|
||||||
|
int retrieve_airline_record(AirlinesDBRecord* record, std::string search_term);
|
||||||
|
|
||||||
|
struct AircraftDBRecord {
|
||||||
|
char aircraft_registration[9]; // aircraft registration
|
||||||
|
char aircraft_manufacturer[33]; // aircraft manufacturer
|
||||||
|
char aircraft_model[33]; // aircraft model
|
||||||
|
char icao_type[5]; // ICAO type descripton or when unavailable ICAO type designator
|
||||||
|
char aircraft_owner[33]; // aircraft owner
|
||||||
|
char aircraft_operator[33]; // aircraft operator
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
int retrieve_aircraft_record(AircraftDBRecord* record, std::string search_term);
|
||||||
|
|
||||||
|
private:
|
||||||
|
string file_path = ""; // path inclusing filename
|
||||||
|
int index_item_length = 0; // length of index item
|
||||||
|
int record_length = 0; // length of record
|
||||||
|
|
||||||
|
File db_file { };
|
||||||
|
int number_of_records = 0;
|
||||||
|
int position = 0;
|
||||||
|
|
||||||
|
char file_buffer[32] { 0 };
|
||||||
|
bool found = false;
|
||||||
|
|
||||||
|
int result = 0;
|
||||||
|
|
||||||
|
int retrieve_record(std::string file_path, int index_item_length, int record_length, void* record, std::string search_term);
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
} // namespace std
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif/*__DATABASE_H__*/
|
|
@ -197,12 +197,12 @@ std::vector<std::filesystem::path> scan_root_directories(const std::filesystem::
|
||||||
return directory_list;
|
return directory_list;
|
||||||
}
|
}
|
||||||
|
|
||||||
void delete_file(const std::filesystem::path& file_path) {
|
uint32_t delete_file(const std::filesystem::path& file_path) {
|
||||||
f_unlink(reinterpret_cast<const TCHAR*>(file_path.c_str()));
|
return f_unlink(reinterpret_cast<const TCHAR*>(file_path.c_str()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void rename_file(const std::filesystem::path& file_path, const std::filesystem::path& new_name) {
|
uint32_t rename_file(const std::filesystem::path& file_path, const std::filesystem::path& new_name) {
|
||||||
f_rename(reinterpret_cast<const TCHAR*>(file_path.c_str()), reinterpret_cast<const TCHAR*>(new_name.c_str()));
|
return f_rename(reinterpret_cast<const TCHAR*>(file_path.c_str()), reinterpret_cast<const TCHAR*>(new_name.c_str()));
|
||||||
}
|
}
|
||||||
|
|
||||||
FATTimestamp file_created_date(const std::filesystem::path& file_path) {
|
FATTimestamp file_created_date(const std::filesystem::path& file_path) {
|
||||||
|
|
|
@ -238,8 +238,8 @@ struct FATTimestamp {
|
||||||
uint16_t FAT_time;
|
uint16_t FAT_time;
|
||||||
};
|
};
|
||||||
|
|
||||||
void delete_file(const std::filesystem::path& file_path);
|
uint32_t delete_file(const std::filesystem::path& file_path);
|
||||||
void rename_file(const std::filesystem::path& file_path, const std::filesystem::path& new_name);
|
uint32_t rename_file(const std::filesystem::path& file_path, const std::filesystem::path& new_name);
|
||||||
FATTimestamp file_created_date(const std::filesystem::path& file_path);
|
FATTimestamp file_created_date(const std::filesystem::path& file_path);
|
||||||
uint32_t make_new_directory(const std::filesystem::path& dir_path);
|
uint32_t make_new_directory(const std::filesystem::path& dir_path);
|
||||||
|
|
||||||
|
|
|
@ -51,15 +51,15 @@ enum freqman_entry_type {
|
||||||
//Entry step placed for AlainD freqman version (or any other enhanced version)
|
//Entry step placed for AlainD freqman version (or any other enhanced version)
|
||||||
enum freqman_entry_step {
|
enum freqman_entry_step {
|
||||||
STEP_DEF = 0, // default
|
STEP_DEF = 0, // default
|
||||||
AM_US, // 10 Khz AM/CB
|
AM_US, // 10 kHz AM/CB
|
||||||
AM_EUR, // 9 Khz LW/MW
|
AM_EUR, // 9 kHz LW/MW
|
||||||
NFM_1, // 12,5 Khz (Analogic PMR 446)
|
NFM_1, // 12,5 kHz (Analogic PMR 446)
|
||||||
NFM_2, // 6,25 Khz (Digital PMR 446)
|
NFM_2, // 6,25 kHz (Digital PMR 446)
|
||||||
FM_1, // 100 Khz
|
FM_1, // 100 kHz
|
||||||
FM_2, // 50 Khz
|
FM_2, // 50 kHz
|
||||||
N_1, // 25 Khz
|
N_1, // 25 kHz
|
||||||
N_2, // 250 Khz
|
N_2, // 250 kHz
|
||||||
AIRBAND, // AIRBAND 8,33 Khz
|
AIRBAND, // AIRBAND 8,33 kHz
|
||||||
ERROR_STEP
|
ERROR_STEP
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -169,7 +169,7 @@ int main(void) {
|
||||||
|
|
||||||
sdcStart(&SDCD1, nullptr);
|
sdcStart(&SDCD1, nullptr);
|
||||||
|
|
||||||
controls_init();
|
// controls_init(); // Commented out as now happens in portapack.cpp
|
||||||
lcd_frame_sync_configure();
|
lcd_frame_sync_configure();
|
||||||
rtc_interrupt_enable();
|
rtc_interrupt_enable();
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
#include "hackrf_gpio.hpp"
|
#include "hackrf_gpio.hpp"
|
||||||
using namespace hackrf::one;
|
using namespace hackrf::one;
|
||||||
|
|
||||||
|
|
||||||
#include "clock_manager.hpp"
|
#include "clock_manager.hpp"
|
||||||
#include "event_m0.hpp"
|
#include "event_m0.hpp"
|
||||||
|
|
||||||
|
@ -45,6 +46,7 @@ using asahi_kasei::ak4951::AK4951;
|
||||||
#include "cpld_update.hpp"
|
#include "cpld_update.hpp"
|
||||||
|
|
||||||
#include "optional.hpp"
|
#include "optional.hpp"
|
||||||
|
#include "irq_controls.hpp"
|
||||||
|
|
||||||
namespace portapack {
|
namespace portapack {
|
||||||
|
|
||||||
|
@ -179,18 +181,19 @@ static PortaPackModel portapack_model() {
|
||||||
static Optional<PortaPackModel> model;
|
static Optional<PortaPackModel> model;
|
||||||
|
|
||||||
if( !model.is_valid() ) {
|
if( !model.is_valid() ) {
|
||||||
/*For the time being, it is impossible to distinguish the hardware of R1 and R2 from the software level*/
|
if( audio_codec_wm8731.detected() ) {
|
||||||
/*At this point, I2c is not ready.*/
|
model = PortaPackModel::R1_20150901; // H1R1
|
||||||
//if( audio_codec_wm8731.detected() ) {
|
} else {
|
||||||
// model = PortaPackModel::R1_20150901;
|
model = PortaPackModel::R2_20170522; // H1R2, H2+
|
||||||
//} else {
|
}
|
||||||
model = PortaPackModel::R2_20170522;
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return model.value();
|
return model.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//audio_codec_wm8731 = H1R1 & H2+
|
||||||
|
//audio_codec_ak4951 = H1R2
|
||||||
|
|
||||||
static audio::Codec* portapack_audio_codec() {
|
static audio::Codec* portapack_audio_codec() {
|
||||||
/* I2C ready OK, Automatic recognition of audio chip */
|
/* I2C ready OK, Automatic recognition of audio chip */
|
||||||
return (audio_codec_wm8731.detected())
|
return (audio_codec_wm8731.detected())
|
||||||
|
@ -200,16 +203,37 @@ static audio::Codec* portapack_audio_codec() {
|
||||||
}
|
}
|
||||||
|
|
||||||
static const portapack::cpld::Config& portapack_cpld_config() {
|
static const portapack::cpld::Config& portapack_cpld_config() {
|
||||||
|
const auto switches_state = get_switches_state();
|
||||||
|
if (switches_state[(size_t)ui::KeyEvent::Up]){
|
||||||
|
persistent_memory::set_config_cpld(1);
|
||||||
|
return portapack::cpld::rev_20170522::config;
|
||||||
|
}
|
||||||
|
if (switches_state[(size_t)ui::KeyEvent::Down]){
|
||||||
|
persistent_memory::set_config_cpld(2);
|
||||||
|
return portapack::cpld::rev_20150901::config;
|
||||||
|
}
|
||||||
|
if (switches_state[(size_t)ui::KeyEvent::Left]){
|
||||||
|
persistent_memory::set_config_cpld(3);
|
||||||
|
}
|
||||||
|
if (switches_state[(size_t)ui::KeyEvent::Select]){
|
||||||
|
persistent_memory::set_config_cpld(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (portapack::persistent_memory::config_cpld() == 1) {
|
||||||
|
return portapack::cpld::rev_20170522::config;
|
||||||
|
} else if (portapack::persistent_memory::config_cpld() == 2) {
|
||||||
|
return portapack::cpld::rev_20150901::config;
|
||||||
|
}
|
||||||
return (portapack_model() == PortaPackModel::R2_20170522)
|
return (portapack_model() == PortaPackModel::R2_20170522)
|
||||||
? portapack::cpld::rev_20170522::config
|
? portapack::cpld::rev_20170522::config
|
||||||
: portapack::cpld::rev_20150901::config
|
: portapack::cpld::rev_20150901::config;
|
||||||
;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Backlight* backlight() {
|
Backlight* backlight() {
|
||||||
return (portapack_model() == PortaPackModel::R2_20170522)
|
return (portapack_model() == PortaPackModel::R2_20170522)
|
||||||
? static_cast<portapack::Backlight*>(&backlight_cat4004)
|
? static_cast<portapack::Backlight*>(&backlight_cat4004) // R2_20170522
|
||||||
: static_cast<portapack::Backlight*>(&backlight_on_off);
|
: static_cast<portapack::Backlight*>(&backlight_on_off); // R1_20150901
|
||||||
}
|
}
|
||||||
|
|
||||||
#define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0]))
|
#define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0]))
|
||||||
|
@ -318,14 +342,15 @@ bool init() {
|
||||||
|
|
||||||
i2c0.start(i2c_config_boot_clock);
|
i2c0.start(i2c_config_boot_clock);
|
||||||
|
|
||||||
if( !portapack::cpld::update_if_necessary(portapack_cpld_config()) ) {
|
// Keeping this here for now incase we need to revert
|
||||||
shutdown_base();
|
// if( !portapack::cpld::update_if_necessary(portapack_cpld_config()) ) {
|
||||||
return false;
|
// shutdown_base();
|
||||||
}
|
// return false;
|
||||||
|
// }
|
||||||
|
|
||||||
if( !hackrf::cpld::load_sram() ) {
|
// if( !hackrf::cpld::load_sram() ) {
|
||||||
chSysHalt();
|
// chSysHalt();
|
||||||
}
|
// }
|
||||||
|
|
||||||
configure_pins_portapack();
|
configure_pins_portapack();
|
||||||
|
|
||||||
|
@ -336,7 +361,6 @@ bool init() {
|
||||||
i2c0.stop();
|
i2c0.stop();
|
||||||
|
|
||||||
set_clock_config(clock_config_irc);
|
set_clock_config(clock_config_irc);
|
||||||
|
|
||||||
cgu::pll1::disable();
|
cgu::pll1::disable();
|
||||||
|
|
||||||
/* Incantation from LPC43xx UM10503 section 12.2.1.1, to bring the M4
|
/* Incantation from LPC43xx UM10503 section 12.2.1.1, to bring the M4
|
||||||
|
@ -377,20 +401,38 @@ bool init() {
|
||||||
|
|
||||||
i2c0.start(i2c_config_fast_clock);
|
i2c0.start(i2c_config_fast_clock);
|
||||||
|
|
||||||
|
touch::adc::init();
|
||||||
|
controls_init();
|
||||||
|
|
||||||
clock_manager.set_reference_ppb(persistent_memory::correction_ppb());
|
clock_manager.set_reference_ppb(persistent_memory::correction_ppb());
|
||||||
|
|
||||||
audio::init(portapack_audio_codec());
|
|
||||||
|
|
||||||
clock_manager.enable_first_if_clock();
|
clock_manager.enable_first_if_clock();
|
||||||
clock_manager.enable_second_if_clock();
|
clock_manager.enable_second_if_clock();
|
||||||
clock_manager.enable_codec_clocks();
|
clock_manager.enable_codec_clocks();
|
||||||
radio::init();
|
radio::init();
|
||||||
|
|
||||||
touch::adc::init();
|
if( !portapack::cpld::update_if_necessary(portapack_cpld_config()) ) {
|
||||||
|
// If using a "2021/12 QFP100", press and hold the left button while booting. Should only need to do once.
|
||||||
|
const auto switches_state = get_switches_state();
|
||||||
|
/*
|
||||||
|
* The LEFT key held check seems redundant as its in the portapack_cpld_config().
|
||||||
|
* But for some reason the persistent_memory check fails on some devices if we dont have the extra check in....
|
||||||
|
* So dont ask me why that is, but we have to keep this redundant check in for the persistent_memory check to work.
|
||||||
|
*/
|
||||||
|
if (!switches_state[(size_t)ui::KeyEvent::Left] && portapack::persistent_memory::config_cpld() != 3){
|
||||||
|
shutdown_base();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if( !hackrf::cpld::load_sram() ) {
|
||||||
|
chSysHalt();
|
||||||
|
}
|
||||||
|
|
||||||
LPC_CREG->DMAMUX = portapack::gpdma_mux;
|
LPC_CREG->DMAMUX = portapack::gpdma_mux;
|
||||||
gpdma::controller.enable();
|
gpdma::controller.enable();
|
||||||
|
|
||||||
|
audio::init(portapack_audio_codec());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -129,6 +129,11 @@ std::string to_string_decimal(float decimal, int8_t precision) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string to_string_freq(const uint64_t f) {
|
||||||
|
auto final_str = to_string_dec_int(f / 1000000,4) + to_string_dec_int(f % 1000000, 6, '0');
|
||||||
|
return final_str;
|
||||||
|
}
|
||||||
|
|
||||||
std::string to_string_short_freq(const uint64_t f) {
|
std::string to_string_short_freq(const uint64_t f) {
|
||||||
auto final_str = to_string_dec_int(f / 1000000,4) + "." + to_string_dec_int((f / 100) % 10000, 4, '0');
|
auto final_str = to_string_dec_int(f / 1000000,4) + "." + to_string_dec_int((f / 100) % 10000, 4, '0');
|
||||||
return final_str;
|
return final_str;
|
||||||
|
|
|
@ -48,6 +48,7 @@ std::string to_string_decimal(float decimal, int8_t precision);
|
||||||
std::string to_string_hex(const uint64_t n, const int32_t l = 0);
|
std::string to_string_hex(const uint64_t n, const int32_t l = 0);
|
||||||
std::string to_string_hex_array(uint8_t * const array, const int32_t l = 0);
|
std::string to_string_hex_array(uint8_t * const array, const int32_t l = 0);
|
||||||
|
|
||||||
|
std::string to_string_freq(const uint64_t f);
|
||||||
std::string to_string_short_freq(const uint64_t f);
|
std::string to_string_short_freq(const uint64_t f);
|
||||||
std::string to_string_time_ms(const uint32_t ms);
|
std::string to_string_time_ms(const uint32_t ms);
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#include "ui_qrcode.hpp"
|
#include "ui_qrcode.hpp"
|
||||||
#include "qrcodegen.hpp"
|
#include "qrcodegen.hpp"
|
||||||
#include "portapack.hpp"
|
#include "portapack.hpp"
|
||||||
|
#include "portapack_persistent_memory.hpp"
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -43,9 +44,38 @@ QRCodeImage::QRCodeImage(
|
||||||
}
|
}
|
||||||
|
|
||||||
void QRCodeImage::paint(Painter& painter) {
|
void QRCodeImage::paint(Painter& painter) {
|
||||||
|
|
||||||
|
|
||||||
// The structure to manage the QR code
|
// The structure to manage the QR code
|
||||||
QRCode qrcode;
|
QRCode qrcode;
|
||||||
int qr_version = 10; // bigger versions aren't handled very well
|
|
||||||
|
|
||||||
|
//Either small or large QR code can be shown..
|
||||||
|
|
||||||
|
if(portapack::persistent_memory::show_bigger_qr_code()) { // show large QR code
|
||||||
|
int qr_version = 2;
|
||||||
|
|
||||||
|
// Allocate a chunk of memory to store the QR code
|
||||||
|
uint8_t qrcodeBytes[qrcode_getBufferSize(qr_version)];
|
||||||
|
|
||||||
|
qrcode_initText(&qrcode, qrcodeBytes, qr_version, ECC_HIGH, qr_text_);
|
||||||
|
|
||||||
|
|
||||||
|
display.fill_rectangle(Rect(10, 30, 220, 220), Color::white());
|
||||||
|
|
||||||
|
for (uint8_t y = 0; y < qrcode.size; y++) {
|
||||||
|
for (uint8_t x = 0; x < qrcode.size; x++) {
|
||||||
|
if (qrcode_getModule(&qrcode, x, y)) {
|
||||||
|
display.fill_rectangle(Rect(20+(x*8), 40+(y*8), 8, 8), Color::black());
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
else { // show small QR code
|
||||||
|
int qr_version = 10;
|
||||||
|
|
||||||
// Allocate a chunk of memory to store the QR code
|
// Allocate a chunk of memory to store the QR code
|
||||||
uint8_t qrcodeBytes[qrcode_getBufferSize(qr_version)];
|
uint8_t qrcodeBytes[qrcode_getBufferSize(qr_version)];
|
||||||
|
@ -63,6 +93,8 @@ void QRCodeImage::paint(Painter& painter) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QRCodeView::focus() {
|
void QRCodeView::focus() {
|
||||||
|
@ -84,10 +116,9 @@ QRCodeView::QRCodeView(
|
||||||
|
|
||||||
|
|
||||||
add_children({
|
add_children({
|
||||||
&text_qr,
|
|
||||||
&qr_code,
|
&qr_code,
|
||||||
&button_close});
|
&button_close});
|
||||||
text_qr.set(qr_text);
|
//text_qr.set(qr_text);
|
||||||
qr_code.set_text(qr_text);
|
qr_code.set_text(qr_text);
|
||||||
|
|
||||||
button_close.on_select = [&nav](Button&){
|
button_close.on_select = [&nav](Button&){
|
||||||
|
|
|
@ -74,13 +74,13 @@ private:
|
||||||
{ 50, 100, 100, 100 }
|
{ 50, 100, 100, 100 }
|
||||||
};
|
};
|
||||||
|
|
||||||
Text text_qr {
|
//Text text_qr {
|
||||||
{ 0 * 8, 10 * 16, 32 * 8, 1 * 8 },
|
// { 0 * 8, 10 * 16, 32 * 8, 1 * 8 },
|
||||||
"-"
|
// "-"
|
||||||
};
|
//};
|
||||||
|
|
||||||
Button button_close {
|
Button button_close {
|
||||||
{ 9 * 8, 15 * 16, 12 * 8, 3 * 16 },
|
{ 9 * 8, 31 * 8, 12 * 8, 3 * 16 },
|
||||||
"Back"
|
"Back"
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -190,7 +190,7 @@ namespace ui
|
||||||
void on_speaker();
|
void on_speaker();
|
||||||
void on_stealth();
|
void on_stealth();
|
||||||
void on_bias_tee();
|
void on_bias_tee();
|
||||||
//void on_textentry();
|
// void on_textentry();
|
||||||
void on_camera();
|
void on_camera();
|
||||||
void on_title();
|
void on_title();
|
||||||
void refresh();
|
void refresh();
|
||||||
|
@ -212,7 +212,7 @@ namespace ui
|
||||||
void refresh();
|
void refresh();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static constexpr auto version_string = "v1.4.3";
|
// static constexpr auto version_string = "v1.4.4"; // This is commented out as we are now setting the version via ENV (VERSION_STRING=v1.0.0)
|
||||||
NavigationView &nav_;
|
NavigationView &nav_;
|
||||||
|
|
||||||
Rectangle backdrop{
|
Rectangle backdrop{
|
||||||
|
@ -221,7 +221,7 @@ namespace ui
|
||||||
|
|
||||||
Text version{
|
Text version{
|
||||||
{2, 0, 11 * 8, 16},
|
{2, 0, 11 * 8, 16},
|
||||||
version_string};
|
VERSION_STRING};
|
||||||
|
|
||||||
LiveDateTime ltime{
|
LiveDateTime ltime{
|
||||||
{86, 0, 19 * 8, 16}};
|
{86, 0, 19 * 8, 16}};
|
||||||
|
|
|
@ -99,13 +99,13 @@ void RecordView::focus() {
|
||||||
|
|
||||||
void RecordView::set_sampling_rate(const size_t new_sampling_rate) {
|
void RecordView::set_sampling_rate(const size_t new_sampling_rate) {
|
||||||
|
|
||||||
/* We are changing "REC" icon background to yellow in BW rec Options >600Khz
|
/* We are changing "REC" icon background to yellow in BW rec Options >600kHz
|
||||||
where we are NOT recording full IQ .C16 files (recorded files are decimated ones).
|
where we are NOT recording full IQ .C16 files (recorded files are decimated ones).
|
||||||
Those decimated recorded files,has not the full IQ samples .
|
Those decimated recorded files,has not the full IQ samples .
|
||||||
are ok as recorded spectrum indication, but they should not be used by Replay app.
|
are ok as recorded spectrum indication, but they should not be used by Replay app.
|
||||||
|
|
||||||
We keep original black background in all the correct IQ .C16 files BW's Options */
|
We keep original black background in all the correct IQ .C16 files BW's Options */
|
||||||
if (new_sampling_rate > 4800000) { // > BW >600Khz (fs=8*BW), (750Khz ...2750Khz)
|
if (new_sampling_rate > 4800000) { // > BW >600kHz (fs=8*BW), (750kHz ...2750kHz)
|
||||||
button_record.set_background(ui::Color::yellow());
|
button_record.set_background(ui::Color::yellow());
|
||||||
} else {
|
} else {
|
||||||
button_record.set_background(ui::Color::black());
|
button_record.set_background(ui::Color::black());
|
||||||
|
@ -127,6 +127,11 @@ void RecordView::set_sampling_rate(const size_t new_sampling_rate) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Setter for datetime and frequency filename
|
||||||
|
void RecordView::set_filename_date_frequency(bool set) {
|
||||||
|
filename_date_frequency = set;
|
||||||
|
}
|
||||||
|
|
||||||
bool RecordView::is_active() const {
|
bool RecordView::is_active() const {
|
||||||
return (bool)capture_thread;
|
return (bool)capture_thread;
|
||||||
}
|
}
|
||||||
|
@ -149,7 +154,24 @@ void RecordView::start() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto base_path = next_filename_stem_matching_pattern(filename_stem_pattern);
|
|
||||||
|
std::filesystem::path base_path;
|
||||||
|
if(filename_date_frequency) {
|
||||||
|
rtcGetTime(&RTCD1, &datetime);
|
||||||
|
|
||||||
|
//ISO 8601
|
||||||
|
std::string date_time = to_string_dec_uint(datetime.year(), 4, '0') +
|
||||||
|
to_string_dec_uint(datetime.month(), 2, '0') +
|
||||||
|
to_string_dec_uint(datetime.day(), 2, '0') + "T" +
|
||||||
|
to_string_dec_uint(datetime.hour()) +
|
||||||
|
to_string_dec_uint(datetime.minute()) +
|
||||||
|
to_string_dec_uint(datetime.second());
|
||||||
|
|
||||||
|
base_path = filename_stem_pattern.string() + "_" + date_time + "_" + to_string_freq(receiver_model.tuning_frequency()) + "Hz";
|
||||||
|
} else {
|
||||||
|
base_path = next_filename_stem_matching_pattern(filename_stem_pattern);
|
||||||
|
}
|
||||||
|
|
||||||
if( base_path.empty() ) {
|
if( base_path.empty() ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,6 +63,8 @@ public:
|
||||||
|
|
||||||
bool is_active() const;
|
bool is_active() const;
|
||||||
|
|
||||||
|
void set_filename_date_frequency(bool set);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void toggle();
|
void toggle();
|
||||||
//void toggle_pitch_rssi();
|
//void toggle_pitch_rssi();
|
||||||
|
@ -75,6 +77,11 @@ private:
|
||||||
void handle_error(const File::Error error);
|
void handle_error(const File::Error error);
|
||||||
|
|
||||||
//bool pitch_rssi_enabled = false;
|
//bool pitch_rssi_enabled = false;
|
||||||
|
|
||||||
|
// Time Stamp
|
||||||
|
bool filename_date_frequency = false;
|
||||||
|
rtc::RTC datetime { };
|
||||||
|
|
||||||
const std::filesystem::path filename_stem_pattern;
|
const std::filesystem::path filename_stem_pattern;
|
||||||
const FileType file_type;
|
const FileType file_type;
|
||||||
const size_t write_size;
|
const size_t write_size;
|
||||||
|
|
|
@ -115,6 +115,10 @@ void AK4951::init() {
|
||||||
// update(Register::DigitalFilterMode);
|
// update(Register::DigitalFilterMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool AK4951::detected() {
|
||||||
|
return reset();
|
||||||
|
}
|
||||||
|
|
||||||
bool AK4951::reset() {
|
bool AK4951::reset() {
|
||||||
io.audio_reset_state(true);
|
io.audio_reset_state(true);
|
||||||
|
|
||||||
|
@ -212,90 +216,347 @@ void AK4951::speaker_disable() {
|
||||||
set_speaker_power(false);
|
set_speaker_power(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AK4951::microphone_enable() {
|
void AK4951::microphone_enable(int8_t alc_mode) {
|
||||||
// map.r.digital_mic.DMIC = 0;
|
// alc_mode =0 = (OFF =same as original code = NOT using AK4951 Programmable digital filter block),
|
||||||
// update(Register::DigitalMic);
|
// alc_mode >1 (with DIGITAL FILTER BLOCK , example : 1:(+12dB) , 2:(+9dB)", 3:(+6dB), ...)
|
||||||
|
|
||||||
const uint_fast8_t mgain = 0b0111;
|
// map.r.digital_mic.DMIC = 0; // originally commented code
|
||||||
map.r.signal_select_1.MGAIN20 = mgain & 7;
|
// update(Register::DigitalMic); // originally commented code
|
||||||
map.r.signal_select_1.PMMP = 1;
|
|
||||||
map.r.signal_select_1.MPSEL = 1; // MPWR2 pin
|
|
||||||
map.r.signal_select_1.MGAIN3 = (mgain >> 3) & 1;
|
|
||||||
update(Register::SignalSelect1);
|
|
||||||
|
|
||||||
map.r.signal_select_2.INL = 0b01; // Lch input signal = LIN2
|
uint_fast8_t mgain =0b0111; // Pre-amp mic (Original code, =0b0111 (+21dB's=7x3dBs),(Max is NOT 0b1111!, it is 0b1010=+30dBs=10x3dBs)
|
||||||
map.r.signal_select_2.INR = 0b01; // Rch input signal = RIN2
|
|
||||||
map.r.signal_select_2.MICL = 0; // MPWR = 2.4V
|
|
||||||
update(Register::SignalSelect2);
|
|
||||||
|
|
||||||
// map.r.r_ch_mic_gain_setting.MGR = 0x80; // Microphone sensitivity correction = 0dB.
|
map.r.signal_select_2.INL = 0b01; // Lch input signal = LIN2 , our ext. MONO MIC is connected here LIN2 in Portapack.
|
||||||
// update(Register::RchMicGainSetting);
|
map.r.signal_select_2.INR = 0b01; // Rch input signal = RIN2 , Not used ,not connected ,but no problem.
|
||||||
/*
|
map.r.signal_select_2.MICL = 0; // MPWR = 2.4V (it has two possible settings , 2.4V or 2.0V) , (majority smarthphones around 2V , range 1V-5V)
|
||||||
map.r.timer_select.FRN = ?;
|
update(Register::SignalSelect2);
|
||||||
map.r.timer_select.FRATT = ?;
|
|
||||||
map.r.timer_select.ADRST = 0b??;
|
|
||||||
update(Register::TimerSelect);
|
|
||||||
|
|
||||||
map.r.alc_timer_select. = ?;
|
// ------Common code part, = original setting conditions, it is fine for all user-GUI alc_modes: OFF , and ALC modes .*/
|
||||||
update(Register::ALCTimerSelect);
|
map.r.digital_filter_select_1.HPFAD = 1; // HPF1 ON (after ADC);page 40 datasheet, HPFAD bit controls the ON/OFF of the HPF1 (HPF ON is recommended).
|
||||||
map.r.alc_mode_control_1. = ?;
|
map.r.digital_filter_select_1.HPFC = 0b11; // HPF Cut off frequency of high pass filter from 236.8 Hz @fs=48k ("00":3.7Hz, "01":14,8Hz, "10":118,4Hz)
|
||||||
map.r.alc_mode_control_1.ALC = 1;
|
update(Register::DigitalFilterSelect1);
|
||||||
update(Register::ALCModeControl1);
|
|
||||||
|
|
||||||
map.r.alc_mode_control_2.REF = ?;
|
// map.r.r_ch_mic_gain_setting.MGR = 0x80; // Microphone sensitivity correction = 0dB., (not used by now , original code cond.)
|
||||||
update(Register::ALCModeControl2);
|
// update(Register::RchMicGainSetting); // (those two lines , not activated, same as original)
|
||||||
*/
|
|
||||||
// map.r.l_ch_input_volume_control.IV = 0xe1;
|
// pre-load 4 byes LPF coefficicients (.lpf_coefficient_0,1,2,3), FSA 14..0, FSB 14..0 , (fcut initial 6kHz, fs 48Khz).
|
||||||
// update(Register::LchInputVolumeControl);
|
// it will be default pre-loading coeff. for al ALC modes, LPF bit is activated down, for all ALC digital modes.
|
||||||
// map.r.r_ch_input_volume_control.IV = 0xe1;
|
map.r.lpf_coefficient_0.l = 0x5F; // Pre-loading here LPF 6kHz, 1st Order from digital Block , Fc=6000 Hz, fs = 48khz
|
||||||
// update(Register::RchInputVolumeControl);
|
map.r.lpf_coefficient_1.h = 0x09; // LPF bit is activated down, for all ALC digital modes.
|
||||||
/*
|
map.r.lpf_coefficient_2.l = 0xBF; // Writting reg to AK4951, with "update", following instructions.
|
||||||
map.r.auto_hpf_control.STG = 0b00;
|
map.r.lpf_coefficient_3.h = 0x32;
|
||||||
map.r.auto_hpf_control.SENC = 0b011;
|
|
||||||
map.r.auto_hpf_control.AHPF = 0;
|
update(Register::LPFCoefficient0); // Writing pre-loaded 4 bytes LPF CoefFiecients 14 bits (FSA13..0, FSB13..0
|
||||||
update(Register::AutoHPFControl);
|
update(Register::LPFCoefficient1); // In this case , LPF 6KHz , when we activate the LPF block.
|
||||||
*/
|
update(Register::LPFCoefficient2);
|
||||||
map.r.digital_filter_select_1.HPFAD = 1; // HPF1 (after ADC) = on
|
update(Register::LPFCoefficient3);
|
||||||
map.r.digital_filter_select_1.HPFC = 0b11; // 2336.8 Hz @ fs=48k
|
|
||||||
update(Register::DigitalFilterSelect1);
|
// Reset , setting OFF all 5 x Digital Equalizer filters
|
||||||
/*
|
map.r.digital_filter_select_3.EQ1 = 0; // EQ1 Coeffic Setting , (0: Disable-default, audio data passes EQ1 block by 0dB gain). When EQ1="1”, the settings of E1A15-0, E1B15-0 and E1C15-0 bits are enabled
|
||||||
map.r.digital_filter_select_2.HPF = 0;
|
map.r.digital_filter_select_3.EQ2 = 0; // EQ2 Coeffic Setting , (0: Disable-default, audio data passes EQ2 block by 0dB gain). When EQ2="1”, the settings of E2A15-0, E2B15-0 and E2C15-0 bits are enabled
|
||||||
map.r.digital_filter_select_2.LPF = 0;
|
map.r.digital_filter_select_3.EQ3 = 0; // EQ3 Coeffic Setting , (0: Disable-default, audio data passes EQ3 block by 0dB gain). When EQ3="1”, the settings of E3A15-0, E3B15-0 and E3C15-0 bits are enabled
|
||||||
map.r.digital_filter_select_2.FIL3 = 0;
|
map.r.digital_filter_select_3.EQ4 = 0; // EQ4 Coeffic Setting , (0: Disable-default, audio data passes EQ4 block by 0dB gain). When EQ4="1”, the settings of E4A15-0, E4B15-0 and E4C15-0 bits are enabled
|
||||||
map.r.digital_filter_select_2.EQ0 = 0;
|
map.r.digital_filter_select_3.EQ5 = 0; // EQ5 Coeffic Setting , (0: Disable-default, audio data passes EQ5 block by 0dB gain). When EQ5="1”, the settings of E5A15-0, E5B15-0 and E5C15-0 bits are enabled
|
||||||
map.r.digital_filter_select_2.GN = 0b00;
|
update(Register::DigitalFilterSelect3); // A,B,C EQ1 Coefficients are already pre-loaded in ak4951.hpp
|
||||||
|
|
||||||
|
|
||||||
|
if (alc_mode==0) { // Programmable Digital Filter OFF, same as original condition., no Digital ALC, nor Wind Noise Filter, LPF , EQ
|
||||||
|
|
||||||
|
map.r.digital_filter_select_2.LPF = 0; // LPF-Block, Coeffic Setting Enable (OFF-Default), When LPF bit is “0”, audio data passes the LPF block by 0dB gain.
|
||||||
update(Register::DigitalFilterSelect2);
|
update(Register::DigitalFilterSelect2);
|
||||||
|
|
||||||
map.r.digital_filter_select_3.EQ1 = 0;
|
// Pre-loading AUDIO PATH with all DIGITAL BLOCK by pased, see, audio path block diagramm AK4951 datasheet + Table Playback mode -Recording mode.
|
||||||
map.r.digital_filter_select_3.EQ2 = 0;
|
// Digital filter block PATH is BY PASSED (we can swith off DIG. BLOCK power , PMPFIL=0) .The Path in Recording Mode 2 & Playback Mode 2 (NO DIG FILTER BLOCK AT ALL, not for MIC recording, nor for Playback)
|
||||||
map.r.digital_filter_select_3.EQ3 = 0;
|
map.r.digital_filter_mode.ADCPF = 1; // ADCPF bit swith ("0" Mic after ADC Output connected (recording mode) to the DIGITAL FILTER BLOCK. ("1" Playback mode)
|
||||||
map.r.digital_filter_select_3.EQ4 = 0;
|
map.r.digital_filter_mode.PFSDO = 0; // ADC bit switch ("0" : 1st order HPF) connectedto the Output. By bass DIGITAL block .
|
||||||
map.r.digital_filter_select_3.EQ5 = 0;
|
map.r.digital_filter_mode.PFDAC = 0b00; // (Input selector for DAC (not used in MIC), SDTI= Audio Serial Data Input Pin)
|
||||||
update(Register::DigitalFilterSelect3);
|
update(Register::DigitalFilterMode); // Writing the Audio Path : NO DIGITAL BLOCK or DIG BLOCK FOR MIC , Audio mode path : Playback mode /-Recording mode.
|
||||||
*/
|
|
||||||
map.r.digital_filter_mode.PFSDO = 0; // ADC (+ 1st order HPF) Output
|
|
||||||
map.r.digital_filter_mode.ADCPF = 1; // ADC Output (default)
|
|
||||||
update(Register::DigitalFilterMode);
|
|
||||||
|
|
||||||
// ... Set coefficients ...
|
map.r.power_management_1.PMADL = 1; // ADC Lch = Lch input signal. Mic Amp Lch and ADC Lch Power Management
|
||||||
|
map.r.power_management_1.PMADR = 1; // ADC Rch = Rch input signal. Mic Amp Rch and ADC Rch Power Management
|
||||||
map.r.power_management_1.PMADL = 1; // ADC Lch = Lch input signal
|
map.r.power_management_1.PMPFIL = 0; // Pre-loading , Programmable Dig. filter OFF ,filter unused, routed around.(original value = 0 )
|
||||||
map.r.power_management_1.PMADR = 1; // ADC Rch = Rch input signal
|
update(Register::PowerManagement1); // Activating the Power management of the used blocks . (Mic ADC always + Dig Block filter , when used )
|
||||||
map.r.power_management_1.PMPFIL = 0; // Programmable filter unused, routed around.
|
|
||||||
update(Register::PowerManagement1);
|
|
||||||
|
|
||||||
// 1059/fs, 22ms @ 48kHz
|
// 1059/fs, 22ms @ 48kHz
|
||||||
chThdSleepMilliseconds(22);
|
chThdSleepMilliseconds(22);
|
||||||
|
|
||||||
|
} else { // ( alc_mode !=0)
|
||||||
|
|
||||||
|
switch(alc_mode) { // Pre-loading register values depending on user-GUI selection (they will be sended below, with "update(Register_name::xxx )".
|
||||||
|
|
||||||
|
case 1: // ALC-> on, (+12dB's) Auto Vol max + Wind Noise cancel + LPF 6kHz + Pre-amp Mic (+21dB=original)
|
||||||
|
map.r.alc_mode_control_2.REF = 0xC0; // REF7-0 bits,max gain at ALC recovery operation,(FFH +36dBs , D0H +18dBs, A0H 0dBs, C0H=+12dBs)
|
||||||
|
map.r.l_ch_input_volume_control.IV = 0xC0; // Left, Input Digital Volume Setting, (FFH +36dBs , D0H +18dBs, A0H 0dBs, 70H=-18dBs)
|
||||||
|
map.r.r_ch_input_volume_control.IV = 0xC0; // Right Input Dig Vol Setting, same comment as above , The value of IVOL should be <= than REF’s
|
||||||
|
|
||||||
|
// Already Pre-loaded, "map.r.lpf_coefficient", 6Khz - LPF 1st Order from digital Block,Fc=6000Hz,fs = 48khz
|
||||||
|
// LPF bit is activated down, for all ALC digital modes.
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 2: // ALC-> on, (+09dB's) Auto Vol max + Wind Noise cancel + LPF 6kHz + Pre-amp Mic (+21dB=original)
|
||||||
|
map.r.alc_mode_control_2.REF = 0xB8; // REF7-0 bits,max gain at ALC recoveryoperation,(FFH +36dBs , D0H +18dBs, A0H 0dBs, B8H= +9dBs)
|
||||||
|
map.r.l_ch_input_volume_control.IV = 0xB8; // Left, Input Digital Volume Setting, (FFH +36dBs , D0H +18dBs, A0H 0dBs, 70H=-18dBs)
|
||||||
|
map.r.r_ch_input_volume_control.IV = 0xB8; // Right Input Dig Vol Setting, same comment as above , The value of IVOL should be <= than REF’s
|
||||||
|
|
||||||
|
// Already Pre-loaded, "map.r.lpf_coefficient", 6Khz - LPF 1st Order from digital Block,Fc=6000Hz,fs = 48khz
|
||||||
|
// LPF bit is activated down, for all ALC digital modes.
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 3: // ALC-> on, (+06dB's) Auto Vol max + Wind Noise cancel + LPF 6kHz + Pre-amp Mic (+21dB=original)
|
||||||
|
map.r.alc_mode_control_2.REF = 0xB0; // 0xB8 , REF7-0 bits,max gain at ALC recoveryoperation,(FFH +36dBs , D0H +18dBs, A0H 0dBs, B0H= +6dBs)
|
||||||
|
map.r.l_ch_input_volume_control.IV = 0xB0; // Left, Input Digital Volume Setting, (FFH +36dBs , D0H +18dBs, A0H 0dBs, 70H=-18dBs)
|
||||||
|
map.r.r_ch_input_volume_control.IV = 0xB0; // Right Input Dig Vol Setting, same comment as above , Then value of IVOL should be <= than REF’s
|
||||||
|
|
||||||
|
// Already Pre-loaded, "map.r.lpf_coefficient", 6Khz - LPF 1st Order from digital Block,Fc=6000Hz,fs = 48khz
|
||||||
|
// LPF bit is activated down, for all ALC digital modes.
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 4: // ALC-> on, (+03dB's) Auto Vol max + Wind Noise cancel + Pre-amp Mic (+21dB=original)
|
||||||
|
// + EQ boosting ~<2kHz (f0:1,1k, fb:1,7K, k=1,8) && + LPF 3,5k
|
||||||
|
map.r.alc_mode_control_2.REF = 0xA8; // 0xA8 , REF7-0 bits,max gain at ALC recoveryoperation,(FFH +36dBs , D0H +18dBs, A0H 0dBs, A8H= +3dBs)
|
||||||
|
map.r.l_ch_input_volume_control.IV = 0xA8; // Left, Input Digital Volume Setting, (FFH +36dBs , D0H +18dBs, A0H 0dBs, 70H=-18dBs)
|
||||||
|
map.r.r_ch_input_volume_control.IV = 0xA8; // Right Input Dig Vol Setting, same comment as above , Then value of IVOL should be <= than REF’s
|
||||||
|
|
||||||
|
//The EQn (n=1, 2, 3, 4 or 5) coefficient must be set when EQn bit = “0” or PMPFIL bit = “0”.
|
||||||
|
map.r.digital_filter_select_3.EQ1 = 1; // EQ1 Coeffic Setting , (0: Disable-default, audio data passes EQ1 block by 0dB gain). When EQ1="1”, the settings of E1A15-0, E1B15-0 and E1C15-0 bits are enabled
|
||||||
|
update(Register::DigitalFilterSelect3); // A,B,C EQ1 Coefficients are already pre-loaded in ak4951.hpp
|
||||||
|
|
||||||
|
map.r.lpf_coefficient_0.l = 0x0D; // Pre-loading here LPF 3,5k , 1st Order from digital Block , Fc=3.500 Hz, fs = 48khz
|
||||||
|
map.r.lpf_coefficient_1.h = 0x06; // LPF bit is activated down, for all ALC digital modes.
|
||||||
|
map.r.lpf_coefficient_2.l = 0x1A; // Writting reg to AK4951 , down with update....
|
||||||
|
map.r.lpf_coefficient_3.h = 0x2C;
|
||||||
|
// LPF bit is activated down, for all ALC digital modes.
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 5: // ALC-> on, (+03dB's) Auto Vol max + Wind Noise cancel + Pre-amp Mic (+21dB=original)
|
||||||
|
// + EQ boosting ~<3kHz (f0~1k4,fb~2,4k,k=1,8) && LPF 4kHz
|
||||||
|
map.r.alc_mode_control_2.REF = 0xA8; // 0xA0 , REF7-0 bits,max gain at ALC recoveryoperation,(FFH +36dBs , D0H +18dBs, A0H 0dBs, A8H= +3dBs)
|
||||||
|
map.r.l_ch_input_volume_control.IV = 0xA8; // Left, Input Digital Volume Setting, (FFH +36dBs , D0H +18dBs, A0H 0dBs, 70H=-18dBs)
|
||||||
|
map.r.r_ch_input_volume_control.IV = 0xA8; // Right Input Dig Vol Setting, same comment as above , Then value of IVOL should be <= than REF’s
|
||||||
|
|
||||||
|
map.r.digital_filter_select_3.EQ2 = 1; // EQ2 Coeffic Setting , (0: Disable-default, audio data passes EQ2 block by 0dB gain). When EQ2="1”, the settings of E2A15-0, E2B15-0 and E2C15-0 bits are enabled
|
||||||
|
update(Register::DigitalFilterSelect3);
|
||||||
|
|
||||||
|
map.r.lpf_coefficient_0.l = 0xC3; // Pre-loading here LPF 4k , 1st Order from digital Block , Fc=4000 Hz, fs = 48khz
|
||||||
|
map.r.lpf_coefficient_1.h = 0x06; // LPF bit is activated down, for all ALC digital modes.
|
||||||
|
map.r.lpf_coefficient_2.l = 0x86; // Writting reg to AK4951 , down with update....
|
||||||
|
map.r.lpf_coefficient_3.h = 0x2D;
|
||||||
|
// LPF bit is activated down, for all ALC digital modes.
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 6: // ALC-> on, (+03dB's) Auto Vol max + Wind Noise cancel + LPF 6kHz + Pre-amp Mic (+21dB=original)
|
||||||
|
map.r.alc_mode_control_2.REF = 0xA8; // REF7-0 bits,max gain at ALC recoveryoperation,(FFH +36dBs , D0H +18dBs, A0H 0dBs, A0H= 0dBs)
|
||||||
|
map.r.l_ch_input_volume_control.IV = 0xA8; // Left, Input Digital Volume Setting, (FFH +36dBs , D0H +18dBs, A0H 0dBs, 70H=-18dBs)
|
||||||
|
map.r.r_ch_input_volume_control.IV = 0xA8; // Right Input Dig Vol Setting, same comment as above , Then value of IVOL should be <= than REF’s
|
||||||
|
|
||||||
|
// Already Pre-loaded, "map.r.lpf_coefficient", 6Khz - LPF 1st Order from digital Block,Fc=6000Hz,fs = 48khz
|
||||||
|
// LPF bit is activated down, for all ALC digital modes.
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 7: // ALC-> on, (+00dB's) Auto Vol max + Wind Noise cancel + LPF 6kHz + Pre-amp Mic (+21dB=original)
|
||||||
|
map.r.alc_mode_control_2.REF = 0xA0; // REF7-0 bits,max gain at ALC recoveryoperation,(FFH +36dBs , D0H +18dBs, A0H 0dBs, A0H= 0dBs)
|
||||||
|
map.r.l_ch_input_volume_control.IV = 0xA0; // Left, Input Digital Volume Setting, (FFH +36dBs , D0H +18dBs, A0H 0dBs, 70H=-18dBs)
|
||||||
|
map.r.r_ch_input_volume_control.IV = 0xA0; // Right Input Dig Vol Setting, same comment as above , Then value of IVOL should be <= than REF’s
|
||||||
|
|
||||||
|
// Already Pre-loaded, "map.r.lpf_coefficient", 6Khz - LPF 1st Order from digital Block,Fc=6000Hz,fs = 48khz
|
||||||
|
// LPF bit is activated down, for all ALC digital modes.
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 8: // ALC-> on, (-03dB's) Auto Vol max + Wind Noise cancel + LPF 6kHz + Pre-amp Mic (+21dB=original)
|
||||||
|
map.r.alc_mode_control_2.REF = 0x98; //REF7-0 bits,max gain at ALC recovery operation,(FFH +36dBs , D0H +18dBs, A0H 0dBs, 98H=-03dBs)
|
||||||
|
map.r.l_ch_input_volume_control.IV = 0x98; // Left, Input Digital Volume Setting, (FFH +36dBs , D0H +18dBs, A0H 0dBs, 70H=-18dBs)
|
||||||
|
map.r.r_ch_input_volume_control.IV = 0x98; // Right Input Dig Vol Setting, same comment as above , Then value of IVOL should be <= than REF’s
|
||||||
|
|
||||||
|
// Already Pre-loaded, "map.r.lpf_coefficient", 6Khz - LPF 1st Order from digital Block,Fc=6000Hz,fs = 48khz
|
||||||
|
// LPF bit is activated down, for all ALC digital modes.
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 9: // ALC-> on, (-06dB's) Auto Vol max + Wind Noise cancel + LPF 6kHz + Pre-amp Mic (+21dB=original)
|
||||||
|
map.r.alc_mode_control_2.REF = 0x90; // REF7-0 bits,max gain at ALC recovery operation,(FFH +36dBs , D0H +18dBs, A0H 0dBs, 90H=-06dBs)
|
||||||
|
map.r.l_ch_input_volume_control.IV = 0x90; // Left, Input Digital Volume Setting, (FFH +36dBs , D0H +18dBs, A0H 0dBs, 70H=-18dBs)
|
||||||
|
map.r.r_ch_input_volume_control.IV = 0x90; // Right Input Dig Vol Setting, same comment as above , Then value of IVOL should be <= than REF’s
|
||||||
|
|
||||||
|
// Already Pre-loaded, "map.r.lpf_coefficient", 6Khz - LPF 1st Order from digital Block,Fc=6000Hz,fs = 48khz
|
||||||
|
// LPF bit is activated down, for all ALC digital modes.
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 10: // ALC-> on, (-09dB's) Auto Vol max + Wind Noise cancel + LPF 6kHz - Pre-amp MIC -3dB (18dB's)
|
||||||
|
// Reduce also Pre-amp Mic -3dB's (+18dB's)
|
||||||
|
mgain = 0b0110; // Pre-amp mic Mic Gain Pre-amp (+18dB), Original=0b0111 (+21dB's =7x3dBs),
|
||||||
|
|
||||||
|
map.r.alc_mode_control_2.REF = 0x88; // REF7-0 bits,max gain at ALC recovery operation,(FFH +36dBs , D0H +18dBs, A0H 0dBs, 88H=-09dBs)
|
||||||
|
map.r.l_ch_input_volume_control.IV = 0x88; // Left, Input Digital Volume Setting, (FFH +36dBs , D0H +18dBs, A0H 0dBs, 70H=-18dBs)
|
||||||
|
map.r.r_ch_input_volume_control.IV = 0x88; // Right Input Dig Vol Setting, same comment as above , Then value of IVOL should be <= than REF’s
|
||||||
|
|
||||||
|
// Already Pre-loaded, "map.r.lpf_coefficient", 6Khz - LPF 1st Order from digital Block,Fc=6000Hz,fs = 48khz
|
||||||
|
// LPF bit is activated down, for all ALC digital modes.
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 11: // ALC-> on, (-12dB's) Auto Vol max + Wind Noise cancel + LPF 6kHz - Pre-amp MIC -6dB (15dB's)
|
||||||
|
// Reduce also Pre-amp Mic -6dB's (+15dB's)
|
||||||
|
mgain = 0b0101; // Pre-amp mic Mic Gain Pre-amp (+15dB), (Original=0b0111 (+21dB's= 7x3dBs),
|
||||||
|
|
||||||
|
map.r.alc_mode_control_2.REF = 0x80; // REF7-0 bits,max gain at ALC recovery operation,(FFH +36dBs , D0H +18dBs, A0H 0dBs, 80H=-12dBs)
|
||||||
|
map.r.l_ch_input_volume_control.IV = 0x80; // Left, Input Digital Volume Setting, (FFH +36dBs , D0H +18dBs, A0H 0dBs, 70H=-18dBs)
|
||||||
|
map.r.r_ch_input_volume_control.IV = 0x80; // Right Input Dig Vol Setting, same comment as above , Then value of IVOL should be <= than REF’s
|
||||||
|
|
||||||
|
// Already Pre-loaded, "map.r.lpf_coefficient", 6Khz - LPF 1st Order from digital Block,Fc=6000Hz,fs = 48khz
|
||||||
|
// LPF bit is activated down, for all ALC digital modes.
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------DIGITAL ALC (Automatic Level Control ) --- --------
|
||||||
|
map.r.alc_mode_control_1.ALC = 0; // LMTH2-0, WTM1-0, RGAIN2-0, REF7-0, RFST1-0, EQFC1-0, FRATT, FRN and ALCEQN bits (needs to be set up with ALC disable = 0)
|
||||||
|
update(Register::ALCModeControl1);
|
||||||
|
|
||||||
|
map.r.timer_select.FRN = 0; // (FRN= 0 Fast Recovery mode , enable )
|
||||||
|
map.r.timer_select.FRATT = 0; // Fast Recovery Ref. Volume Atten. Amount -0,00106dB's, timing 4/fs (default)
|
||||||
|
map.r.timer_select.ADRST = 0b00; // initial offset ADC cycles , 22ms @fs=48Khz.
|
||||||
|
update(Register::TimerSelect);
|
||||||
|
|
||||||
|
map.r.alc_timer_select.RFST = 0b00; // RFST1-0: ALC Fast Recovery Speed Default: “00” (0.0032dB)
|
||||||
|
map.r.alc_timer_select.WTM = 0b00; // ALC Recovery Operation Waiting Period 128/fs = 2,7 mseg (min=default)
|
||||||
|
map.r.alc_timer_select.EQFC = 0b10; // Selecting default, fs 48Khz , ALCEQ: First order zero pole high pass filter fc2=100Hz, fc1=150Hz
|
||||||
|
map.r.alc_timer_select.IVTM = 0; // IVTM bit set the vol transition time ,236/fs = 4,9msecs (min) (default was 19,7msegs.)
|
||||||
|
update(Register::ALCTimerSelect);
|
||||||
|
|
||||||
|
map.r.alc_mode_control_1.LMTH10 = 0b11; // ALC Limiter Detec Level/ Recovery Counter Reset; lower 2 bits (Ob111=-8,4dbs), (default 0b000=-2,5dBs)
|
||||||
|
map.r.alc_mode_control_1.RGAIN = 0b000; // ALC Recovery Gain Step, max step , max speed. Default: “000” (0.00424dB)
|
||||||
|
map.r.alc_mode_control_1.ALC = 1; // ALC Enable . (we are now, NOT in MANUAL volume mode, only becomes manual when (ALC=“0” while ADCPF=“1”. )
|
||||||
|
map.r.alc_mode_control_1.LMTH2 = 1; // ALC Limiter Detection Level/ Recovery Counter Reset Level,Upper bit,default 0b000
|
||||||
|
map.r.alc_mode_control_1.ALCEQN = 1; // ALC EQ Off =1 not used by now, 0: ALC EQ On (default)
|
||||||
|
update(Register::ALCModeControl1);
|
||||||
|
|
||||||
|
// map.r.alc_mode_control_2.REF = 0x??; // Pre-loaded in top part. Maximum gain at ALC recovery operation,.(FFH +36dBs , D0H +18dBs, A0H 0dBs, 70H=-18dBs)
|
||||||
|
update(Register::ALCModeControl2);
|
||||||
|
|
||||||
|
// map.r.l_ch_input_volume_control.IV = 0x??; // Pre-loaded in top part. Left, Input Digital Volume Setting, (FFH +36dBs , D0H +18dBs, A0H 0dBs, 70H=-18dBs)
|
||||||
|
update(Register::LchInputVolumeControl);
|
||||||
|
|
||||||
|
// map.r.r_ch_input_volume_control.IV = 0x??; // Pre-loaded in top part. Right,Input Digital Volume Setting, (FFH +36dBs , D0H +18dBs, A0H 0dBs, 70H=-18dBs)
|
||||||
|
update(Register::RchInputVolumeControl);
|
||||||
|
|
||||||
|
|
||||||
|
//---------------Switch ON, Digital Automatic Wind Noise Filter reduction -------------------
|
||||||
|
// Difficult to realise that Dynamic HPF Wind noise filter benefit, maybe because we have another fixed HPF 236.8 Hz .
|
||||||
|
// Anyway , we propose to activate it , with default setting conditions.
|
||||||
|
map.r.power_management_1.PMPFIL = 0; // (*1) To programm SENC, STG , we need PMPFIL = 0 . (but this disconnect Digital block power supply.
|
||||||
|
update(Register::PowerManagement1); // Updated PMPFIL to 0 . (*1)
|
||||||
|
|
||||||
|
map.r.auto_hpf_control.STG = 0b00; // (00=LOW ATTENUATION Level), lets put 11 (HIGH ATTENUATION Level) (default 00)
|
||||||
|
map.r.auto_hpf_control.SENC = 0b011; // (000=LOW sensitivity detection)… 111((MAX sensitivity detection) (default 011)
|
||||||
|
map.r.auto_hpf_control.AHPF = 1; // Autom. Wind noise filter ON (AHPF bit=“1”).It atten. wind noise when detecting ,and adjusts the atten. level dynamically.
|
||||||
|
update(Register::AutoHPFControl);
|
||||||
|
|
||||||
|
// We are in Digital Block ON , (Wind Noise Filter+ALC+LPF+EQ),==> needs at the end , PMPFIL=1 , Program. Dig.filter ON
|
||||||
|
// map.r.power_management_1.PMPFIL = 1; // that instruction is at the end , we can skp pre-loading Programmable Dig. filter ON (*1)
|
||||||
|
//---------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Writing AUDIO PATH diagramm, Changing Audio mode path : Playback mode1 /-Recording mode2. (Figure 37 AK4951 datasheet, Table 27. Recording Playback Mode)
|
||||||
|
// When changing those modes, PMPFIL bit must be “0”, it is OK (*1)
|
||||||
|
map.r.digital_filter_mode.ADCPF = 1; // ADCPF bit swith ("0" Mic after ADC Output connected (recording mode) to the DIGITAL FILTER BLOCK. ("1" Playback mode)
|
||||||
|
map.r.digital_filter_mode.PFSDO = 1; // ADC (+ 1st order HPF) Output
|
||||||
|
map.r.digital_filter_mode.PFDAC = 0b00; // (Input selector for DAC (not used in MIC), SDTI= Audio Serial Data Input Pin)
|
||||||
|
update(Register::DigitalFilterMode); // Writing the Audio Path : NO DIGITAL BLOCK or DIG BLOCK FOR MIC , Audio mode path : Playback mode /-Recording mode.
|
||||||
|
|
||||||
|
// The EQn (n=1, 2, 3, 4 or 5) coefficient must be set when EQn bit = “0” or PMPFIL bit = “0”., but we are already (*1)
|
||||||
|
// map.r.power_management_1.PMPFIL = 0; // In the previous Wind Noise Filter , we already set up PPFIL = 0
|
||||||
|
// update(Register::PowerManagement1); // Activating the Power management of the used blocks . (Mic ADC always + Dig Block filter , when used )
|
||||||
|
|
||||||
|
// ... Set EQ & LPF coefficients ---------------------------------
|
||||||
|
|
||||||
|
// writting to the IC ak4951 reg. settings defined in Ak4951.hpp , the 30 bytes , EQ coefficient = 5 (EQ1,2,3,4,5) x 3 (A,B,C coefficients) x 2 bytes (16 bits)
|
||||||
|
update(Register::E1Coefficient0); // we could pre-load here,ex ,"map.r.e1_coefficient_0.l = 0x50;" , EQ1 Coefficient A : A7...A0, but already done in ak4951.hpp
|
||||||
|
update(Register::E1Coefficient1); // we could pre-load here,ex ,"map.r.e1_coefficient_1.h = 0xFE;" , EQ1 Coefficient A : A15..A8, " "
|
||||||
|
update(Register::E1Coefficient2); // we could pre-load here,ex ,"map.r.e1_coefficient_2.l = 0x29;" , EQ1 Coefficient B : B7...B0, " "
|
||||||
|
update(Register::E1Coefficient3); // we could pre-load here,ex ,"map.r.e1_coefficient_3.h = 0xC5;" , EQ1 Coefficient B : B15..B8, " "
|
||||||
|
update(Register::E1Coefficient4); // we could pre-load here,ex ,"map.r.e1_coefficient_4.l = 0xA0;" , EQ1 Coefficient C : C7...C0, " "
|
||||||
|
update(Register::E1Coefficient5); // we could pre-load here,ex ,"map.r.e1_coefficient_5.h = 0x1C;" , EQ1 Coefficient C : C15..C8, " "
|
||||||
|
|
||||||
|
update(Register::E2Coefficient0); // writing pre-loaded EQ2 coefficcients
|
||||||
|
update(Register::E2Coefficient1);
|
||||||
|
update(Register::E2Coefficient2);
|
||||||
|
update(Register::E2Coefficient3);
|
||||||
|
update(Register::E2Coefficient4);
|
||||||
|
update(Register::E2Coefficient5);
|
||||||
|
|
||||||
|
// Already pre-loaded LPF coefficients to 6k, 3,5k or 4k ,(LPF 6Khz all digital alc modes top , except when 3k5 , 4k)
|
||||||
|
update(Register::LPFCoefficient0); // Writing pre-loaded 4 bytes LPF CoefFiecients 14 bits (FSA13..0, FSB13..0
|
||||||
|
update(Register::LPFCoefficient1);
|
||||||
|
update(Register::LPFCoefficient2);
|
||||||
|
update(Register::LPFCoefficient3);
|
||||||
|
|
||||||
|
// Activating LPF block , (and re-configuring the rest of bits of the same register)
|
||||||
|
map.r.digital_filter_select_2.HPF = 0; // HPF2-Block, Coeffic Setting Enable (OFF-Default), When HPF bit is “0”, audio data passes the HPF2 block by is 0dB gain.
|
||||||
|
map.r.digital_filter_select_2.LPF = 1; // LPF-Block, Coeffic Setting Enable (OFF-Default), When LPF bit is “0”, audio data passes the LPF block by 0dB gain.
|
||||||
|
map.r.digital_filter_select_2.FIL3 = 0; // Stereo_Emphasis_Filter-Block,(OFF-Default) Coefficient Setting Enable , OFF , Disable.
|
||||||
|
map.r.digital_filter_select_2.EQ0 = 0; // Gain Compensation-Block, (OFF-Default) Coeffic Setting Enable, When EQ0 bit = “0” audio data passes the EQ0 block by 0dB gain.
|
||||||
|
map.r.digital_filter_select_2.GN = 0b00; // Gain Setting of the Gain Compensation Block Default: “00”-Default (0dB)
|
||||||
|
update(Register::DigitalFilterSelect2);
|
||||||
|
|
||||||
|
// Acitivating digital block , power supply
|
||||||
|
map.r.power_management_1.PMADL = 1; // ADC Lch = Lch input signal. Mic Amp Lch and ADC Lch Power Management
|
||||||
|
map.r.power_management_1.PMADR = 1; // ADC Rch = Rch input signal. Mic Amp Rch and ADC Rch Power Management
|
||||||
|
map.r.power_management_1.PMPFIL = 1; // Pre-loaded in top part. Orig value=0, Programmable Digital filter unused (not power up), routed around.
|
||||||
|
update(Register::PowerManagement1); // Activating the Power management of the used blocks . (Mic ADC always + Dig Block filter , when used )
|
||||||
|
|
||||||
|
// 1059/fs, 22ms @ 48kHz
|
||||||
|
chThdSleepMilliseconds(22);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Common part for all alc_mode , --------------------------
|
||||||
|
// const uint_fast8_t mgain = 0b0111; // Already pre-loaded , in above switch case .
|
||||||
|
map.r.signal_select_1.MGAIN20 = mgain & 7; // writing 3 lower bits of mgain , (pre-amp mic gain).
|
||||||
|
map.r.signal_select_1.PMMP = 1; // Activating DC Mic Power supply through 2kohms res., similar majority smartphones headphone+mic jack, "plug-in-power"
|
||||||
|
map.r.signal_select_1.MPSEL = 1; // MPWR2 pin ,selecting output voltage to MPWR2 pin, that we are using in portapack ext. MIC)
|
||||||
|
map.r.signal_select_1.MGAIN3 = (mgain >> 3) & 1; // writing 4th upper bit of mgain (pre-amp mic gain).
|
||||||
|
update(Register::SignalSelect1);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void AK4951::microphone_disable() {
|
void AK4951::microphone_disable() {
|
||||||
map.r.power_management_1.PMADL = 0;
|
map.r.power_management_1.PMADL = 0; // original code , disable Power managem.Mic ADC L
|
||||||
map.r.power_management_1.PMADR = 0;
|
map.r.power_management_1.PMADR = 0; // original code , disable Power managem.Mic ADC R
|
||||||
map.r.power_management_1.PMPFIL = 0;
|
map.r.power_management_1.PMPFIL = 0; // original code , disable Power managem. all Programmable Dig. block
|
||||||
update(Register::PowerManagement1);
|
update(Register::PowerManagement1);
|
||||||
|
|
||||||
map.r.alc_mode_control_1.ALC = 0;
|
map.r.alc_mode_control_1.ALC = 0; // original code , Restore , disable ALC block.
|
||||||
update(Register::ALCModeControl1);
|
update(Register::ALCModeControl1);
|
||||||
|
|
||||||
|
map.r.auto_hpf_control.AHPF = 0; //----------- new code addition , Restore disable Wind noise filter OFF (AHPF bit=“0”).
|
||||||
|
update(Register::AutoHPFControl);
|
||||||
|
|
||||||
|
//Restore original AUDIO PATH , condition, (Digital filter block PATH is BY PASSED) (we can also swith off DIG. BLOCK power , PMPFIL=0)
|
||||||
|
// The Path in Recording Mode 2 & Playback Mode 2 , (NO DIG FILTER BLOCK AT ALL, not for MIC recording, nor for Playback)
|
||||||
|
map.r.digital_filter_mode.ADCPF = 1; // new code addition , ADCPF bit swith ("0" Mic after ADC Output connected (recording mode) to the DIGITAL FILTER BLOCK. ("1" Playback mode)
|
||||||
|
map.r.digital_filter_mode.PFSDO = 0; // new code addition , ADC bit switch ("0" : 1st order HPF) connectedto the Output. By bass DIGITAL block .
|
||||||
|
map.r.digital_filter_mode.PFDAC = 0b00; // new code addition , (Input selector for DAC (not used in MIC), SDTI= Audio Serial Data Input Pin)
|
||||||
|
update(Register::DigitalFilterMode); // Writing the Audio Path : NO DIGITAL BLOCK or DIG BLOCK FOR MIC , Audio mode path : Playback mode /-Recording mode.
|
||||||
|
|
||||||
|
// Restore original condition , LPF , OFF . same as when not using DIGITAL Programmable block
|
||||||
|
map.r.digital_filter_select_2.LPF = 0; // LPF-Block, Coeffic Setting Enable (OFF-Default), When LPF bit is “0”, audio data passes the LPF block by 0dB gain.
|
||||||
|
update(Register::DigitalFilterSelect2);
|
||||||
|
|
||||||
|
map.r.lpf_coefficient_0.l = 0x00; // Pre-loading here LPF 6k , 1st Order from digital Block , Fc=6000 Hz, fs = 48khz
|
||||||
|
map.r.lpf_coefficient_1.h = 0x00; // LPF bit is activated down, for all ALC digital modes.
|
||||||
|
map.r.lpf_coefficient_2.l = 0x00; // Writting reg to AK4951 , down with update....
|
||||||
|
map.r.lpf_coefficient_3.h = 0x00;
|
||||||
|
|
||||||
|
update(Register::LPFCoefficient0); // Writing pre-loaded 4 bytes LPF CoefFiecients 14 bits (FSA13..0, FSB13..0
|
||||||
|
update(Register::LPFCoefficient1);
|
||||||
|
update(Register::LPFCoefficient2);
|
||||||
|
update(Register::LPFCoefficient3);
|
||||||
|
|
||||||
|
// Switch off all EQ 1,2,3,4,5
|
||||||
|
map.r.digital_filter_select_3.EQ1 = 0; // EQ1 Coeffic Setting , (0: Disable-default, audio data passes EQ1 block by 0dB gain). When EQ1="1”, the settings of E1A15-0, E1B15-0 and E1C15-0 bits are enabled
|
||||||
|
map.r.digital_filter_select_3.EQ2 = 0; // EQ2 Coeffic Setting , (0: Disable-default, audio data passes EQ2 block by 0dB gain). When EQ2="1”, the settings of E2A15-0, E2B15-0 and E2C15-0 bits are enabled
|
||||||
|
map.r.digital_filter_select_3.EQ3 = 0; // EQ3 Coeffic Setting , (0: Disable-default, audio data passes EQ3 block by 0dB gain). When EQ3="1”, the settings of E3A15-0, E3B15-0 and E3C15-0 bits are enabled
|
||||||
|
map.r.digital_filter_select_3.EQ4 = 0; // EQ4 Coeffic Setting , (0: Disable-default, audio data passes EQ4 block by 0dB gain). When EQ4="1”, the settings of E4A15-0, E4B15-0 and E4C15-0 bits are enabled
|
||||||
|
map.r.digital_filter_select_3.EQ5 = 0; // EQ5 Coeffic Setting , (0: Disable-default, audio data passes EQ5 block by 0dB gain). When EQ5="1”, the settings of E5A15-0, E5B15-0 and E5C15-0 bits are enabled
|
||||||
|
update(Register::DigitalFilterSelect3);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
reg_t AK4951::read(const address_t reg_address) {
|
reg_t AK4951::read(const address_t reg_address) {
|
||||||
|
|
|
@ -773,40 +773,41 @@ constexpr RegisterMap default_after_reset { Register_Type {
|
||||||
.REV = 0b1100,
|
.REV = 0b1100,
|
||||||
},
|
},
|
||||||
|
|
||||||
.e1_coefficient_0 = { .l = 0x00 },
|
// just pre-loading into memory, 30 bytes = EQ 1,2,3,4,5 x A,B,C (2 x bytes) coefficients, but it will be written from ak4951.cpp
|
||||||
.e1_coefficient_1 = { .h = 0x00 },
|
.e1_coefficient_0 = { .l = 0xCA }, //EQ1 Coefficient A : A7...A0, BW : 300Hz - 1700Hz (fo = 1150Hz , fb= 1700Hz) , k=1,8 peaking
|
||||||
.e1_coefficient_2 = { .l = 0x00 },
|
.e1_coefficient_1 = { .h = 0x05 }, //EQ1 Coefficient A : A15..A8
|
||||||
.e1_coefficient_3 = { .h = 0x00 },
|
.e1_coefficient_2 = { .l = 0xEB }, //EQ1 Coefficient B : B7...B0
|
||||||
.e1_coefficient_4 = { .l = 0x00 },
|
.e1_coefficient_3 = { .h = 0x38 }, //EQ1 Coefficient B : B15...B8
|
||||||
.e1_coefficient_5 = { .h = 0x00 },
|
.e1_coefficient_4 = { .l = 0x6F }, //EQ1 Coefficient C : C7...C0
|
||||||
|
.e1_coefficient_5 = { .h = 0xE6 }, //EQ1 Coefficient C : C15..C8
|
||||||
|
|
||||||
.e2_coefficient_0 = { .l = 0x00 },
|
.e2_coefficient_0 = { .l = 0x05 }, //EQ2 Coefficient A : A7...A0, BW : 250Hz - 2700Hz (fo = 1475Hz , fb= 2450Hz) , k=1,8 peaking
|
||||||
.e2_coefficient_1 = { .h = 0x00 },
|
.e2_coefficient_1 = { .h = 0x08 }, //EQ2 Coefficient A : A15..A8
|
||||||
.e2_coefficient_2 = { .l = 0x00 },
|
.e2_coefficient_2 = { .l = 0x11 }, //EQ2 Coefficient B : B7...B0
|
||||||
.e2_coefficient_3 = { .h = 0x00 },
|
.e2_coefficient_3 = { .h = 0x36 }, //EQ2 Coefficient B : B15...B8
|
||||||
.e2_coefficient_4 = { .l = 0x00 },
|
.e2_coefficient_4 = { .l = 0xE9 }, //EQ2 Coefficient C : C7...C0
|
||||||
.e2_coefficient_5 = { .h = 0x00 },
|
.e2_coefficient_5 = { .h = 0xE8 }, //EQ2 Coefficient C : C15..C8
|
||||||
|
|
||||||
.e3_coefficient_0 = { .l = 0x00 },
|
.e3_coefficient_0 = { .l = 0x00 }, //EQ3 Coefficient A : A7...A0, not used currently
|
||||||
.e3_coefficient_1 = { .h = 0x00 },
|
.e3_coefficient_1 = { .h = 0x00 }, //EQ3 Coefficient A : A15..A8
|
||||||
.e3_coefficient_2 = { .l = 0x00 },
|
.e3_coefficient_2 = { .l = 0x00 }, //EQ3 Coefficient B : B7...B0
|
||||||
.e3_coefficient_3 = { .h = 0x00 },
|
.e3_coefficient_3 = { .h = 0x00 }, //EQ3 Coefficient B : B15...B8
|
||||||
.e3_coefficient_4 = { .l = 0x00 },
|
.e3_coefficient_4 = { .l = 0x00 }, //EQ3 Coefficient C : C7...C0
|
||||||
.e3_coefficient_5 = { .h = 0x00 },
|
.e3_coefficient_5 = { .h = 0x00 }, //EQ3 Coefficient C : C15..C8
|
||||||
|
|
||||||
.e4_coefficient_0 = { .l = 0x00 },
|
.e4_coefficient_0 = { .l = 0x00 }, //EQ4 Coefficient A : A7...A0, not used currently
|
||||||
.e4_coefficient_1 = { .h = 0x00 },
|
.e4_coefficient_1 = { .h = 0x00 }, //EQ4 Coefficient A : A15..A8
|
||||||
.e4_coefficient_2 = { .l = 0x00 },
|
.e4_coefficient_2 = { .l = 0x00 }, //EQ4 Coefficient B : B7...B0
|
||||||
.e4_coefficient_3 = { .h = 0x00 },
|
.e4_coefficient_3 = { .h = 0x00 }, //EQ4 Coefficient B : B15...B8
|
||||||
.e4_coefficient_4 = { .l = 0x00 },
|
.e4_coefficient_4 = { .l = 0x00 }, //EQ4 Coefficient C : C7...C0
|
||||||
.e4_coefficient_5 = { .h = 0x00 },
|
.e4_coefficient_5 = { .h = 0x00 }, //EQ4 Coefficient C : C15..C8
|
||||||
|
|
||||||
.e5_coefficient_0 = { .l = 0x00 },
|
.e5_coefficient_0 = { .l = 0x00 }, //EQ5 Coefficient A : A7...A0, not used currently
|
||||||
.e5_coefficient_1 = { .h = 0x00 },
|
.e5_coefficient_1 = { .h = 0x00 }, //EQ5 Coefficient A : A15..A8
|
||||||
.e5_coefficient_2 = { .l = 0x00 },
|
.e5_coefficient_2 = { .l = 0x00 }, //EQ5 Coefficient B : B7...B0
|
||||||
.e5_coefficient_3 = { .h = 0x00 },
|
.e5_coefficient_3 = { .h = 0x00 }, //EQ5 Coefficient B : B15...B8
|
||||||
.e5_coefficient_4 = { .l = 0x00 },
|
.e5_coefficient_4 = { .l = 0x00 }, //EQ5 Coefficient C : C7...C0
|
||||||
.e5_coefficient_5 = { .h = 0x00 },
|
.e5_coefficient_5 = { .h = 0x00 }, //EQ5 Coefficient C : C15..C8
|
||||||
} };
|
} };
|
||||||
|
|
||||||
class AK4951 : public audio::Codec {
|
class AK4951 : public audio::Codec {
|
||||||
|
@ -823,6 +824,8 @@ public:
|
||||||
return "AK4951";
|
return "AK4951";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool detected();
|
||||||
|
|
||||||
void init() override;
|
void init() override;
|
||||||
bool reset() override;
|
bool reset() override;
|
||||||
|
|
||||||
|
@ -839,7 +842,7 @@ public:
|
||||||
void set_headphone_volume(const volume_t volume) override;
|
void set_headphone_volume(const volume_t volume) override;
|
||||||
void headphone_mute();
|
void headphone_mute();
|
||||||
|
|
||||||
void microphone_enable();
|
void microphone_enable(int8_t alc_mode); // added user GUI parameter , to set up AK4951 ALC mode.
|
||||||
void microphone_disable();
|
void microphone_disable();
|
||||||
|
|
||||||
size_t reg_count() const override {
|
size_t reg_count() const override {
|
||||||
|
|
|
@ -81,39 +81,34 @@ public:
|
||||||
SamplerateConfig = 24,
|
SamplerateConfig = 24,
|
||||||
BTLERxConfigure = 25,
|
BTLERxConfigure = 25,
|
||||||
NRFRxConfigure = 26,
|
NRFRxConfigure = 26,
|
||||||
|
TXProgress = 27,
|
||||||
TXProgress = 30,
|
Retune = 28,
|
||||||
Retune = 31,
|
TonesConfigure = 29,
|
||||||
|
AFSKTxConfigure = 30,
|
||||||
TonesConfigure = 32,
|
PitchRSSIConfigure = 31,
|
||||||
AFSKTxConfigure = 33,
|
OOKConfigure = 32,
|
||||||
PitchRSSIConfigure = 34,
|
RDSConfigure = 33,
|
||||||
OOKConfigure = 35,
|
AudioTXConfig = 34,
|
||||||
RDSConfigure = 36,
|
POCSAGConfigure = 35,
|
||||||
AudioTXConfig = 37,
|
DTMFTXConfig = 36,
|
||||||
POCSAGConfigure = 38,
|
ADSBConfigure = 37,
|
||||||
DTMFTXConfig = 39,
|
JammerConfigure = 38,
|
||||||
ADSBConfigure = 40,
|
WidebandSpectrumConfig = 39,
|
||||||
JammerConfigure = 41,
|
FSKConfigure = 40,
|
||||||
WidebandSpectrumConfig = 42,
|
SSTVConfigure = 41,
|
||||||
FSKConfigure = 43,
|
SigGenConfig = 42,
|
||||||
SSTVConfigure = 44,
|
SigGenTone = 43,
|
||||||
SigGenConfig = 43,
|
POCSAGPacket = 44,
|
||||||
SigGenTone = 44,
|
ADSBFrame = 45,
|
||||||
|
AFSKData = 46,
|
||||||
POCSAGPacket = 45,
|
TestAppPacket = 47,
|
||||||
ADSBFrame = 46,
|
RequestSignal = 48,
|
||||||
AFSKData = 47,
|
FIFOData = 49,
|
||||||
TestAppPacket = 48,
|
AudioLevelReport = 50,
|
||||||
|
CodedSquelch = 51,
|
||||||
RequestSignal = 49,
|
AudioSpectrum = 52,
|
||||||
FIFOData = 50,
|
APRSPacket = 53,
|
||||||
|
APRSRxConfigure = 54,
|
||||||
AudioLevelReport = 51,
|
|
||||||
CodedSquelch = 52,
|
|
||||||
AudioSpectrum = 53,
|
|
||||||
APRSPacket = 54,
|
|
||||||
APRSRxConfigure = 55,
|
|
||||||
MAX
|
MAX
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -95,6 +95,9 @@ struct data_t {
|
||||||
uint32_t pocsag_ignore_address;
|
uint32_t pocsag_ignore_address;
|
||||||
|
|
||||||
int32_t tone_mix;
|
int32_t tone_mix;
|
||||||
|
|
||||||
|
// Hardware
|
||||||
|
uint32_t hardware_config;
|
||||||
};
|
};
|
||||||
|
|
||||||
static_assert(sizeof(data_t) <= backup_ram.size(), "Persistent memory structure too large for VBAT-maintained region");
|
static_assert(sizeof(data_t) <= backup_ram.size(), "Persistent memory structure too large for VBAT-maintained region");
|
||||||
|
@ -231,6 +234,10 @@ bool disable_touchscreen() { // Option to disable touch screen
|
||||||
return data->ui_config & (1 << 24);
|
return data->ui_config & (1 << 24);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool show_bigger_qr_code() { // show bigger QR code
|
||||||
|
return data->ui_config & (1 << 23);
|
||||||
|
}
|
||||||
|
|
||||||
bool hide_clock() { // clock hidden from main menu
|
bool hide_clock() { // clock hidden from main menu
|
||||||
return data->ui_config & (1 << 25);
|
return data->ui_config & (1 << 25);
|
||||||
}
|
}
|
||||||
|
@ -258,6 +265,10 @@ bool config_splash() {
|
||||||
return data->ui_config & (1 << 31);
|
return data->ui_config & (1 << 31);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint8_t config_cpld() {
|
||||||
|
return data->hardware_config;
|
||||||
|
}
|
||||||
|
|
||||||
uint32_t config_backlight_timer() {
|
uint32_t config_backlight_timer() {
|
||||||
const uint32_t timer_seconds[8] = { 0, 5, 15, 30, 60, 180, 300, 600 };
|
const uint32_t timer_seconds[8] = { 0, 5, 15, 30, 60, 180, 300, 600 };
|
||||||
return timer_seconds[data->ui_config & 7]; //first three bits, 8 possible values
|
return timer_seconds[data->ui_config & 7]; //first three bits, 8 possible values
|
||||||
|
@ -267,6 +278,10 @@ void set_disable_touchscreen(bool v) {
|
||||||
data->ui_config = (data->ui_config & ~(1 << 24)) | (v << 24);
|
data->ui_config = (data->ui_config & ~(1 << 24)) | (v << 24);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void set_show_bigger_qr_code(bool v) {
|
||||||
|
data->ui_config = (data->ui_config & ~(1 << 23)) | (v << 23);
|
||||||
|
}
|
||||||
|
|
||||||
void set_clock_hidden(bool v) {
|
void set_clock_hidden(bool v) {
|
||||||
data->ui_config = (data->ui_config & ~(1 << 25)) | (v << 25);
|
data->ui_config = (data->ui_config & ~(1 << 25)) | (v << 25);
|
||||||
}
|
}
|
||||||
|
@ -295,6 +310,10 @@ void set_config_splash(bool v) {
|
||||||
data->ui_config = (data->ui_config & ~(1 << 31)) | (v << 31);
|
data->ui_config = (data->ui_config & ~(1 << 31)) | (v << 31);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void set_config_cpld(uint8_t i) {
|
||||||
|
data->hardware_config = i;
|
||||||
|
}
|
||||||
|
|
||||||
void set_config_backlight_timer(uint32_t i) {
|
void set_config_backlight_timer(uint32_t i) {
|
||||||
data->ui_config = (data->ui_config & ~7) | (i & 7);
|
data->ui_config = (data->ui_config & ~7) | (i & 7);
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,7 +74,11 @@ void set_playdead_sequence(const uint32_t new_value);
|
||||||
bool stealth_mode();
|
bool stealth_mode();
|
||||||
void set_stealth_mode(const bool v);
|
void set_stealth_mode(const bool v);
|
||||||
|
|
||||||
|
uint8_t config_cpld();
|
||||||
|
void set_config_cpld(uint8_t i);
|
||||||
|
|
||||||
bool config_splash();
|
bool config_splash();
|
||||||
|
bool show_bigger_qr_code();
|
||||||
bool hide_clock();
|
bool hide_clock();
|
||||||
bool clock_with_date();
|
bool clock_with_date();
|
||||||
bool config_login();
|
bool config_login();
|
||||||
|
@ -83,6 +87,7 @@ uint32_t config_backlight_timer();
|
||||||
bool disable_touchscreen();
|
bool disable_touchscreen();
|
||||||
|
|
||||||
void set_config_splash(bool v);
|
void set_config_splash(bool v);
|
||||||
|
void set_show_bigger_qr_code(bool v);
|
||||||
void set_clock_hidden(bool v);
|
void set_clock_hidden(bool v);
|
||||||
void set_clock_with_date(bool v);
|
void set_clock_with_date(bool v);
|
||||||
void set_config_login(bool v);
|
void set_config_login(bool v);
|
||||||
|
|
|
@ -142,7 +142,23 @@ static int32_t rect_distances(
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (std::abs(perpendicular_axis_end - perpendicular_axis_start) + 1) * (on_axis_distance + 1);
|
|
||||||
|
switch(direction) {
|
||||||
|
case KeyEvent::Right:
|
||||||
|
case KeyEvent::Left:
|
||||||
|
return ((std::abs(perpendicular_axis_end - perpendicular_axis_start) + 1) ^ 3) * sqrt((on_axis_distance + 1));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case KeyEvent::Up:
|
||||||
|
case KeyEvent::Down:
|
||||||
|
return (sqrt(std::abs(perpendicular_axis_end - perpendicular_axis_start) + 1)) * ((on_axis_distance + 1) ^ 3);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FocusManager::update(
|
void FocusManager::update(
|
||||||
|
|
|
@ -345,8 +345,9 @@ public:
|
||||||
void speaker_disable() {};
|
void speaker_disable() {};
|
||||||
|
|
||||||
|
|
||||||
void microphone_enable() override {
|
void microphone_enable(int8_t alc_mode) override {
|
||||||
// TODO: Implement
|
(void)alc_mode; // to avoid "unused warning" when compiling. (@WM8731 we do not use that parameter)
|
||||||
|
// TODO: Implement,
|
||||||
}
|
}
|
||||||
|
|
||||||
void microphone_disable() override {
|
void microphone_disable() override {
|
||||||
|
|
BIN
firmware/graphics/icon_qr_code.png
Executable file
BIN
firmware/graphics/icon_qr_code.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 427 B |
|
@ -436,7 +436,7 @@ ASF,Austrian Air Force,AUSTRIAN AIRFORCE,Austria
|
||||||
ASG,African Star Airways (PTY) Ltd.,AFRICAN STAR,South Africa
|
ASG,African Star Airways (PTY) Ltd.,AFRICAN STAR,South Africa
|
||||||
ASH,Mesa Airlines,AIR SHUTTLE,United States
|
ASH,Mesa Airlines,AIR SHUTTLE,United States
|
||||||
ASI,Aerosun International Inc.,AEROSUN,United States
|
ASI,Aerosun International Inc.,AEROSUN,United States
|
||||||
ASJ,Air Satellite,,Canada
|
ASJ,AstonJet,,France
|
||||||
ASK,Aerosky,MULTISKY,Spain
|
ASK,Aerosky,MULTISKY,Spain
|
||||||
ASL,Air Serbia,AIR SERBIA,Serbia
|
ASL,Air Serbia,AIR SERBIA,Serbia
|
||||||
ASM,Awesome Flight Services (PTY) Ltd.,AWESOME,South Africa
|
ASM,Awesome Flight Services (PTY) Ltd.,AWESOME,South Africa
|
||||||
|
@ -508,6 +508,7 @@ AVG,Aviation Legacy,AVILEF,Gambia
|
||||||
AVH,AV8 Helicopters,KENT HELI,United Kingdom
|
AVH,AV8 Helicopters,KENT HELI,United Kingdom
|
||||||
AVJ,Avia Traffic Company,ATOMIC,Kyrgyzstan
|
AVJ,Avia Traffic Company,ATOMIC,Kyrgyzstan
|
||||||
AVK,AV8 Helicopters,AVIATE-COPTER,South Africa
|
AVK,AV8 Helicopters,AVIATE-COPTER,South Africa
|
||||||
|
AVL,Aviation Adventures,SKY VENTURES,United States
|
||||||
AVM,Aviación Ejecutiva Mexicana S.A.,AVEMEX,Mexico
|
AVM,Aviación Ejecutiva Mexicana S.A.,AVEMEX,Mexico
|
||||||
AVN,Air Vanuatu,AIR VAN,Vanuatu
|
AVN,Air Vanuatu,AIR VAN,Vanuatu
|
||||||
AVO,Aviation at Work,AVIATION WORK,South Africa
|
AVO,Aviation at Work,AVIATION WORK,South Africa
|
||||||
|
@ -1293,6 +1294,7 @@ CRX,Cross Aviation,CROSSAIR,United Kingdom
|
||||||
CRY,Primavia Limited,CARRIERS,United Kingdom
|
CRY,Primavia Limited,CARRIERS,United Kingdom
|
||||||
CRZ,Cruzeiro do Sul Servicos Aereos,,Brazil
|
CRZ,Cruzeiro do Sul Servicos Aereos,,Brazil
|
||||||
CSA,Czech Airlines,CSA,Czech Republic
|
CSA,Czech Airlines,CSA,Czech Republic
|
||||||
|
CSB,21 Air,CARGO SOUTH,United States
|
||||||
CSC,Sichuan Airlines,SI CHUAN,China
|
CSC,Sichuan Airlines,SI CHUAN,China
|
||||||
CSD,Courier Services,DELIVERY,United States
|
CSD,Courier Services,DELIVERY,United States
|
||||||
CSE,CSE Aviation,OXFORD,United Kingdom
|
CSE,CSE Aviation,OXFORD,United Kingdom
|
||||||
|
@ -1685,6 +1687,7 @@ EFS,EFAOS- Agencia De Viagens e Turismo,EFAOS,Angola
|
||||||
EFT,Embassy Freight Company,EMBASSY FREIGHT,United States
|
EFT,Embassy Freight Company,EMBASSY FREIGHT,United States
|
||||||
EFX,Easy Fly Express,EASY EXPRESS,BD
|
EFX,Easy Fly Express,EASY EXPRESS,BD
|
||||||
EFY,EasyFly,,Colombia
|
EFY,EasyFly,,Colombia
|
||||||
|
EGC,First Wing Aircraft Charter and Maintenance,EAGLE CREEK,United States
|
||||||
EGF,American Eagle Airlines,EAGLE FLIGHT,United States
|
EGF,American Eagle Airlines,EAGLE FLIGHT,United States
|
||||||
EGH,BBN-Airways,,United Kingdom
|
EGH,BBN-Airways,,United Kingdom
|
||||||
EGJ,Eagle Jet Charter,EAGLE JET,United States
|
EGJ,Eagle Jet Charter,EAGLE JET,United States
|
||||||
|
@ -1862,6 +1865,7 @@ EVN,Euraviation,EURAVIATION,Italy
|
||||||
EVR,Aeronautical Academy of Europe,DIANA,Portugal
|
EVR,Aeronautical Academy of Europe,DIANA,Portugal
|
||||||
EVT,Everett Limited,,Tanzania
|
EVT,Everett Limited,,Tanzania
|
||||||
EVX,ATR,GREEN SPIRIT,France
|
EVX,ATR,GREEN SPIRIT,France
|
||||||
|
EVY,Royal Australian Air Force,,Australia
|
||||||
EWA,East-West Airlines,,Australia
|
EWA,East-West Airlines,,Australia
|
||||||
EWE,Eurowings Europe,,Austria
|
EWE,Eurowings Europe,,Austria
|
||||||
EWG,Eurowings,EUROWINGS,Germany
|
EWG,Eurowings,EUROWINGS,Germany
|
||||||
|
@ -2009,6 +2013,7 @@ FGY,Froggy Corporate Aviation,,Australia
|
||||||
FHE,Hello,FLYHELLO,Switzerland
|
FHE,Hello,FLYHELLO,Switzerland
|
||||||
FHI,FlyHigh Airlines Ireland (FH),,Ireland
|
FHI,FlyHigh Airlines Ireland (FH),,Ireland
|
||||||
FHL,Fast Helicopters,FINDON,United Kingdom
|
FHL,Fast Helicopters,FINDON,United Kingdom
|
||||||
|
FHM,Freebird Airlines Europe,EUROBIRD,Malta
|
||||||
FHS,Forth and Clyde Helicopter Services,HELISCOT,United Kingdom
|
FHS,Forth and Clyde Helicopter Services,HELISCOT,United Kingdom
|
||||||
FHY,Freebird Airlines,FREEBIRD AIR,Turkey
|
FHY,Freebird Airlines,FREEBIRD AIR,Turkey
|
||||||
FI5,Fly One,,Moldova
|
FI5,Fly One,,Moldova
|
||||||
|
@ -2029,6 +2034,7 @@ FJI,Fiji Airways,PACIFIC,Fiji
|
||||||
FJK,Fly Jet Kz,,Kazakhstan
|
FJK,Fly Jet Kz,,Kazakhstan
|
||||||
FJM,Fly Jamaica Airways,GREENHEART,Jamaica
|
FJM,Fly Jamaica Airways,GREENHEART,Jamaica
|
||||||
FJO,Flexjet Operations Malta Limited,FLEX MALTA,Malta
|
FJO,Flexjet Operations Malta Limited,FLEX MALTA,Malta
|
||||||
|
FRJ,Fly Jordan,SOLITAIRE AIR,Jordan
|
||||||
FJS,Florida Jet Service,FLORIDAJET,United States
|
FJS,Florida Jet Service,FLORIDAJET,United States
|
||||||
FKA,Flying kangaroo Airline,,Australia
|
FKA,Flying kangaroo Airline,,Australia
|
||||||
FKI,FLM Aviation Mohrdieck,KIEL AIR,Germany
|
FKI,FLM Aviation Mohrdieck,KIEL AIR,Germany
|
||||||
|
@ -2139,6 +2145,7 @@ FTH,Mountain Aviation,FOOTHILL,United States
|
||||||
FTI,FTI Fluggesellschaft,,Germany
|
FTI,FTI Fluggesellschaft,,Germany
|
||||||
FTL,Flightline,FLIGHT-AVIA,Spain
|
FTL,Flightline,FLIGHT-AVIA,Spain
|
||||||
FTM,Flyteam Aviation,FLYTEAM,United Kingdom
|
FTM,Flyteam Aviation,FLYTEAM,United Kingdom
|
||||||
|
FTN,Victory Air,FRONTRUNNER,United States
|
||||||
FTP,Keystone Aerial Surveys,FOOTPRINT,United States
|
FTP,Keystone Aerial Surveys,FOOTPRINT,United States
|
||||||
FTR,Finist'air,FINISTAIR,France
|
FTR,Finist'air,FINISTAIR,France
|
||||||
FTS,First Sabre,FIRST SABRE,Mexico
|
FTS,First Sabre,FIRST SABRE,Mexico
|
||||||
|
@ -2230,6 +2237,7 @@ GCC,GECAS,GECAS,Ireland
|
||||||
GCF,Aeronor,AEROCARTO,Spain
|
GCF,Aeronor,AEROCARTO,Spain
|
||||||
GCH,Gama Aviation Switzerland,GAMA SWISS,Switzerland
|
GCH,Gama Aviation Switzerland,GAMA SWISS,Switzerland
|
||||||
GCK,Aerogem Cargo,,Ghana
|
GCK,Aerogem Cargo,,Ghana
|
||||||
|
GCL,CargoLogic Germany,SAXONIAN,Germany
|
||||||
GCM,Comair Flight Services,GLOBECOM,South Africa
|
GCM,Comair Flight Services,GLOBECOM,South Africa
|
||||||
GCN,Gulf Central Airlines,GULF CENTRAL,United States
|
GCN,Gulf Central Airlines,GULF CENTRAL,United States
|
||||||
GCO,Gemini Air Cargo,GEMINI,United States
|
GCO,Gemini Air Cargo,GEMINI,United States
|
||||||
|
@ -2321,6 +2329,7 @@ GJM,Airhub Airlines,AIRHUB,Malta
|
||||||
GJS,GoJet Airlines,LINDBERGH,United States
|
GJS,GoJet Airlines,LINDBERGH,United States
|
||||||
GJT,Gestión Aérea Ejecutiva,BANJET,Spain
|
GJT,Gestión Aérea Ejecutiva,BANJET,Spain
|
||||||
GKA,US Army Parachute Team,GOLDEN KNIGHTS,United States
|
GKA,US Army Parachute Team,GOLDEN KNIGHTS,United States
|
||||||
|
GKY,Gama Aviation,GAMA CAYMAN,Cayman Islands
|
||||||
GLA,Great Lakes Airlines,LAKES AIR,United States
|
GLA,Great Lakes Airlines,LAKES AIR,United States
|
||||||
GLB,Global Airways (GLB),GLO-AIR,United States
|
GLB,Global Airways (GLB),GLO-AIR,United States
|
||||||
GLC,Global Aircargo,,Bahrain
|
GLC,Global Aircargo,,Bahrain
|
||||||
|
@ -2348,6 +2357,7 @@ GMI,Germania,GERMANIA,Germany
|
||||||
GMJ,Gamisa Aviación,GAMISA,Spain
|
GMJ,Gamisa Aviación,GAMISA,Spain
|
||||||
GML,G & L Aviation,GEEANDEL,South Africa
|
GML,G & L Aviation,GEEANDEL,South Africa
|
||||||
GMM,Aerotaxis Guamuchil,AEROGUAMUCHIL,Mexico
|
GMM,Aerotaxis Guamuchil,AEROGUAMUCHIL,Mexico
|
||||||
|
GMN,Garmin,GARMIN,United States
|
||||||
GMQ,Germania Express,CORGI,Germany
|
GMQ,Germania Express,CORGI,Germany
|
||||||
GMR,Golden Myanmar Airlines,GOLDEN MYANMAR,Myanmar
|
GMR,Golden Myanmar Airlines,GOLDEN MYANMAR,Myanmar
|
||||||
GMS,Aeroservicios Gama,SERVICIOS GAMA,Mexico
|
GMS,Aeroservicios Gama,SERVICIOS GAMA,Mexico
|
||||||
|
@ -2383,11 +2393,12 @@ GPA,Golden Pacific Airlines,GOLDEN PAC,United States
|
||||||
GPC,Gulf Pearl Air Lines,AIR GULFPEARL,Libya
|
GPC,Gulf Pearl Air Lines,AIR GULFPEARL,Libya
|
||||||
GPD,Tradewind Aviation,GOODSPEED,United States
|
GPD,Tradewind Aviation,GOODSPEED,United States
|
||||||
GPE,GP Express Airlines,REGIONAL EXPRESS,United States
|
GPE,GP Express Airlines,REGIONAL EXPRESS,United States
|
||||||
GPL,DLR,,Germany
|
GPL,DLR,GERMAN POLAR,Germany
|
||||||
GPM,Grup Air-Med,GRUPOMED,Spain
|
GPM,Grup Air-Med,GRUPOMED,Spain
|
||||||
GPR,GPM Aeroservicio,GPM AEROSERVICIO,Mexico
|
GPR,GPM Aeroservicio,GPM AEROSERVICIO,Mexico
|
||||||
GPX,GP Aviation,,Bulgaria
|
GPX,GP Aviation,,Bulgaria
|
||||||
GRA,Guardian Air Asset Management,FLEX,South Africa
|
GRA,Guardian Air Asset Management,FLEX,South Africa
|
||||||
|
GRB,Phoenix Air Group,GREY BIRD,United States
|
||||||
GRD,National Grid plc,GRID,United Kingdom
|
GRD,National Grid plc,GRID,United Kingdom
|
||||||
GRE,Air Scotland,GREECE AIRWAYS,Greece
|
GRE,Air Scotland,GREECE AIRWAYS,Greece
|
||||||
GRG,Air Georgia,AIR GEORGIA,Georgia
|
GRG,Air Georgia,AIR GEORGIA,Georgia
|
||||||
|
@ -2455,6 +2466,7 @@ GXY,Galaxy Airlines,GALAX,Japan
|
||||||
GYP,Eagle Aviation,GYPSY,United Kingdom
|
GYP,Eagle Aviation,GYPSY,United Kingdom
|
||||||
GZA,Excellent Air,EXCELLENT AIR,Germany
|
GZA,Excellent Air,EXCELLENT AIR,Germany
|
||||||
GZD,Grizodubova Air Company,GRIZODUBOVA AIR,Russia
|
GZD,Grizodubova Air Company,GRIZODUBOVA AIR,Russia
|
||||||
|
GZO,Aeromanagement Group,GEZIRA,United States
|
||||||
GZP,Gazpromavia,GAZPROMAVIA,Russia
|
GZP,Gazpromavia,GAZPROMAVIA,Russia
|
||||||
GZQ,Zagros Air,ZAGROS,Iran
|
GZQ,Zagros Air,ZAGROS,Iran
|
||||||
HA1,Hankook Air US,,United States
|
HA1,Hankook Air US,,United States
|
||||||
|
@ -2515,6 +2527,7 @@ HEJ,Hellas Jet,,Greece
|
||||||
HEL,Helicol,HELICOL,Colombia
|
HEL,Helicol,HELICOL,Colombia
|
||||||
HEM,CHC Helicopter,HEMS,Australia
|
HEM,CHC Helicopter,HEMS,Australia
|
||||||
HEN,Helicópteros Y Vehículos Nacionales Aéreos,HELINAC,Mexico
|
HEN,Helicópteros Y Vehículos Nacionales Aéreos,HELINAC,Mexico
|
||||||
|
HEP,Oslo Politidistrikt Helikoptertjenesten,HELIPOLICE,Norway
|
||||||
HER,Hera Flight,,United States
|
HER,Hera Flight,,United States
|
||||||
HES,Holiday Europe,HOLIDAY EUROPE,Bulgaria
|
HES,Holiday Europe,HOLIDAY EUROPE,Bulgaria
|
||||||
HET,TAF Helicopters,HELITAF,Spain
|
HET,TAF Helicopters,HELITAF,Spain
|
||||||
|
@ -2588,6 +2601,7 @@ HLT,Helitafe,HELITAFE,Mexico
|
||||||
HLU,Heli Union Heli Prestations,HELI UNION,France
|
HLU,Heli Union Heli Prestations,HELI UNION,France
|
||||||
HLW,Heliworks,HELIWORKS,Chile
|
HLW,Heliworks,HELIWORKS,Chile
|
||||||
HLX,Hapag-Lloyd Express (TUIfly),YELLOW CAB,Germany
|
HLX,Hapag-Lloyd Express (TUIfly),YELLOW CAB,Germany
|
||||||
|
HLY,Heli Air,WHISPER,United Kingdom
|
||||||
HMA,Air Tahoma,TAHOMA,United States
|
HMA,Air Tahoma,TAHOMA,United States
|
||||||
HMB,CHC Global Operations Canada,HUMMINGBIRD,Canada
|
HMB,CHC Global Operations Canada,HUMMINGBIRD,Canada
|
||||||
HMC,Heliamerica De Mexico,HELIAMERICA,Mexico
|
HMC,Heliamerica De Mexico,HELIAMERICA,Mexico
|
||||||
|
@ -2628,6 +2642,7 @@ HQO,Avinor,,Norway
|
||||||
HRA,Heli-Iberica,ERICA,Spain
|
HRA,Heli-Iberica,ERICA,Spain
|
||||||
HRB,Haiti International Airline,HAITI AIRLINE,Haiti
|
HRB,Haiti International Airline,HAITI AIRLINE,Haiti
|
||||||
HRC,Harco Aviation,HARCO,United States
|
HRC,Harco Aviation,HARCO,United States
|
||||||
|
HRE,FFH Sudwestdeutsche Verkehrsfliegerschule,HART AIR,Germany
|
||||||
HRH,Royal Tongan Airlines,TONGA ROYAL,Tonga
|
HRH,Royal Tongan Airlines,TONGA ROYAL,Tonga
|
||||||
HRI,Skyraidybos Mokymo Centras,HELIRIM,Lithuania
|
HRI,Skyraidybos Mokymo Centras,HELIRIM,Lithuania
|
||||||
HRM,Hermes Airlines,,Greece
|
HRM,Hermes Airlines,,Greece
|
||||||
|
@ -2747,6 +2762,7 @@ ICT,Intercontinental de Aviación,CONTAVIA,Colombia
|
||||||
ICU,Reignwood Asia Aviation Co Ltd,ASIA MEDICAL,China
|
ICU,Reignwood Asia Aviation Co Ltd,ASIA MEDICAL,China
|
||||||
ICV,Cargolux Italia,CARGO MED,Italy
|
ICV,Cargolux Italia,CARGO MED,Italy
|
||||||
ICX,International Charter Xpress,,United States
|
ICX,International Charter Xpress,,United States
|
||||||
|
ICY,Intercity Air,INTERCITY,Malaysia
|
||||||
IDA,Indonesia Air Transport,INTRA,Indonesia
|
IDA,Indonesia Air Transport,INTRA,Indonesia
|
||||||
IDE,Independence Air,,United States
|
IDE,Independence Air,,United States
|
||||||
IDG,IDG Technology Air,INDIGO,Czech Republic
|
IDG,IDG Technology Air,INDIGO,Czech Republic
|
||||||
|
@ -2819,6 +2835,7 @@ INC,Insel Air International,INSELAIR,Netherlands Antilles
|
||||||
IND,Iona National Airways,IONA,Ireland
|
IND,Iona National Airways,IONA,Ireland
|
||||||
INE,International Europe,,Spain
|
INE,International Europe,,Spain
|
||||||
ING,Aeroingenieria,,Chile
|
ING,Aeroingenieria,,Chile
|
||||||
|
INI,Initium Aviation,INITIUM,Spain
|
||||||
INK,Sincom-Avia,SINCOM AVIA,Ukraine
|
INK,Sincom-Avia,SINCOM AVIA,Ukraine
|
||||||
INL,Intal Avia,INTAL AVIA,Kyrgyzstan
|
INL,Intal Avia,INTAL AVIA,Kyrgyzstan
|
||||||
INO,Aeroservicios Intergrados de Norte,INTENOR,Mexico
|
INO,Aeroservicios Intergrados de Norte,INTENOR,Mexico
|
||||||
|
@ -3055,6 +3072,7 @@ JSE,Jets Y Servicios Ejecutivos,,Mexico
|
||||||
JSH,Jetstream Air,,Hungary
|
JSH,Jetstream Air,,Hungary
|
||||||
JSI,Jet Air Group,,Russia
|
JSI,Jet Air Group,,Russia
|
||||||
JSJ,JS Air,,Pakistan
|
JSJ,JS Air,,Pakistan
|
||||||
|
JSL,SelectJet,SELECTJET,United States
|
||||||
JSM,Jet Stream,,Moldova
|
JSM,Jet Stream,,Moldova
|
||||||
JSN,Suncor Energy Inc,JETSUN,Canada
|
JSN,Suncor Energy Inc,JETSUN,Canada
|
||||||
JSP,Palmer Aviation,PALMER,United Kingdom
|
JSP,Palmer Aviation,PALMER,United Kingdom
|
||||||
|
@ -3519,6 +3537,7 @@ LRW,Al Rida Airways,AL RIDA,Mauritania
|
||||||
LSA,LANSA,INTERNACIONAL,Dominican Republic
|
LSA,LANSA,INTERNACIONAL,Dominican Republic
|
||||||
LSC,Los Cedros Aviación,CEDROS,Chile
|
LSC,Los Cedros Aviación,CEDROS,Chile
|
||||||
LSE,Línea De Aeroservicios,,Chile
|
LSE,Línea De Aeroservicios,,Chile
|
||||||
|
LSI,Aliscargo Airlines,ALIS,Italy
|
||||||
LSK,Aurela,AURELA,Lithuania
|
LSK,Aurela,AURELA,Lithuania
|
||||||
LSM,Aerobusinessservice,,Russia
|
LSM,Aerobusinessservice,,Russia
|
||||||
LSP,Spectrum Aviation Incorporated,AIR TONY,United Kingdom
|
LSP,Spectrum Aviation Incorporated,AIR TONY,United Kingdom
|
||||||
|
@ -3775,10 +3794,12 @@ MMD,Air Alsie,MERMAID,Denmark
|
||||||
MMF,Netherlands Air Force,,Netherlands
|
MMF,Netherlands Air Force,,Netherlands
|
||||||
MMG,Aereo Ruta Maya,RUTA MAYA,Guatemala
|
MMG,Aereo Ruta Maya,RUTA MAYA,Guatemala
|
||||||
MMH,McMahon Helicopter,NIGHT RIDER,United States
|
MMH,McMahon Helicopter,NIGHT RIDER,United States
|
||||||
|
MMI,Marina Militare Italiana,ITALIAN NAVY,Italy
|
||||||
MMJ,Macau Jet International,MACAUJET,China
|
MMJ,Macau Jet International,MACAUJET,China
|
||||||
MML,Hunnu Air,TRANS MONGOLIA,Mongolia
|
MML,Hunnu Air,TRANS MONGOLIA,Mongolia
|
||||||
MMM,Aviation Company Meridian,AVIAMERIDIAN,Russia
|
MMM,Aviation Company Meridian,AVIAMERIDIAN,Russia
|
||||||
MMN,Pro Airways,,United States
|
MMN,Pro Airways,,United States
|
||||||
|
MMO,Malta MedAir,MALIT,Malta
|
||||||
MMP,AMP Incorporated,AMP-INC,United States
|
MMP,AMP Incorporated,AMP-INC,United States
|
||||||
MMR,Musrata Air Transport,MUSRATA AIR,Libya
|
MMR,Musrata Air Transport,MUSRATA AIR,Libya
|
||||||
MMS,SAAD (A320) Limited,MUSAAD AIR,Cayman Islands
|
MMS,SAAD (A320) Limited,MUSAAD AIR,Cayman Islands
|
||||||
|
@ -3933,6 +3954,7 @@ MXS,Millon Express,MILLON EXPRESS,United States
|
||||||
MXT,México Transportes Aéreos,TRANSMEX,Mexico
|
MXT,México Transportes Aéreos,TRANSMEX,Mexico
|
||||||
MXU,Maximus Air Cargo,CARGO MAX,United Arab Emirates
|
MXU,Maximus Air Cargo,CARGO MAX,United Arab Emirates
|
||||||
MXX,Merchant Express Aviation,MERCHANT,Nigeria
|
MXX,Merchant Express Aviation,MERCHANT,Nigeria
|
||||||
|
MXY,Breeze Airways,MOXY,United States
|
||||||
MYA,Myflug,MYFLUG,Iceland
|
MYA,Myflug,MYFLUG,Iceland
|
||||||
MYD,Maya Island Air,MYLAND,Belize
|
MYD,Maya Island Air,MYLAND,Belize
|
||||||
MYI,Mayair,MAYAIR,Mexico
|
MYI,Mayair,MAYAIR,Mexico
|
||||||
|
@ -3961,7 +3983,7 @@ NAF,Royal Netherlands Air Force,NETHERLANDS AIR FORCE,Netherlands
|
||||||
NAH,Nahanni Air Services Ltd,NAHANNI,Canada
|
NAH,Nahanni Air Services Ltd,NAHANNI,Canada
|
||||||
NAI,North Adria Aviation,NORTH-ADRIA,Croatia
|
NAI,North Adria Aviation,NORTH-ADRIA,Croatia
|
||||||
NAJ,North American Jet Charter Group,JET GROUP,United States
|
NAJ,North American Jet Charter Group,JET GROUP,United States
|
||||||
NAK,École Nationale de l'Aviation Civile,ENAC SCHOOL,France
|
NAK,ENAC,ENAC SCHOOL,France
|
||||||
NAL,Northway Aviation Ltd,NORTHWAY,Canada
|
NAL,Northway Aviation Ltd,NORTHWAY,Canada
|
||||||
NAM,Nortland Air Manitoba,MANITOBA,Canada
|
NAM,Nortland Air Manitoba,MANITOBA,Canada
|
||||||
NAN,Norwegian Air Norway,NORSHIP,Norway
|
NAN,Norwegian Air Norway,NORSHIP,Norway
|
||||||
|
@ -4134,6 +4156,7 @@ NSA,Nile Safaris Aviation,NILE SAFARIS,Sudan
|
||||||
NSC,Societe De Transport Aerien De Mauritanie,TRANS-SOCIETE,Mauritania
|
NSC,Societe De Transport Aerien De Mauritanie,TRANS-SOCIETE,Mauritania
|
||||||
NSE,SATENA,SATENA,Colombia
|
NSE,SATENA,SATENA,Colombia
|
||||||
NSF,Northamptonshire School of Flying,NORTON,United Kingdom
|
NSF,Northamptonshire School of Flying,NORTON,United Kingdom
|
||||||
|
NSH,Sterling Aviation,NORTH-SHORE,United States
|
||||||
NSJ,Nanshan Jet,NANSHAN,China
|
NSJ,Nanshan Jet,NANSHAN,China
|
||||||
NSK,Air Intersalonika,INTERSALONIKA,Greece
|
NSK,Air Intersalonika,INTERSALONIKA,Greece
|
||||||
NSL,Neric,NERICAIR,United Kingdom
|
NSL,Neric,NERICAIR,United Kingdom
|
||||||
|
@ -4150,6 +4173,7 @@ NTB,Servicios Aéreos Del Norte,SERVINORTE,Mexico
|
||||||
NTC,Gibson Aviation,NIGHT CHASE,United States
|
NTC,Gibson Aviation,NIGHT CHASE,United States
|
||||||
NTD,Aero Norte,,Mexico
|
NTD,Aero Norte,,Mexico
|
||||||
NTE,Interaire,INTERMEX,Mexico
|
NTE,Interaire,INTERMEX,Mexico
|
||||||
|
NTF,OK Business Aircraft,NETFLIGHT,Czech Republic
|
||||||
NTG,Servicios Integrales De Aviación,INTEGRALES,Mexico
|
NTG,Servicios Integrales De Aviación,INTEGRALES,Mexico
|
||||||
NTH,Hokkaido Air System,NORTH AIR,Japan
|
NTH,Hokkaido Air System,NORTH AIR,Japan
|
||||||
NTJ,NextJet,NEXTJET,Sweden
|
NTJ,NextJet,NEXTJET,Sweden
|
||||||
|
@ -4183,6 +4207,7 @@ NVR,Novair,NAVIGATOR,Sweden
|
||||||
NVS,Nouvelle Air Affaires Gabon,NOUVELLE AFFAIRES,GA
|
NVS,Nouvelle Air Affaires Gabon,NOUVELLE AFFAIRES,GA
|
||||||
NVY,Royal Navy,NAVY,United Kingdom
|
NVY,Royal Navy,NAVY,United Kingdom
|
||||||
NWA,Delta Airlines,NORTHWEST,United States
|
NWA,Delta Airlines,NORTHWEST,United States
|
||||||
|
NWC,Aircompany North-West LLC,WEST WAY,Russia
|
||||||
NWD,New World Jet Corporation,NEW WORLD,United States
|
NWD,New World Jet Corporation,NEW WORLD,United States
|
||||||
NWE,Northwest Aero Associates,,United States
|
NWE,Northwest Aero Associates,,United States
|
||||||
NWF,Northwest Flyers,SECOND CITY,United States
|
NWF,Northwest Flyers,SECOND CITY,United States
|
||||||
|
@ -4273,6 +4298,7 @@ OLV,Aerolíneas Olve,OLVE,Mexico
|
||||||
OLX,Olimex Aerotaxi,OLIMEX,Czech Republic
|
OLX,Olimex Aerotaxi,OLIMEX,Czech Republic
|
||||||
OLY,Olympic Aviation,OLAVIA,Greece
|
OLY,Olympic Aviation,OLAVIA,Greece
|
||||||
OMA,Oman Air,OMAN AIR,Oman
|
OMA,Oman Air,OMAN AIR,Oman
|
||||||
|
OMD,Nomadic Aviation,NOMADIC,United States
|
||||||
OME,Homer Air,,Germany
|
OME,Homer Air,,Germany
|
||||||
OMF,Omniflys,OMNIFLYS,Mexico
|
OMF,Omniflys,OMNIFLYS,Mexico
|
||||||
OMG,Aeromega,OMEGA,United Kingdom
|
OMG,Aeromega,OMEGA,United Kingdom
|
||||||
|
@ -4855,6 +4881,7 @@ RJA,Royal Jordanian,JORDANIAN,Jordan
|
||||||
RJC,Richmor Aviation,COLUMBIA JET,United States
|
RJC,Richmor Aviation,COLUMBIA JET,United States
|
||||||
RJD,Rotana Jet,,United Arab Emirates
|
RJD,Rotana Jet,,United Arab Emirates
|
||||||
RJM,Millen Corporation,MILLEN,United Kingdom
|
RJM,Millen Corporation,MILLEN,United Kingdom
|
||||||
|
RJR,Air CM Global,MELITA,Malta
|
||||||
RJS,Aeroservicios Jet,ASERJET,Mexico
|
RJS,Aeroservicios Jet,ASERJET,Mexico
|
||||||
RJT,RA Jet Aeroservicios,RA JET,Mexico
|
RJT,RA Jet Aeroservicios,RA JET,Mexico
|
||||||
RJZ,Royal Jordanian Air Force,JORDAN AIR FORCE,Jordan
|
RJZ,Royal Jordanian Air Force,JORDAN AIR FORCE,Jordan
|
||||||
|
@ -5046,7 +5073,6 @@ RYR,Ryanair,RYANAIR,Ireland
|
||||||
RYS,Buzz (Ryanair),MAGIC SUN,Poland
|
RYS,Buzz (Ryanair),MAGIC SUN,Poland
|
||||||
RYT,Raya Jet,,Jordan
|
RYT,Raya Jet,,Jordan
|
||||||
RYZ,Ryazan State Air Enterprise,RYAZAN AIR,Russia
|
RYZ,Ryazan State Air Enterprise,RYAZAN AIR,Russia
|
||||||
RZ,Superna Airlines,YANGTZE RIVER,China
|
|
||||||
RZA,Jet Fighter Flights,,Australia
|
RZA,Jet Fighter Flights,,Australia
|
||||||
RZL,Aero Zambia,AERO ZAMBIA,Zambia
|
RZL,Aero Zambia,AERO ZAMBIA,Zambia
|
||||||
RZN,Aero Zano,ZANO,Mexico
|
RZN,Aero Zano,ZANO,Mexico
|
||||||
|
@ -5131,6 +5157,7 @@ SDC,Sunrise Airlines,SUNDANCE,United States
|
||||||
SDD,Skymaster Air Taxi,SKY DANCE,United States
|
SDD,Skymaster Air Taxi,SKY DANCE,United States
|
||||||
SDE,Air Partners Corp.,STAMPEDE,Canada
|
SDE,Air Partners Corp.,STAMPEDE,Canada
|
||||||
SDF,Sundorph Aeronautical Corporation,SUNDORPH,United States
|
SDF,Sundorph Aeronautical Corporation,SUNDORPH,United States
|
||||||
|
SDG,Star Air,HI STAR,India
|
||||||
SDH,Servicio De Helicopteros,ARCOS,Spain
|
SDH,Servicio De Helicopteros,ARCOS,Spain
|
||||||
SDI,San Dima Air,,United States
|
SDI,San Dima Air,,United States
|
||||||
SDJ,Club 328,SPACEJET,United Kingdom
|
SDJ,Club 328,SPACEJET,United Kingdom
|
||||||
|
@ -5568,6 +5595,7 @@ SXA,Southern Cross Aviation,FERRY,United States
|
||||||
SXC,Sky Exec Aviation Services,SKY EXEC,Nigeria
|
SXC,Sky Exec Aviation Services,SKY EXEC,Nigeria
|
||||||
SXD,Sunexpress Deutschland,SUNRISE,Germany
|
SXD,Sunexpress Deutschland,SUNRISE,Germany
|
||||||
SXE,Southeast Express Airlines,DOGWOOD EXPRESS,United States
|
SXE,Southeast Express Airlines,DOGWOOD EXPRESS,United States
|
||||||
|
SXI,Southern Cross International,SOUTHERN CROSS,Netherlands
|
||||||
SXL,Skyline Flight,SKYLINE,United States
|
SXL,Skyline Flight,SKYLINE,United States
|
||||||
SXM,Servicios Aéreos Especializados Mexicanos,SERVIMEX,Mexico
|
SXM,Servicios Aéreos Especializados Mexicanos,SERVIMEX,Mexico
|
||||||
SXN,SaxonAir,SAXONAIR,United Kingdom
|
SXN,SaxonAir,SAXONAIR,United Kingdom
|
||||||
|
@ -5709,6 +5737,7 @@ TFK,Transafrik International,,São Tomé and Príncipe
|
||||||
TFL,TUI Airlines Netherlands,ORANGE,Netherlands
|
TFL,TUI Airlines Netherlands,ORANGE,Netherlands
|
||||||
TFN,Norwegian Aviation College,SPIRIT,Norway
|
TFN,Norwegian Aviation College,SPIRIT,Norway
|
||||||
TFO,Transportes Aéreos del Pacífico,TRANSPORTES PACIFICO,Mexico
|
TFO,Transportes Aéreos del Pacífico,TRANSPORTES PACIFICO,Mexico
|
||||||
|
TFR,Air Freight NZ Cargo,TOLL FREIGHT,New Zealand
|
||||||
TFT,Thai Flying Service,THAI FLYING,Thailand
|
TFT,Thai Flying Service,THAI FLYING,Thailand
|
||||||
TFU,213th Flight Unit,THJY,Russia
|
TFU,213th Flight Unit,THJY,Russia
|
||||||
TFX,Toll Priority,TOLL EXPRESS,AU
|
TFX,Toll Priority,TOLL EXPRESS,AU
|
||||||
|
@ -5763,6 +5792,7 @@ TIS,Tesis,TESIS,Russia
|
||||||
TIV,Thrive Aviation,THRIVE,United States
|
TIV,Thrive Aviation,THRIVE,United States
|
||||||
TIW,Transcarga Intl Airways,TIACA,Venezuela
|
TIW,Transcarga Intl Airways,TIACA,Venezuela
|
||||||
TJA,T.J. Air,,United States
|
TJA,T.J. Air,,United States
|
||||||
|
TJD,Aliserio,ALISERIO,Italy
|
||||||
TJJ,Top Jets,THUNDERBOLT,Bulgaria
|
TJJ,Top Jets,THUNDERBOLT,Bulgaria
|
||||||
TJK,Tajikair,TAJIKAIR,Tajikistan
|
TJK,Tajikair,TAJIKAIR,Tajikistan
|
||||||
TJN,Tien-Shan,NERON,Kazakhstan
|
TJN,Tien-Shan,NERON,Kazakhstan
|
||||||
|
@ -5969,6 +5999,7 @@ TVI,Tiramavia,TIRAMAVIA,Moldova
|
||||||
TVJ,Thai Vietjet Air,THAIVIET JET,Thailand
|
TVJ,Thai Vietjet Air,THAIVIET JET,Thailand
|
||||||
TVL,Travel Service,TRAVEL SERVICE,Hungary
|
TVL,Travel Service,TRAVEL SERVICE,Hungary
|
||||||
TVO,Transavio,TRANS-BALLERIO,Italy
|
TVO,Transavio,TRANS-BALLERIO,Italy
|
||||||
|
TVP,Smartwings Poland,JET TRAVEL,Poland
|
||||||
TVR,Tavrey Airlines,TAVREY,Ukraine
|
TVR,Tavrey Airlines,TAVREY,Ukraine
|
||||||
TVS,Smartwings,SKYTRAVEL,Czech Republic
|
TVS,Smartwings,SKYTRAVEL,Czech Republic
|
||||||
TVV,Travira Air,PARAMITA,Indonesia
|
TVV,Travira Air,PARAMITA,Indonesia
|
||||||
|
@ -6036,6 +6067,7 @@ UAL,United Airlines,UNITED,United States
|
||||||
UAR,Aerostar Airlines,AEROSTAR,Ukraine
|
UAR,Aerostar Airlines,AEROSTAR,Ukraine
|
||||||
UAS,University Air Squadron,,United Kingdom
|
UAS,University Air Squadron,,United Kingdom
|
||||||
UAT,Ukraine Atlantic,,Ukraine
|
UAT,Ukraine Atlantic,,Ukraine
|
||||||
|
UAW,UAS/AEF St Athan,,United Kingdom
|
||||||
UAY,University of Birmingham Air Squadron (RAF),,United Kingdom
|
UAY,University of Birmingham Air Squadron (RAF),,United Kingdom
|
||||||
UBA,Myanma Airways,UNIONAIR,Myanmar
|
UBA,Myanma Airways,UNIONAIR,Myanmar
|
||||||
UBD,United Airways,UNITED BANGLADESH,Bangladesh
|
UBD,United Airways,UNITED BANGLADESH,Bangladesh
|
||||||
|
@ -6331,6 +6363,7 @@ VSR,Aviostart AS,AVIOSTART,Bulgaria
|
||||||
VSS,Virign Islands Seaplane Shuttle,WATERBIRD,United States
|
VSS,Virign Islands Seaplane Shuttle,WATERBIRD,United States
|
||||||
VSV,Scat Air,VLASTA,Kazakhstan
|
VSV,Scat Air,VLASTA,Kazakhstan
|
||||||
VTA,Air Tahiti,AIR TAHITI,French Polynesia
|
VTA,Air Tahiti,AIR TAHITI,French Polynesia
|
||||||
|
VTB,Jet Strean Charter,SUXAIR,Hungary
|
||||||
VTC,Vuelos Especializados Tollocan,VUELOS TOLLOCAN,Mexico
|
VTC,Vuelos Especializados Tollocan,VUELOS TOLLOCAN,Mexico
|
||||||
VTE,Contour Airlines,VOLUNTEER,United States
|
VTE,Contour Airlines,VOLUNTEER,United States
|
||||||
VTG,Aviação Transportes Aéreos e Cargas,ATACARGO,Angola
|
VTG,Aviação Transportes Aéreos e Cargas,ATACARGO,Angola
|
||||||
|
@ -6389,6 +6422,7 @@ WAU,Wizz Air Ukraine,,Ukraine
|
||||||
WAV,Warbelow's Air Ventures,WARBELOW,United States
|
WAV,Warbelow's Air Ventures,WARBELOW,United States
|
||||||
WAW,Wings Airways,WING SHUTTLE,United States
|
WAW,Wings Airways,WING SHUTTLE,United States
|
||||||
WAY,Airways,GARONNE,France
|
WAY,Airways,GARONNE,France
|
||||||
|
WAZ,Wizz Air,WIZZ SKY,United Arab Emirates
|
||||||
WBA,Finncomm Airlines,WESTBIRD,Finland
|
WBA,Finncomm Airlines,WESTBIRD,Finland
|
||||||
WBR,Multi-Aero,WEBER,United States
|
WBR,Multi-Aero,WEBER,United States
|
||||||
WCA,West Coast Airways,WEST-LEONE,Sierra Leone
|
WCA,West Coast Airways,WEST-LEONE,Sierra Leone
|
||||||
|
@ -6401,6 +6435,7 @@ WCR,West Caribbean Costa Rica,WEST CARIBBEAN,Costa Rica
|
||||||
WCW,West Caribbean Airways,WEST,Colombia
|
WCW,West Caribbean Airways,WEST,Colombia
|
||||||
WCY,Viking Express,TITAN AIR,United States
|
WCY,Viking Express,TITAN AIR,United States
|
||||||
WDA,Wimbi Dira Airways,WIMBI DIRA,Democratic Republic of Congo
|
WDA,Wimbi Dira Airways,WIMBI DIRA,Democratic Republic of Congo
|
||||||
|
WDE,Pallas Aviation,SANDSTONE,United States
|
||||||
WDG,Ministry of Agriculture Fisheries and Food,WATCHDOG,United Kingdom
|
WDG,Ministry of Agriculture Fisheries and Food,WATCHDOG,United Kingdom
|
||||||
WDK,Oxford Air Services,WOODSTOCK,United Kingdom
|
WDK,Oxford Air Services,WOODSTOCK,United Kingdom
|
||||||
WDL,WDL Aviation,WDL,Germany
|
WDL,WDL Aviation,WDL,Germany
|
||||||
|
@ -6463,6 +6498,7 @@ WLV,Aviation North,WOLVERINE,United States
|
||||||
WLX,West Air Luxembourg,WEST LUX,Luxembourg
|
WLX,West Air Luxembourg,WEST LUX,Luxembourg
|
||||||
WMA,Watermakers Air,WATERMAKERS,United States
|
WMA,Watermakers Air,WATERMAKERS,United States
|
||||||
WML,Chantilly Air,MARLIN,United States
|
WML,Chantilly Air,MARLIN,United States
|
||||||
|
WMN,Trident Aircraft,WATERMAN,United States
|
||||||
WNA,Winair,WINAIR,United States
|
WNA,Winair,WINAIR,United States
|
||||||
WNR,Wondair on Demand Aviation,WONDAIR,Spain
|
WNR,Wondair on Demand Aviation,WONDAIR,Spain
|
||||||
WOA,World Airways,WORLD,United States
|
WOA,World Airways,WORLD,United States
|
||||||
|
@ -6537,6 +6573,7 @@ XBM,CBM America,,United States
|
||||||
XBO,Baseops International,,United States
|
XBO,Baseops International,,United States
|
||||||
XCA,Colt Transportes Aereos,COLT,Brazil
|
XCA,Colt Transportes Aereos,COLT,Brazil
|
||||||
XCC,Ecoturistica de Xcalak,XCALAK,Mexico
|
XCC,Ecoturistica de Xcalak,XCALAK,Mexico
|
||||||
|
XCH,Jet Exchange,EXCHANGE,United Kingdom
|
||||||
XCL,Contel ASC,,United States
|
XCL,Contel ASC,,United States
|
||||||
XCO,Compuflight Operations Service,,United States
|
XCO,Compuflight Operations Service,,United States
|
||||||
XCS,Compuserve Incorporated,,United States
|
XCS,Compuserve Incorporated,,United States
|
||||||
|
@ -6557,6 +6594,7 @@ XFS,American Flight Service Systems,,United States
|
||||||
XFX,Airways Corporation of New Zealand,AIRCORP,New Zealand
|
XFX,Airways Corporation of New Zealand,AIRCORP,New Zealand
|
||||||
XGA,General Aviation Terminal,,Canada
|
XGA,General Aviation Terminal,,Canada
|
||||||
XGG,IMP Group Aviation Services,,Canada
|
XGG,IMP Group Aviation Services,,Canada
|
||||||
|
XGN,NexGen Flight Solutions,NEXGEN,United States
|
||||||
XGO,AirGO Flugservice GmbH & Co KG,PASTIS,Germany
|
XGO,AirGO Flugservice GmbH & Co KG,PASTIS,Germany
|
||||||
XGS,Global System,,United States
|
XGS,Global System,,United States
|
||||||
XGW,Global Weather Dynamics,,United States
|
XGW,Global Weather Dynamics,,United States
|
||||||
|
|
File diff suppressed because it is too large
Load diff
295
firmware/tools/make_mids_db/MaritimeIdentificationDigits.csv
Executable file
295
firmware/tools/make_mids_db/MaritimeIdentificationDigits.csv
Executable file
|
@ -0,0 +1,295 @@
|
||||||
|
Digit,Allocated to
|
||||||
|
201,Albania (Republic of)
|
||||||
|
202,Andorra (Principality of)
|
||||||
|
203,Austria
|
||||||
|
204,Portugal - Azores
|
||||||
|
205,Belgium
|
||||||
|
206,Belarus (Republic of)
|
||||||
|
207,Bulgaria (Republic of)
|
||||||
|
208,Vatican City State
|
||||||
|
209,Cyprus (Republic of)
|
||||||
|
210,Cyprus (Republic of)
|
||||||
|
211,Germany (Federal Republic of)
|
||||||
|
212,Cyprus (Republic of)
|
||||||
|
213,Georgia
|
||||||
|
214,Moldova (Republic of)
|
||||||
|
215,Malta
|
||||||
|
216,Armenia (Republic of)
|
||||||
|
218,Germany (Federal Republic of)
|
||||||
|
219,Denmark
|
||||||
|
220,Denmark
|
||||||
|
224,Spain
|
||||||
|
225,Spain
|
||||||
|
226,France
|
||||||
|
227,France
|
||||||
|
228,France
|
||||||
|
229,Malta
|
||||||
|
230,Finland
|
||||||
|
231,Denmark - Faroe Islands
|
||||||
|
232,United Kingdom of Great Britain and Northern Ireland
|
||||||
|
233,United Kingdom of Great Britain and Northern Ireland
|
||||||
|
234,United Kingdom of Great Britain and Northern Ireland
|
||||||
|
235,United Kingdom of Great Britain and Northern Ireland
|
||||||
|
236,United Kingdom of Great Britain and Northern Ireland - Gibraltar
|
||||||
|
237,Greece
|
||||||
|
238,Croatia (Republic of)
|
||||||
|
239,Greece
|
||||||
|
240,Greece
|
||||||
|
241,Greece
|
||||||
|
242,Morocco (Kingdom of)
|
||||||
|
243,Hungary
|
||||||
|
244,Netherlands (Kingdom of the)
|
||||||
|
245,Netherlands (Kingdom of the)
|
||||||
|
246,Netherlands (Kingdom of the)
|
||||||
|
247,Italy
|
||||||
|
248,Malta
|
||||||
|
249,Malta
|
||||||
|
250,Ireland
|
||||||
|
251,Iceland
|
||||||
|
252,Liechtenstein (Principality of)
|
||||||
|
253,Luxembourg
|
||||||
|
254,Monaco (Principality of)
|
||||||
|
255,Portugal - Madeira
|
||||||
|
256,Malta
|
||||||
|
257,Norway
|
||||||
|
258,Norway
|
||||||
|
259,Norway
|
||||||
|
261,Poland (Republic of)
|
||||||
|
262,Montenegro
|
||||||
|
263,Portugal
|
||||||
|
264,Romania
|
||||||
|
265,Sweden
|
||||||
|
266,Sweden
|
||||||
|
267,Slovak Republic
|
||||||
|
268,San Marino (Republic of)
|
||||||
|
269,Switzerland (Confederation of)
|
||||||
|
270,Czech Republic
|
||||||
|
271,Turkey
|
||||||
|
272,Ukraine
|
||||||
|
273,Russian Federation
|
||||||
|
274,North Macedonia (Republic of)
|
||||||
|
275,Latvia (Republic of)
|
||||||
|
276,Estonia (Republic of)
|
||||||
|
277,Lithuania (Republic of)
|
||||||
|
278,Slovenia (Republic of)
|
||||||
|
279,Serbia (Republic of)
|
||||||
|
301,United Kingdom of Great Britain and Northern Ireland - Anguilla
|
||||||
|
303,United States of America - Alaska (State of)
|
||||||
|
304,Antigua and Barbuda
|
||||||
|
305,Antigua and Barbuda
|
||||||
|
306,"Netherlands (Kingdom of the) - Bonaire, Sint Eustatius and Saba"
|
||||||
|
306,Netherlands (Kingdom of the) - Curaçao
|
||||||
|
306,Netherlands (Kingdom of the) - Sint Maarten (Dutch part)
|
||||||
|
307,Netherlands (Kingdom of the) - Aruba
|
||||||
|
308,Bahamas (Commonwealth of the)
|
||||||
|
309,Bahamas (Commonwealth of the)
|
||||||
|
310,United Kingdom of Great Britain and Northern Ireland - Bermuda
|
||||||
|
311,Bahamas (Commonwealth of the)
|
||||||
|
312,Belize
|
||||||
|
314,Barbados
|
||||||
|
316,Canada
|
||||||
|
319,United Kingdom of Great Britain and Northern Ireland - Cayman Islands
|
||||||
|
321,Costa Rica
|
||||||
|
323,Cuba
|
||||||
|
325,Dominica (Commonwealth of)
|
||||||
|
327,Dominican Republic
|
||||||
|
329,France - Guadeloupe (French Department of)
|
||||||
|
330,Grenada
|
||||||
|
331,Denmark - Greenland
|
||||||
|
332,Guatemala (Republic of)
|
||||||
|
334,Honduras (Republic of)
|
||||||
|
336,Haiti (Republic of)
|
||||||
|
338,United States of America
|
||||||
|
339,Jamaica
|
||||||
|
341,Saint Kitts and Nevis (Federation of)
|
||||||
|
343,Saint Lucia
|
||||||
|
345,Mexico
|
||||||
|
347,France - Martinique (French Department of)
|
||||||
|
348,United Kingdom of Great Britain and Northern Ireland - Montserrat
|
||||||
|
350,Nicaragua
|
||||||
|
351,Panama (Republic of)
|
||||||
|
352,Panama (Republic of)
|
||||||
|
353,Panama (Republic of)
|
||||||
|
354,Panama (Republic of)
|
||||||
|
355,Panama (Republic of)
|
||||||
|
356,Panama (Republic of)
|
||||||
|
357,Panama (Republic of)
|
||||||
|
358,United States of America - Puerto Rico
|
||||||
|
359,El Salvador (Republic of)
|
||||||
|
361,France - Saint Pierre and Miquelon (Territorial Collectivity of)
|
||||||
|
362,Trinidad and Tobago
|
||||||
|
364,United Kingdom of Great Britain and Northern Ireland - Turks and Caicos Islands
|
||||||
|
366,United States of America
|
||||||
|
367,United States of America
|
||||||
|
368,United States of America
|
||||||
|
369,United States of America
|
||||||
|
370,Panama (Republic of)
|
||||||
|
371,Panama (Republic of)
|
||||||
|
372,Panama (Republic of)
|
||||||
|
373,Panama (Republic of)
|
||||||
|
374,Panama (Republic of)
|
||||||
|
375,Saint Vincent and the Grenadines
|
||||||
|
376,Saint Vincent and the Grenadines
|
||||||
|
377,Saint Vincent and the Grenadines
|
||||||
|
378,United Kingdom of Great Britain and Northern Ireland - British Virgin Islands
|
||||||
|
379,United States of America - United States Virgin Islands
|
||||||
|
401,Afghanistan
|
||||||
|
403,Saudi Arabia (Kingdom of)
|
||||||
|
405,Bangladesh (People's Republic of)
|
||||||
|
408,Bahrain (Kingdom of)
|
||||||
|
410,Bhutan (Kingdom of)
|
||||||
|
412,China (People's Republic of)
|
||||||
|
413,China (People's Republic of)
|
||||||
|
414,China (People's Republic of)
|
||||||
|
416,China (People's Republic of) - Taiwan (Province of China)
|
||||||
|
417,Sri Lanka (Democratic Socialist Republic of)
|
||||||
|
419,India (Republic of)
|
||||||
|
422,Iran (Islamic Republic of)
|
||||||
|
423,Azerbaijan (Republic of)
|
||||||
|
425,Iraq (Republic of)
|
||||||
|
428,Israel (State of)
|
||||||
|
431,Japan
|
||||||
|
432,Japan
|
||||||
|
434,Turkmenistan
|
||||||
|
436,Kazakhstan (Republic of)
|
||||||
|
437,Uzbekistan (Republic of)
|
||||||
|
438,Jordan (Hashemite Kingdom of)
|
||||||
|
440,Korea (Republic of)
|
||||||
|
441,Korea (Republic of)
|
||||||
|
443,"State of Palestine (In accordance with Resolution 99 Rev. Dubai, 2018)"
|
||||||
|
445,Democratic People's Republic of Korea
|
||||||
|
447,Kuwait (State of)
|
||||||
|
450,Lebanon
|
||||||
|
451,Kyrgyz Republic
|
||||||
|
453,China (People's Republic of) - Macao (Special Administrative Region of China)
|
||||||
|
455,Maldives (Republic of)
|
||||||
|
457,Mongolia
|
||||||
|
459,Nepal (Federal Democratic Republic of)
|
||||||
|
461,Oman (Sultanate of)
|
||||||
|
463,Pakistan (Islamic Republic of)
|
||||||
|
466,Qatar (State of)
|
||||||
|
468,Syrian Arab Republic
|
||||||
|
470,United Arab Emirates
|
||||||
|
471,United Arab Emirates
|
||||||
|
472,Tajikistan (Republic of)
|
||||||
|
473,Yemen (Republic of)
|
||||||
|
475,Yemen (Republic of)
|
||||||
|
477,China (People's Republic of) - Hong Kong (Special Administrative Region of China)
|
||||||
|
478,Bosnia and Herzegovina
|
||||||
|
501,France - Adelie Land
|
||||||
|
503,Australia
|
||||||
|
506,Myanmar (Union of)
|
||||||
|
508,Brunei Darussalam
|
||||||
|
510,Micronesia (Federated States of)
|
||||||
|
511,Palau (Republic of)
|
||||||
|
512,New Zealand
|
||||||
|
514,Cambodia (Kingdom of)
|
||||||
|
515,Cambodia (Kingdom of)
|
||||||
|
516,Australia - Christmas Island (Indian Ocean)
|
||||||
|
518,New Zealand - Cook Islands
|
||||||
|
520,Fiji (Republic of)
|
||||||
|
523,Australia - Cocos (Keeling) Islands
|
||||||
|
525,Indonesia (Republic of)
|
||||||
|
529,Kiribati (Republic of)
|
||||||
|
531,Lao People's Democratic Republic
|
||||||
|
533,Malaysia
|
||||||
|
536,United States of America - Northern Mariana Islands (Commonwealth of the)
|
||||||
|
538,Marshall Islands (Republic of the)
|
||||||
|
540,France - New Caledonia
|
||||||
|
542,New Zealand - Niue
|
||||||
|
544,Nauru (Republic of)
|
||||||
|
546,France - French Polynesia
|
||||||
|
548,Philippines (Republic of the)
|
||||||
|
550,Timor-Leste (Democratic Republic of)
|
||||||
|
553,Papua New Guinea
|
||||||
|
555,United Kingdom of Great Britain and Northern Ireland - Pitcairn Island
|
||||||
|
557,Solomon Islands
|
||||||
|
559,United States of America - American Samoa
|
||||||
|
561,Samoa (Independent State of)
|
||||||
|
563,Singapore (Republic of)
|
||||||
|
564,Singapore (Republic of)
|
||||||
|
565,Singapore (Republic of)
|
||||||
|
566,Singapore (Republic of)
|
||||||
|
567,Thailand
|
||||||
|
570,Tonga (Kingdom of)
|
||||||
|
572,Tuvalu
|
||||||
|
574,Viet Nam (Socialist Republic of)
|
||||||
|
576,Vanuatu (Republic of)
|
||||||
|
577,Vanuatu (Republic of)
|
||||||
|
578,France - Wallis and Futuna Islands
|
||||||
|
601,South Africa (Republic of)
|
||||||
|
603,Angola (Republic of)
|
||||||
|
605,Algeria (People's Democratic Republic of)
|
||||||
|
607,France - Saint Paul and Amsterdam Islands
|
||||||
|
608,United Kingdom of Great Britain and Northern Ireland - Ascension Island
|
||||||
|
609,Burundi (Republic of)
|
||||||
|
610,Benin (Republic of)
|
||||||
|
611,Botswana (Republic of)
|
||||||
|
612,Central African Republic
|
||||||
|
613,Cameroon (Republic of)
|
||||||
|
615,Congo (Republic of the)
|
||||||
|
616,Comoros (Union of the)
|
||||||
|
617,Cabo Verde (Republic of)
|
||||||
|
618,France - Crozet Archipelago
|
||||||
|
619,Côte d'Ivoire (Republic of)
|
||||||
|
620,Comoros (Union of the)
|
||||||
|
621,Djibouti (Republic of)
|
||||||
|
622,Egypt (Arab Republic of)
|
||||||
|
624,Ethiopia (Federal Democratic Republic of)
|
||||||
|
625,Eritrea
|
||||||
|
626,Gabonese Republic
|
||||||
|
627,Ghana
|
||||||
|
629,Gambia (Republic of the)
|
||||||
|
630,Guinea-Bissau (Republic of)
|
||||||
|
631,Equatorial Guinea (Republic of)
|
||||||
|
632,Guinea (Republic of)
|
||||||
|
633,Burkina Faso
|
||||||
|
634,Kenya (Republic of)
|
||||||
|
635,France - Kerguelen Islands
|
||||||
|
636,Liberia (Republic of)
|
||||||
|
637,Liberia (Republic of)
|
||||||
|
638,South Sudan (Republic of)
|
||||||
|
642,Libya (State of)
|
||||||
|
644,Lesotho (Kingdom of)
|
||||||
|
645,Mauritius (Republic of)
|
||||||
|
647,Madagascar (Republic of)
|
||||||
|
649,Mali (Republic of)
|
||||||
|
650,Mozambique (Republic of)
|
||||||
|
654,Mauritania (Islamic Republic of)
|
||||||
|
655,Malawi
|
||||||
|
656,Niger (Republic of the)
|
||||||
|
657,Nigeria (Federal Republic of)
|
||||||
|
659,Namibia (Republic of)
|
||||||
|
660,France - Reunion (French Department of)
|
||||||
|
661,Rwanda (Republic of)
|
||||||
|
662,Sudan (Republic of the)
|
||||||
|
663,Senegal (Republic of)
|
||||||
|
664,Seychelles (Republic of)
|
||||||
|
665,United Kingdom of Great Britain and Northern Ireland - Saint Helena
|
||||||
|
666,Somalia (Federal Republic of)
|
||||||
|
667,Sierra Leone
|
||||||
|
668,Sao Tome and Principe (Democratic Republic of)
|
||||||
|
669,Eswatini (Kingdom of)
|
||||||
|
670,Chad (Republic of)
|
||||||
|
671,Togolese Republic
|
||||||
|
672,Tunisia
|
||||||
|
674,Tanzania (United Republic of)
|
||||||
|
675,Uganda (Republic of)
|
||||||
|
676,Democratic Republic of the Congo
|
||||||
|
677,Tanzania (United Republic of)
|
||||||
|
678,Zambia (Republic of)
|
||||||
|
679,Zimbabwe (Republic of)
|
||||||
|
701,Argentine Republic
|
||||||
|
710,Brazil (Federative Republic of)
|
||||||
|
720,Bolivia (Plurinational State of)
|
||||||
|
725,Chile
|
||||||
|
730,Colombia (Republic of)
|
||||||
|
735,Ecuador
|
||||||
|
740,United Kingdom of Great Britain and Northern Ireland - Falkland Islands (Malvinas)
|
||||||
|
745,France - Guiana (French Department of)
|
||||||
|
750,Guyana
|
||||||
|
755,Paraguay (Republic of)
|
||||||
|
760,Peru
|
||||||
|
765,Suriname (Republic of)
|
||||||
|
770,Uruguay (Eastern Republic of)
|
||||||
|
775,Venezuela (Bolivarian Republic of)
|
|
13
firmware/tools/make_mids_db/README.md
Normal file
13
firmware/tools/make_mids_db/README.md
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
# Make mids.db
|
||||||
|
|
||||||
|
Licensed under [GNU GPL v3](../../../LICENSE)
|
||||||
|
|
||||||
|
Python3 script creates a MID (Marine Identification Digit) database.
|
||||||
|
MID is part of MMSI and determines (among other things) the conutry.
|
||||||
|
|
||||||
|
|
||||||
|
USAGE:
|
||||||
|
- Copy Excel file from https://www.itu.int/en/ITU-R/terrestrial/fmd/Pages/mid.aspx
|
||||||
|
- Convert it to a csv document
|
||||||
|
- Run Python 3 script: `./make_mids_db.py`
|
||||||
|
- Copy file to /AIS folder on SDCARD
|
55
firmware/tools/make_mids_db/make_mid_db.py
Executable file
55
firmware/tools/make_mids_db/make_mid_db.py
Executable file
|
@ -0,0 +1,55 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
# Copyright (C) 2022 ArjanOnwezen
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2, or (at your option)
|
||||||
|
# any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; see the file COPYING. If not, write to
|
||||||
|
# the Free Software Foundation, Inc., 51 Franklin Street,
|
||||||
|
# Boston, MA 02110-1301, USA.
|
||||||
|
#
|
||||||
|
|
||||||
|
# -------------------------------------------------------------------------------------
|
||||||
|
# Create mids.db, used for AIS receiver application, using converted Excel file on page:
|
||||||
|
# https://www.itu.int/en/ITU-R/terrestrial/fmd/Pages/mid.aspx
|
||||||
|
# as a source.
|
||||||
|
# MID stands for Marine Identification Digits and can be used to determine conutry of
|
||||||
|
# vessel or coastal station.
|
||||||
|
# -------------------------------------------------------------------------------------
|
||||||
|
import csv
|
||||||
|
import re
|
||||||
|
import unicodedata
|
||||||
|
mid_codes=bytearray()
|
||||||
|
countries=bytearray()
|
||||||
|
row_count=0
|
||||||
|
|
||||||
|
database=open("mids.db", "wb")
|
||||||
|
|
||||||
|
with open('MaritimeIdentificationDigits.csv', 'rt') as csv_file:
|
||||||
|
sorted_lines=sorted(csv_file.readlines())
|
||||||
|
|
||||||
|
for row in csv.reader(sorted_lines, quotechar='"', delimiter=',', quoting=csv.QUOTE_ALL, skipinitialspace=True):
|
||||||
|
mid_code=row[0]
|
||||||
|
# Normalize some unicode characters
|
||||||
|
#unicodedata.normalize('NFKD', row[3][:32]).encode('ascii', 'ignore')
|
||||||
|
country=unicodedata.normalize('NFKD', "".join(re.split("\(|\)|\[|\]", row[1].split('-')[-1].replace(" of Great Britain and Northern Ireland" , ""))[::2])).replace("Democratic People's Republic of Korea", "North-Korea").strip().encode('ascii', 'ignore')[:32]
|
||||||
|
if len(mid_code) == 3 :
|
||||||
|
country_padding=bytearray()
|
||||||
|
print(mid_code,' - ', country)
|
||||||
|
mid_codes=mid_codes+bytearray(mid_code+'\0', encoding='ascii')
|
||||||
|
country_padding=bytearray('\0' * (32 - len(country)), encoding='ascii')
|
||||||
|
countries=countries+country+country_padding
|
||||||
|
row_count+=1
|
||||||
|
|
||||||
|
database.write(mid_codes+countries)
|
||||||
|
print("Total of", row_count, "MID codes stored in database")
|
||||||
|
|
2
flashing/Check for firmware updates.url
Normal file
2
flashing/Check for firmware updates.url
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
[InternetShortcut]
|
||||||
|
URL=https://github.com/eried/portapack-mayhem/releases
|
2
flashing/How to update the firmware.url
Normal file
2
flashing/How to update the firmware.url
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
[InternetShortcut]
|
||||||
|
URL=https://github.com/eried/portapack-mayhem/wiki/Update-firmware
|
1
flashing/README.txt
Normal file
1
flashing/README.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Plug HackRF+Portapack, set it in HackRF mode, launch flash_portapack_mayhem.bat
|
BIN
flashing/dfu-util-static.exe
Normal file
BIN
flashing/dfu-util-static.exe
Normal file
Binary file not shown.
19
flashing/dfu_hackrf_one.bat
Normal file
19
flashing/dfu_hackrf_one.bat
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
@echo off
|
||||||
|
|
||||||
|
echo *** Run HackRF firmware in RAM via LPC DFU ***
|
||||||
|
echo.
|
||||||
|
echo This is used to "unbrick" your HackRF, if you are no longer able to use
|
||||||
|
echo HackRF tools to flash or operate your HackRF.
|
||||||
|
echo.
|
||||||
|
echo Connect your HackRF One to a USB port on your computer.
|
||||||
|
echo.
|
||||||
|
echo Hold down both the DFU and RESET buttons on the HackRF.
|
||||||
|
echo Then release the RESET button (closest to the edge).
|
||||||
|
echo Then release the DFU button.
|
||||||
|
echo.
|
||||||
|
pause
|
||||||
|
|
||||||
|
echo.
|
||||||
|
dfu-util-static.exe --device 1fc9:000c --download hackrf_one_usb.dfu --reset
|
||||||
|
echo.
|
||||||
|
pause
|
BIN
flashing/driver/dpinst.exe
Normal file
BIN
flashing/driver/dpinst.exe
Normal file
Binary file not shown.
7
flashing/driver/dpinst.xml
Normal file
7
flashing/driver/dpinst.xml
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<?xml version="1.0" ?>
|
||||||
|
<dpinst>
|
||||||
|
<deleteBinaries/>
|
||||||
|
<installAllOrNone/>
|
||||||
|
<suppressAddRemovePrograms/>
|
||||||
|
<suppressWizard/>
|
||||||
|
</dpinst>
|
BIN
flashing/driver/hackrf_one.inf
Normal file
BIN
flashing/driver/hackrf_one.inf
Normal file
Binary file not shown.
BIN
flashing/driver/hackrf_one_amd64.cat
Normal file
BIN
flashing/driver/hackrf_one_amd64.cat
Normal file
Binary file not shown.
BIN
flashing/driver/lpc_dfu.inf
Normal file
BIN
flashing/driver/lpc_dfu.inf
Normal file
Binary file not shown.
BIN
flashing/driver/lpc_dfu_amd64.cat
Normal file
BIN
flashing/driver/lpc_dfu_amd64.cat
Normal file
Binary file not shown.
15
flashing/flash_hackrf_one.bat
Normal file
15
flashing/flash_hackrf_one.bat
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
@echo off
|
||||||
|
|
||||||
|
echo *** Re-flash the HackRF with HackRF firmware ***
|
||||||
|
echo.
|
||||||
|
echo Connect your HackRF One to a USB port on your computer.
|
||||||
|
echo.
|
||||||
|
echo If using a PortaPack, put the PortaPack in HackRF mode by selecting
|
||||||
|
echo the "HackRF" option from the main menu.
|
||||||
|
echo.
|
||||||
|
pause
|
||||||
|
|
||||||
|
echo.
|
||||||
|
hackrf_update.exe hackrf_one_usb.bin
|
||||||
|
echo.
|
||||||
|
pause
|
15
flashing/flash_portapack_mayhem.bat
Normal file
15
flashing/flash_portapack_mayhem.bat
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
@echo off
|
||||||
|
|
||||||
|
echo *** Re-flash the HackRF with PortaPack firmware ***
|
||||||
|
echo.
|
||||||
|
echo Connect your HackRF One to a USB port on your computer.
|
||||||
|
echo.
|
||||||
|
echo If using a PortaPack, put the PortaPack in HackRF mode by selecting
|
||||||
|
echo the "HackRF" option from the main menu.
|
||||||
|
echo.
|
||||||
|
pause
|
||||||
|
|
||||||
|
echo.
|
||||||
|
hackrf_update.exe portapack-h1_h2-mayhem.bin
|
||||||
|
echo.
|
||||||
|
pause
|
BIN
flashing/hackrf_one_usb.bin
Normal file
BIN
flashing/hackrf_one_usb.bin
Normal file
Binary file not shown.
BIN
flashing/hackrf_one_usb.dfu
Normal file
BIN
flashing/hackrf_one_usb.dfu
Normal file
Binary file not shown.
BIN
flashing/hackrf_update.exe
Normal file
BIN
flashing/hackrf_update.exe
Normal file
Binary file not shown.
2
hackrf
2
hackrf
|
@ -1 +1 @@
|
||||||
Subproject commit 22267f3b8e71bd064337921444b0e40509f47b43
|
Subproject commit e6eb4ba29bbe5dc2fcd092e394188bc10a8bad54
|
Binary file not shown.
Binary file not shown.
BIN
sdcard/AIS/mids.db
Normal file
BIN
sdcard/AIS/mids.db
Normal file
Binary file not shown.
|
@ -1,41 +1,41 @@
|
||||||
f=174928000,d=Channel 5A
|
f=174928000,d=Channel 5A
|
||||||
f=176648000,d=Channel 5B
|
f=176640000,d=Channel 5B
|
||||||
f=178358000,d=Channel 5C
|
f=178352000,d=Channel 5C
|
||||||
f=180068000,d=Channel 5D
|
f=180064000,d=Channel 5D
|
||||||
f=181938000,d=Channel 6A
|
f=181936000,d=Channel 6A
|
||||||
f=183648000,d=Channel 6B
|
f=183648000,d=Channel 6B
|
||||||
f=185368000,d=Channel 6C
|
f=185360000,d=Channel 6C
|
||||||
f=187078000,d=Channel 6D
|
f=187072000,d=Channel 6D
|
||||||
f=188928000,d=Channel 7A
|
f=188928000,d=Channel 7A
|
||||||
f=190648000,d=Channel 7B
|
f=190640000,d=Channel 7B
|
||||||
f=192358000,d=Channel 7C
|
f=192352000,d=Channel 7C
|
||||||
f=194068000,d=Channel 7D
|
f=194064000,d=Channel 7D
|
||||||
f=195938000,d=Channel 8A
|
f=195936000,d=Channel 8A
|
||||||
f=197648000,d=Channel 8B
|
f=197648000,d=Channel 8B
|
||||||
f=199368000,d=Channel 8C
|
f=199360000,d=Channel 8C
|
||||||
f=201078000,d=Channel 8D
|
f=201072000,d=Channel 8D
|
||||||
f=202928000,d=Channel 9A
|
f=202928000,d=Channel 9A
|
||||||
f=204648000,d=Channel 9B
|
f=204640000,d=Channel 9B
|
||||||
f=206358000,d=Channel 9C
|
f=206352000,d=Channel 9C
|
||||||
f=208068000,d=Channel 9D
|
f=208064000,d=Channel 9D
|
||||||
f=209938000,d=Channel 10A
|
f=209936000,d=Channel 10A
|
||||||
f=210096000,d=Channel 10N
|
f=210096000,d=Channel 10N
|
||||||
f=211648000,d=Channel 10B
|
f=211648000,d=Channel 10B
|
||||||
f=213368000,d=Channel 10C
|
f=213360000,d=Channel 10C
|
||||||
f=215078000,d=Channel 10D
|
f=215072000,d=Channel 10D
|
||||||
f=216928000,d=Channel 11A
|
f=216928000,d=Channel 11A
|
||||||
f=217088000,d=Channel 11N
|
f=217088000,d=Channel 11N
|
||||||
f=218648000,d=Channel 11B
|
f=218640000,d=Channel 11B
|
||||||
f=220358000,d=Channel 11C
|
f=220352000,d=Channel 11C
|
||||||
f=222068000,d=Channel 11D
|
f=222064000,d=Channel 11D
|
||||||
f=223938000,d=Channel 12A
|
f=223936000,d=Channel 12A
|
||||||
f=224096000,d=Channel 12N
|
f=224096000,d=Channel 12N
|
||||||
f=225648000,d=Channel 12B
|
f=225648000,d=Channel 12B
|
||||||
f=227368000,d=Channel 12C
|
f=227360000,d=Channel 12C
|
||||||
f=229078000,d=Channel 12D
|
f=229072000,d=Channel 12D
|
||||||
f=230788000,d=Channel 13A
|
f=230784000,d=Channel 13A
|
||||||
f=232498000,d=Channel 13B
|
f=232496000,d=Channel 13B
|
||||||
f=234208000,d=Channel 13C
|
f=234208000,d=Channel 13C
|
||||||
f=235778000,d=Channel 13D
|
f=235776000,d=Channel 13D
|
||||||
f=237448000,d=Channel 13E
|
f=237488000,d=Channel 13E
|
||||||
f=239208000,d=Channel 13F
|
f=239200000,d=Channel 13F
|
||||||
|
|
11
sdcard/SAMPLES/README.md
Normal file
11
sdcard/SAMPLES/README.md
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
# Files for Replay app
|
||||||
|
|
||||||
|
Sample files below can be used with Replay app.
|
||||||
|
|
||||||
|
See [Wiki](https://github.com/eried/portapack-mayhem/wiki/C16-format) for more info over C16 file format.
|
||||||
|
|
||||||
|
| file | description | frequency |
|
||||||
|
| ------ | ------ | ------: |
|
||||||
|
| [HamptonBayFanOnOff.C16](HamptonBayFanOnOff.C16) | Switches Hampton Bay fan on/off. |304.175 Mhz |
|
||||||
|
| [TeslaChargePort_EU_AU.C16](TeslaChargePort_EU_AU.C16) | Opens a Tesla charge door. This version is for non-US Tesla cars operating at 433MHz. | 433.95 Mhz |
|
||||||
|
| [TeslaChargePort_US.C16](TeslaChargePort_US.C16) | Opens a Tesla charge door. This version is for US Tesla cars operating at 315MHz. |315 Mhz |
|
BIN
sdcard/SAMPLES/TeslaChargePort_EU_AU.C16
Normal file
BIN
sdcard/SAMPLES/TeslaChargePort_EU_AU.C16
Normal file
Binary file not shown.
2
sdcard/SAMPLES/TeslaChargePort_EU_AU.TXT
Normal file
2
sdcard/SAMPLES/TeslaChargePort_EU_AU.TXT
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
sample_rate=500000
|
||||||
|
center_frequency=433950000
|
BIN
sdcard/SAMPLES/TeslaChargePort_US.C16
Normal file
BIN
sdcard/SAMPLES/TeslaChargePort_US.C16
Normal file
Binary file not shown.
2
sdcard/SAMPLES/TeslaChargePort_US.TXT
Normal file
2
sdcard/SAMPLES/TeslaChargePort_US.TXT
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
sample_rate=500000
|
||||||
|
center_frequency=315000000
|
Loading…
Add table
Add a link
Reference in a new issue