mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-11-30 08:24:11 +01:00
0a9be2dedd
You can now send and receive packets (up to 63 bytes) just like using the USART port with PIOS_COM. HID packet length will soon be increased to support maximum UAVTalk message length. git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@182 ebee16cc-31ac-478f-84a7-5cbb03baadba
55 lines
2.2 KiB
C
55 lines
2.2 KiB
C
/**
|
|
******************************************************************************
|
|
*
|
|
* @file pios_com.h
|
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
|
* Parts by Thorsten Klose (tk@midibox.org) (tk@midibox.org)
|
|
* @brief COM layer functions header
|
|
* @see The GNU Public License (GPL) Version 3
|
|
*
|
|
*****************************************************************************/
|
|
/*
|
|
* 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
|
|
* (at your option) any later version.
|
|
*
|
|
* 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
|
|
* for more details.
|
|
*
|
|
* 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.,
|
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
*/
|
|
|
|
#ifndef PIOS_COM_H
|
|
#define PIOS_COM_H
|
|
|
|
/* Global Types */
|
|
typedef enum {
|
|
COM_DEBUG_UART = 0,
|
|
COM_GPS_UART = 1,
|
|
COM_TELEM_UART = 2,
|
|
COM_AUX_UART = 3,
|
|
COM_USB_HID = 4
|
|
} COMPortTypeDef;
|
|
|
|
/* Public Functions */
|
|
extern int32_t PIOS_COM_Init(void);
|
|
|
|
extern int32_t PIOS_COM_SendCharNonBlocking(COMPortTypeDef port, char c);
|
|
extern int32_t PIOS_COM_SendChar(COMPortTypeDef port, char c);
|
|
extern int32_t PIOS_COM_SendBufferNonBlocking(COMPortTypeDef port, uint8_t *buffer, uint16_t len);
|
|
extern int32_t PIOS_COM_SendBuffer(COMPortTypeDef port, uint8_t *buffer, uint16_t len);
|
|
extern int32_t PIOS_COM_SendStringNonBlocking(COMPortTypeDef port, char *str);
|
|
extern int32_t PIOS_COM_SendString(COMPortTypeDef port, char *str);
|
|
extern int32_t PIOS_COM_SendFormattedStringNonBlocking(COMPortTypeDef port, char *format, ...);
|
|
extern int32_t PIOS_COM_SendFormattedString(COMPortTypeDef port, char *format, ...);
|
|
|
|
extern int32_t PIOS_COM_ReceiveHandler(void);
|
|
extern int32_t PIOS_COM_ReceiveCallbackInit(void *callback_receive);
|
|
|
|
#endif /* PIOS_COM_H */
|