Fabio Fumi
/
send_to_sharp
Renamed
bit_send.h@5:062962db7a48, 2022-03-29 (annotated)
- Committer:
- ffxx68
- Date:
- Tue Mar 29 10:06:20 2022 +0000
- Revision:
- 5:062962db7a48
- Parent:
- 1:9289febf4ae9
Receiving the file through serial port
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ffxx68 | 0:07819bc70660 | 1 | #ifndef BIT_SEND |
ffxx68 | 0:07819bc70660 | 2 | #define BIT_SEND |
ffxx68 | 0:07819bc70660 | 3 | |
ffxx68 | 1:9289febf4ae9 | 4 | #define BIT_TICK_DELAY 125 // us - 125 us = 4 Khz base freq |
ffxx68 | 1:9289febf4ae9 | 5 | #define BIT_TICK_1_REPEAT 1 // nr. of ticks to stay on each output level |
ffxx68 | 0:07819bc70660 | 6 | #define BIT_TICK_1_NCYCLES 16 // nr. of output level switching, per bit |
ffxx68 | 1:9289febf4ae9 | 7 | #define BIT_TICK_0_REPEAT 2 // same for bit "0" |
ffxx68 | 0:07819bc70660 | 8 | #define BIT_TICK_0_NCYCLES 8 |
ffxx68 | 0:07819bc70660 | 9 | |
ffxx68 | 0:07819bc70660 | 10 | #define BIT_FIRST_SENT ( 1UL << 0 ) // signal for first bit sent |
ffxx68 | 0:07819bc70660 | 11 | #define BIT_LAST_SENT ( 1UL << 1 ) // signal for last bit sent |
ffxx68 | 0:07819bc70660 | 12 | #define BIT_LAST_PROCESSING ( 1UL << 2 ) // last bit is being processes |
ffxx68 | 1:9289febf4ae9 | 13 | #define BIT_SENDING ( 1UL << 3 ) // bit being processed |
ffxx68 | 0:07819bc70660 | 14 | |
ffxx68 | 5:062962db7a48 | 15 | #ifdef FILE_BUF_SIZE |
ffxx68 | 5:062962db7a48 | 16 | //extern volatile char debugOut[]; // holding debug info to print at the end |
ffxx68 | 5:062962db7a48 | 17 | //static char debugLine[128]; |
ffxx68 | 5:062962db7a48 | 18 | //#define debug_printf(f_, ...) { sprintf((char*)debugLine,(f_), ##__VA_ARGS__); strcat ( (char*)debugOut, debugLine ); } |
ffxx68 | 5:062962db7a48 | 19 | #define debug_printf(f_, ...) |
ffxx68 | 5:062962db7a48 | 20 | #else |
ffxx68 | 1:9289febf4ae9 | 21 | #define debug_printf(f_, ...) printf((f_), ##__VA_ARGS__) |
ffxx68 | 0:07819bc70660 | 22 | #endif |
ffxx68 | 0:07819bc70660 | 23 | |
ffxx68 | 0:07819bc70660 | 24 | void bitHandlerInit( void ) ; |
ffxx68 | 0:07819bc70660 | 25 | void bitHandlerStop ( void ) ; |
ffxx68 | 0:07819bc70660 | 26 | int bitWaitSend ( uint8_t bit_value, uint8_t invert ); |
ffxx68 | 0:07819bc70660 | 27 | bool bitHandlerRunning( void ) ; |
ffxx68 | 0:07819bc70660 | 28 | |
ffxx68 | 0:07819bc70660 | 29 | #endif |