73 #define CSEC_STATUS_BUSY (0x1U)
75 #define CSEC_STATUS_SECURE_BOOT (0x2U)
78 #define CSEC_STATUS_BOOT_INIT (0x4U)
82 #define CSEC_STATUS_BOOT_FINISHED (0x8U)
85 #define CSEC_STATUS_BOOT_OK (0x10U)
87 #define CSEC_STATUS_RND_INIT (0x20U)
89 #define CSEC_STATUS_EXT_DEBUGGER (0x40U)
92 #define CSEC_STATUS_INT_DEBUGGER (0x80U)
192 #define CSEC_NO_ERROR 0x1U
193 #define CSEC_SEQUENCE_ERROR 0x2U
194 #define CSEC_KEY_NOT_AVAILABLE 0x4U
195 #define CSEC_KEY_INVALID 0x8U
196 #define CSEC_KEY_EMPTY 0x10U
197 #define CSEC_NO_SECURE_BOOT 0x20U
198 #define CSEC_KEY_WRITE_PROTECTED 0x40U
199 #define CSEC_KEY_UPDATE_ERROR 0x80U
200 #define CSEC_RNG_SEED 0x100U
201 #define CSEC_NO_DEBUGGING 0x200U
202 #define CSEC_MEMORY_FAILURE 0x400U
203 #define CSEC_GENERAL_ERROR 0x800U
210 #if defined(__cplusplus)
413 return (
FTFC->FCSESTAT);
447 static inline void CSEC_HAL_SetInterrupt(
bool enable)
449 uint8_t tmp =
FTFC->FCNFG;
454 #if defined(__cplusplus)
#define CSE_PRAM_RAMn_DATA_32_BYTE_1(x)
#define CSEC_KEY_WRITE_PROTECTED
static void CSEC_HAL_WaitCommandCompletion(void)
Waits for the completion of a CSEc command.
#define FTFC_FSTAT_CCIF_MASK
#define END_FUNCTION_DECLARATION_RAMSECTION
static void CSEC_HAL_WriteCommandHeader(csec_cmd_t funcId, csec_func_format_t funcFormat, csec_call_sequence_t callSeq, csec_key_id_t keyId)
Writes the command header to CSE_PRAM.
START_FUNCTION_DECLARATION_RAMSECTION void CSEC_HAL_WriteCmdAndWait(csec_cmd_t funcId, csec_func_format_t funcFormat, csec_call_sequence_t callSeq, csec_key_id_t keyId) END_FUNCTION_DECLARATION_RAMSECTION static inline void CSEC_HAL_SetInterrupt(bool enable)
Writes the command header to CSE_PRAM and waits for completion.
#define CSE_PRAM_RAMn_DATA_32_BYTE_3(x)
#define FTFC_FCNFG_CCIE(x)
void CSEC_HAL_WriteCommandBytes(uint8_t offset, const uint8_t *bytes, uint8_t numBytes)
Writes command bytes to CSE_PRAM.
static csec_status_t CSEC_HAL_ReadStatus(void)
Reads the status of the CSEc module.
csec_cmd_t
CSEc commands which follow the same values as the SHE command definition.
#define CSEC_NO_SECURE_BOOT
#define START_FUNCTION_DECLARATION_RAMSECTION
Places a function in RAM.
#define CSEC_KEY_UPDATE_ERROR
status_t
Status return codes. Common error codes will be a unified enumeration (C enum) that will contain all ...
void CSEC_HAL_ReadCommandWords(uint8_t offset, uint32_t *words, uint8_t numWords)
Reads command words from CSE_PRAM.
void CSEC_HAL_ReadCommandBytes(uint8_t offset, uint8_t *bytes, uint8_t numBytes)
Reads command bytes from CSE_PRAM.
void CSEC_HAL_WriteCommandWords(uint8_t offset, const uint32_t *words, uint8_t numWords)
Writes command words to CSE_PRAM.
#define CSEC_KEY_NOT_AVAILABLE
#define CSE_PRAM_RAMn_DATA_32_BYTE_0(x)
static status_t CSEC_HAL_ReadErrorBits(void)
Reads the error bits from PRAM.
#define CSEC_GENERAL_ERROR
csec_func_format_t
Specifies how the data is transferred to/from the CSE. There are two use cases. One is to copy all da...
uint8_t CSEC_HAL_ReadCommandByte(uint8_t offset)
Reads a command byte from CSE_PRAM.
uint8_t csec_status_t
Represents the status of the CSEc module. Provides one bit for each status code as per SHE specificat...
#define CSE_PRAM_RAMn_DATA_32_BYTE_2(x)
#define CSEC_SEQUENCE_ERROR
csec_call_sequence_t
Specifies if the information is the first or a following function call.
#define FEATURE_CSEC_ERROR_BITS_OFFSET
CSE_PRAM offset of the error bits field contained by all commands.
#define CSEC_NO_ERROR
Represents the result of the execution of a command. Provides one bit for each error code as per SHE ...
#define CSEC_MEMORY_FAILURE
void CSEC_HAL_WriteCommandHalfWord(uint8_t offset, uint16_t halfWord)
Writes a command half word to CSE_PRAM.
csec_key_id_t
Specify the KeyID to be used to implement the requested cryptographic operation.
uint16_t CSEC_HAL_ReadCommandHalfWord(uint8_t offset)
Reads a command half word from CSE_PRAM.
#define CSEC_NO_DEBUGGING
#define FTFC_FCNFG_CCIE_MASK
void CSEC_HAL_WriteCommandByte(uint8_t offset, uint8_t byte)
Writes a command byte to CSE_PRAM.