|
WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
|
#include <stdint.h>#include <stdbool.h>#include "tcxo.h"#include "securec.h"#include "hal_sfc_v150_regs_op.h"#include "hal_sfc.h"
宏定义 | |
| #define | SPI_CMD_RDSR 0x05 |
| #define | SPI_CMD_RDID 0x9F |
| #define | SPI_CMD_WREN 0x06 |
| #define | STANDARD_SPI 0x0 |
| #define | ENABLE 0x1 |
| #define | DISABLE 0x0 |
| #define | READ_MODE 0x1 |
| #define | WRITE_MODE 0x0 |
| #define | FLASH_CMD_INDEX 0x0 |
| #define | FLASH_CMD_OFFSET 0x1 |
| #define | FLASH_CMD_BIT 0x2 |
| #define | FLASH_OPREATION_MAX_NUM 0x3 |
| #define | SFC_DATABUF_LENGTH 0x40 |
| #define | ADDR_SHIFT_BITS 16 |
| #define | FLASH_SIZE_D_VALUE 0xF |
| #define | SFC_V150_MIN_SIZE 0x10000 |
| #define | FLASH_ID_MASK 0xFFFFFF |
| #define | get_word_num(byte_num) (((byte_num) >> 2) + (((byte_num) & 0x3) != 0)) |
函数 | |
| STATIC errcode_t | hal_sfc_regs_wait_ready (uint8_t wip_bit) |
| STATIC errcode_t | hal_sfc_execute_type_cmd (uint8_t cmd_len, uint8_t *cmd) |
| STATIC errcode_t | hal_sfc_execute_type_proc (uint8_t cmd, uint8_t offset, uint8_t bit) |
| STATIC errcode_t | hal_sfc_execute_cmds (flash_cmd_execute_t *command) |
| STATIC errcode_t | hal_sfc_write_enable (void) |
| errcode_t | hal_sfc_dma_read (uint32_t flash_addr, uint8_t *read_buffer, uint32_t read_size) |
| SFC dma模式读操作 | |
| errcode_t | hal_sfc_dma_write (uint32_t flash_addr, uint8_t *write_data, uint32_t write_size) |
| SFC dma模式读操作。 | |
| errcode_t | hal_sfc_get_flash_id (uint32_t *flash_id) |
| 获取Flash ID操作 | |
| STATIC uint32_t | get_size (uint32_t size) |
| errcode_t | hal_sfc_init (flash_spi_ctrl_t *spi_ctrl, uint32_t mapping, uint32_t flash_size) |
| SFC 初始化操作。 | |
| void | hal_sfc_deinit (void) |
| SFC 去初始化操作。 | |
| STATIC errcode_t | hal_sfc_reg_read_once (uint32_t flash_addr, uint8_t *read_buffer, uint32_t read_size, spi_opreation_t read_opreation) |
| errcode_t | hal_sfc_reg_read (uint32_t flash_addr, uint8_t *read_buffer, uint32_t read_size, spi_opreation_t read_opreation) |
| SFC 内嵌SPI模式读操作。 | |
| STATIC errcode_t | hal_sfc_reg_write_once (uint32_t flash_addr, uint8_t *write_data, uint32_t write_size, spi_opreation_t write_opreation) |
| errcode_t | hal_sfc_reg_write (uint32_t flash_addr, uint8_t *write_data, uint32_t write_size, spi_opreation_t write_opreation) |
| SFC 内嵌SPI模式写操作。 | |
| errcode_t | hal_sfc_reg_erase (uint32_t flash_addr, spi_opreation_t erase_opreation, bool delete_chip) |
| SFC 内嵌SPI模式擦除操作。 | |
| STATIC errcode_t | hal_sfc_regs_read_flash_info (uint32_t opt_type, uint8_t cmd, uint8_t *buffer, uint32_t length) |
| STATIC errcode_t | hal_sfc_regs_set_flash_attr (uint32_t opt_type, uint8_t cmd, uint8_t *buffer, uint32_t length) |
| STATIC errcode_t | hal_sfc_regs_read_flash_unique_id (uint32_t opt_type, uint8_t cmd, uint8_t *buffer, uint32_t length) |
| errcode_t | hal_sfc_reg_flash_opreations (uint32_t opt_type, uint8_t cmd, uint8_t *buffer, uint32_t length) |
| SFC 内嵌SPI模式Flash其他操作。 | |
变量 | |
| bool | g_dma_busy = false |
| #define ADDR_SHIFT_BITS 16 |
| #define DISABLE 0x0 |
| #define ENABLE 0x1 |
| #define FLASH_CMD_BIT 0x2 |
| #define FLASH_CMD_INDEX 0x0 |
| #define FLASH_CMD_OFFSET 0x1 |
| #define FLASH_ID_MASK 0xFFFFFF |
| #define FLASH_OPREATION_MAX_NUM 0x3 |
| #define FLASH_SIZE_D_VALUE 0xF |
| #define get_word_num | ( | byte_num | ) | (((byte_num) >> 2) + (((byte_num) & 0x3) != 0)) |
| #define READ_MODE 0x1 |
| #define SFC_DATABUF_LENGTH 0x40 |
| #define SFC_V150_MIN_SIZE 0x10000 |
| #define SPI_CMD_RDID 0x9F |
| #define SPI_CMD_RDSR 0x05 |
Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2022-2022. All rights reserved.
Description: Provides SFC HAL source
History:
2022-12-01, Create file.
| #define SPI_CMD_WREN 0x06 |
| #define STANDARD_SPI 0x0 |
| #define WRITE_MODE 0x0 |
| STATIC uint32_t get_size | ( | uint32_t | size | ) |
| STATIC errcode_t hal_sfc_execute_cmds | ( | flash_cmd_execute_t * | command | ) |
| STATIC errcode_t hal_sfc_reg_read_once | ( | uint32_t | flash_addr, |
| uint8_t * | read_buffer, | ||
| uint32_t | read_size, | ||
| spi_opreation_t | read_opreation | ||
| ) |
| STATIC errcode_t hal_sfc_reg_write_once | ( | uint32_t | flash_addr, |
| uint8_t * | write_data, | ||
| uint32_t | write_size, | ||
| spi_opreation_t | write_opreation | ||
| ) |
| STATIC errcode_t hal_sfc_regs_read_flash_info | ( | uint32_t | opt_type, |
| uint8_t | cmd, | ||
| uint8_t * | buffer, | ||
| uint32_t | length | ||
| ) |
| STATIC errcode_t hal_sfc_regs_read_flash_unique_id | ( | uint32_t | opt_type, |
| uint8_t | cmd, | ||
| uint8_t * | buffer, | ||
| uint32_t | length | ||
| ) |
| STATIC errcode_t hal_sfc_regs_set_flash_attr | ( | uint32_t | opt_type, |
| uint8_t | cmd, | ||
| uint8_t * | buffer, | ||
| uint32_t | length | ||
| ) |
| bool g_dma_busy = false |