Functions | |
cy_en_msc_status_t | Cy_MSC_Init (MSC_Type *base, cy_stc_msc_base_config_t const *config, cy_en_msc_key_t key, cy_stc_msc_context_t *context) |
Acquires, locks, and configures the MSC HW block. More... | |
cy_en_msc_status_t | Cy_MSC_DeInit (const MSC_Type *base, cy_en_msc_key_t key, cy_stc_msc_context_t *context) |
Releases the MSC HW block previously captured and locked by the caller. More... | |
cy_en_msc_status_t | Cy_MSC_Capture (MSC_Type *base, cy_en_msc_key_t key, cy_stc_msc_context_t *context) |
Acquires and locks the MSC HW block without changing its configuration. More... | |
cy_en_msc_status_t | Cy_MSC_Configure (MSC_Type *base, const cy_stc_msc_base_config_t *config, cy_en_msc_key_t key, const cy_stc_msc_context_t *context) |
Sets configuration of all MSC HW block registers at once. More... | |
void | Cy_MSC_ConfigureScan (MSC_Type *base, uint32_t numRegs, const uint32_t *scanConfig) |
Sets configuration of sensor frame registers of the MSC HW block and starts the scan. More... | |
__STATIC_INLINE cy_en_msc_key_t | Cy_MSC_GetLockStatus (const MSC_Type *base, const cy_stc_msc_context_t *context) |
Verifies whether the specified MSC HW block is acquired and locked by a higher-level firmware. More... | |
__STATIC_INLINE cy_en_msc_status_t | Cy_MSC_GetConversionStatus (const MSC_Type *base, const cy_stc_msc_context_t *context) |
Verifies whether the specified MSC HW block is busy (performing scan or conversion). More... | |
__STATIC_INLINE uint32_t | Cy_MSC_ReadReg (const MSC_Type *base, uint32_t offset) |
Reads value from the specified the MSC HW block register. More... | |
__STATIC_INLINE void | Cy_MSC_WriteReg (MSC_Type *base, uint32_t offset, uint32_t value) |
Writes a value to the specified MSC HW block register. More... | |
__STATIC_INLINE void | Cy_MSC_SetBits (MSC_Type *base, uint32_t offset, uint32_t mask) |
Sets bits, specified by the Mask parameter in the MSC HW block register, specified by the Offset parameter. More... | |
__STATIC_INLINE void | Cy_MSC_ClrBits (MSC_Type *base, uint32_t offset, uint32_t mask) |
Clears bits, specified by the Mask parameter in the MSC HW block register, specified by the Offset parameter. More... | |
__STATIC_INLINE void | Cy_MSC_WriteBits (MSC_Type *base, uint32_t offset, uint32_t mask, uint32_t value) |
Writes field, specified by the Mask parameter with the value, specified by the Value parameter. More... | |
cy_en_msc_status_t Cy_MSC_Init | ( | MSC_Type * | base, |
cy_stc_msc_base_config_t const * | config, | ||
cy_en_msc_key_t | key, | ||
cy_stc_msc_context_t * | context | ||
) |
Acquires, locks, and configures the MSC HW block.
If the MSC HW block is already in use by other middleware or by the application program, the function returns the CY_MSC_LOCKED status and does not configure the MSC HW block.
If the acquisition is successful, this function writes configuration data into all MSC HW block registers (except read-only registers and SEQ_START register) at once. Because the SEQ_START register is excluded from write, use the Cy_MSC_WriteReg() function to trigger the state machine for scan or conversion.
To capture the MSC block without its reconfiguration use the Cy_MSC_Capture() function.
base | The pointer to a MSC HW block base address. |
config | The pointer to a configuration structure that contains the initial configuration. |
key | The ID of middleware or a user-level function to work with the specified MSC HW block. |
context | The pointer to the context structure allocated by the user or middleware. |
cy_en_msc_status_t Cy_MSC_DeInit | ( | const MSC_Type * | base, |
cy_en_msc_key_t | key, | ||
cy_stc_msc_context_t * | context | ||
) |
Releases the MSC HW block previously captured and locked by the caller.
If the MSC HW block is acquired by another caller or the block is in the busy state (performing scan or conversion), the de-initialization request is ignored and the corresponding status is returned.
base | The pointer to a MSC HW block base address. |
key | The ID of middleware or a user-level function to work with the specified MSC HW block. |
context | The pointer to the context structure allocated by the user or middleware. |
cy_en_msc_status_t Cy_MSC_Capture | ( | MSC_Type * | base, |
cy_en_msc_key_t | key, | ||
cy_stc_msc_context_t * | context | ||
) |
Acquires and locks the MSC HW block without changing its configuration.
If the MSC HW block is already in use by other middleware or by the application program, then the function returns the CY_MSC_LOCKED status.
base | The pointer to a MSC HW block base address. |
key | The ID of middleware or a user-level function to work with the specified MSC HW block. |
context | The pointer to the context structure allocated by the user or middleware. |
cy_en_msc_status_t Cy_MSC_Configure | ( | MSC_Type * | base, |
const cy_stc_msc_base_config_t * | config, | ||
cy_en_msc_key_t | key, | ||
const cy_stc_msc_context_t * | context | ||
) |
Sets configuration of all MSC HW block registers at once.
This function writes configuration data into all MSC block registers (except read-only registers and the SEQ_START register) at once. Because the SEQ_START register is excluded from write, use the Cy_MSC_WriteReg() function to perform triggering state machine for scan or conversion.
base | The pointer to a MSC HW block base address. |
config | The pointer to a configuration structure that contains initial configuration. |
key | The ID of middleware or a user-level function to work with the specified MSC HW block. |
context | The pointer to the context structure allocated by the user or middleware. |
void Cy_MSC_ConfigureScan | ( | MSC_Type * | base, |
uint32_t | numRegs, | ||
const uint32_t * | scanConfig | ||
) |
Sets configuration of sensor frame registers of the MSC HW block and starts the scan.
base | Pointer to a MSC HW block base address. |
numRegs | Number of registers in scan configuration written into MSC HW block. Possible values are CY_MSC_5_SNS_REGS and CY_MSC_6_SNS_REGS. |
scanConfig | The pointer to a scan configuration structure. |
__STATIC_INLINE cy_en_msc_key_t Cy_MSC_GetLockStatus | ( | const MSC_Type * | base, |
const cy_stc_msc_context_t * | context | ||
) |
Verifies whether the specified MSC HW block is acquired and locked by a higher-level firmware.
base | Pointer to a MSC HW block base address. |
context | The pointer to the context structure allocated by a user or middleware. |
__STATIC_INLINE cy_en_msc_status_t Cy_MSC_GetConversionStatus | ( | const MSC_Type * | base, |
const cy_stc_msc_context_t * | context | ||
) |
Verifies whether the specified MSC HW block is busy (performing scan or conversion).
base | Pointer to a MSC HW block base address. |
context | The pointer to the context structure allocated by a user or middleware. |
__STATIC_INLINE uint32_t Cy_MSC_ReadReg | ( | const MSC_Type * | base, |
uint32_t | offset | ||
) |
Reads value from the specified the MSC HW block register.
base | Pointer to a MSC HW block base address. |
offset | Register offset relative to base address. |
__STATIC_INLINE void Cy_MSC_WriteReg | ( | MSC_Type * | base, |
uint32_t | offset, | ||
uint32_t | value | ||
) |
Writes a value to the specified MSC HW block register.
base | Pointer to a MSC HW block base address. |
offset | Register offset relative to base address. |
value | Value to be written to the register. |
__STATIC_INLINE void Cy_MSC_SetBits | ( | MSC_Type * | base, |
uint32_t | offset, | ||
uint32_t | mask | ||
) |
Sets bits, specified by the Mask parameter in the MSC HW block register, specified by the Offset parameter.
base | Pointer to a MSC HW block base address. |
offset | Register offset relative to base address. |
mask | Mask value for register bits to be set. |
__STATIC_INLINE void Cy_MSC_ClrBits | ( | MSC_Type * | base, |
uint32_t | offset, | ||
uint32_t | mask | ||
) |
Clears bits, specified by the Mask parameter in the MSC HW block register, specified by the Offset parameter.
base | Pointer to a MSC HW block base address. |
offset | Register offset relative to base address. |
mask | Mask value for register bits to be cleared. |
__STATIC_INLINE void Cy_MSC_WriteBits | ( | MSC_Type * | base, |
uint32_t | offset, | ||
uint32_t | mask, | ||
uint32_t | value | ||
) |
Writes field, specified by the Mask parameter with the value, specified by the Value parameter.
base | Pointer to a MSC HW block base address. |
offset | Register offset relative to base address. |
mask | Specifies bits to be modified. |
value | Specifies a value to be written to the register. |