PSoC 6 Peripheral Driver Library

General Description

Functions

cy_en_crypto_status_t Cy_Crypto_Core_Enable (CRYPTO_Type *base)
 The function to enable the Crypto hardware. More...
 
cy_en_crypto_status_t Cy_Crypto_Core_Disable (CRYPTO_Type *base)
 Disables the operation of the CRYPTO block. More...
 
cy_en_crypto_status_t Cy_Crypto_Core_GetLibInfo (cy_en_crypto_lib_info_t *libInfo)
 Get Crypto service information. More...
 
cy_en_crypto_status_t Cy_Crypto_Core_SetVuMemoryAddress (CRYPTO_Type *base, uint32_t const *vuMemoryAddr, uint32_t vuMemorySize)
 Sets the new memory buffer address and size. More...
 
__STATIC_INLINE uint32_t * Cy_Crypto_Core_GetVuMemoryAddress (CRYPTO_Type *base)
 Gets Crypto memory buffer address. More...
 
uint32_t Cy_Crypto_Core_GetVuMemorySize (CRYPTO_Type *base)
 Get Crypto memory buffer size. More...
 
void Cy_Crypto_Core_InvertEndianness (void *inArrPtr, uint32_t byteSize)
 This function reverts byte-array memory block, like:
inArr[0] <—> inArr[n]
inArr[1] <—> inArr[n-1]
inArr[2] <—> inArr[n-2]
........................
inArr[n/2] <—> inArr[n/2-1]
More...
 
__STATIC_INLINE bool Cy_Crypto_Core_IsEnabled (CRYPTO_Type *base)
 The function checks whether the Crypto hardware is enabled. More...
 
__STATIC_INLINE uint8_t Cy_Crypto_Core_GetFIFODepth (CRYPTO_Type *base)
 Returns the total available number of instructions in the instruction FIFO. More...
 
__STATIC_INLINE uint8_t Cy_Crypto_Core_GetFIFOUsed (CRYPTO_Type *base)
 Returns the number of instructions in the instruction FIFO. More...
 
__STATIC_INLINE void Cy_Crypto_Core_WaitForInstrFifoAvailable (CRYPTO_Type *base, uint32_t instr)
 Waits until number of entries in the instruction FIFO is less than specified number. More...
 
__STATIC_INLINE void Cy_Crypto_Core_WaitForFifoAvailable (CRYPTO_Type *base)
 Waits until number of entries in the instruction FIFO is less than specified in EVENT_LEVEL field in FF_CTL register, an event is generated: "event" = INSTR_FF_STATUS.USED < EVENT_LEVEL. More...
 
__STATIC_INLINE void Cy_Crypto_Core_WaitForReady (CRYPTO_Type *base)
 Waits until all instruction in FIFO will be completed. More...
 
__STATIC_INLINE void Cy_Crypto_Core_Vu_WaitForComplete (CRYPTO_Type *base)
 Waits until VU instruction will be completed. More...
 
__STATIC_INLINE void Cy_Crypto_Core_SetInterruptMask (CRYPTO_Type *base, uint32_t interrupts)
 Masks / unmasks multiple interrupt sources. More...
 
__STATIC_INLINE uint32_t Cy_Crypto_Core_GetInterruptMask (CRYPTO_Type const *base)
 Reports mask / unmask multiple interrupt sources. More...
 
__STATIC_INLINE uint32_t Cy_Crypto_Core_GetInterruptStatusMasked (CRYPTO_Type const *base)
 Reports states of multiple enabled interrupt sources. More...
 
__STATIC_INLINE uint32_t Cy_Crypto_Core_GetInterruptStatus (CRYPTO_Type *base)
 Reports states of multiple interrupt sources. More...
 
__STATIC_INLINE void Cy_Crypto_Core_SetInterrupt (CRYPTO_Type *base, uint32_t interrupts)
 Sets one of more interrupt sources. More...
 
__STATIC_INLINE void Cy_Crypto_Core_ClearInterrupt (CRYPTO_Type *base, uint32_t interrupts)
 Clears multiple interrupt sources. More...
 
void Cy_Crypto_Core_ClearVuRegisters (CRYPTO_Type *base)
 The function to initialize the Crypto VU registers. More...
 
void Cy_Crypto_Core_HwInit (void)
 The function to initialize the Crypto hardware.
 

Function Documentation

◆ Cy_Crypto_Core_Enable()

cy_en_crypto_status_t Cy_Crypto_Core_Enable ( CRYPTO_Type *  base)

The function to enable the Crypto hardware.

Parameters
baseThe pointer to the CRYPTO instance.
Returns
Crypto status cy_en_crypto_status_t

◆ Cy_Crypto_Core_Disable()

cy_en_crypto_status_t Cy_Crypto_Core_Disable ( CRYPTO_Type *  base)

Disables the operation of the CRYPTO block.

Parameters
baseThe pointer to the CRYPTO instance.
Returns
cy_en_crypto_status_t

◆ Cy_Crypto_Core_GetLibInfo()

cy_en_crypto_status_t Cy_Crypto_Core_GetLibInfo ( cy_en_crypto_lib_info_t *  libInfo)

Get Crypto service information.

Parameters
libInfoThe pointer to a variable to store gathered crypto library information.
Returns
cy_en_crypto_status_t

◆ Cy_Crypto_Core_SetVuMemoryAddress()

cy_en_crypto_status_t Cy_Crypto_Core_SetVuMemoryAddress ( CRYPTO_Type *  base,
uint32_t const *  vuMemoryAddr,
uint32_t  vuMemorySize 
)

Sets the new memory buffer address and size.

Parameters
baseThe pointer to the CRYPTO instance.
vuMemoryAddrThe memory buffer location that will be used as Crypto MEM_BUFF
vuMemorySizeThe provided memory buffer size in bytes.
Returns
cy_en_crypto_status_t
Note
This function sets the default device specific values when vuMemoryAddr parameter is NULL and vuMemorySize parameter is zero.
New memory buffer should be allocated in a memory region that is not protected by a protection scheme for use by Crypto hardware.

◆ Cy_Crypto_Core_GetVuMemoryAddress()

__STATIC_INLINE uint32_t * Cy_Crypto_Core_GetVuMemoryAddress ( CRYPTO_Type *  base)

Gets Crypto memory buffer address.

Parameters
baseThe pointer to the CRYPTO instance.
Returns
Current Crypto MEM_BUFF location address or NULL if Crypto IP is not enabled.

◆ Cy_Crypto_Core_GetVuMemorySize()

uint32_t Cy_Crypto_Core_GetVuMemorySize ( CRYPTO_Type *  base)

Get Crypto memory buffer size.

Parameters
baseThe pointer to the CRYPTO instance.
Returns
The current MEM_BUFF size in bytes.

◆ Cy_Crypto_Core_InvertEndianness()

void Cy_Crypto_Core_InvertEndianness ( void *  inArrPtr,
uint32_t  byteSize 
)

This function reverts byte-array memory block, like:
inArr[0] <—> inArr[n]
inArr[1] <—> inArr[n-1]
inArr[2] <—> inArr[n-2]
........................
inArr[n/2] <—> inArr[n/2-1]

Odd or even byteSize are acceptable.

Parameters
inArrPtrThe pointer to the memory whose endianness is to be inverted.
byteSizeThe length of the memory array whose endianness is to be inverted (in bytes)

◆ Cy_Crypto_Core_IsEnabled()

__STATIC_INLINE bool Cy_Crypto_Core_IsEnabled ( CRYPTO_Type *  base)

The function checks whether the Crypto hardware is enabled.

Parameters
baseThe pointer to the CRYPTO instance.
Returns
Crypto status cy_en_crypto_status_t

◆ Cy_Crypto_Core_GetFIFODepth()

__STATIC_INLINE uint8_t Cy_Crypto_Core_GetFIFODepth ( CRYPTO_Type *  base)

Returns the total available number of instructions in the instruction FIFO.

Parameters
baseThe pointer to the CRYPTO instance.

◆ Cy_Crypto_Core_GetFIFOUsed()

__STATIC_INLINE uint8_t Cy_Crypto_Core_GetFIFOUsed ( CRYPTO_Type *  base)

Returns the number of instructions in the instruction FIFO.

The value of this field ranges from 0 to 8

Parameters
baseThe pointer to the CRYPTO instance.

◆ Cy_Crypto_Core_WaitForInstrFifoAvailable()

__STATIC_INLINE void Cy_Crypto_Core_WaitForInstrFifoAvailable ( CRYPTO_Type *  base,
uint32_t  instr 
)

Waits until number of entries in the instruction FIFO is less than specified number.

Parameters
baseThe pointer to the CRYPTO instance.
instrThe number of needed available space in the instruction FIFO.

◆ Cy_Crypto_Core_WaitForFifoAvailable()

__STATIC_INLINE void Cy_Crypto_Core_WaitForFifoAvailable ( CRYPTO_Type *  base)

Waits until number of entries in the instruction FIFO is less than specified in EVENT_LEVEL field in FF_CTL register, an event is generated: "event" = INSTR_FF_STATUS.USED < EVENT_LEVEL.

By default EVENT_LEVEL = 0;

Parameters
baseThe pointer to the CRYPTO instance.

◆ Cy_Crypto_Core_WaitForReady()

__STATIC_INLINE void Cy_Crypto_Core_WaitForReady ( CRYPTO_Type *  base)

Waits until all instruction in FIFO will be completed.

Parameters
baseThe pointer to the CRYPTO instance.

◆ Cy_Crypto_Core_Vu_WaitForComplete()

__STATIC_INLINE void Cy_Crypto_Core_Vu_WaitForComplete ( CRYPTO_Type *  base)

Waits until VU instruction will be completed.

Parameters
baseThe pointer to the CRYPTO instance.

◆ Cy_Crypto_Core_SetInterruptMask()

__STATIC_INLINE void Cy_Crypto_Core_SetInterruptMask ( CRYPTO_Type *  base,
uint32_t  interrupts 
)

Masks / unmasks multiple interrupt sources.

Parameters
baseThe pointer to the CRYPTO instance.
interruptsMask bits. See definitions above.

◆ Cy_Crypto_Core_GetInterruptMask()

__STATIC_INLINE uint32_t Cy_Crypto_Core_GetInterruptMask ( CRYPTO_Type const *  base)

Reports mask / unmask multiple interrupt sources.

Parameters
baseThe pointer to the CRYPTO instance.
Returns
Mask bits. See definitions above.

◆ Cy_Crypto_Core_GetInterruptStatusMasked()

__STATIC_INLINE uint32_t Cy_Crypto_Core_GetInterruptStatusMasked ( CRYPTO_Type const *  base)

Reports states of multiple enabled interrupt sources.

Parameters
baseThe pointer to the CRYPTO instance.
Returns
Source bits. See definitions above.

◆ Cy_Crypto_Core_GetInterruptStatus()

__STATIC_INLINE uint32_t Cy_Crypto_Core_GetInterruptStatus ( CRYPTO_Type *  base)

Reports states of multiple interrupt sources.

Parameters
baseThe pointer to the CRYPTO instance.
Returns
Source bits. See definitions above.

◆ Cy_Crypto_Core_SetInterrupt()

__STATIC_INLINE void Cy_Crypto_Core_SetInterrupt ( CRYPTO_Type *  base,
uint32_t  interrupts 
)

Sets one of more interrupt sources.

Parameters
baseThe pointer to the CRYPTO instance.
interruptsSource bit(s)

◆ Cy_Crypto_Core_ClearInterrupt()

__STATIC_INLINE void Cy_Crypto_Core_ClearInterrupt ( CRYPTO_Type *  base,
uint32_t  interrupts 
)

Clears multiple interrupt sources.

Parameters
baseThe pointer to the CRYPTO instance.
interruptsSource bit(s). See definitions above.

◆ Cy_Crypto_Core_ClearVuRegisters()

void Cy_Crypto_Core_ClearVuRegisters ( CRYPTO_Type *  base)

The function to initialize the Crypto VU registers.

Parameters
baseThe pointer to the CRYPTO instance.