1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
20006: examples/gnrc_border_router: enable setting ZEP topology r=benpicco a=benpicco



20033: driver/mtd: mtd_init add documentation for return value r=benpicco a=kfessel



Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
Co-authored-by: Karl Fessel <karl.fessel@ml-pa.com>
This commit is contained in:
bors[bot] 2023-11-01 10:01:07 +00:00 committed by GitHub
commit 436a4ec91f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 91 additions and 69 deletions

View File

@ -62,7 +62,7 @@ start_radvd() {
}
start_zep_dispatch() {
${ZEP_DISPATCH} :: "${ZEP_PORT_BASE}" > /dev/null &
${ZEP_DISPATCH} ${ZEP_DISPATCH_FLAGS} :: "${ZEP_PORT_BASE}" > /dev/null &
ZEP_DISPATCH_PID=$!
}
@ -95,6 +95,17 @@ else
USE_ZEP_DISPATCH=0
fi
if [ "$1" = "-t" ] || [ "$1" = "--topology" ]; then
ZEP_DISPATCH_FLAGS+="-t $2 "
shift 2
fi
if [ "$1" = "-w" ] || [ "$1" = "--monitor" ]; then
modprobe mac802154_hwsim
ZEP_DISPATCH_FLAGS+="-w wpan0 "
shift 1
fi
ELFFILE=$1
PREFIX=$2
shift 2

View File

@ -204,8 +204,8 @@ struct mtd_desc {
*
* @param[in] dev Pointer to the selected driver
*
* @returns 0 on success
* @returns < 0 value in error
* @retval 0 on success
* @retval <0 value on error
*/
int (*init)(mtd_dev_t *dev);
@ -219,8 +219,8 @@ struct mtd_desc {
* @param[in] addr Starting address
* @param[in] size Number of bytes
*
* @return 0 on success
* @return < 0 value on error
* @retval 0 on success
* @retval <0 value on error
*/
int (*read)(mtd_dev_t *dev,
void *buff,
@ -239,8 +239,8 @@ struct mtd_desc {
* @param[in] offset Byte offset from the start of the page
* @param[in] size Number of bytes
*
* @return number of bytes read on success
* @return < 0 value on error
* @retval n number of bytes read on success
* @retval <0 value on error
*/
int (*read_page)(mtd_dev_t *dev,
void *buff,
@ -259,8 +259,8 @@ struct mtd_desc {
* @param[in] addr Starting address
* @param[in] size Number of bytes
*
* @return 0 on success
* @return < 0 value on error
* @retval 0 on success
* @retval <0 value on error
*/
int (*write)(mtd_dev_t *dev,
const void *buff,
@ -279,8 +279,8 @@ struct mtd_desc {
* @param[in] offset Byte offset from the start of the page
* @param[in] size Number of bytes
*
* @return bytes written on success
* @return < 0 value on error
* @retval n bytes written on success
* @retval <0 value on error
*/
int (*write_page)(mtd_dev_t *dev,
const void *buff,
@ -297,8 +297,8 @@ struct mtd_desc {
* @param[in] addr Starting address
* @param[in] size Number of bytes
*
* @return 0 on success
* @return < 0 value on error
* @retval 0 on success
* @retval <0 value on error
*/
int (*erase)(mtd_dev_t *dev,
uint32_t addr,
@ -312,8 +312,8 @@ struct mtd_desc {
* @param[in] count Number of sectors to erase
*
* @return 0 on success
* @return < 0 value on error
* @retval 0 on success
* @retval <0 value on error
*/
int (*erase_sector)(mtd_dev_t *dev,
uint32_t sector,
@ -325,8 +325,8 @@ struct mtd_desc {
* @param[in] dev Pointer to the selected driver
* @param[in] power Power state to apply (from @ref mtd_power_state)
*
* @return 0 on success
* @return < 0 value on error
* @retval 0 on success
* @retval <0 value on error
*/
int (*power)(mtd_dev_t *dev, enum mtd_power_state power);
@ -341,7 +341,10 @@ struct mtd_desc {
*
* @param mtd the device to initialize
*
* @return
* @retval 0 on success
* @retval <0 on error probably errno
* @retval -ENODEV if no device if given or no driver is set
* @retval -ENOTSUP if device has no init function
*/
int mtd_init(mtd_dev_t *mtd);
@ -355,12 +358,12 @@ int mtd_init(mtd_dev_t *mtd);
* @param[in] addr the start address to read from
* @param[in] count the number of bytes to read
*
* @return 0 on success
* @return < 0 if an error occurred
* @return -ENODEV if @p mtd is not a valid device
* @return -ENOTSUP if operation is not supported on @p mtd
* @return -EOVERFLOW if @p addr or @p count are not valid, i.e. outside memory
* @return -EIO if I/O error occurred
* @retval 0 on success
* @retval <0 if an error occurred
* @retval -ENODEV if @p mtd is not a valid device
* @retval -ENOTSUP if operation is not supported on @p mtd
* @retval -EOVERFLOW if @p addr or @p count are not valid, i.e. outside memory
* @retval -EIO if I/O error occurred
*/
int mtd_read(mtd_dev_t *mtd, void *dest, uint32_t addr, uint32_t count);
@ -376,12 +379,12 @@ int mtd_read(mtd_dev_t *mtd, void *dest, uint32_t addr, uint32_t count);
* @param[in] offset offset from the start of the page (in bytes)
* @param[in] size the number of bytes to read
*
* @return number of bytes read on success
* @return < 0 value on error
* @return -ENODEV if @p mtd is not a valid device
* @return -ENOTSUP if operation is not supported on @p mtd
* @return -EOVERFLOW if @p addr or @p count are not valid, i.e. outside memory
* @return -EIO if I/O error occurred
* @retval n number of bytes read on success
* @retval <0 value on error
* @retval -ENODEV if @p mtd is not a valid device
* @retval -ENOTSUP if operation is not supported on @p mtd
* @retval -EOVERFLOW if @p addr or @p count are not valid, i.e. outside memory
* @retval -EIO if I/O error occurred
*/
int mtd_read_page(mtd_dev_t *mtd, void *dest, uint32_t page, uint32_t offset, uint32_t size);
@ -398,14 +401,14 @@ int mtd_read_page(mtd_dev_t *mtd, void *dest, uint32_t page, uint32_t offset, ui
* @param[in] addr the start address to write to
* @param[in] count the number of bytes to write
*
* @return 0 on success
* @return < 0 if an error occurred
* @return -ENODEV if @p mtd is not a valid device
* @return -ENOTSUP if operation is not supported on @p mtd
* @return -EOVERFLOW if @p addr or @p count are not valid, i.e. outside memory,
* or overlapping two pages
* @return -EIO if I/O error occurred
* @return -EINVAL if parameters are invalid (invalid alignment for instance)
* @retval 0 on success
* @retval <0 if an error occurred
* @retval -ENODEV if @p mtd is not a valid device
* @retval -ENOTSUP if operation is not supported on @p mtd
* @retval -EOVERFLOW if @p addr or @p count are not valid, i.e. outside memory,
* or overlapping two pages
* @retval -EIO if I/O error occurred
* @retval -EINVAL if parameters are invalid (invalid alignment for instance)
*/
int mtd_write(mtd_dev_t *mtd, const void *src, uint32_t addr, uint32_t count);
@ -425,13 +428,13 @@ int mtd_write(mtd_dev_t *mtd, const void *src, uint32_t addr, uint32_t count);
* @param[in] offset byte offset from the start of the page
* @param[in] size the number of bytes to write
*
* @return number of bytes written on success
* @return < 0 value on error
* @return -ENODEV if @p mtd is not a valid device
* @return -ENOTSUP if operation is not supported on @p mtd
* @return -EOVERFLOW if @p addr or @p count are not valid, i.e. outside memory,
* @return -EIO if I/O error occurred
* @return -EINVAL if parameters are invalid
* @retval n number of bytes written on success
* @retval <0 value on error
* @retval -ENODEV if @p mtd is not a valid device
* @retval -ENOTSUP if operation is not supported on @p mtd
* @retval -EOVERFLOW if @p addr or @p count are not valid, i.e. outside memory,
* @retval -EIO if I/O error occurred
* @retval -EINVAL if parameters are invalid
*/
int mtd_write_page_raw(mtd_dev_t *mtd, const void *src, uint32_t page,
uint32_t offset, uint32_t size);
@ -455,13 +458,13 @@ int mtd_write_page_raw(mtd_dev_t *mtd, const void *src, uint32_t page,
* @param[in] offset byte offset from the start of the page
* @param[in] size the number of bytes to write
*
* @return number of bytes written on success
* @return < 0 value on error
* @return -ENODEV if @p mtd is not a valid device
* @return -ENOTSUP if operation is not supported on @p mtd
* @return -EOVERFLOW if @p addr or @p count are not valid, i.e. outside memory,
* @return -EIO if I/O error occurred
* @return -EINVAL if parameters are invalid
* @retval n number of bytes written on success
* @retval <0 value on error
* @retval -ENODEV if @p mtd is not a valid device
* @retval -ENOTSUP if operation is not supported on @p mtd
* @retval -EOVERFLOW if @p addr or @p count are not valid, i.e. outside memory,
* @retval -EIO if I/O error occurred
* @retval -EINVAL if parameters are invalid
*/
int mtd_write_page(mtd_dev_t *mtd, const void *src, uint32_t page,
uint32_t offset, uint32_t size);
@ -475,12 +478,12 @@ int mtd_write_page(mtd_dev_t *mtd, const void *src, uint32_t page,
* @param[in] addr the address of the first sector to erase
* @param[in] count the number of bytes to erase
*
* @return 0 if erase successful
* @return < 0 if an error occurred
* @return -ENODEV if @p mtd is not a valid device
* @return -ENOTSUP if operation is not supported on @p mtd
* @return -EOVERFLOW if @p addr or @p count are not valid, i.e. outside memory
* @return -EIO if I/O error occurred
* @retval 0 if erase successful
* @retval <0 if an error occurred
* @retval -ENODEV if @p mtd is not a valid device
* @retval -ENOTSUP if operation is not supported on @p mtd
* @retval -EOVERFLOW if @p addr or @p count are not valid, i.e. outside memory
* @retval -EIO if I/O error occurred
*/
int mtd_erase(mtd_dev_t *mtd, uint32_t addr, uint32_t count);
@ -491,12 +494,12 @@ int mtd_erase(mtd_dev_t *mtd, uint32_t addr, uint32_t count);
* @param[in] sector the first sector number to erase
* @param[in] num the number of sectors to erase
*
* @return 0 if erase successful
* @return < 0 if an error occurred
* @return -ENODEV if @p mtd is not a valid device
* @return -ENOTSUP if operation is not supported on @p mtd
* @return -EOVERFLOW if @p addr or @p sector are not valid, i.e. outside memory
* @return -EIO if I/O error occurred
* @retval 0 if erase successful
* @retval <0 if an error occurred
* @retval -ENODEV if @p mtd is not a valid device
* @retval -ENOTSUP if operation is not supported on @p mtd
* @retval -EOVERFLOW if @p addr or @p sector are not valid, i.e. outside memory
* @retval -EIO if I/O error occurred
*/
int mtd_erase_sector(mtd_dev_t *mtd, uint32_t sector, uint32_t num);
@ -506,11 +509,11 @@ int mtd_erase_sector(mtd_dev_t *mtd, uint32_t sector, uint32_t num);
* @param mtd the device to access
* @param[in] power the power mode to set
*
* @return 0 if power mode successfully set
* @return < 0 if an error occurred
* @return -ENODEV if @p mtd is not a valid device
* @return -ENOTSUP if operation or @p power state is not supported on @p mtd
* @return -EIO if I/O error occurred
* @retval 0 if power mode successfully set
* @retval <0 if an error occurred
* @retval -ENODEV if @p mtd is not a valid device
* @retval -ENOTSUP if operation or @p power state is not supported on @p mtd
* @retval -EIO if I/O error occurred
*/
int mtd_power(mtd_dev_t *mtd, enum mtd_power_state power);

View File

@ -23,6 +23,14 @@ endif
# enable the ZEP dispatcher
FLAGS_EXTRAS += -z $(ZEP_PORT_BASE)
ifneq (, $(ZEP_TOPO_FILE))
FLAGS_EXTRAS += --topology $(ZEP_TOPO_FILE)
endif
ifeq (1, $(ZEP_MONITOR))
FLAGS_EXTRAS += --monitor
endif
# Configure terminal parameters
TERMDEPS += host-tools
TERMPROG_FLAGS = $(FLAGS_EXTRAS) $(ELFFILE) $(IPV6_PREFIX)