Functions

group group_crypto_lld_hw_functions

Functions

void Cy_Crypto_Core_ClearVuRegisters(CRYPTO_Type *base)

The function to initialize the Crypto VU registers.

Parameters
  • base: The pointer to the CRYPTO instance.

void Cy_Crypto_Core_HwInit(void)

The function to initialize the Crypto hardware.

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.

note

This function sets the default device specific values when vuMemoryAddr parameter is NULL and vuMemorySize parameter is zero.

note

New memory buffer should be allocated in a memory region that is not protected by a protection scheme for use by Crypto hardware.

Return

cy_en_crypto_status_t

Parameters
  • base: The pointer to the CRYPTO instance.

  • vuMemoryAddr: The memory buffer location that will be used as Crypto MEM_BUFF

  • vuMemorySize: The provided memory buffer size in bytes.

uint32_t Cy_Crypto_Core_GetVuMemorySize(CRYPTO_Type *base)

Get Crypto memory buffer size.

Return

The current MEM_BUFF size in bytes.

Parameters
  • base: The pointer to the CRYPTO instance.

cy_en_crypto_status_t Cy_Crypto_Core_Enable(CRYPTO_Type *base)

The function to enable the Crypto hardware.

Return

Crypto status cy_en_crypto_status_t

Parameters
  • base: The pointer to the CRYPTO instance.

cy_en_crypto_status_t Cy_Crypto_Core_GetLibInfo(cy_en_crypto_lib_info_t *libInfo)

Get Crypto service information.

Return

cy_en_crypto_status_t

Parameters
  • libInfo: The pointer to a variable to store gathered crypto library information.

cy_en_crypto_status_t Cy_Crypto_Core_Disable(CRYPTO_Type *base)

Disables the operation of the CRYPTO block.

Return

cy_en_crypto_status_t

Parameters
  • base: The pointer to the CRYPTO instance.

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
  • inArrPtr: The pointer to the memory whose endianness is to be inverted.

  • byteSize: The length of the memory array whose endianness is to be inverted (in bytes)

__STATIC_INLINE void * Cy_Crypto_Core_GetVuMemoryAddress (CRYPTO_Type *base)

Gets Crypto memory buffer address.

Return

Current Crypto MEM_BUFF location address or NULL if Crypto IP is not enabled.

Parameters
  • base: The pointer to the CRYPTO instance.

__STATIC_INLINE bool Cy_Crypto_Core_IsEnabled (CRYPTO_Type *base)

The function checks whether the Crypto hardware is enabled.

Return

Crypto status cy_en_crypto_status_t

Parameters
  • base: The pointer to the CRYPTO instance.

__STATIC_INLINE uint8_t Cy_Crypto_Core_GetFIFODepth (CRYPTO_Type *base)

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

Parameters
  • base: The pointer to the CRYPTO instance.

__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
  • base: The pointer to the CRYPTO instance.

__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
  • base: The pointer to the CRYPTO instance.

  • instr: The number of needed available space in the instruction FIFO.

__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
  • base: The pointer to the CRYPTO instance.

__STATIC_INLINE void Cy_Crypto_Core_WaitForReady (CRYPTO_Type *base)

Waits until all instruction in FIFO will be completed.

Parameters
  • base: The pointer to the CRYPTO instance.

__STATIC_INLINE void Cy_Crypto_Core_Vu_WaitForComplete (CRYPTO_Type *base)

Waits until VU instruction will be completed.

Parameters
  • base: The pointer to the CRYPTO instance.

__STATIC_INLINE void Cy_Crypto_Core_SetInterruptMask (CRYPTO_Type *base, uint32_t interrupts)

Masks / unmasks multiple interrupt sources.

Parameters
  • base: The pointer to the CRYPTO instance.

  • interrupts: Mask bits. See definitions above.

__STATIC_INLINE uint32_t Cy_Crypto_Core_GetInterruptMask (CRYPTO_Type const *base)

Reports mask / unmask multiple interrupt sources.

Return

Mask bits. See definitions above.

Parameters
  • base: The pointer to the CRYPTO instance.

__STATIC_INLINE uint32_t Cy_Crypto_Core_GetInterruptStatusMasked (CRYPTO_Type const *base)

Reports states of multiple enabled interrupt sources.

Return

Source bits. See definitions above.

Parameters
  • base: The pointer to the CRYPTO instance.

__STATIC_INLINE uint32_t Cy_Crypto_Core_GetInterruptStatus (CRYPTO_Type *base)

Reports states of multiple interrupt sources.

Return

Source bits. See definitions above.

Parameters
  • base: The pointer to the CRYPTO instance.

__STATIC_INLINE void Cy_Crypto_Core_SetInterrupt (CRYPTO_Type *base, uint32_t interrupts)

Sets one of more interrupt sources.

Parameters
  • base: The pointer to the CRYPTO instance.

  • interrupts: Source bit(s)

__STATIC_INLINE void Cy_Crypto_Core_ClearInterrupt (CRYPTO_Type *base, uint32_t interrupts)

Clears multiple interrupt sources.

Parameters
  • base: The pointer to the CRYPTO instance.

  • interrupts: Source bit(s). See definitions above.