Header documentation for SDK function TPM_SetupDualEdgeCapture

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Header documentation for SDK function TPM_SetupDualEdgeCapture

772 Views
martinhowell1
Contributor III

After a lot of debugging and peering at registers I found an incorrect and/or misleading comment in fsl_tpm.h for the function TPM_SetupDualEdgeCapture()

It reads:

/*!
* @brief Configures the dual edge capture mode of the TPM.
*
* This function allows to measure a pulse width of the signal on the input of channel of a
* channel pair. The filter function is disabled if the filterVal argument passed is zero.
*
* @param base TPM peripheral base address
* @param chnlPairNumber The TPM channel pair number; options are 0, 1, 2, 3
* @param edgeParam Sets up the dual edge capture function
* @param filterValue Filter value, specify 0 to disable filter.
*/
void TPM_SetupDualEdgeCapture(TPM_Type *base,
tpm_chnl_t chnlPairNumber,
const tpm_dual_edge_capture_param_t *edgeParam,
uint32_t filterValue);

I was trying to combine channels 2 and 3 so passed kTPM_Chnl_2 to the chnlPairNumber. I should have passed kTPM_Chnl_1!! The comment should probably read

/*!
* @brief Configures the dual edge capture mode of the TPM.
*
* This function allows to measure a pulse width of the signal on the input of channel of a
* channel pair. The filter function is disabled if the filterVal argument passed is zero.
*
* @param base TPM peripheral base address
* @param chnlPairNumber The TPM channel pair number; options are 0 to combine ch 0 and 1, 1 to combine ch 2 and 3, 2 to combine ch 4 and 5
* @param edgeParam Sets up the dual edge capture function
* @param filterValue Filter value, specify 0 to disable filter.
*/

Probably we shouldnt be using tpm_chnl_t for this parameter but define another type tpm_combine_chnl_t instead.

0 Kudos
3 Replies

630 Views
martinhowell1
Contributor III

Sorry I should have said.

We are using the M4 core on the iMX7ulp CPU although I am sure the TPM module is common to many of your SOCs

The TPM driver version is given in fsl_tpm.h as:

#define FSL_TPM_DRIVER_VERSION (MAKE_VERSION(2, 0, 2)) /*!< Version 2.0.2 */

The SDK has been installed on my machine into a folder called:

SDK_2.2_EVK-MCIMX7ULP_M4

Is there any further info you need?

0 Kudos

630 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Martin Howell,

  Thanks a lot for your updated information.

  About the IMX7 problem, it's better to create the question in this area:

i.MX Processors 

  I am just the kinetis and the I.MXRT engineer.

  So, please create a new question in the new area, or the next time you need to add the chip part number in the question title.


Have a great day,
Kerry

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

630 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Martin Howell,

  Please tell me what the kinetis chip you are using?

  Please also let me know your SDK code name.

  Waiting for your updated information.
Have a great day,
Kerry

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos