Functions
IO operation functions
Peripheral Driver » HAL Driver » EFUSE » Functions

eFuse Data manage functions More...

## Functions
hal_status_t | hal_efuse_write (efuse_handle_t *p_efuse, uint32_t word_offset, uint32_t *p_data, uint32_t nword)
| Write the eFuse memory data. More...
hal_status_t | hal_efuse_read (efuse_handle_t *p_efuse, uint32_t word_offset, uint32_t *p_data, uint32_t nword)
| Read the eFuse memory data. More...
hal_status_t | hal_efuse_write_keyram (efuse_handle_t *p_efuse, keyram_mask_t *p_mask)
| Read the key from eFuse memory and write to keyram. More...
hal_status_t | hal_efuse_initial_value_check (efuse_handle_t *p_efuse)
| Check the eFuse memory with 0, if memory are all 0, return HAL_OK, then return HAL_ERROR. More...
hal_status_t | hal_efuse_crc_calculate (efuse_handle_t *p_efuse, uint32_t word_offset, uint32_t nword, uint32_t *p_result)
| Calculate CRC of the eFuse memory data. More...
hal_status_t | hal_efuse_read_trim (efuse_handle_t *p_efuse, uint32_t word_offset, uint32_t *p_data, uint32_t nword)
| Read trim from eFuse memory data. More...
hal_status_t | hal_efuse_set_main_backup (efuse_handle_t *p_efuse)
| Set the main or backup info of the eFuse memory. More...

## Detailed Description

eFuse Data manage functions

## Function Documentation

## ◆ hal_efuse_crc_calculate()

hal_status_t hal_efuse_crc_calculate | ( | efuse_handle_t * | p_efuse,
|  | uint32_t | word_offset,
|  | uint32_t | nword,
|  | uint32_t * | p_result
| ) |  |

Calculate CRC of the eFuse memory data.

Note
  Address must be main info eFuse memory address.

Parameters

  [in] | p_efuse | Pointer to a eFuse handle which contains the configuration information for the specified eFuse module.
  [in] | word_offset | eFuse memory offset, unit word, this parament can be a value between: 0x00 ~ 0x80.
  [in] | nword | Size of data to be read, unit word, this parament can be a value between: 1 ~ 60.
  [in] | p_result | Pointer to result.

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_efuse_initial_value_check()

hal_status_t hal_efuse_initial_value_check | ( | efuse_handle_t * | p_efuse | ) |

Check the eFuse memory with 0, if memory are all 0, return HAL_OK, then return HAL_ERROR.

Parameters

  [in] | p_efuse | Pointer to a eFuse handle which contains the configuration information for the specified eFuse module.

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_efuse_read()

hal_status_t hal_efuse_read | ( | efuse_handle_t * | p_efuse,
|  | uint32_t | word_offset,
|  | uint32_t * | p_data,
|  | uint32_t | nword
| ) |  |

Read the eFuse memory data.

Note
  Address should be eFuse memory address.

Parameters

  [in] | p_efuse | Pointer to a eFuse handle which contains the configuration information for the specified eFuse module.
  [in] | word_offset | eFuse memory offset, unit word, this parament can be a value between: 0x000 ~ 0x80.
  [in] | p_data | Pointer to data buffer for storage eFuse data.
  [in] | nword | Size of data to be read, unit word.

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_efuse_read_trim()

hal_status_t hal_efuse_read_trim | ( | efuse_handle_t * | p_efuse,
|  | uint32_t | word_offset,
|  | uint32_t * | p_data,
|  | uint32_t | nword
| ) |  |

Read trim from eFuse memory data.

Note
  Address must be main info eFuse memory address.

Parameters

  [in] | p_efuse | Pointer to a eFuse handle which contains the configuration information for the specified eFuse module.
  [in] | word_offset | eFuse memory offset, unit word, this parament can be a value between: 0x00 ~ 0x80.
  [in] | p_data | Pointer to data buffer for storage eFuse data.
  [in] | nword | Size of data to be read, unit word, this parament can be a value between: 1 ~ 20.

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_efuse_set_main_backup()

hal_status_t hal_efuse_set_main_backup | ( | efuse_handle_t * | p_efuse | ) |

Set the main or backup info of the eFuse memory.

Parameters

  [in] | p_efuse | Pointer to a eFuse handle which contains the configuration information for the specified eFuse module.

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_efuse_write()

hal_status_t hal_efuse_write | ( | efuse_handle_t * | p_efuse,
|  | uint32_t | word_offset,
|  | uint32_t * | p_data,
|  | uint32_t | nword
| ) |  |

Write the eFuse memory data.

Note
  Address should be eFuse memory address.

Parameters

  [in] | p_efuse | Pointer to a eFuse handle which contains the configuration information for the specified eFuse module.
  [in] | word_offset | eFuse memory offset, unit word, this parament can be a value between: 0x00 ~ 0x80.
  [in] | p_data | Pointer to data buffer for storage eFuse data.
  [in] | nword | Size of data to be write, unit word.

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_efuse_write_keyram()

hal_status_t hal_efuse_write_keyram | ( | efuse_handle_t * | p_efuse,
|  | keyram_mask_t * | p_mask
| ) |  |

Read the key from eFuse memory and write to keyram.

Parameters

  [in] | p_efuse | Pointer to a eFuse handle which contains the configuration information for the specified eFuse module.
  [in] | p_mask | Pointer to a KEYRAM handle which contains the configuration information for the specified KEYRAM MASK.

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.