2010-09-27 09:28:45 +02:00
|
|
|
/**
|
|
|
|
******************************************************************************
|
|
|
|
* @addtogroup PIOS PIOS Core hardware abstraction layer
|
|
|
|
* @{
|
|
|
|
* @addtogroup PIOS_USART USART Functions
|
|
|
|
* @brief PIOS interface for USART port
|
|
|
|
* @{
|
|
|
|
*
|
2013-05-19 16:37:30 +02:00
|
|
|
* @file pios_usart.h
|
2010-09-27 09:28:45 +02:00
|
|
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
|
|
|
* @brief USART functions header.
|
|
|
|
* @see The GNU Public License (GPL) Version 3
|
|
|
|
*
|
|
|
|
*****************************************************************************/
|
2013-05-19 16:37:30 +02:00
|
|
|
/*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2010-09-27 09:28:45 +02:00
|
|
|
* (at your option) any later version.
|
2013-05-19 16:37:30 +02:00
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
|
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
2010-09-27 09:28:45 +02:00
|
|
|
* for more details.
|
2013-05-19 16:37:30 +02:00
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
2010-09-27 09:28:45 +02:00
|
|
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef PIOS_USART_H
|
|
|
|
#define PIOS_USART_H
|
|
|
|
|
2011-02-12 23:19:43 +01:00
|
|
|
/* Global Types */
|
2010-09-27 09:28:45 +02:00
|
|
|
/* Public Functions */
|
|
|
|
|
2017-04-19 15:55:36 +02:00
|
|
|
/* USART Ioctls */
|
|
|
|
|
|
|
|
enum PIOS_USART_Inverted {
|
|
|
|
PIOS_USART_Inverted_None = 0,
|
|
|
|
PIOS_USART_Inverted_Rx = (1 << 0),
|
|
|
|
PIOS_USART_Inverted_Tx = (1 << 1),
|
|
|
|
PIOS_USART_Inverted_RxTx = (PIOS_USART_Inverted_Rx | PIOS_USART_Inverted_Tx)
|
|
|
|
};
|
|
|
|
|
2017-04-17 00:50:08 +02:00
|
|
|
#define PIOS_IOCTL_USART_SET_INVERTED COM_IOCTL(COM_IOCTL_TYPE_USART, 1, enum PIOS_USART_Inverted)
|
|
|
|
#define PIOS_IOCTL_USART_SET_SWAPPIN COM_IOCTL(COM_IOCTL_TYPE_USART, 2, bool)
|
|
|
|
#define PIOS_IOCTL_USART_SET_HALFDUPLEX COM_IOCTL(COM_IOCTL_TYPE_USART, 3, bool)
|
2017-04-19 15:55:36 +02:00
|
|
|
|
2017-04-17 00:50:08 +02:00
|
|
|
#define PIOS_IOCTL_USART_GET_RXGPIO COM_IOCTL(COM_IOCTL_TYPE_USART, 4, struct stm32_gpio)
|
|
|
|
#define PIOS_IOCTL_USART_GET_TXGPIO COM_IOCTL(COM_IOCTL_TYPE_USART, 5, struct stm32_gpio)
|
2017-04-19 15:55:36 +02:00
|
|
|
|
|
|
|
/* PIOS_IRQ_PRIO_ values */
|
2017-04-17 00:50:08 +02:00
|
|
|
#define PIOS_IOCTL_USART_SET_IRQ_PRIO COM_IOCTL(COM_IOCTL_TYPE_USART, 6, uint8_t)
|
2017-04-19 15:55:36 +02:00
|
|
|
|
2017-04-25 13:11:37 +02:00
|
|
|
#define PIOS_IOCTL_USART_GET_DSMBIND COM_IOCTL(COM_IOCTL_TYPE_USART, 7, struct stm32_gpio)
|
|
|
|
|
|
|
|
|
2010-09-27 09:28:45 +02:00
|
|
|
#endif /* PIOS_USART_H */
|
|
|
|
|
|
|
|
/**
|
2013-05-19 16:37:30 +02:00
|
|
|
* @}
|
|
|
|
* @}
|
|
|
|
*/
|