[FL-1528] SubGhz: dma send (#579)
* Gui: input injection in screen stream * Cli: expose ASCII table in public header * SubGhz: dma output draft * SubGhz: output initialization cleanup * SubGhz: update dma send routine, add subghz_tx cli command. * SubGhz: proper register address for DMA * SubGhz: proper, fully working dma+tim2 configuration * SubGhz: transmit PT with cli. * Drivers: fix invalid size in CC1101 PA_TABLE loading routine. * Interrupts: configurable DMA isrs. * F5: backport fixes. * SubGhz: free buffer after use * SubGhz: use sleep instead of reset at the end * SubGhz: async tx repeat with circular DMA * SubGhz: disable dma channel on complete, adjust PT send timings * SubGhz: backport function singature change to F5 * SubGhz: add tx debug gpio
This commit is contained in:
@@ -156,8 +156,8 @@ void subghz_capture_enter(void* context) {
|
||||
|
||||
hal_gpio_init(&gpio_cc1101_g0, GpioModeInput, GpioPullNo, GpioSpeedLow);
|
||||
|
||||
api_hal_subghz_set_capture_callback(subghz_worker_rx_callback, subghz_capture->worker);
|
||||
api_hal_subghz_enable_capture();
|
||||
api_hal_subghz_set_async_rx_callback(subghz_worker_rx_callback, subghz_capture->worker);
|
||||
api_hal_subghz_start_async_rx();
|
||||
|
||||
subghz_worker_start(subghz_capture->worker);
|
||||
|
||||
@@ -171,8 +171,8 @@ void subghz_capture_exit(void* context) {
|
||||
|
||||
subghz_worker_stop(subghz_capture->worker);
|
||||
|
||||
api_hal_subghz_disable_capture();
|
||||
api_hal_subghz_init();
|
||||
api_hal_subghz_stop_async_rx();
|
||||
api_hal_subghz_sleep();
|
||||
}
|
||||
|
||||
uint32_t subghz_capture_back(void* context) {
|
||||
|
@@ -100,15 +100,15 @@ bool subghz_static_input(InputEvent* event, void* context) {
|
||||
uint8_t bit = i % 8;
|
||||
bool value = (key[byte] >> (7 - bit)) & 1;
|
||||
// Payload send
|
||||
hal_gpio_write(&gpio_cc1101_g0, false);
|
||||
delay_us(value ? SUBGHZ_PT_ONE : SUBGHZ_PT_ZERO);
|
||||
hal_gpio_write(&gpio_cc1101_g0, true);
|
||||
delay_us(value ? SUBGHZ_PT_ONE : SUBGHZ_PT_ZERO);
|
||||
hal_gpio_write(&gpio_cc1101_g0, false);
|
||||
delay_us(value ? SUBGHZ_PT_ZERO : SUBGHZ_PT_ONE);
|
||||
}
|
||||
// Last bit
|
||||
hal_gpio_write(&gpio_cc1101_g0, false);
|
||||
delay_us(SUBGHZ_PT_ONE);
|
||||
hal_gpio_write(&gpio_cc1101_g0, true);
|
||||
delay_us(SUBGHZ_PT_ONE);
|
||||
hal_gpio_write(&gpio_cc1101_g0, false);
|
||||
// Guard time
|
||||
delay_us(10600);
|
||||
}
|
||||
@@ -132,7 +132,7 @@ void subghz_static_enter(void* context) {
|
||||
api_hal_subghz_load_preset(ApiHalSubGhzPresetOokAsync);
|
||||
|
||||
hal_gpio_init(&gpio_cc1101_g0, GpioModeOutputPushPull, GpioPullNo, GpioSpeedLow);
|
||||
hal_gpio_write(&gpio_cc1101_g0, true);
|
||||
hal_gpio_write(&gpio_cc1101_g0, false);
|
||||
|
||||
with_view_model(
|
||||
subghz_static->view, (SubghzStaticModel * model) {
|
||||
@@ -151,7 +151,7 @@ void subghz_static_exit(void* context) {
|
||||
// SubghzStatic* subghz_static = context;
|
||||
|
||||
// Reinitialize IC to default state
|
||||
api_hal_subghz_init();
|
||||
api_hal_subghz_sleep();
|
||||
}
|
||||
|
||||
uint32_t subghz_static_back(void* context) {
|
||||
|
@@ -108,7 +108,7 @@ bool subghz_test_basic_input(InputEvent* event, void* context) {
|
||||
osTimerStart(subghz_test_basic->timer, 1024 / 4);
|
||||
} else {
|
||||
hal_gpio_init(&gpio_cc1101_g0, GpioModeOutputPushPull, GpioPullNo, GpioSpeedLow);
|
||||
hal_gpio_write(&gpio_cc1101_g0, false);
|
||||
hal_gpio_write(&gpio_cc1101_g0, true);
|
||||
api_hal_subghz_tx();
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ void subghz_test_basic_exit(void* context) {
|
||||
osTimerStop(subghz_test_basic->timer);
|
||||
|
||||
// Reinitialize IC to default state
|
||||
api_hal_subghz_init();
|
||||
api_hal_subghz_sleep();
|
||||
}
|
||||
|
||||
void subghz_test_basic_rssi_timer_callback(void* context) {
|
||||
|
@@ -157,7 +157,7 @@ void subghz_test_packet_exit(void* context) {
|
||||
osTimerStop(subghz_test_packet->timer);
|
||||
|
||||
// Reinitialize IC to default state
|
||||
api_hal_subghz_init();
|
||||
api_hal_subghz_sleep();
|
||||
}
|
||||
|
||||
void subghz_test_packet_rssi_timer_callback(void* context) {
|
||||
|
Reference in New Issue
Block a user