Hello Alessandro,
Here are my answers:
1. If you want to use TSS not only in bsp, but also in the application following files are needed: TSS_API.h, TSS_DataTypes.h, TSS_StatusCodes.h, TSS_DataTypes.h. For the FreeMASTER are needed at least files: freemaster.h, freemaster_tsa.h.
The following lines should be added to the bsp_twrk20d72m.bat:
copy /Y ..\..\..\mqx\build\cw10\bsp_twrk20d72m\Sources\TSS\TSS_API.h .\Generated_Code
copy /Y ..\..\..\mqx\build\cw10\bsp_twrk20d72m\Sources\TSS\TSS_DataTypes.h .\Generated_Code
copy /Y ..\..\..\mqx\build\cw10\bsp_twrk20d72m\Sources\TSS\TSS_StatusCodes.h .\Generated_Code
copy /Y ..\..\..\mqx\build\cw10\bsp_twrk20d72m\Sources\TSS\TSS_Sensor.h .\Generated_Code
copy /Y ..\..\..\mqx\build\cw10\bsp_twrk20d72m\Sources\FreeMASTER\freemaster.h .\Generated_Code
copy /Y ..\..\..\mqx\build\cw10\bsp_twrk20d72m\Sources\FreeMASTER\freemaster_tsa.h .\Generated_Code
2. Yes, the while( TSS_Task() == TSS_STATUS_PROCESSING ) is correct. You can also call only TSS_Task(), but the while( TSS_Task() == TSS_STATUS_PROCESSING ) is better for fast measurement of capacitive signal.
3. Yes, the TSS_fCallBack0() callback is generated if any touch/release is detected on at least one electrode assigned to the control. The event which cause the callback is defined in the Keypad Event register. The Keypad provides touch/release state of the electrode by the buffer. The macros TSS_KEYPAD_BUFFER_READ(destvar,kpcsStruct) and TSS_KEYPAD_BUFFER_EMPTY(kpcsStruct) should be used for the buffer control. Of course, TSS offers to detect simultaneous touches, but with the keypad buffer we can get only the simultaneous touches during the one TSS_Task() cycle. The better option is to use tss_au8ElectrodeStatus[] array where each bit indicates current electrode state.
4. Yes, SCI, FlexCAN and programming ports like OSJTAG, OSBDM, BDM are possible connection with the FreeMASTER. I'm not sure if RS485 will work. Please, ask to FreeMASTER developer.
5. Right, the FMSTR_Poll() needs to be called periodically for the polling and short interrupt variant of FreeMASTER communication. FMSTR_Poll() is not needed if long interrupt variant is used. The communication options can be set in freemaster_cfg.h file.
The example in the attachment presents MQX 3.8.1 + TSS 2.6. Component + FreeMASTER communication in CW10.2 on twrk20d72m board.
Best Regards
Peter Moravcik
TSS SW Team