KW40Z_Connectivity_Software_1.0.1 KSDK_1.3.0 IAR 7.5
I want to use TSI keys (capacitive touch buttons) instead of keyboard gpio so how can I disable it.
I looked for
app_preinclude.h
/* Defines the number of available keys for the keyboard module */
gKBD_KeysCount_c but fails if set to 0
(or gKeyBoardSupported_d ?)
What about GPIO_IrqAdapter.
Can I fully disabled it (GPIO keyboard support) to save some flash ?
Thank you,
Lucian.
Solved! Go to Solution.
Hi Lucian Firan
Yes, if you use KeyBoardSupported_d as 0, it will disable all Switches initialization related with SW3 and SW4, for example Gpio_IrqAdapter, you can check that in Keyboard.c it uses the GpioInstallIsr funtion inside a #if gKeyBoardSupported_d, and if you don't use this GpioInstallIsr funtion in other part of the code, the compiler will ignore this code.
If you application requires to use TSI then you going to need to implement this driver in the keyboard drivers. I recommend you to check the following demo, it has tsi drivers for kw40z, it could help you in your implementation.
http://www.nxp.com/assets/documents/data/en/application-notes/FRDMKW40ZDAUG.pdf
http://www.nxp.com/assets/documents/data/en/application-notes-software/FRDMKW40ZDAUGSW.zip
Note:The TSI implementation is not a good "Flash saver". It will need an extra software timer that can trigger TSI measurements.
Hope this information help you.
Best Regards,
Mario Castañeda
Hi Lucian Firan
The method to fully disable GPIO keyboard is if you change gKeyBoardSupported_d as 0, You can find this macro in Keyboard.h file.
Now implementing TSI keys instead of GPIO I couldn't say that it will save flash, because to implement TSI keys you will add TSI measurement, timer to trigger measure, calibration, etc. so it will represent a more code that a GPIO.
I recommend you to change the application to work without Keyboards. So for example, after everything is initializated and set up the device starts advertisement without SW4 Press
Hope it helps.
Best Regards,
Mario
Hi Mario,
Thank you; my idea is not using the both TSI + GPIO something like:
/* Disable/enable keyboard GPIO */
#define gKeyBoardSupported_d 0
/* Defines the number of available keys for the keyboard module */
#define gKBD_KeysCount_c 2
#if (!gKeyBoardSupported_d)
// init TSI code...
#endif
Doing this I will disable also Gpio_IrqAdapter ?
Best Regards,
Lucian
Hi Lucian Firan
Yes, if you use KeyBoardSupported_d as 0, it will disable all Switches initialization related with SW3 and SW4, for example Gpio_IrqAdapter, you can check that in Keyboard.c it uses the GpioInstallIsr funtion inside a #if gKeyBoardSupported_d, and if you don't use this GpioInstallIsr funtion in other part of the code, the compiler will ignore this code.
If you application requires to use TSI then you going to need to implement this driver in the keyboard drivers. I recommend you to check the following demo, it has tsi drivers for kw40z, it could help you in your implementation.
http://www.nxp.com/assets/documents/data/en/application-notes/FRDMKW40ZDAUG.pdf
http://www.nxp.com/assets/documents/data/en/application-notes-software/FRDMKW40ZDAUGSW.zip
Note:The TSI implementation is not a good "Flash saver". It will need an extra software timer that can trigger TSI measurements.
Hope this information help you.
Best Regards,
Mario Castañeda