Fabio Fumi / Mbed 2 deprecated send_to_sharp

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers bit_send.h Source File

bit_send.h

00001 #ifndef BIT_SEND
00002 #define BIT_SEND
00003 
00004 #define BIT_TICK_DELAY      125 // us - 125 us = 4 Khz base freq
00005 #define BIT_TICK_1_REPEAT   1  // nr. of ticks to stay on each output level
00006 #define BIT_TICK_1_NCYCLES  16 // nr. of output level switching, per bit
00007 #define BIT_TICK_0_REPEAT   2  // same for bit "0"
00008 #define BIT_TICK_0_NCYCLES  8 
00009 
00010 #define BIT_FIRST_SENT      ( 1UL << 0 ) // signal for first bit sent
00011 #define BIT_LAST_SENT       ( 1UL << 1 ) // signal for last bit sent
00012 #define BIT_LAST_PROCESSING ( 1UL << 2 ) // last bit is being processes
00013 #define BIT_SENDING         ( 1UL << 3 ) // bit being processed
00014 
00015 #ifdef FILE_BUF_SIZE
00016 //extern volatile char debugOut[];  //  holding debug info to print at the end
00017 //static char debugLine[128];
00018 //#define debug_printf(f_, ...) { sprintf((char*)debugLine,(f_), ##__VA_ARGS__); strcat ( (char*)debugOut, debugLine ); }
00019 #define debug_printf(f_, ...)
00020 #else
00021 #define debug_printf(f_, ...) printf((f_), ##__VA_ARGS__)
00022 #endif
00023 
00024 void bitHandlerInit( void ) ;
00025 void bitHandlerStop ( void ) ;
00026 int bitWaitSend ( uint8_t bit_value, uint8_t invert );
00027 bool bitHandlerRunning( void ) ;
00028 
00029 #endif