Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
cubexHal.pdf
Скачиваний:
111
Добавлен:
10.02.2016
Размер:
16.16 Mб
Скачать

HAL PCCARD Generic Driver

UM1725

39 HAL PCCARD Generic Driver

39.1PCCARD Firmware driver registers structures

39.1.1PCCARD_HandleTypeDef

Data Fields

FMC_PCCARD_TypeDef * Instance

FMC_PCCARD_InitTypeDef Init

__IO HAL_PCCARD_StateTypeDef State

HAL_LockTypeDef Lock

Field Documentation

FMC_PCCARD_TypeDef* PCCARD_HandleTypeDef::Instance

Register base address for PCCARD device

FMC_PCCARD_InitTypeDef PCCARD_HandleTypeDef::Init

PCCARD device control configuration parameters

__IO HAL_PCCARD_StateTypeDef PCCARD_HandleTypeDef::State

PCCARD device access state

HAL_LockTypeDef PCCARD_HandleTypeDef::Lock

PCCARD Lock

39.2PCCARD Firmware driver API description

39.2.1How to use this driver

This driver is a generic layered driver which contains a set of APIs used to control PCCARD/compact flash memories. It uses the FMC/FSMC layer functions to interface with PCCARD devices. This driver is used for:

PCCARD/Compact Flash memory configuration sequence using the function HAL_PCCARD_Init()/HAL_CF_Init() with control and timing parameters for both common and attribute spaces.

Read PCCARD/Compact Flash memory maker and device IDs using the function HAL_PCCARD_Read_ID()/HAL_CF_Read_ID(). The read information is stored in the CompactFlash_ID structure declared by the function caller.

Access PCCARD/Compact Flash memory by read/write operations using the functions HAL_PCCARD_Read_Sector()/ HAL_PCCARD_Write_Sector() - HAL_CF_Read_Sector()/HAL_CF_Write_Sector(), to read/write sector.

Perform PCCARD/Compact Flash Reset chip operation using the function

HAL_PCCARD_Reset()/HAL_CF_Reset.

Perform PCCARD/Compact Flash erase sector operation using the function HAL_PCCARD_Erase_Sector()/HAL_CF_Erase_Sector.

Read the PCCARD/Compact Flash status operation using the function HAL_PCCARD_ReadStatus()/HAL_CF_ReadStatus().

You can monitor the PCCARD/Compact Flash device HAL state by calling the function HAL_PCCARD_GetState()/HAL_CF_GetState()

494/900

DOCID025834 Rev 2

UM1725 HAL PCCARD Generic Driver

This driver is a set of generic APIs which handle standard PCCARD/compact flash operations. If a PCCARD/Compact Flash device contains different operations and/or implementations, it should be implemented separately.

39.2.2PCCARD Initialization and de-initialization functions

This section provides functions allowing to initialize/de-initialize the PCCARD memory

This section contains the following APIs:

HAL_PCCARD_Init()

HAL_PCCARD_DeInit()

HAL_PCCARD_MspInit()

HAL_PCCARD_MspDeInit()

39.2.3PCCARD Input and Output functions

This section provides functions allowing to use and control the PCCARD memory

This section contains the following APIs:

HAL_PCCARD_Read_ID()

HAL_PCCARD_Read_Sector()

HAL_PCCARD_Write_Sector()

HAL_PCCARD_Erase_Sector()

HAL_PCCARD_Reset()

HAL_PCCARD_IRQHandler()

HAL_PCCARD_ITCallback()

39.2.4PCCARD State functions

This subsection permits to get in run-time the status of the PCCARD controller and the data flow.

This section contains the following APIs:

HAL_PCCARD_GetState()

HAL_PCCARD_GetStatus()

HAL_PCCARD_ReadStatus()

39.2.5HAL_PCCARD_Init

Function Name

HAL_StatusTypeDef HAL_PCCARD_Init

 

 

(PCCARD_HandleTypeDef * hpccard,

 

 

FMC_NAND_PCC_TimingTypeDef * ComSpaceTiming,

 

 

FMC_NAND_PCC_TimingTypeDef * AttSpaceTiming,

 

 

FMC_NAND_PCC_TimingTypeDef * IOSpaceTiming)

 

Function Description

Perform the PCCARD memory Initialization sequence.

 

Parameters

 

hpccard: pointer to a PCCARD_HandleTypeDef structure

 

 

that contains the configuration information for PCCARD

 

 

module.

 

 

ComSpaceTiming: Common space timing structure

 

 

AttSpaceTiming: Attribute space timing structure

 

 

IOSpaceTiming: IO space timing structure

 

Return values

 

HAL status

 

 

 

DOCID025834 Rev 2

495/900

HAL PCCARD Generic Driver

UM1725

39.2.6HAL_PCCARD_DeInit

Function Name

HAL_StatusTypeDef HAL_PCCARD_DeInit

 

(PCCARD_HandleTypeDef * hpccard)

Function Description

Perform the PCCARD memory De-initialization sequence.

Parameters

 

hpccard: pointer to a PCCARD_HandleTypeDef structure

 

 

that contains the configuration information for PCCARD

 

 

module.

Return values

 

HAL status

39.2.7HAL_PCCARD_MspInit

Function Name

void HAL_PCCARD_MspInit (PCCARD_HandleTypeDef *

 

hpccard)

Function Description

PCCARD MSP Init.

Parameters

 

hpccard: pointer to a PCCARD_HandleTypeDef structure

 

 

that contains the configuration information for PCCARD

 

 

module.

Return values

 

None

39.2.8HAL_PCCARD_MspDeInit

Function Name

void HAL_PCCARD_MspDeInit (PCCARD_HandleTypeDef *

 

hpccard)

Function Description

PCCARD MSP DeInit.

Parameters

 

hpccard: pointer to a PCCARD_HandleTypeDef structure

 

 

that contains the configuration information for PCCARD

 

 

module.

Return values

 

None

39.2.9HAL_PCCARD_Read_ID

Function Name

HAL_StatusTypeDef HAL_PCCARD_Read_ID

 

(PCCARD_HandleTypeDef * hpccard, uint8_t

 

CompactFlash_ID, uint8_t * pStatus)

Function Description

Read Compact Flash's ID.

Parameters

 

hpccard: pointer to a PCCARD_HandleTypeDef structure

 

 

that contains the configuration information for PCCARD

 

 

module.

 

CompactFlash_ID: Compact flash ID structure.

 

pStatus: pointer to compact flash status

Return values

 

HAL status

39.2.10HAL_PCCARD_Read_Sector

Function Name

HAL_StatusTypeDef HAL_PCCARD_Read_Sector

 

(PCCARD_HandleTypeDef * hpccard, uint16_t * pBuffer,

 

uint16_t SectorAddress, uint8_t * pStatus)

496/900

DOCID025834 Rev 2

UM1725

 

HAL PCCARD Generic Driver

Function Description

Read sector from PCCARD memory.

Parameters

 

hpccard: pointer to a PCCARD_HandleTypeDef structure

 

 

that contains the configuration information for PCCARD

 

 

module.

 

pBuffer: pointer to destination read buffer

 

SectorAddress: Sector address to read

 

pStatus: pointer to PCCARD status

Return values

 

HAL status

39.2.11HAL_PCCARD_Write_Sector

Function Name

HAL_StatusTypeDef HAL_PCCARD_Write_Sector

 

(PCCARD_HandleTypeDef * hpccard, uint16_t * pBuffer,

 

uint16_t SectorAddress, uint8_t * pStatus)

Function Description

Write sector to PCCARD memory.

Parameters

 

hpccard: pointer to a PCCARD_HandleTypeDef structure

 

 

that contains the configuration information for PCCARD

 

 

module.

 

pBuffer: pointer to source write buffer

 

SectorAddress: Sector address to write

 

pStatus: pointer to PCCARD status

Return values

 

HAL status

39.2.12HAL_PCCARD_Erase_Sector

Function Name

HAL_StatusTypeDef HAL_PCCARD_Erase_Sector

 

(PCCARD_HandleTypeDef * hpccard, uint16_t SectorAddress,

 

uint8_t * pStatus)

Function Description

Erase sector from PCCARD memory.

Parameters

 

hpccard: pointer to a PCCARD_HandleTypeDef structure

 

 

that contains the configuration information for PCCARD

 

 

module.

 

SectorAddress: Sector address to erase

 

pStatus: pointer to PCCARD status

Return values

 

HAL status

39.2.13HAL_PCCARD_Reset

Function Name

HAL_StatusTypeDef HAL_PCCARD_Reset

 

(PCCARD_HandleTypeDef * hpccard)

Function Description

Reset the PCCARD memory.

Parameters

 

hpccard: pointer to a PCCARD_HandleTypeDef structure

 

 

that contains the configuration information for PCCARD

 

 

module.

Return values

 

HAL status

39.2.14HAL_PCCARD_IRQHandler

DOCID025834 Rev 2

497/900

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]