mirror of
https://github.com/eclipse-threadx/levelx.git
synced 2026-09-14 04:06:00 +08:00
87 lines
4.7 KiB
C
87 lines
4.7 KiB
C
/***************************************************************************
|
|
* Copyright (c) 2024 Microsoft Corporation
|
|
* Copyright (c) 2026-present Eclipse ThreadX contributors
|
|
*
|
|
* This program and the accompanying materials are made available under the
|
|
* terms of the MIT License which is available at
|
|
* https://opensource.org/licenses/MIT.
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
**************************************************************************/
|
|
|
|
|
|
/**************************************************************************/
|
|
/**************************************************************************/
|
|
/** */
|
|
/** LevelX Component */
|
|
/** */
|
|
/** NAND Flash */
|
|
/** */
|
|
/**************************************************************************/
|
|
/**************************************************************************/
|
|
|
|
#define LX_SOURCE_CODE
|
|
|
|
|
|
/* Disable ThreadX error checking. */
|
|
|
|
#ifndef LX_DISABLE_ERROR_CHECKING
|
|
#define LX_DISABLE_ERROR_CHECKING
|
|
#endif
|
|
|
|
|
|
/* Include necessary system files. */
|
|
|
|
#include "lx_api.h"
|
|
|
|
|
|
/**************************************************************************/
|
|
/* */
|
|
/* FUNCTION RELEASE */
|
|
/* */
|
|
/* _lx_nand_flash_open PORTABLE C */
|
|
/* 6.3.0 */
|
|
/* AUTHOR */
|
|
/* */
|
|
/* Xiuwen Cai, Microsoft Corporation */
|
|
/* */
|
|
/* DESCRIPTION */
|
|
/* */
|
|
/* This function opens a NAND flash instance and ensures the */
|
|
/* NAND flash is in a coherent state. */
|
|
/* */
|
|
/* INPUT */
|
|
/* */
|
|
/* nand_flash NAND flash instance */
|
|
/* name Name of NAND flash instance */
|
|
/* nand_driver_initialize Driver initialize */
|
|
/* nand_driver_info_ptr User data pointer */
|
|
/* memory_ptr Pointer to memory used by the */
|
|
/* LevelX for this NAND. */
|
|
/* memory_size Size of memory - must at least*/
|
|
/* 7 * total block count + */
|
|
/* 2 * page size */
|
|
/* */
|
|
/* OUTPUT */
|
|
/* */
|
|
/* return status */
|
|
/* */
|
|
/* CALLS */
|
|
/* */
|
|
/* lx_nand_flash_open_extended Pass NULL as driver_info_ptr */
|
|
/* */
|
|
/* CALLED BY */
|
|
/* */
|
|
/* Application Code */
|
|
/* */
|
|
/**************************************************************************/
|
|
UINT _lx_nand_flash_open(LX_NAND_FLASH *nand_flash, CHAR *name, UINT (*nand_driver_initialize)(LX_NAND_FLASH *),
|
|
ULONG* memory_ptr, UINT memory_size)
|
|
{
|
|
UINT status = LX_ERROR;
|
|
|
|
status = _lx_nand_flash_open_extended(nand_flash, name, nand_driver_initialize, NULL, memory_ptr, memory_size);
|
|
|
|
return status;
|
|
}
|