The MSC HW block represents the devices of the fifth CAPSENSE™ generation. More...
Modules | |
Macros | |
Functions | |
Data Structures | |
Enumerated Types | |
The MSC HW block represents the devices of the fifth CAPSENSE™ generation.
It enables multiple sensing capabilities on PSOC™ devices, including self-cap and mutual-cap capacitive touch-sense solutions.
The CAPSENSE™ solution includes:
This section describes only the MSC driver. Refer to the corresponding sections for documentation of middleware supported by the MSC HW block.
The MSC driver is a low-level peripheral driver that provides an interface to a complex mixed signal of the MSC HW block.
The MSC driver alone does not provide system-level functions. Instead, it is used by upper-level middleware to configure the MSC HW block required by an application.
The MSC 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 MSC driver also implements a lock semaphore mechanism.
The MSC driver supports re-entrance. If a device contains several MSC HW blocks, the same MSC driver is used to configure any HW block. For that, each function of the MSC driver contains a base address to define the MSC HW block to which the MSC driver communicates.
There is no restriction on the MSC Driver usage in RTOS.
The MSC driver is a simple wrapper driver specifically designed to be used by higher level middleware. Hence, is highly not recommended to use the MSC driver directly in the application program. To incorporate MSC HW block functionality in the application program, an associated middleware should be used.
The MSC Driver can be used to implement a custom sensing solution. In such a case, the application program must acquire and lock the MSC HW block prior to accessing it.
Setting up and using the MSC driver can be summed up in these four stages:
The following code snippet demonstrates how to capture the MSC HW block for custom implementation:
The entire solution, like CAPSENSE™, in addition to the MSC HW block, incorporates the following instances:
The MSC 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 MSC HW block requires a peripheral clock (clk_peri) input. It can be assigned using two methods:
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 MSC HW block supports two types of the connection GPIO pin-to-block:
This is a legacy connection through an analog multiplexed bus (AMUXBUS) available in previous generations of CAPSENSE™ devices.
Any analog-capable GPIO pin that can be connected to an analog multiplexed bus (AMUXBUS) can be connected to the MSC HW block as an input / sensor.
A GPIO input can be assigned to the MSC HW block using the following methods:
If middleware is used, pin configuration is managed by the middleware. Under the MSC driver custom implementation, the application program must manage the pin connections.
Each AMUXBUS can be split into multiple segments. Ensure that the MSC HW block and a GPIO belong to the same bus segment or join the segments to establish the connection GPIO-to-MSC HW block.
For more information about pin configuration, refer to the GPIO (General Purpose Input Output) driver.
The enhanced direct HW-wire connection pin-to-MSC HW block is available in the devices of the fifth generation CAPSENSE™.
Only dedicated pins can be used for such a type of connection. Refer to the device datasheet for the exact pin definition.
A GPIO input can be assigned to the MSC HW block only by proper configuration of the MSC HW block. If middleware is used, pin configuration is managed by the middleware.
Under the MSC driver custom implementation, the application program must manage the pin connections.
The advantages of this type of a connection under the CAPSENSE™ MW usage are the following:
The MSC HW block has one interrupt. The MSC HW block can generate interrupts on the following events:
Additionally, the MSC interrupt can wake the device from the Sleep power mode. The MSC HW block is powered down in the Deep Sleep power mode. So, it cannot be used as a wake-up source in this power mode.
If a CAPSENSE™ is used, the interrupt service routine is managed by middleware. When using the MSC 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 MSC interrupt. Use the pre-defined enumeration as the interrupt source of the MSC HW block. The MSC 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 MSC interrupt is triggered.
The following code snippet demonstrates how to configure and enable the MSC interrupt:
For more information, refer to the SysInt (System Interrupt) driver.
Alternatively, instead of handling the interrupts, the Cy_MSC_GetConversionStatus() function allows for firmware polling of the MSC block status.
The MSC HW block can operate in Active and Sleep CPU power modes. It is also possible to switch between Low power and Ultra Low power system modes. In Deep Sleep power mode, the MSC HW block is powered off. When the device wakes up from Deep Sleep, the MSC HW block resumes operation without the need for re-initialization.
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 |
---|---|---|
1.10.2 | Minor documentation updates | Documentation improvement |
1.10.1 | Update the paths to the code snippets | PDL structure update |
1.10 | Added Cy_MSC_Capture() function | CAPSENSE™ memory consumption optimization |
1.0 | The initial version |