![]() |
MAX32672 Peripheral Driver API
Peripheral Driver API for the MAX32672
|
Modules | |
| CTB_Registers | |
Data Structures | |
| struct | mxc_ctb_dma_req_t |
| struct | mxc_ctb_ecc_req_t |
| struct | mxc_ctb_crc_req_t |
| struct | mxc_ctb_hash_req_t |
| struct | mxc_ctb_cipher_req_t |
Typedefs | |
| typedef void(* | mxc_ctb_complete_cb_t) (void *req, int result) |
Enumerations | |
| enum | mxc_ctb_features_t |
| enum | mxc_ctb_dma_read_source_t |
| enum | mxc_ctb_dma_write_source_t |
| enum | mxc_ctb_crc_bitorder_t |
| enum | mxc_ctb_hash_func_t |
| enum | mxc_ctb_hash_source_t |
| enum | mxc_ctb_cipher_mode_t |
| enum | mxc_ctb_cipher_t |
| enum | mxc_ctb_cipher_key_t |
| enum | mxc_ctb_cipher_operation_t |
| struct mxc_ctb_dma_req_t |
Structure for using DMA with CTB.
Data Fields | |
| uint8_t * | sourceBuffer |
| uint8_t * | destBuffer |
| uint32_t | length |
| mxc_ctb_complete_cb_t | callback |
| struct mxc_ctb_ecc_req_t |
Structure used to set up ECC request.
| struct mxc_ctb_crc_req_t |
Structure used to set up CRC request.
| struct mxc_ctb_hash_req_t |
Structure used to set up Hash request.
| struct mxc_ctb_cipher_req_t |
Structure used to set up Cipher request.
| enum mxc_ctb_cipher_t |
| void MXC_CTB_CacheInvalidate | ( | void | ) |
Invalidates the CTB's internal cache.
| uint32_t MXC_CTB_CheckFeatures | ( | void | ) |
Detects what CTB features exist, see mxc_ctb_features_t.
| int MXC_CTB_Cipher_Decrypt | ( | mxc_ctb_cipher_req_t * | req | ) |
Perform a decryption using the cipher feature.
| req | Structure containing data for the decryption |
| void MXC_CTB_Cipher_DecryptAsync | ( | mxc_ctb_cipher_req_t * | req | ) |
Perform a decryption using the cipher feature.
| req | Structure containing data for the decryption |
| int MXC_CTB_Cipher_Encrypt | ( | mxc_ctb_cipher_req_t * | req | ) |
Perform an encryption using the cipher feature.
| req | Structure containing data for the encryption |
| void MXC_CTB_Cipher_EncryptAsync | ( | mxc_ctb_cipher_req_t * | req | ) |
Perform an encryption using the cipher feature.
| req | Structure containing data for the encryption |
| unsigned int MXC_CTB_Cipher_GetBlockSize | ( | mxc_ctb_cipher_t | cipher | ) |
Get the block size for a given cipher type.
| cipher | See mxc_ctb_cipher_t for options |
| mxc_ctb_cipher_t MXC_CTB_Cipher_GetCipher | ( | void | ) |
Get the cipher type used for cipher operations.
| void MXC_CTB_Cipher_GetIV | ( | uint8_t * | ivOut, |
| uint32_t | len | ||
| ) |
Get the initial value used for cipher operations.
| ivOut | buffer containing iv |
| len | length of buffer |
| unsigned int MXC_CTB_Cipher_GetKeySize | ( | mxc_ctb_cipher_t | cipher | ) |
Get the key size for a given cipher type.
| cipher | See mxc_ctb_cipher_t for options |
| mxc_ctb_cipher_key_t MXC_CTB_Cipher_GetKeySource | ( | void | ) |
Get the cipher type used for cipher operations.
| mxc_ctb_cipher_mode_t MXC_CTB_Cipher_GetMode | ( | void | ) |
Get the block mode used for cipher operations.
| void MXC_CTB_Cipher_SetCipher | ( | mxc_ctb_cipher_t | cipher | ) |
Set the cipher type used for cipher operations.
| cipher | See mxc_ctb_cipher_t for options |
| void MXC_CTB_Cipher_SetIV | ( | uint8_t * | iv, |
| uint32_t | len | ||
| ) |
Set the initial value used for cipher operations.
| iv | buffer containing iv |
| len | length of initial value |
| void MXC_CTB_Cipher_SetKey | ( | uint8_t * | key, |
| uint32_t | len | ||
| ) |
Set the cipher key.
| key | buffer containing key |
| len | length of key (dependent on cipher used) |
| void MXC_CTB_Cipher_SetKeySource | ( | mxc_ctb_cipher_key_t | source | ) |
Set the source of the key used in cipher operations.
| source | See mxc_ctb_cipher_key_t for options |
| void MXC_CTB_Cipher_SetMode | ( | mxc_ctb_cipher_mode_t | mode | ) |
Set the block mode used for cipher operations.
| mode | See mxc_ctb_cipher_mode_t for options |
| void MXC_CTB_Cipher_SetOperation | ( | mxc_ctb_cipher_operation_t | operation | ) |
Configure for encryption or decryption.
| operation | Set to perform encryption/decryption mxc_ctb_cipher_operation_t |
| int MXC_CTB_CRC_Compute | ( | mxc_ctb_crc_req_t * | req | ) |
Perform a CRC computation.
| req | Structure containing the data for calculation |
| void MXC_CTB_CRC_ComputeAsync | ( | mxc_ctb_crc_req_t * | req | ) |
Perform a CRC computation asynchronously.
| req | Structure containing the data for calculation |
| mxc_ctb_crc_bitorder_t MXC_CTB_CRC_GetDirection | ( | void | ) |
Set the bit-order of CRC calculation.
| uint32_t MXC_CTB_CRC_GetPoly | ( | void | ) |
Get the polynomial for CRC calculation.
| uint32_t MXC_CTB_CRC_GetResult | ( | void | ) |
Get the result of a CRC calculation.
| void MXC_CTB_CRC_SetDirection | ( | mxc_ctb_crc_bitorder_t | bitOrder | ) |
Set the bit-order of CRC calculation.
| bitOrder | The direction to perform CRC calculation in, mxc_ctb_crc_bitorder_t |
| void MXC_CTB_CRC_SetFinalXORValue | ( | uint32_t | xor | ) |
Set the value that will be bitwise XORed with the final output from the CRC computation. Use 0 to skip the XOR step.
| xor | The value that will be XORed with the CRC |
| void MXC_CTB_CRC_SetInitialValue | ( | uint32_t | seed | ) |
Set the intial value used (the seed) when starting a CRC computation.
| seed | The value to seed the CRC generator with |
| void MXC_CTB_CRC_SetPoly | ( | uint32_t | poly | ) |
Set the Polynomial for CRC calculation.
| poly | The polynomial to use for CRC calculation |
| int MXC_CTB_DMA_DoOperation | ( | mxc_ctb_dma_req_t * | req | ) |
Start a DMA transfer defined by the request object Blocks until completion.
| req | request structure that contains the source and destination information. A destination address of NULL will indicate that the Read Source has been set as something other than memory. |
| mxc_ctb_dma_read_source_t MXC_CTB_DMA_GetReadSource | ( | void | ) |
Get the source the DMA reads from.
| mxc_ctb_dma_write_source_t MXC_CTB_DMA_GetWriteSource | ( | void | ) |
Set the source the DMA write fifo reads from.
| void MXC_CTB_DMA_SetDestination | ( | uint8_t * | dest | ) |
Set the destination address of the DMA.
| dest | pointer to destination |
| void MXC_CTB_DMA_SetReadSource | ( | mxc_ctb_dma_read_source_t | source | ) |
Set the source the DMA reads from.
| source | The source of the data for DMA read operations see mxc_ctb_dma_read_source_t for a list of sources |
| void MXC_CTB_DMA_SetSource | ( | uint8_t * | source | ) |
Set the source address of the DMA.
| source | pointer to the source location |
| int MXC_CTB_DMA_SetupOperation | ( | mxc_ctb_dma_req_t * | req | ) |
Set the source and destination addresses of the DMA.
| req | request structure that contains the source and destination information. A destination address of NULL will indicate that the Read Source has been set as something other than memory. |
| void MXC_CTB_DMA_SetWriteSource | ( | mxc_ctb_dma_write_source_t | source | ) |
Set the source the DMA write fifo reads from.
| source | The source of the data for DMA write operations see mxc_ctb_dma_write_source_t for a list of sources |
| void MXC_CTB_DMA_StartTransfer | ( | uint32_t | length | ) |
Start a DMA transfer of fixed size.
| length | Number of bytes to transfer |
| uint32_t MXC_CTB_Done | ( | void | ) |
Returns CTB features showing operations complete, see mxc_ctb_features_t.
| void MXC_CTB_DoneClear | ( | uint32_t | features | ) |
Clears the selected feature's done bits, see mxc_ctb_features_t.
| features | bit banded value indicating features to clear |
| int MXC_CTB_ECC_Compute | ( | mxc_ctb_ecc_req_t * | req | ) |
Compute the ECC value for a block of data up to 8kB in size.
| req | Structure containing data for the ECC request |
| void MXC_CTB_ECC_ComputeAsync | ( | mxc_ctb_ecc_req_t * | req | ) |
Compute the ECC value for a block of data up to 8kB in size.
| req | Structure containing data for the ECC request |
| void MXC_CTB_ECC_Disable | ( | void | ) |
Disable ECC Calculation.
| void MXC_CTB_ECC_Enable | ( | void | ) |
Enable ECC Calculation.
| int MXC_CTB_ECC_ErrorCheck | ( | mxc_ctb_ecc_req_t * | req | ) |
Check for single or dual bit errors in a block of data.
| req | Structure containing data for the ECC request |
| void MXC_CTB_ECC_ErrorCheckAsync | ( | mxc_ctb_ecc_req_t * | req | ) |
Check for single or dual bit errors in a block of data.
| req | Structure containing data for the ECC request |
| uint32_t MXC_CTB_ECC_GetResult | ( | void | ) |
Get the Result of an ECC Calculation.
| uint32_t MXC_CTB_GetEnabledFeatures | ( | void | ) |
Check which CTB features are enabled.
| int MXC_CTB_Hash_Compute | ( | mxc_ctb_hash_req_t * | req | ) |
Compute a Hash Digest.
| req | Structure containing all data needed for a hash computation |
| void MXC_CTB_Hash_ComputeAsync | ( | mxc_ctb_hash_req_t * | req | ) |
Compute a Hash Digest.
| req | Structure containing all data needed for a hash computation |
| int MXC_CTB_Hash_GetAutoPad | ( | void | ) |
Get whether to use automatic padding of the input data.
| unsigned int MXC_CTB_Hash_GetBlockSize | ( | mxc_ctb_hash_func_t | function | ) |
Get the block size for a given hash function.
| function | See mxc_ctb_hash_func_t for options |
| unsigned int MXC_CTB_Hash_GetDigestSize | ( | mxc_ctb_hash_func_t | function | ) |
Get the digest size for a given hash function.
| function | See mxc_ctb_hash_func_t for options |
| mxc_ctb_hash_func_t MXC_CTB_Hash_GetFunction | ( | void | ) |
Get the algorithm to use for hash computation.
| void MXC_CTB_Hash_GetResult | ( | uint8_t * | digest, |
| int * | len | ||
| ) |
Get the result of a hash computation.
| digest | buffer to store the ouctbt of the hash algorithm |
| len | location to store the length of the digest |
| mxc_ctb_hash_source_t MXC_CTB_Hash_GetSource | ( | void | ) |
Get the source of data for the hash computation.
| void MXC_CTB_Hash_InitializeHash | ( | void | ) |
Initialize the hash computation unit.
| void MXC_CTB_Hash_SetAutoPad | ( | int | pad | ) |
Set whether to use automatic padding of the input data.
| pad | Use hardware padding of the data |
| void MXC_CTB_Hash_SetFunction | ( | mxc_ctb_hash_func_t | function | ) |
Set the algorithm to use for hash computation.
| function | See mxc_ctb_hash_func_t for options |
| void MXC_CTB_Hash_SetMessageSize | ( | uint32_t | size | ) |
Set the size of the data input into the hash computation.
| size | Size of the data in bytes |
| void MXC_CTB_Hash_SetSource | ( | mxc_ctb_hash_source_t | source | ) |
Set the source of data for the hash computation.
| source | see mxc_ctb_hash_source_t for options |
| int MXC_CTB_Init | ( | uint32_t | features | ) |
Enable portions of the CTB.
| features | bit banded value indicating features to enable see mxc_ctb_features_t for a list of features |
| int MXC_CTB_Ready | ( | void | ) |
Checks the global CTB Ready Status.
| void MXC_CTB_Reset | ( | uint32_t | features | ) |
Resets the selected features, see mxc_ctb_features_t.
| features | bit banded value indicating features to reset |
| int MXC_CTB_Shutdown | ( | uint32_t | features | ) |
Disable and reset portions of the CTB.
| features | bit banded value indicating features to shutdown see mxc_ctb_features_t for a list of features |
| int MXC_CTB_TRNG_Random | ( | uint8_t * | data, |
| uint32_t | len | ||
| ) |
Get a random number of length len.
| data | Pointer to a location to store the number |
| len | Length of random number in bytes |
| void MXC_CTB_TRNG_RandomAsync | ( | uint8_t * | data, |
| uint32_t | len, | ||
| mxc_ctb_complete_cb_t | callback | ||
| ) |
Get a random number of length len, do not block while generating data.
| data | Pointer to a location to store the number |
| len | Length of random number in bytes |
| callback | Function that will be called when all data has been generated |
| int MXC_CTB_TRNG_RandomInt | ( | void | ) |
Get a random number.