Functions | |
cy_en_msclp_status_t | Cy_MSCLP_Init (MSCLP_Type *base, cy_stc_msclp_base_config_t const *config, cy_en_msclp_key_t key, cy_stc_msclp_context_t *context) |
Acquires, locks, and configures the MSCLP HW block. More... | |
cy_en_msclp_status_t | Cy_MSCLP_DeInit (MSCLP_Type *base, cy_en_msclp_key_t key, cy_stc_msclp_context_t *context) |
Releases the MSCLP HW block previously captured and locked by the caller. More... | |
cy_en_msclp_status_t | Cy_MSCLP_Capture (MSCLP_Type *base, cy_en_msclp_key_t key, cy_stc_msclp_context_t *context) |
Acquires and locks the MSCLP HW block without changing its configuration. More... | |
cy_en_msclp_status_t | Cy_MSCLP_Configure (MSCLP_Type *base, const cy_stc_msclp_base_config_t *config, cy_en_msclp_key_t key, const cy_stc_msclp_context_t *context) |
Sets configuration of all MSCLP HW block registers at once. More... | |
cy_en_msclp_status_t | Cy_MSCLP_MrssStart (MSCLP_Type *base, cy_stc_msclp_mrss_config_t const *mrssCfg, cy_en_msclp_key_t key, cy_stc_msclp_context_t const *context) |
Turns on the MRSS resources. More... | |
cy_en_msclp_status_t | Cy_MSCLP_MrssStop (MSCLP_Type *base, cy_en_msclp_key_t key, cy_stc_msclp_context_t const *context) |
Turns off the MRSS resources. More... | |
cy_en_msclp_status_t | Cy_MSCLP_MrssStatus (MSCLP_Type *base, cy_en_msclp_key_t key, cy_stc_msclp_context_t const *context) |
Returns the MRSS status (enabled/disabled). More... | |
void | Cy_MSCLP_ConfigureScan (MSCLP_Type *base, uint32_t numRegs, const uint32_t *scanConfig) |
Sets configuration of sensor frame registers of the MSCLP HW block and starts the scan. More... | |
__STATIC_INLINE cy_en_msclp_key_t | Cy_MSCLP_GetLockStatus (const MSCLP_Type *base, const cy_stc_msclp_context_t *context) |
Verifies whether the specified MSCLP HW block is acquired and locked by a higher-level firmware. More... | |
__STATIC_INLINE cy_en_msclp_status_t | Cy_MSCLP_GetConversionStatus (const MSCLP_Type *base, const cy_stc_msclp_context_t *context) |
Verifies whether the specified MSCLP HW block is busy (performing scan or conversion). More... | |
__STATIC_INLINE uint32_t | Cy_MSCLP_ReadReg (const MSCLP_Type *base, uint32_t offset) |
Reads value from the specified the MSCLP HW block register. More... | |
__STATIC_INLINE void | Cy_MSCLP_WriteReg (MSCLP_Type *base, uint32_t offset, uint32_t value) |
Writes a value to the specified MSCLP HW block register. More... | |
__STATIC_INLINE void | Cy_MSCLP_SetBits (MSCLP_Type *base, uint32_t offset, uint32_t mask) |
Sets bits, specified by the Mask parameter in the MSCLP HW block register, specified by the Offset parameter. More... | |
__STATIC_INLINE void | Cy_MSCLP_ClrBits (MSCLP_Type *base, uint32_t offset, uint32_t mask) |
Clears bits, specified by the Mask parameter in the MSCLP HW block register, specified by the Offset parameter. More... | |
__STATIC_INLINE void | Cy_MSCLP_WriteBits (MSCLP_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... | |
__STATIC_INLINE void | Cy_MSCLP_SwStartFrame (MSCLP_Type *base) |
The function initiates the non-blocking scan of an entire configured frame by launch the MSCLP HW block state machine. More... | |
__STATIC_INLINE void | Cy_MSCLP_SwStartAosFrame (MSCLP_Type *base) |
The function initiates the non-blocking scan of an entire configured frame by launch the MSCLP HW block state machine. More... | |
__STATIC_INLINE uint32_t | Cy_MSCLP_ReadSensorDataWord (MSCLP_Type const *base, uint32_t addr) |
Reads one 32-bit data word from the SNS.SENSOR_DATA memory. More... | |
void | Cy_MSCLP_ReadSensorDataArray (MSCLP_Type const *base, uint32_t startAddr, uint32_t *ptrData, uint32_t dataSize) |
Reads an array of 32-bit data words from the SNS.SENSOR_DATA memory. More... | |
__STATIC_INLINE void | Cy_MSCLP_WriteSensorDataWord (MSCLP_Type *base, uint32_t addr, uint32_t data) |
Writes one 32-bit data word into the SNS.SENSOR_DATA memory. More... | |
cy_en_msclp_status_t | Cy_MSCLP_WriteSensorDataArray (MSCLP_Type *base, uint32_t startAddr, uint32_t const *ptrData, uint32_t dataSize) |
Writes an array of 32-bit data words into the SNS.SENSOR_DATA memory. More... | |
cy_en_msclp_status_t Cy_MSCLP_Init | ( | MSCLP_Type * | base, |
cy_stc_msclp_base_config_t const * | config, | ||
cy_en_msclp_key_t | key, | ||
cy_stc_msclp_context_t * | context | ||
) |
Acquires, locks, and configures the MSCLP HW block.
If the MSCLP HW block is already in use by other middleware or by the application program, the function returns the CY_MSCLP_LOCKED status and does not configure the MSCLP HW block.
If the acquisition is successful, this function writes configuration data into all MSCLP 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_MSCLP_WriteReg() function to trigger the state machine for scan or conversion.
To capture the MSCLP block without its reconfiguration use the Cy_MSCLP_Capture() function.
base | The pointer to a MSCLP 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 MSCLP HW block. |
context | The pointer to the context structure allocated by the user or middleware. |
cy_en_msclp_status_t Cy_MSCLP_DeInit | ( | MSCLP_Type * | base, |
cy_en_msclp_key_t | key, | ||
cy_stc_msclp_context_t * | context | ||
) |
Releases the MSCLP HW block previously captured and locked by the caller.
If the MSCLP 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 MSCLP HW block base address. |
key | The ID of middleware or a user-level function to work with the specified MSCLP HW block. |
context | The pointer to the context structure allocated by the user or middleware. |
cy_en_msclp_status_t Cy_MSCLP_Capture | ( | MSCLP_Type * | base, |
cy_en_msclp_key_t | key, | ||
cy_stc_msclp_context_t * | context | ||
) |
Acquires and locks the MSCLP HW block without changing its configuration.
If the MSCLP HW block is already in use by other middleware or by the application program, then the function returns the CY_MSCLP_LOCKED status.
base | The pointer to a MSCLP HW block base address. |
key | The ID of middleware or a user-level function to work with the specified MSCLP HW block. |
context | The pointer to the context structure allocated by the user or middleware. |
cy_en_msclp_status_t Cy_MSCLP_Configure | ( | MSCLP_Type * | base, |
const cy_stc_msclp_base_config_t * | config, | ||
cy_en_msclp_key_t | key, | ||
const cy_stc_msclp_context_t * | context | ||
) |
Sets configuration of all MSCLP HW block registers at once.
This function writes configuration data into all MSCLP 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_MSCLP_WriteReg() function to perform triggering state machine for scan or conversion.
base | The pointer to a MSCLP 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 MSCLP HW block. |
context | The pointer to the context structure allocated by the user or middleware. |
cy_en_msclp_status_t Cy_MSCLP_MrssStart | ( | MSCLP_Type * | base, |
cy_stc_msclp_mrss_config_t const * | mrssCfg, | ||
cy_en_msclp_key_t | key, | ||
cy_stc_msclp_context_t const * | context | ||
) |
Turns on the MRSS resources.
Checks the system defined VDDA value and turns on PUMP if VDDA is less then the threshold defined by the CY_MSCLP_VDDA_PUMP_TRESHOLD macro, else turns on only REF and IMO.
base | The pointer to a MSCLP HW block base address. |
mrssCfg | The pointer to the MRSS configuration structure cy_stc_msclp_mrss_config_t. |
key | The ID of middleware or a user-level function to work with the specified MSCLP HW block cy_en_msclp_key_t. |
context | The pointer to the context structure allocated by the user or middleware. |
cy_en_msclp_status_t Cy_MSCLP_MrssStop | ( | MSCLP_Type * | base, |
cy_en_msclp_key_t | key, | ||
cy_stc_msclp_context_t const * | context | ||
) |
Turns off the MRSS resources.
base | The pointer to a MSCLP HW block base address. |
key | The ID of middleware or a user-level function to work with the specified MSCLP HW block. |
context | The pointer to the context structure allocated by the user or middleware. |
cy_en_msclp_status_t Cy_MSCLP_MrssStatus | ( | MSCLP_Type * | base, |
cy_en_msclp_key_t | key, | ||
cy_stc_msclp_context_t const * | context | ||
) |
Returns the MRSS status (enabled/disabled).
base | The pointer to a MSCLP HW block base address. |
key | The ID of middleware or a user-level function to work with the specified MSCLP HW block. |
context | The pointer to the context structure allocated by the user or middleware. |
void Cy_MSCLP_ConfigureScan | ( | MSCLP_Type * | base, |
uint32_t | numRegs, | ||
const uint32_t * | scanConfig | ||
) |
Sets configuration of sensor frame registers of the MSCLP HW block and starts the scan.
base | Pointer to a MSCLP HW block base address. |
numRegs | Number of registers in scan configuration written into MSCLP HW block. Possible values are CY_MSCLP_6_SNS_REGS and CY_MSCLP_11_SNS_REGS. CY_MSCLP_5_SNS_REGS is also supported. |
scanConfig | The pointer to a scan configuration structure. |
__STATIC_INLINE cy_en_msclp_key_t Cy_MSCLP_GetLockStatus | ( | const MSCLP_Type * | base, |
const cy_stc_msclp_context_t * | context | ||
) |
Verifies whether the specified MSCLP HW block is acquired and locked by a higher-level firmware.
base | Pointer to a MSCLP HW block base address. |
context | The pointer to the context structure allocated by a user or middleware. |
__STATIC_INLINE cy_en_msclp_status_t Cy_MSCLP_GetConversionStatus | ( | const MSCLP_Type * | base, |
const cy_stc_msclp_context_t * | context | ||
) |
Verifies whether the specified MSCLP HW block is busy (performing scan or conversion).
base | Pointer to a MSCLP HW block base address. |
context | The pointer to the context structure allocated by a user or middleware. |
__STATIC_INLINE uint32_t Cy_MSCLP_ReadReg | ( | const MSCLP_Type * | base, |
uint32_t | offset | ||
) |
Reads value from the specified the MSCLP HW block register.
base | Pointer to a MSCLP HW block base address. |
offset | Register offset relative to base address. |
__STATIC_INLINE void Cy_MSCLP_WriteReg | ( | MSCLP_Type * | base, |
uint32_t | offset, | ||
uint32_t | value | ||
) |
Writes a value to the specified MSCLP HW block register.
base | Pointer to a MSCLP HW block base address. |
offset | Register offset relative to base address. |
value | Value to be written to the register. |
__STATIC_INLINE void Cy_MSCLP_SetBits | ( | MSCLP_Type * | base, |
uint32_t | offset, | ||
uint32_t | mask | ||
) |
Sets bits, specified by the Mask parameter in the MSCLP HW block register, specified by the Offset parameter.
base | Pointer to a MSCLP HW block base address. |
offset | Register offset relative to base address. |
mask | Mask value for register bits to be set. |
__STATIC_INLINE void Cy_MSCLP_ClrBits | ( | MSCLP_Type * | base, |
uint32_t | offset, | ||
uint32_t | mask | ||
) |
Clears bits, specified by the Mask parameter in the MSCLP HW block register, specified by the Offset parameter.
base | Pointer to a MSCLP HW block base address. |
offset | Register offset relative to base address. |
mask | Mask value for register bits to be cleared. |
__STATIC_INLINE void Cy_MSCLP_WriteBits | ( | MSCLP_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 MSCLP 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. |
__STATIC_INLINE void Cy_MSCLP_SwStartFrame | ( | MSCLP_Type * | base | ) |
The function initiates the non-blocking scan of an entire configured frame by launch the MSCLP HW block state machine.
The function requires the following things to be done ahead the function call:
The MSCLP HW block takes the first sensor configuration from Sensor Data RAM and executes the scan. After scan is complete, the next sensor configuration is taken (without MCU involvement) and the scan is executes. It happens till the scan of the last sensor of a frame is complete. Then MSCLP state machine goes to the idle state.
base | The pointer to the MSCLP HW block base address. |
__STATIC_INLINE void Cy_MSCLP_SwStartAosFrame | ( | MSCLP_Type * | base | ) |
The function initiates the non-blocking scan of an entire configured frame by launch the MSCLP HW block state machine.
The function requires the following things to be done ahead the function call:
The MSCLP HW block launches internal timer. After timeout the block takes the first sensor configuration from Sensor Data RAM and executes the scan. After scan is complete, the next sensor configuration is taken (without MCU involvement) and the scan is executes. It happens till the scan of the last sensor in a frame is complete. Then the MSCLP state machine goes to the idle state if number of frame scans is configured to one. Otherwise frame is scanned the configured number of times with configured timeout.
base | The pointer to the MSCLP HW block base address. |
__STATIC_INLINE uint32_t Cy_MSCLP_ReadSensorDataWord | ( | MSCLP_Type const * | base, |
uint32_t | addr | ||
) |
Reads one 32-bit data word from the SNS.SENSOR_DATA memory.
base | Pointer to a MSCLP HW block base address. |
addr | The address (index of the 32-bit word) in the SNS.SENSOR_DATA. |
void Cy_MSCLP_ReadSensorDataArray | ( | MSCLP_Type const * | base, |
uint32_t | startAddr, | ||
uint32_t * | ptrData, | ||
uint32_t | dataSize | ||
) |
Reads an array of 32-bit data words from the SNS.SENSOR_DATA memory.
base | Pointer to a MSCLP HW block base address. |
startAddr | The starting address (index of the 32-bit word) in the SNS.SENSOR_DATA. |
ptrData | Pointer to the 32-bit data array to be copied from the SNS.SENSOR_DATA. |
dataSize | The size of the data array (in 32-bit words). |
__STATIC_INLINE void Cy_MSCLP_WriteSensorDataWord | ( | MSCLP_Type * | base, |
uint32_t | addr, | ||
uint32_t | data | ||
) |
Writes one 32-bit data word into the SNS.SENSOR_DATA memory.
base | Pointer to a MSCLP HW block base address. |
addr | The address (index of the 32-bit word) in the SNS.SENSOR_DATA. |
data | The 32-bit data word value. |
cy_en_msclp_status_t Cy_MSCLP_WriteSensorDataArray | ( | MSCLP_Type * | base, |
uint32_t | startAddr, | ||
uint32_t const * | ptrData, | ||
uint32_t | dataSize | ||
) |
Writes an array of 32-bit data words into the SNS.SENSOR_DATA memory.
base | Pointer to a MSCLP HW block base address. |
startAddr | The starting address (index of the 32-bit word) in the SNS.SENSOR_DATA. |
ptrData | Pointer to the 32-bit data array to be copied into the SNS.SENSOR_DATA. |
dataSize | The size of the data array (in 32-bit words). |