Forum Discussion
Altera_Forum
Honored Contributor
12 years agoYes, the DEVTAB_ENTRY macro will only fill in the generic devtab, which holds any kind of driver accessible with the generic API. eCos also has specific device tables for special kind of peripherals, such as for example cyg_flashdevtab for flash devices. Those tables need dedicated macros to be filled correctly.
In that case if you can't find the documentation, it is a good idea to check the include files of the generic package. For example in your case, in the CYGPKG_IO_FLASH package, you'll find with the following macros in packages/io/flash/current/include/flash_dev.h (on my old version of eCos, so yours my differ a little):// Macros for instantiating the above structures.
# ifdef CYGHWR_IO_FLASH_BLOCK_LOCKING
# define CYG_FLASH_FUNS(_funs_, _init_, _query_ , _erase_, _prog_ , _read_, _lock_, _unlock_)
struct cyg_flash_dev_funs _funs_ =
{
.flash_init = _init_,
.flash_query = _query_,
.flash_erase_block = _erase_,
.flash_program = _prog_,
.flash_read = _read_,
.flash_block_lock = _lock_,
.flash_block_unlock = _unlock_
}
# else
# define CYG_FLASH_FUNS(_funs_, _init_, _query_ , _erase_, _prog_ , _read_, _lock_, _unlock_)
struct cyg_flash_dev_funs _funs_ =
{
.flash_init = _init_,
.flash_query = _query_,
.flash_erase_block = _erase_,
.flash_program = _prog_,
.flash_read = _read_
}
# endif
// We assume HAL tables are placed into RAM.
# define CYG_FLASH_DRIVER(_name_, _funs_, _flags_, _start_, _end_, _num_block_infos_, _block_info_, _priv_)
struct cyg_flash_dev _name_ CYG_HAL_TABLE_ENTRY(cyg_flashdev) =
{
.funs = _funs_,
.flags = _flags_,
.start = _start_,
.end = _end_,
.num_block_infos = _num_block_infos_,
.block_info = _block_info_,
.priv = _priv_
}