Implementation of the flash driver for ADuCM302x.
More...
#include <drivers/flash/adi_flash.h>
#include <drivers/dma/adi_dma.h>
#include <stdlib.h>
#include <malloc.h>
#include <string.h>
#include "no_os_flash.h"
#include "aducm3029_flash.h"
#include "no_os_error.h"
#include "no_os_alloc.h"
|
| int32_t | no_os_flash_init (struct no_os_flash_dev **device, struct no_os_flash_init_param *init_param) |
| |
| int32_t | no_os_flash_remove (struct no_os_flash_dev *dev) |
| |
| int32_t | no_os_flash_clear_page (struct no_os_flash_dev *dev, int32_t page_no) |
| |
| int32_t | no_os_flash_write_page (struct no_os_flash_dev *dev, int32_t page_no, uint32_t *data) |
| |
| int32_t | no_os_flash_write (struct no_os_flash_dev *dev, uint32_t flash_addr, uint32_t *array, uint32_t array_size) |
| |
| int32_t | no_os_flash_read (struct no_os_flash_dev *dev, uint32_t flash_addr, uint32_t *array, uint32_t size) |
| |
Implementation of the flash driver for ADuCM302x.
- Author
- Andrei Drimbarean (adnre.nosp@m.i.dr.nosp@m.imbar.nosp@m.ean@.nosp@m.analo.nosp@m.g.co.nosp@m.m)
Copyright 2021(c) Analog Devices, Inc.
SPDX-License-Identifier: BSD-3-Clause
◆ no_os_flash_clear_page()
| int32_t no_os_flash_clear_page |
( |
struct no_os_flash_dev * | dev, |
|
|
int32_t | page_no ) |
Erase a flash page.
- Parameters
-
| [in] | dev | - Pointer to the flash device handler. |
| [in] | page_no | - Page number. |
- Returns
- 0 in case of success, negative error code otherwise.
◆ no_os_flash_init()
Initialize flash controller.
- Parameters
-
| [out] | device | - Pointer to the driver handler. |
| [in] | init_param | - Pointer to the initialization structure. |
- Returns
- 0 in case of success, error code otherwise.
◆ no_os_flash_read()
| int32_t no_os_flash_read |
( |
struct no_os_flash_dev * | dev, |
|
|
uint32_t | flash_addr, |
|
|
uint32_t * | array, |
|
|
uint32_t | size ) |
Read data from the flash memory.
- Parameters
-
| [in] | dev | - Pointer to the flash device handler. |
| [in] | flash_addr | - Start address of the read. |
| [out] | array | - Pointer to the container for the read data. |
| [in] | size | - Size of the read data in 32-bit words. |
- Returns
- 0 in case of success, negative error code otherwise.
◆ no_os_flash_remove()
Free memory allocated by no_os_flash_init().
- Parameters
-
| [in] | dev | - Pointer to the driver handler. |
- Returns
- 0 in case of success, error code otherwise.
◆ no_os_flash_write()
| int32_t no_os_flash_write |
( |
struct no_os_flash_dev * | dev, |
|
|
uint32_t | flash_addr, |
|
|
uint32_t * | array, |
|
|
uint32_t | array_size ) |
Write data in flash memory.
- Parameters
-
| [in] | dev | - Pointer to the flash device handler. |
| [in] | flash_addr | - Start address of the write. |
| [in] | array | - Pointer to the data to be written. |
| [in] | array_size | - Size of the written data in 32-bit words. |
- Returns
- 0 in case of success, negative error code otherwise.
◆ no_os_flash_write_page()
| int32_t no_os_flash_write_page |
( |
struct no_os_flash_dev * | dev, |
|
|
int32_t | page_no, |
|
|
uint32_t * | data ) |
Write a page in flash memory.
- Parameters
-
| [in] | dev | - Pointer to the flash device handler. |
| [in] | page_no | - Page number. |
| [in] | data | - Pointer to the data to be written. data length must be FLASH_PAGE_SIZE_WORDS in size. |
- Returns
- 0 in case of success, negative error code otherwise.