This commit is contained in:
RogueMaster
2022-11-26 02:23:03 -05:00
parent a8864038ac
commit 68f51411a1
19 changed files with 1689 additions and 1419 deletions
+3 -13
View File
@@ -14,9 +14,9 @@
extern "C" {
#endif
#define PULSE_READER_NO_EDGE 0xFFFFFFFFUL
#define PULSE_READER_LOST_EDGE 0xFFFFFFFEUL
#define F_TIM2 64000000UL
#define PULSE_READER_NO_EDGE 0xFFFFFFFFUL
#define PULSE_READER_LOST_EDGE 0xFFFFFFFEUL
#define F_TIM2 64000000UL
/**
* unit of the edge durations to return
@@ -28,7 +28,6 @@ typedef enum {
PulseReaderUnitMicrosecond,
} PulseReaderUnit;
typedef struct {
bool start_level;
uint32_t* timer_buffer;
@@ -47,7 +46,6 @@ typedef struct {
LL_DMA_InitTypeDef dma_config_gpio;
} PulseReader;
/** Allocate a PulseReader object
*
* Allocates memory for a ringbuffer and initalizes the object
@@ -57,7 +55,6 @@ typedef struct {
*/
PulseReader* pulse_reader_alloc(const GpioPin* gpio, uint32_t size);
/** Free a PulseReader object
*
* Frees all memory of the given object
@@ -66,7 +63,6 @@ PulseReader* pulse_reader_alloc(const GpioPin* gpio, uint32_t size);
*/
void pulse_reader_free(PulseReader* signal);
/** Start signal capturing
*
* Initializes DMA1, TIM2 and DMAMUX_REQ_GEN_0 to automatically capture timer values
@@ -83,7 +79,6 @@ void pulse_reader_start(PulseReader* signal);
*/
void pulse_reader_stop(PulseReader* signal);
/** Recevie a sample from ringbuffer
*
* Waits for the specified time until a new edge gets detected.
@@ -98,7 +93,6 @@ void pulse_reader_stop(PulseReader* signal);
*/
uint32_t pulse_reader_receive(PulseReader* signal, int timeout_us);
/** Get available samples
*
* Get the number of available samples in the ringbuffer
@@ -109,7 +103,6 @@ uint32_t pulse_reader_receive(PulseReader* signal, int timeout_us);
*/
uint32_t pulse_reader_samples(PulseReader* signal);
/** Set timebase
*
* Set the timebase to be used when returning pulse duration.
@@ -119,8 +112,6 @@ uint32_t pulse_reader_samples(PulseReader* signal);
*/
void pulse_reader_set_timebase(PulseReader* signal, PulseReaderUnit unit);
/** Set bit time
*
* Set the number of timebase units per bit.
@@ -134,7 +125,6 @@ void pulse_reader_set_timebase(PulseReader* signal, PulseReaderUnit unit);
*/
void pulse_reader_set_bittime(PulseReader* signal, uint32_t bit_time);
#ifdef __cplusplus
}
#endif