HPM SDK
HPMicro Software Development Kit
BKEY driver APIs

BKEY driver APIs. More...

Typedefs

typedef enum bkey_lock_type bkey_lock_type_t
 Lock type. More...
 

Enumerations

enum  bkey_lock_type { bkey_lock_write = BKEY_ECC_WLOCK_MASK , bkey_lock_read = BKEY_ECC_RLOCK_MASK , bkey_lock_both = BKEY_ECC_RLOCK_MASK | BKEY_ECC_WLOCK_MASK }
 Lock type. More...
 

Functions

static void bkey_set_key_data (BKEY_Type *ptr, uint8_t key, uint8_t start, uint32_t *data, uint8_t size)
 bkey set key content More...
 
static void bkey_get_key_data (BKEY_Type *ptr, uint8_t key, uint8_t start, uint32_t *data, uint8_t size)
 bkey fetch key content More...
 
static void bkey_lock (BKEY_Type *ptr, uint8_t key, bkey_lock_type_t lock, uint16_t ecc)
 bkey lock key More...
 
static void bkey_select_key (BKEY_Type *ptr, uint8_t key)
 bkey select key More...
 

Detailed Description

BKEY driver APIs.

Typedef Documentation

◆ bkey_lock_type_t

#include <drivers/inc/hpm_bkey_drv.h>

Lock type.

Enumeration Type Documentation

◆ bkey_lock_type

#include <drivers/inc/hpm_bkey_drv.h>

Lock type.

Enumerator
bkey_lock_write 
bkey_lock_read 
bkey_lock_both 

Function Documentation

◆ bkey_get_key_data()

static void bkey_get_key_data ( BKEY_Type ptr,
uint8_t  key,
uint8_t  start,
uint32_t *  data,
uint8_t  size 
)
inlinestatic

#include <drivers/inc/hpm_bkey_drv.h>

bkey fetch key content

Fetch key content

Parameters
[in]ptrBKEY base address
[in]keykey index
[in]startkey content data start index
[in]datapointer of buffer to received key content
[in]sizedata total size in 32-bit

◆ bkey_lock()

static void bkey_lock ( BKEY_Type ptr,
uint8_t  key,
bkey_lock_type_t  lock,
uint16_t  ecc 
)
inlinestatic

#include <drivers/inc/hpm_bkey_drv.h>

bkey lock key

Feed correct ecc data of current key content and lock it

Parameters
[in]ptrBKEY base address
[in]keykey index
[in]locklock type
[in]eccecc value of current key content

◆ bkey_select_key()

static void bkey_select_key ( BKEY_Type ptr,
uint8_t  key 
)
inlinestatic

#include <drivers/inc/hpm_bkey_drv.h>

bkey select key

Select which key to use

Parameters
[in]ptrBKEY base address
[in]keykey index
  • 0 select key0 in secure mode, key1 in non-secure mode
  • 1 select key1 in secure or non-secure mode

◆ bkey_set_key_data()

static void bkey_set_key_data ( BKEY_Type ptr,
uint8_t  key,
uint8_t  start,
uint32_t *  data,
uint8_t  size 
)
inlinestatic

#include <drivers/inc/hpm_bkey_drv.h>

bkey set key content

Program key content

Parameters
[in]ptrBKEY base address
[in]keyKey index
[in]startKey content data start index
[in]datapointer of actual data to be programmed
[in]sizedata total size in 32-bit