Skip to content
This repository has been archived by the owner on Jul 28, 2024. It is now read-only.

Commit

Permalink
Add AM-q Modulation
Browse files Browse the repository at this point in the history
  • Loading branch information
grugnoymeme authored Oct 15, 2023
1 parent 3037e8b commit 5a8c5ab
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions firmware/targets/f7/api_symbols.csv
Original file line number Diff line number Diff line change
Expand Up @@ -3883,6 +3883,7 @@ Variable,+,subghz_device_cc1101_preset_gfsk_9_99kb_async_regs,const uint8_t[],
Variable,+,subghz_device_cc1101_preset_msk_99_97kb_async_regs,const uint8_t[],
Variable,+,subghz_device_cc1101_preset_ook_270khz_async_regs,const uint8_t[],
Variable,+,subghz_device_cc1101_preset_ook_650khz_async_regs,const uint8_t[],
Variable,+,subghz_device_cc1101_preset_ook_650khz_async_regs_better_q,const uint8_t[],
Variable,+,subghz_protocol_raw,const SubGhzProtocol,
Variable,+,subghz_protocol_raw_decoder,const SubGhzProtocolDecoder,
Variable,+,subghz_protocol_raw_encoder,const SubGhzProtocolEncoder,
Expand Down
2 changes: 2 additions & 0 deletions lib/subghz/blocks/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ void subghz_block_generic_get_preset_name(const char* preset_name, FuriString* p
preset_name_temp = "FuriHalSubGhzPresetOok270Async";
} else if(!strcmp(preset_name, "AM650")) {
preset_name_temp = "FuriHalSubGhzPresetOok650Async";
} else if(!strcmp(preset_name, "AM_Q")) {
preset_name_temp = "FuriHalSubGhzPresetOok650Async_q";
} else if(!strcmp(preset_name, "FM238")) {
preset_name_temp = "FuriHalSubGhzPreset2FSKDev238Async";
} else if(!strcmp(preset_name, "FM476")) {
Expand Down
4 changes: 4 additions & 0 deletions lib/subghz/devices/cc1101_configs.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ const uint8_t subghz_device_cc1101_preset_ook_270khz_async_regs[] = {
0x00,
};

const uint8_t subghz_device_cc1101_preset_ook_650khz_async_regs_better_q[] = {
0x02, 0x0D, 0x03, 0x07, 0x08, 0x32, 0x0B, 0x06, 0x14, 0x00, 0x13, 0x00, 0x12, 0x30, 0x11, 0x22, 0x10, 0x1C, 0x18, 0x18, 0x19, 0x18, 0x1D, 0x91, 0x1C, 0x00, 0x1B, 0x07, 0x20, 0xFB, 0x22, 0x11, 0x21, 0xB6, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

const uint8_t subghz_device_cc1101_preset_ook_650khz_async_regs[] = {
// https://e2e.ti.com/support/wireless-connectivity/sub-1-ghz-group/sub-1-ghz/f/sub-1-ghz-forum/382066/cc1101---don-t-know-the-correct-registers-configuration

Expand Down
1 change: 1 addition & 0 deletions lib/subghz/devices/cc1101_configs.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ extern "C" {

extern const uint8_t subghz_device_cc1101_preset_ook_270khz_async_regs[];
extern const uint8_t subghz_device_cc1101_preset_ook_650khz_async_regs[];
extern const uint8_t subghz_device_cc1101_preset_ook_650khz_async_regs_better_q[];
extern const uint8_t subghz_device_cc1101_preset_2fsk_dev2_38khz_async_regs[];
extern const uint8_t subghz_device_cc1101_preset_2fsk_dev47_6khz_async_regs[];
extern const uint8_t subghz_device_cc1101_preset_msk_99_97kb_async_regs[];
Expand Down
3 changes: 3 additions & 0 deletions lib/subghz/devices/cc1101_int/cc1101_int_interconnect.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ static void subghz_device_cc1101_int_interconnect_load_preset(
case FuriHalSubGhzPresetOok270Async:
furi_hal_subghz_load_custom_preset(subghz_device_cc1101_preset_ook_270khz_async_regs);
break;
case FuriHalSubGhzPresetOok650Async_q:
furi_hal_subghz_load_custom_preset(subghz_device_cc1101_preset_ook_650khz_async_regs_better_q);
break;
case FuriHalSubGhzPreset2FSKDev238Async:
furi_hal_subghz_load_custom_preset(subghz_device_cc1101_preset_2fsk_dev2_38khz_async_regs);
break;
Expand Down
1 change: 1 addition & 0 deletions lib/subghz/devices/preset.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ typedef enum {
FuriHalSubGhzPresetIDLE, /**< default configuration */
FuriHalSubGhzPresetOok270Async, /**< OOK, bandwidth 270kHz, asynchronous */
FuriHalSubGhzPresetOok650Async, /**< OOK, bandwidth 650kHz, asynchronous */
FuriHalSubGhzPresetOok650Async_q, /** AM_Q*/
FuriHalSubGhzPreset2FSKDev238Async, /**< FM, deviation 2.380371 kHz, asynchronous */
FuriHalSubGhzPreset2FSKDev476Async, /**< FM, deviation 47.60742 kHz, asynchronous */
FuriHalSubGhzPresetMSK99_97KbAsync, /**< MSK, deviation 47.60742 kHz, 99.97Kb/s, asynchronous */
Expand Down
2 changes: 2 additions & 0 deletions lib/subghz/subghz_setting.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ static void subghz_setting_load_default_region(
instance, "AM270", subghz_device_cc1101_preset_ook_270khz_async_regs);
subghz_setting_load_default_preset(
instance, "AM650", subghz_device_cc1101_preset_ook_650khz_async_regs);
subghz_setting_load_default_preset(
instance, "AM_Q", subghz_device_cc1101_preset_ook_650khz_async_regs_better_q);
subghz_setting_load_default_preset(
instance, "FM238", subghz_device_cc1101_preset_2fsk_dev2_38khz_async_regs);
subghz_setting_load_default_preset(
Expand Down

0 comments on commit 5a8c5ab

Please sign in to comment.