mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-17 21:12:43 +01:00
79d33897cb
uart0 functionality is removed by #3164. This patch implements periph/uart, rather than deprecated uart0, using /dev/tty. To use with netdev2_tap simultaneously, this patch adds asynchronus read system and modifies netdev2_tap to use it. A TTY device is specified on command line with -c (COM) option, since -t was used by the old implementation. This patch also implements empty GPIO driver needed by the xbee driver.
75 lines
1.5 KiB
C
75 lines
1.5 KiB
C
/*
|
|
* Copyright (C) 2015 Takuo Yonezawa <Yonezawa-T2@mail.dnp.co.jp>
|
|
*
|
|
* This file is subject to the terms and conditions of the GNU Lesser General
|
|
* Public License v2.1. See the file LICENSE in the top level directory for
|
|
* more details.
|
|
*/
|
|
|
|
/**
|
|
* @ingroup native_cpu
|
|
* @{
|
|
*
|
|
* @file
|
|
* @brief Multiple asynchronus read on file descriptors
|
|
*
|
|
* @author Takuo Yonezawa <Yonezawa-T2@mail.dnp.co.jp>
|
|
*/
|
|
#ifndef ASYNC_READ_H
|
|
#define ASYNC_READ_H
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/**
|
|
* @brief Maximum number of file descriptors
|
|
*/
|
|
#ifndef ASYNC_READ_NUMOF
|
|
#define ASYNC_READ_NUMOF 2
|
|
#endif
|
|
|
|
/**
|
|
* @brief asynchronus read callback type
|
|
*/
|
|
typedef void (*native_async_read_callback_t)(int fd);
|
|
|
|
/**
|
|
* @brief initialize asynchronus read system
|
|
*
|
|
* This registers SIGIO signal handler.
|
|
*/
|
|
void native_async_read_setup(void);
|
|
|
|
/**
|
|
* @brief shutdown asynchronus read system
|
|
*
|
|
* This deregisters SIGIO signal handler.
|
|
*/
|
|
void native_async_read_cleanup(void);
|
|
|
|
/**
|
|
* @brief resume monitoring of file descriptors
|
|
*
|
|
* Call this function after reading file descriptors.
|
|
*
|
|
* @param[in] fd The file descriptor to monitor
|
|
*/
|
|
void native_async_read_continue(int fd);
|
|
|
|
/**
|
|
* @brief start monitoring of file descriptor
|
|
*
|
|
* @param[in] fd The file descriptor to monitor
|
|
* @param[in] handler The callback function to be called when the file
|
|
* descriptor is ready to read.
|
|
*/
|
|
void native_async_read_add_handler(int fd, native_async_read_callback_t handler);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|
|
/** @} */
|