Mistake on this page? Email us
pal_plat_internalFlash.h File Reference

Go to the source code of this file.

Functions

palStatus_t pal_plat_internalFlashInit (void)
 This function initialized the flash API module, And should be called prior to flash API calls. More...
 
palStatus_t pal_plat_internalFlashDeInit (void)
 This function deinitializes the flash module. More...
 
palStatus_t pal_plat_internalFlashWrite (const size_t size, const uint32_t address, const uint32_t *buffer)
 This function writes to the internal flash. More...
 
palStatus_t pal_plat_internalFlashRead (const size_t size, const uint32_t address, uint32_t *buffer)
 This function copies the memory data into the user given buffer. More...
 
palStatus_t pal_plat_internalFlashErase (uint32_t address, size_t size)
 This function erases a sector. More...
 
size_t pal_plat_internalFlashGetPageSize (void)
 This function returns the minimum size of the writing unit when writing to the flash. More...
 
size_t pal_plat_internalFlashGetSectorSize (uint32_t address)
 This function returns the sector size. More...
 
palStatus_t pal_plat_internalFlashGetAreaInfo (uint8_t section, palSotpAreaData_t *data)
 This function return the SOTP section data. More...
 

Function Documentation

palStatus_t pal_plat_internalFlashDeInit ( void  )

This function deinitializes the flash module.

Returns
PAL_SUCCESS upon successful operation.
PAL_ERR_INTERNAL_FLASH_ERROR - see error code palError_t.
Note
Should be called only after pal_InternalFlashinit() is called.
Flash APIs will not work after calling this function.
This function is Blocking till completion.
palStatus_t pal_plat_internalFlashErase ( uint32_t  address,
size_t  size 
)

This function erases a sector.

Parameters
[in]size- the size to be erased, must match sector size.
[in]address- start address for the sector to be erased.
Returns
PAL_SUCCESS upon successful operation.
PAL_ERR_INTERNAL_FLASH_ERROR - see error code palError_t.
Note
ALL sectors can be erased. There is no protection for bootloader, program or other sectors.
This function is Blocking till completion.
Only one sector can be erased with each function call.
This function is Thread Safe.
palStatus_t pal_plat_internalFlashGetAreaInfo ( uint8_t  section,
palSotpAreaData_t data 
)

This function return the SOTP section data.

Parameters
[in]section- the section number (0 or 1)
[out]data- the information about the section
Returns
PAL_SUCCESS upon successful operation.
PAL_ERR_INTERNAL_FLASH_ERROR - see error code palError_t.
size_t pal_plat_internalFlashGetPageSize ( void  )

This function returns the minimum size of the writing unit when writing to the flash.

Returns
the minimum size of the writing unit.
size_t pal_plat_internalFlashGetSectorSize ( uint32_t  address)

This function returns the sector size.

Parameters
[in]address- the starting address of the sector in question
Returns
size of sector, 0 in case of error
palStatus_t pal_plat_internalFlashInit ( void  )

This function initialized the flash API module, And should be called prior to flash API calls.

Returns
PAL_SUCCESS upon successful operation.
PAL_ERR_INTERNAL_FLASH_ERROR - see error code palError_t.
Note
Should be called only once unless pal_InternalFlashDeInit function is called.
This function is Blocking till completion!!
palStatus_t pal_plat_internalFlashRead ( const size_t  size,
const uint32_t  address,
uint32_t *  buffer 
)

This function copies the memory data into the user given buffer.

Parameters
[in]size- the size of the buffer in bytes.
[in]address- the address of the internal flash.
[out]buffer- pointer to the buffer to write to
Returns
PAL_SUCCESS upon successful operation.
PAL_ERR_INTERNAL_FLASH_ERROR - see error code palError_t.
Note
This function is Blocking till completion.
This function is Thread Safe.
palStatus_t pal_plat_internalFlashWrite ( const size_t  size,
const uint32_t  address,
const uint32_t *  buffer 
)

This function writes to the internal flash.

Parameters
[in]buffer- pointer to the buffer to be written
[in]size- the size of the buffer in bytes, must be aligned to minimum writing unit (page size).
[in]address- the address of the internal flash.
Returns
PAL_SUCCESS upon successful operation.
PAL_ERR_INTERNAL_FLASH_ERROR - see error code palError_t.
Note
This function is Blocking till completion.
This function is Thread Safe.