PSoC 6 Peripheral Driver Library

General Description

Macros

#define Cy_Crypto_Server_Start   Cy_Crypto_Server_Start_Full
 Backward compatibility macro for the Server Start function - it starts the Server with Full functionality configuration.
 

Functions

cy_en_crypto_status_t Cy_Crypto_Server_Start_Base (cy_stc_crypto_config_t const *config, cy_stc_crypto_server_context_t *context)
 This function starts the Basic functionality for the Crypto server on the server side core, sets up an interrupt for the IPC Crypto channel, sets up an interrupt to catch Crypto HW errors. More...
 
cy_en_crypto_status_t Cy_Crypto_Server_Start_Extra (cy_stc_crypto_config_t const *config, cy_stc_crypto_server_context_t *context)
 This function starts the Extra functionality for the Crypto server on the server side core, sets up an interrupt for the IPC Crypto channel, sets up an interrupt to catch Crypto HW errors. More...
 
cy_en_crypto_status_t Cy_Crypto_Server_Start_Full (cy_stc_crypto_config_t const *config, cy_stc_crypto_server_context_t *context)
 This function starts the Full functionality for the Crypto server on the server side core, sets up an interrupt for the IPC Crypto channel, sets up an interrupt to catch Crypto HW errors. More...
 
cy_en_crypto_status_t Cy_Crypto_Server_Stop (void)
 This function stops the Crypto server by disabling the IPC notify interrupt and Crypto error interrupt. More...
 
void Cy_Crypto_Server_Process (void)
 This function parses input data received from the Crypto Client, runs the appropriate Crypto function and releases the Crypto IPC channel. More...
 
void Cy_Crypto_Server_GetDataHandler (void)
 This function is a IPC Crypto channel notify interrupt-routine. More...
 
void Cy_Crypto_Server_ErrorHandler (void)
 This function is a routine to handle an interrupt caused by the Crypto hardware error. More...
 

Function Documentation

◆ Cy_Crypto_Server_Start_Base()

cy_en_crypto_status_t Cy_Crypto_Server_Start_Base ( cy_stc_crypto_config_t const *  config,
cy_stc_crypto_server_context_t context 
)

This function starts the Basic functionality for the Crypto server on the server side core, sets up an interrupt for the IPC Crypto channel, sets up an interrupt to catch Crypto HW errors.

This function available for Server side only.

Note
The Crypto server can be run as singleton (not multi-instance) application on the one of available cores at the same time.
Parameters
configThe Crypto configuration structure.
contextThe pointer to the cy_stc_crypto_server_context_t structure that stores the Crypto server context.
Returns
cy_en_crypto_status_t
Function Usage
/* Scenario: Configure Server and Client as follows:
* Server:
* - IPC channel for communication: 13
* - IPC interrupt structure used for new request notifications: 13
* - Data request handler: default
* - Hardware errors handler: default
* Client:
* - IPC channel for communication: 13
* - IPC interrupt structure used for data ready notifications: 14
* - Data Complete callback: not used
*/
#define MY_CHAN_CRYPTO (uint32_t)(13u) /* IPC data channel for the Crypto */
#define MY_INTR_CRYPTO_SRV (uint32_t)(13u) /* IPC interrupt structure for the Crypto server */
#define MY_INTR_CRYPTO_CLI (uint32_t)(14u) /* IPC interrupt structure for the Crypto client */
#define MY_INTR_CRYPTO_SRV_MUX (IRQn_Type)(2u) /* CM0+ IPC interrupt mux number the Crypto server */
#define MY_INTR_CRYPTO_CLI_MUX (IRQn_Type)(3u) /* CM0+ IPC interrupt mux number the Crypto client */
#define MY_INTR_CRYPTO_ERR_MUX (IRQn_Type)(4u) /* CM0+ ERROR interrupt mux number the Crypto server */
const cy_stc_crypto_config_t myCryptoConfig =
{
/* .ipcChannel */ MY_CHAN_CRYPTO,
/* .acquireNotifierChannel */ MY_INTR_CRYPTO_SRV,
/* .releaseNotifierChannel */ MY_INTR_CRYPTO_CLI,
/* .releaseNotifierConfig */ {
#if (CY_CPU_CORTEX_M0P)
/* .intrSrc */ MY_INTR_CRYPTO_CLI_MUX,
/* .cm0pSrc */ cpuss_interrupts_ipc_14_IRQn, /* depends on selected releaseNotifierChannel value */
#else
/* .intrSrc */ cpuss_interrupts_ipc_14_IRQn, /* depends on selected releaseNotifierChannel value */
#endif
/* .intrPriority */ 2u,
},
/* .userCompleteCallback */ NULL,
/* .userGetDataHandler */ NULL,
/* .userErrorHandler */ NULL,
/* .acquireNotifierConfig */ {
#if (CY_CPU_CORTEX_M0P)
/* .intrSrc */ MY_INTR_CRYPTO_SRV_MUX, /* to use with DeepSleep mode should be in DeepSleep capable muxer's range */
/* .cm0pSrc */ cpuss_interrupts_ipc_13_IRQn, /* depends on selected acquireNotifierChannel value */
#else
/* .intrSrc */ cpuss_interrupts_ipc_13_IRQn, /* depends on selected acquireNotifierChannel value */
#endif
/* .intrPriority */ 2u,
},
/* .cryptoErrorIntrConfig */ {
#if (CY_CPU_CORTEX_M0P)
/* .intrSrc */ MY_INTR_CRYPTO_ERR_MUX,
/* .cm0pSrc */ cpuss_interrupt_crypto_IRQn,
#else
/* .intrSrc */ cpuss_interrupt_crypto_IRQn,
#endif
/* .intrPriority */ 2u,
}
};
cy_stc_crypto_server_context_t myCryptoServerContext;
cy_en_crypto_status_t cryptoStatus;
cryptoStatus = Cy_Crypto_Server_Start_Base(&myCryptoConfig, &myCryptoServerContext);
/* ... check for errors... */

◆ Cy_Crypto_Server_Start_Extra()

cy_en_crypto_status_t Cy_Crypto_Server_Start_Extra ( cy_stc_crypto_config_t const *  config,
cy_stc_crypto_server_context_t context 
)

This function starts the Extra functionality for the Crypto server on the server side core, sets up an interrupt for the IPC Crypto channel, sets up an interrupt to catch Crypto HW errors.

This function available for Server side only.

Note
The Crypto server can be run as singleton (not multi-instance) application on the one of available cores at the same time.
Parameters
configThe Crypto configuration structure.
contextThe pointer to the cy_stc_crypto_server_context_t structure that stores the Crypto server context.
Returns
cy_en_crypto_status_t

Refer to Cy_Crypto_Server_Start_Base for the function usage example.

◆ Cy_Crypto_Server_Start_Full()

cy_en_crypto_status_t Cy_Crypto_Server_Start_Full ( cy_stc_crypto_config_t const *  config,
cy_stc_crypto_server_context_t context 
)

This function starts the Full functionality for the Crypto server on the server side core, sets up an interrupt for the IPC Crypto channel, sets up an interrupt to catch Crypto HW errors.

This function available for Server side only.

Note
The Crypto server can be run as singleton (not multi-instance) application on the one of available cores at the same time.
Parameters
configThe Crypto configuration structure.
contextThe pointer to the cy_stc_crypto_server_context_t structure that stores the Crypto server context.
Returns
cy_en_crypto_status_t

Refer to Cy_Crypto_Server_Start_Base for the function usage example.

◆ Cy_Crypto_Server_Stop()

cy_en_crypto_status_t Cy_Crypto_Server_Stop ( void  )

This function stops the Crypto server by disabling the IPC notify interrupt and Crypto error interrupt.

This function available for Server side only.

Returns
cy_en_crypto_status_t

◆ Cy_Crypto_Server_Process()

void Cy_Crypto_Server_Process ( void  )

This function parses input data received from the Crypto Client, runs the appropriate Crypto function and releases the Crypto IPC channel.

This function available for Server side only.

Note
This function should be used only when user register own GetDataHandler function.

◆ Cy_Crypto_Server_GetDataHandler()

void Cy_Crypto_Server_GetDataHandler ( void  )

This function is a IPC Crypto channel notify interrupt-routine.

It receives information from the Crypto client, runs the process if user not setup own handler.

This function available for Server side only.

◆ Cy_Crypto_Server_ErrorHandler()

void Cy_Crypto_Server_ErrorHandler ( void  )

This function is a routine to handle an interrupt caused by the Crypto hardware error.

This function available for Server side only.