added DigitalSequence and PulseReader (#2070)

* added DigitalSequence to chain multiple DigitalSignals
added PulseReader for hardware assisted digital signal sampling
* added send_time option to start a signal at a specific DWT->CYCCNT value
* fixed linter errors and undone function renaming
* fixed renaming
* flagged functions in api_symbols.csv
* allow gpio field to stay uninitialized in digital_signal_prepare_arr()
* fix test cases to match (expected) implementation
* pulse_reader: build as static library
Signed-off-by: g3gg0.de <git@g3gg0.de>
* fix starting level detection in pulse_reader
* added unit test for pulse_reader
* change pulse reader test timings to 1, 10 and 100 ms
* fine tuned timings for pulse_reader test
* pulse_reader_stop now deinits GPIO as recommended by @gornekich
* ran format_py
* pulse_reader: remove from API, allow to link with faps
Signed-off-by: g3gg0.de <git@g3gg0.de>
* remove unit test for pulse_reader again
* pulse_reader: add call to set GPIO pull direction
* make structures private, add C implementation of digital_signal_update_dma()
* digital_signal/pulse_reader: allow parameters for free to be NULL
* digital_signal: show unoptimized and optimized code for digital_signal_update_dma() next to each other
* pulse_reader: further optimize assembly code
* digital_signal: reduce code complexity of digital_signal_update_dma() by only reconfiguring DMA2
* digital_signal: remove assembly code, limiting the performance but increasing portability
* added recovery if the timer already expired
* digital_signal: fix memory leak
* digital_signal: keep lock until all DMA transfers have finished
* DigitalSequence: fix issues with concatenation of same levels and spurious bit flips
* DigitalSignal: use cyclic DMA buffer for sequences
* update api_symbols.csv
* Update api_symbols.csv for f18 target
* Patches from @gornekich to fix linter warnings.
* Remove some redundant if checks
* Remove some magic numbers and reformat.
* Remove forced terminating edge.

Signed-off-by: g3gg0.de <git@g3gg0.de>
Co-authored-by: gornekich <n.gorbadey@gmail.com>
Co-authored-by: Tiernan Messmer <tiernan.messmer@gmail.com>
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
g3gg0.de
2023-05-09 09:55:17 +09:00
committed by GitHub
co-authored by gornekich Tiernan Messmer Aleksandr Kutuzov
parent f57f0efc48
commit e1c6e78b2e
11 changed files with 1021 additions and 85 deletions
+11 -1
View File
@@ -1,5 +1,5 @@
entry,status,name,type,params
Version,+,26.1,,
Version,+,26.2,,
Header,+,applications/services/bt/bt_service/bt.h,,
Header,+,applications/services/cli/cli.h,,
Header,+,applications/services/cli/cli_vcp.h,,
@@ -156,6 +156,7 @@ Header,+,lib/stm32wb_hal/Inc/stm32wbxx_ll_tim.h,,
Header,+,lib/stm32wb_hal/Inc/stm32wbxx_ll_usart.h,,
Header,+,lib/stm32wb_hal/Inc/stm32wbxx_ll_utils.h,,
Header,+,lib/stm32wb_hal/Inc/stm32wbxx_ll_wwdg.h,,
Header,+,lib/pulse_reader/pulse_reader.h,,
Header,+,lib/toolbox/args.h,,
Header,+,lib/toolbox/crc32_calc.h,,
Header,+,lib/toolbox/dir_walk.h,,
@@ -1575,6 +1576,15 @@ Function,+,protocol_dict_render_brief_data,void,"ProtocolDict*, FuriString*, siz
Function,+,protocol_dict_render_data,void,"ProtocolDict*, FuriString*, size_t"
Function,+,protocol_dict_set_data,void,"ProtocolDict*, size_t, const uint8_t*, size_t"
Function,-,pselect,int,"int, fd_set*, fd_set*, fd_set*, const timespec*, const sigset_t*"
Function,-,pulse_reader_alloc,PulseReader*,"const GpioPin*, uint32_t"
Function,-,pulse_reader_free,void,PulseReader*
Function,-,pulse_reader_receive,uint32_t,"PulseReader*, int"
Function,-,pulse_reader_samples,uint32_t,PulseReader*
Function,-,pulse_reader_set_bittime,void,"PulseReader*, uint32_t"
Function,-,pulse_reader_set_pull,void,"PulseReader*, GpioPull"
Function,-,pulse_reader_set_timebase,void,"PulseReader*, PulseReaderUnit"
Function,-,pulse_reader_start,void,PulseReader*
Function,-,pulse_reader_stop,void,PulseReader*
Function,-,putc,int,"int, FILE*"
Function,-,putc_unlocked,int,"int, FILE*"
Function,-,putchar,int,int
1 entry status name type params
2 Version + 26.1 26.2
3 Header + applications/services/bt/bt_service/bt.h
4 Header + applications/services/cli/cli.h
5 Header + applications/services/cli/cli_vcp.h
156 Header + lib/stm32wb_hal/Inc/stm32wbxx_ll_usart.h
157 Header + lib/stm32wb_hal/Inc/stm32wbxx_ll_utils.h
158 Header + lib/stm32wb_hal/Inc/stm32wbxx_ll_wwdg.h
159 Header + lib/pulse_reader/pulse_reader.h
160 Header + lib/toolbox/args.h
161 Header + lib/toolbox/crc32_calc.h
162 Header + lib/toolbox/dir_walk.h
1576 Function + protocol_dict_render_data void ProtocolDict*, FuriString*, size_t
1577 Function + protocol_dict_set_data void ProtocolDict*, size_t, const uint8_t*, size_t
1578 Function - pselect int int, fd_set*, fd_set*, fd_set*, const timespec*, const sigset_t*
1579 Function - pulse_reader_alloc PulseReader* const GpioPin*, uint32_t
1580 Function - pulse_reader_free void PulseReader*
1581 Function - pulse_reader_receive uint32_t PulseReader*, int
1582 Function - pulse_reader_samples uint32_t PulseReader*
1583 Function - pulse_reader_set_bittime void PulseReader*, uint32_t
1584 Function - pulse_reader_set_pull void PulseReader*, GpioPull
1585 Function - pulse_reader_set_timebase void PulseReader*, PulseReaderUnit
1586 Function - pulse_reader_start void PulseReader*
1587 Function - pulse_reader_stop void PulseReader*
1588 Function - putc int int, FILE*
1589 Function - putc_unlocked int int, FILE*
1590 Function - putchar int int