The MSCLP HW block represents the low power family of the fifth-generation CAPSENSE™ devices. More...
Modules | |
Macros | |
Functions | |
Data Structures | |
Enumerated Types | |
The MSCLP HW block represents the low power family of the fifth-generation CAPSENSE™ devices.
It enables multiple sensing capabilities on PSOC™ devices, including the self-cap and mutual-cap capacitive touch-sense solutions and flyback inductive sensing solution.
The CAPSENSE™ solution includes:
This section describes only the MSCLP driver. Refer to the corresponding sections for documentation of middleware supported by the MSCLP HW block.
The MSCLP driver is a low-level peripheral driver that provides an interface to a complex mixed signal of the MSCLP HW block.
The MSCLP driver alone does not provide system-level functions. Instead, it is used by upper-level middleware to configure the MSCLP HW block required by an application.
The MSCLP HW block can support only one function at a time. To allow seamless time-multiplex implementation of functionality and to avoid conflicting access to hardware from the upper level, the MSCLP driver also implements a lock semaphore mechanism.
The MSCLP driver supports re-entrance. If a device contains several MSCLP HW blocks, the same MSCLP driver is used to configure any HW block. For that, each function of the MSCLP driver contains a base address to define the MSCLP HW block to which the MSCLP driver communicates.
There is no restriction on the MSCLP Driver usage in RTOS.
The MSCLP driver is a simple wrapper driver specifically designed to be used by higher level middleware. Hence, it is highly not recommended to use the MSCLP driver directly in the application program. To incorporate MSCLP HW block functionality in the application program, an associated middleware should be used.
The MSCLP Driver can be used to implement a custom sensing solution. In such a case, the application program must acquire and lock the MSCLP HW block prior to accessing it.
Setting up and using the MSCLP driver can be summed up in these four stages:
The following code snippet demonstrates how to capture the MSCLP HW block for custom implementation:
The entire solution, like CAPSENSE™, in addition to the MSCLP HW block, incorporates the following instances:
The MSCLP driver does not configure those blocks and they should be managed by an upper level. When using CAPSENSE™, those blocks are managed by the middleware.
The MSCLP HW block requires a low frequency clock (clk_lf) for LF-AoS operation. It can be enabled either:
Also the MSCLP HW block uses internal MRSS clock source for LF-AoS operation, see the Cy_MSCLP_MrssStart() function.
If middleware is used, the clocks are managed by the middleware.
CAPSENSE™ provides the ability to form a user interface using widgets. Each widget consists of one or more sensors. These sensors are connected to the GPIO pins.
The CAPSENSE™-related GPIO pins can be divided into three groups:
Usage of the MSCv3LP-compatible GPIO sensor pads under the CAPSENSE™ MW has the following advantages:
A GPIO input can be assigned to the MSCLP HW block using the following methods:
If middleware is used, pin configuration is managed by the middleware. Under the MSCLP driver custom implementation, the application program must manage the pin connections.
Each AMUXBUS can be split into multiple segments. Ensure that the MSCLP HW block and a GPIO belong to the same bus segment or join the segments to establish the connection GPIO-to-MSCLP HW block.
For more information about pin configuration, refer to the GPIO (General Purpose Input Output) driver.
The MSCLP HW block implements two interrupts:
The Active domain interrupt can be triggered by the following events:
The Deep Sleep domain interrupt can be triggered by the following events:
The Active domain interrupt can wake up the device from the Sleep power mode. The Deep Sleep domain interrupt can wake up the device from the Deep Sleep power mode.
If CAPSENSE™ MW is used, the interrupt service routine is managed by middleware. When using the MSCLP driver for custom implementation or other middleware, the application program must manage the interrupt service routine.
Implement an interrupt routine and assign it to the MSCLP interrupt. Use the pre-defined enumeration as the interrupt source of the MSCLP HW block. The MSCLP interrupt to the NVIC is raised any time the intersection (logic AND) of the interrupt flags and the corresponding interrupt masks are non-zero. The peripheral interrupt status register should be read in the ISR to detect which condition generated the interrupt. The appropriate interrupt registers should be cleared so that subsequent interrupts can be handled.
The following code snippet demonstrates how to implement a routine to handle the interrupt. The routine is called when a MSCLP interrupt is triggered.
The following code snippet demonstrates how to configure and enable the MSCLP interrupt:
For more information, refer to the SysInt (System Interrupt) driver.
Alternatively, instead of handling the interrupts, the Cy_MSCLP_GetConversionStatus() function allows for firmware polling of the MSCLP block status.
The MSCLP HW block can perform scans in Active, Sleep, and DeepSleep MCU power modes if it is configured for operation in the AS_MS or LP_AOS modes. If MSCLP HW block is configured for operation in the Interrupt Driven (CPU) mode, it can perform scans only in in Active or Sleep MCU power modes.
Refer to the SysPm (System Power Management) driver for more information about low-power mode transitions.
Important information about the CAPSENSE™ technology overview, appropriate Infineon device for the design, CAPSENSE™ system and sensor design guidelines, different interfaces and tuning guidelines necessary for a successful design of a CAPSENSE™ system is available in the Getting Started with CAPSENSE™ document and the product-specific CAPSENSE™ design guide. Infineon highly recommends starting with these documents. They can be found on the Infineon web site at www.infineon.com
For more information, refer to the following documents:
Version | Changes | Reason for Change |
---|---|---|
2.0 | Changed name of defines: CY_MSCLP_IMO_24_MHZ -> CY_MSCLP_IMO_25_MHZ, CY_MSCLP_IMO_36_MHZ -> CY_MSCLP_IMO_38_MHZ, CY_MSCLP_IMO_48_MHZ -> CY_MSCLP_IMO_46_MHZ | Names consistency with HW frequency. |
1.0 | The initial version |