Fabio Fumi
/
send_to_sharp
Renamed
Diff: send_pc1403.h
- Revision:
- 5:062962db7a48
- Parent:
- 2:dff96be9617e
--- a/send_pc1403.h Wed Feb 23 12:24:16 2022 +0000 +++ b/send_pc1403.h Tue Mar 29 10:06:20 2022 +0000 @@ -1,22 +1,29 @@ #ifndef SEND_PC1403 #define SEND_PC1403 +#include "mbed.h" + +#include "serial_file.h" // file-over-serial +#ifndef FILE_BUF_SIZE +#include "bin_file.h" // hardcoded file stream +#endif + +#include "bit_send.h" + // remapping to MBed types -#include "mbed.h" #define uchar uint8_t #define ushort uint16_t #define uint uint32_t #define ulong uint32_t - #define PC_ID 1403 #define TYPE_BIN_ADDR 0xE030 // bit timings -#define BIT_DURATION (8*250) // us, PC1403 -#define SYNC_DURATION 3 // s +#define BIT_DURATION (8*250) // us, PC1403 +#define SYNC_DURATION 1 // seconds #define N_SYNC_BITS SYNC_DURATION * 1000000 / BIT_DURATION -#define MAX_BIT_TIME_ERR 10000 // timing error, per bit: 10ms - UNLIKELY!! +#define MAX_BIT_TIME_ERR 50000 // timing error, per bit: 50ms - UNLIKELY!! #define argP "" // main NOT using command-line input arguments @@ -231,6 +238,8 @@ uint stopb2 ; } ModeInfo ; +extern FileInfo fileInfo ; // extern, for other modules too + /////////////////////////////////////// // static variables static ModeInfo Mode[] = { /* stop bits of first and second nibble */ @@ -240,7 +249,7 @@ static bool bitMirroring = false ; -static ulong CodeOld[] = { +const static char CodeOld[] = { 0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11, 0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11, 0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11, @@ -260,10 +269,21 @@ } ; - //////////////////////////////////////////////////////////////////////////////// // published method +int sharp_fileloop ( FileInfo* ptrFile ) ; +int FileSend ( void ); -int FileSend ( char* FileName, char* FileStream, uint FileSize, FileInfo* ptrFile ); +// From Pocket Tools +int WriteSaveNameToWav (char* ptrName, + uchar mode); +int WriteFooterToMemoWav ( void ); +int WriteSyncToWav (ulong nbSync); +int WriteByteSumToWav (ulong value, + uchar order, + uchar mode); +int WriteByteSumToWav (ulong value, + uchar order, + uchar mode); #endif // SEND_PC1403 \ No newline at end of file