Access and Modify CapSense Register Map in Firmware – KBA2226674

Version: **

 

Question:

How do I read from and write into the CapSense® register map through firmware in CapSense Component version 3.0 or above?

 

Answer:

You can access and modify the CapSense parameters dynamically in firmware using the GetParam and SetParam API functions respectively.


Read operation:

CapSense_GetParam (uint32 paramId, uint32 * value);

 

Use the following parameters as arguments for this API:

 

  • paramId

     The paramId for each register is available in the CapSense RegisterMap header file as CapSense_<ParameterName>_PARAM_ID.

 

  • value

      The value is the pointer to the variable to be updated with the obtained value from the CapSense register.

 

Write operation:

CapSense_SetParam (uint32 paramId, uint32 value);

 

Use the following parameters as arguments for this API:

 

  • paramId

     The paramId for each register is available in the CapSense RegisterMap header file as CapSense_<ParameterName>_PARAM_ID.

 

  • value

     The variable that holds the new value to be updated in the CapSense register.

Note:

  • Refer to the CapSense Component datasheet for details on the format of paramId. It also provides information on the read/write permissions for that specific parameter.

 

  • After modifying a CapSense parameter, re-initialization of the component may be necessary. This information is available for each register in the exported register map file (Select Export Register Map from the CapSense component customizer screen).