2022-05-24 17:00:15 +03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
|
|
|
#include <furi_hal_gpio.h>
|
|
|
|
|
2022-09-14 19:11:38 +03:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2022-05-24 17:00:15 +03:00
|
|
|
typedef struct {
|
|
|
|
bool start_level;
|
|
|
|
uint32_t edge_cnt;
|
|
|
|
uint32_t edges_max_cnt;
|
2022-07-03 17:51:50 +03:00
|
|
|
uint32_t* edge_timings;
|
2022-05-24 17:00:15 +03:00
|
|
|
uint32_t* reload_reg_buff;
|
|
|
|
} DigitalSignal;
|
|
|
|
|
|
|
|
DigitalSignal* digital_signal_alloc(uint32_t max_edges_cnt);
|
|
|
|
|
|
|
|
void digital_signal_free(DigitalSignal* signal);
|
|
|
|
|
|
|
|
bool digital_signal_append(DigitalSignal* signal_a, DigitalSignal* signal_b);
|
|
|
|
|
2022-07-03 17:51:50 +03:00
|
|
|
void digital_signal_prepare_arr(DigitalSignal* signal);
|
|
|
|
|
2022-05-24 17:00:15 +03:00
|
|
|
bool digital_signal_get_start_level(DigitalSignal* signal);
|
|
|
|
|
|
|
|
uint32_t digital_signal_get_edges_cnt(DigitalSignal* signal);
|
|
|
|
|
2022-07-03 17:51:50 +03:00
|
|
|
uint32_t digital_signal_get_edge(DigitalSignal* signal, uint32_t edge_num);
|
2022-05-24 17:00:15 +03:00
|
|
|
|
2022-07-03 17:51:50 +03:00
|
|
|
void digital_signal_send(DigitalSignal* signal, const GpioPin* gpio);
|
2022-09-14 19:11:38 +03:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|