2010-05-24 18:33:36 +02:00
|
|
|
/**
|
|
|
|
******************************************************************************
|
2010-07-16 21:53:35 +02:00
|
|
|
* @addtogroup PIOS PIOS Core hardware abstraction layer
|
|
|
|
* @{
|
|
|
|
* @addtogroup PIOS_OPAHRS OPAHRS Functions
|
|
|
|
* @{
|
2010-05-24 18:33:36 +02:00
|
|
|
*
|
|
|
|
* @file pios_opahrs.h
|
|
|
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
|
|
|
* @brief OpenPilot AHRS 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_OPAHRS_H
|
|
|
|
#define PIOS_OPAHRS_H
|
|
|
|
|
2010-07-04 04:21:49 +02:00
|
|
|
#include "pios_opahrs_proto.h" /* opahrs message structs */
|
2010-05-24 18:33:36 +02:00
|
|
|
|
2010-07-04 04:21:49 +02:00
|
|
|
enum opahrs_result {
|
2010-09-27 09:28:45 +02:00
|
|
|
OPAHRS_RESULT_OK = 0,
|
|
|
|
OPAHRS_RESULT_TIMEOUT,
|
|
|
|
OPAHRS_RESULT_FAILED,
|
2010-07-04 04:21:49 +02:00
|
|
|
};
|
2010-05-24 18:33:36 +02:00
|
|
|
|
2011-02-14 02:17:32 +01:00
|
|
|
extern void PIOS_OPAHRS_Attach(uint32_t spi_id);
|
|
|
|
extern void PIOS_OPAHRS_ForceSlaveSelected(bool selected);
|
2010-09-12 01:06:31 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Protocol V0 messages used to talk to bootloaders
|
|
|
|
*/
|
|
|
|
|
2010-09-27 09:28:45 +02:00
|
|
|
extern enum opahrs_result PIOS_OPAHRS_bl_GetVersions(struct opahrs_msg_v0 *rsp);
|
|
|
|
extern enum opahrs_result PIOS_OPAHRS_bl_GetSerial(struct opahrs_msg_v0 *rsp);
|
|
|
|
extern enum opahrs_result PIOS_OPAHRS_bl_FwupStart(struct opahrs_msg_v0 *rsp);
|
|
|
|
extern enum opahrs_result PIOS_OPAHRS_bl_FwupStatus(struct opahrs_msg_v0 *rsp);
|
|
|
|
extern enum opahrs_result PIOS_OPAHRS_bl_FwupData(struct opahrs_msg_v0 *req, struct opahrs_msg_v0 *rsp);
|
|
|
|
extern enum opahrs_result PIOS_OPAHRS_bl_FwupVerify(struct opahrs_msg_v0 *rsp);
|
2010-09-12 01:06:31 +02:00
|
|
|
extern enum opahrs_result PIOS_OPAHRS_bl_resync(void);
|
2010-09-27 09:28:45 +02:00
|
|
|
extern enum opahrs_result PIOS_OPAHRS_bl_GetMemMap(struct opahrs_msg_v0 *rsp);
|
2010-09-19 01:11:42 +02:00
|
|
|
extern enum opahrs_result PIOS_OPAHRS_bl_reset(uint32_t delay);
|
|
|
|
extern enum opahrs_result PIOS_OPAHRS_bl_boot(uint32_t delay);
|
2010-12-21 18:25:24 +01:00
|
|
|
extern enum opahrs_result PIOS_OPAHRS_bl_FwDlData(struct opahrs_msg_v0 *req, struct opahrs_msg_v0 *rsp);
|
2010-09-12 01:06:31 +02:00
|
|
|
/*
|
|
|
|
* Protocol V1 messages used by application
|
|
|
|
*/
|
2010-07-04 04:21:49 +02:00
|
|
|
extern enum opahrs_result PIOS_OPAHRS_Sync(struct opahrs_msg_v1 *rsp);
|
|
|
|
extern enum opahrs_result PIOS_OPAHRS_GetSerial(struct opahrs_msg_v1 *rsp);
|
2010-08-22 02:21:54 +02:00
|
|
|
extern enum opahrs_result PIOS_OPAHRS_SetGetUpdate(struct opahrs_msg_v1 *rsp, struct opahrs_msg_v1 *req);
|
2010-08-15 01:42:14 +02:00
|
|
|
extern enum opahrs_result PIOS_OPAHRS_GetAttitudeRaw(struct opahrs_msg_v1 *rsp);
|
2010-08-23 05:39:13 +02:00
|
|
|
extern enum opahrs_result PIOS_OPAHRS_SetAlgorithm(struct opahrs_msg_v1 *req);
|
2010-08-19 22:38:27 +02:00
|
|
|
extern enum opahrs_result PIOS_OPAHRS_SetMagNorth(struct opahrs_msg_v1 *req);
|
2010-08-21 23:46:02 +02:00
|
|
|
extern enum opahrs_result PIOS_OPAHRS_SetGetCalibration(struct opahrs_msg_v1 *req, struct opahrs_msg_v1 *rsp);
|
2010-09-25 23:05:38 +02:00
|
|
|
extern enum opahrs_result PIOS_OPAHRS_SetGetInitialized(struct opahrs_msg_v1 *req, struct opahrs_msg_v1 *rsp);
|
2010-07-04 04:21:49 +02:00
|
|
|
extern enum opahrs_result PIOS_OPAHRS_resync(void);
|
2010-05-24 18:33:36 +02:00
|
|
|
|
|
|
|
#endif /* PIOS_OPAHRS_H */
|
2010-07-16 21:53:35 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @}
|
|
|
|
* @}
|
2010-08-15 01:42:14 +02:00
|
|
|
*/
|