mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-20 10:54:14 +01:00
pios: common PIOS header guards
This commit is contained in:
parent
fc6024d23e
commit
e96f717b94
@ -75,7 +75,7 @@ uint8_t PIOS_ADXL345_Read(struct pios_adxl345_data * data);
|
||||
int32_t PIOS_ADXL345_FifoElements();
|
||||
int32_t PIOS_ADXL345_Test();
|
||||
|
||||
#endif
|
||||
#endif /* PIOS_ADXL345_H */
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
@ -28,8 +28,8 @@
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef PIOS_BL_HELPER_H_
|
||||
#define PIOS_BL_HELPER_H_
|
||||
#ifndef PIOS_BL_HELPER_H
|
||||
#define PIOS_BL_HELPER_H
|
||||
|
||||
extern uint8_t *PIOS_BL_HELPER_FLASH_If_Read(uint32_t SectorAddress);
|
||||
|
||||
@ -43,4 +43,4 @@ extern uint8_t PIOS_BL_HELPER_FLASH_Start();
|
||||
|
||||
extern void PIOS_BL_HELPER_CRC_Ini();
|
||||
|
||||
#endif /* PIOS_BL_HELPER_H_ */
|
||||
#endif /* PIOS_BL_HELPER_H */
|
||||
|
@ -29,11 +29,11 @@
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "fifo_buffer.h"
|
||||
|
||||
#ifndef PIOS_BMA180_H
|
||||
#define PIOS_BMA180_H
|
||||
|
||||
#include "fifo_buffer.h"
|
||||
|
||||
#include <pios.h>
|
||||
|
||||
/* BMA180 Addresses */
|
||||
|
@ -27,6 +27,9 @@
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef PIOS_CRC_H
|
||||
#define PIOS_CRC_H
|
||||
|
||||
uint8_t PIOS_CRC_updateByte(uint8_t crc, const uint8_t data);
|
||||
uint8_t PIOS_CRC_updateCRC(uint8_t crc, const uint8_t* data, int32_t length);
|
||||
|
||||
@ -35,3 +38,5 @@ uint16_t PIOS_CRC16_updateCRC(uint16_t crc, const uint8_t* data, int32_t length)
|
||||
|
||||
uint32_t PIOS_CRC32_updateByte(uint32_t crc, const uint8_t data);
|
||||
uint32_t PIOS_CRC32_updateCRC(uint32_t crc, const uint8_t* data, int32_t length);
|
||||
|
||||
#endif /* PIOS_CRC_H */
|
||||
|
@ -37,9 +37,9 @@ extern const char *PIOS_DEBUG_AssertMsg;
|
||||
void PIOS_DEBUG_Init(void);
|
||||
#else
|
||||
#include <pios_tim_priv.h>
|
||||
|
||||
void PIOS_DEBUG_Init(const struct pios_tim_channel * channels, uint8_t num_channels);
|
||||
#endif
|
||||
|
||||
void PIOS_DEBUG_PinHigh(uint8_t pin);
|
||||
void PIOS_DEBUG_PinLow(uint8_t pin);
|
||||
void PIOS_DEBUG_PinValue8Bit(uint8_t value);
|
||||
|
@ -28,7 +28,11 @@
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef PIOS_ETASV3_H
|
||||
#define PIOS_ETASV3_H
|
||||
|
||||
#define ETASV3_I2C_ADDR 0x75
|
||||
|
||||
|
||||
int16_t PIOS_ETASV3_ReadAirspeed (void);
|
||||
|
||||
#endif /* PIOS_ETASV3_H */
|
||||
|
@ -24,8 +24,8 @@
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef PIOS_FLASH_H_
|
||||
#define PIOS_FLASH_H_
|
||||
#ifndef PIOS_FLASH_H
|
||||
#define PIOS_FLASH_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
@ -44,4 +44,4 @@ struct pios_flash_driver {
|
||||
int32_t (*read_data)(uintptr_t flash_id, uint32_t addr, uint8_t * data, uint16_t len);
|
||||
};
|
||||
|
||||
#endif /* PIOS_FLASH_H_ */
|
||||
#endif /* PIOS_FLASH_H */
|
||||
|
@ -24,8 +24,8 @@
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef PIOS_FLASH_INTERNAL_H_
|
||||
#define PIOS_FLASH_INTERNAL_H_
|
||||
#ifndef PIOS_FLASH_INTERNAL_H
|
||||
#define PIOS_FLASH_INTERNAL_H
|
||||
|
||||
#include "pios_flash.h" /* API definition for flash drivers */
|
||||
|
||||
@ -37,4 +37,4 @@ struct pios_flash_internal_cfg {
|
||||
|
||||
extern int32_t PIOS_Flash_Internal_Init(uintptr_t * flash_id, const struct pios_flash_internal_cfg * cfg);
|
||||
|
||||
#endif /* PIOS_FLASH_INTERNAL_H_ */
|
||||
#endif /* PIOS_FLASH_INTERNAL_H */
|
||||
|
@ -28,8 +28,8 @@
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef PIOS_FLASH_JEDEC_H_
|
||||
#define PIOS_FLASH_JEDEC_H_
|
||||
#ifndef PIOS_FLASH_JEDEC_H
|
||||
#define PIOS_FLASH_JEDEC_H
|
||||
|
||||
#include "pios_flash.h" /* API definition for flash drivers */
|
||||
|
||||
@ -49,4 +49,4 @@ struct pios_flash_jedec_cfg {
|
||||
|
||||
int32_t PIOS_Flash_Jedec_Init(uintptr_t * flash_id, uint32_t spi_id, uint32_t slave_num, const struct pios_flash_jedec_cfg * cfg);
|
||||
|
||||
#endif /* PIOS_FLASH_JEDEC_H_ */
|
||||
#endif /* PIOS_FLASH_JEDEC_H */
|
||||
|
@ -24,8 +24,8 @@
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef PIOS_FLASHFS_H_
|
||||
#define PIOS_FLASHFS_H_
|
||||
#ifndef PIOS_FLASHFS_H
|
||||
#define PIOS_FLASHFS_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
@ -34,4 +34,4 @@ int32_t PIOS_FLASHFS_ObjSave(uint32_t fs_id, uint32_t obj_id, uint16_t obj_inst_
|
||||
int32_t PIOS_FLASHFS_ObjLoad(uint32_t fs_id, uint32_t obj_id, uint16_t obj_inst_id, uint8_t * obj_data, uint16_t obj_size);
|
||||
int32_t PIOS_FLASHFS_ObjDelete(uint32_t fs_id, uint32_t obj_id, uint16_t obj_inst_id);
|
||||
|
||||
#endif /* PIOS_FLASHFS_H_ */
|
||||
#endif /* PIOS_FLASHFS_H */
|
||||
|
@ -24,8 +24,8 @@
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef PIOS_FLASHFS_LOGFS_PRIV_H_
|
||||
#define PIOS_FLASHFS_LOGFS_PRIV_H_
|
||||
#ifndef PIOS_FLASHFS_LOGFS_PRIV_H
|
||||
#define PIOS_FLASHFS_LOGFS_PRIV_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include "pios_flash.h" /* struct pios_flash_driver */
|
||||
@ -43,4 +43,4 @@ struct flashfs_logfs_cfg {
|
||||
|
||||
int32_t PIOS_FLASHFS_Logfs_Init(uintptr_t * fs_id, const struct flashfs_logfs_cfg * cfg, const struct pios_flash_driver * driver, uintptr_t flash_id);
|
||||
|
||||
#endif /* PIOS_FLASHFS_LOGFS_PRIV_H_ */
|
||||
#endif /* PIOS_FLASHFS_LOGFS_PRIV_H */
|
||||
|
@ -31,8 +31,6 @@
|
||||
#ifndef PIOS_HMC5883_H
|
||||
#define PIOS_HMC5883_H
|
||||
|
||||
#include <pios.h>
|
||||
|
||||
/* HMC5883 Addresses */
|
||||
#define PIOS_HMC5883_I2C_ADDR 0x1E
|
||||
#define PIOS_HMC5883_I2C_READ_ADDR 0x3D
|
||||
@ -110,6 +108,7 @@ extern int32_t PIOS_HMC5883_ReadMag(int16_t out[3]);
|
||||
extern uint8_t PIOS_HMC5883_ReadID(uint8_t out[4]);
|
||||
extern int32_t PIOS_HMC5883_Test(void);
|
||||
extern bool PIOS_HMC5883_IRQHandler();
|
||||
|
||||
#endif /* PIOS_HMC5883_H */
|
||||
|
||||
/**
|
||||
|
@ -6,8 +6,8 @@
|
||||
* Author: joe
|
||||
*/
|
||||
|
||||
#ifndef PIOS_IAP_H_
|
||||
#define PIOS_IAP_H_
|
||||
#ifndef PIOS_IAP_H
|
||||
#define PIOS_IAP_H
|
||||
|
||||
|
||||
/****************************************************************************************
|
||||
@ -42,4 +42,4 @@ void PIOS_IAP_WriteBootCount(uint16_t);
|
||||
* Public Data
|
||||
****************************************************************************************/
|
||||
|
||||
#endif /* PIOS_IAP_H_ */
|
||||
#endif /* PIOS_IAP_H */
|
||||
|
@ -98,6 +98,7 @@ extern void StartModules();
|
||||
(fn->fn_tinit)(); }
|
||||
|
||||
#endif /* USE_SIM_POSIX */
|
||||
|
||||
#endif /* PIOS_INITCALL_H */
|
||||
|
||||
/**
|
||||
|
@ -32,8 +32,6 @@
|
||||
#ifndef PIOS_L3GD20_H
|
||||
#define PIOS_L3GD20_H
|
||||
|
||||
#include "pios.h"
|
||||
|
||||
/* L3GD20 Addresses */
|
||||
#define PIOS_L3GD20_WHOAMI 0x0F
|
||||
#define PIOS_L3GD20_CTRL_REG1 0X20
|
||||
|
@ -32,8 +32,6 @@
|
||||
#ifndef PIOS_MPU6000_H
|
||||
#define PIOS_MPU6000_H
|
||||
|
||||
#include "pios.h"
|
||||
|
||||
/* MPU6000 Addresses */
|
||||
#define PIOS_MPU6000_SMPLRT_DIV_REG 0X19
|
||||
#define PIOS_MPU6000_DLPF_CFG_REG 0X1A
|
||||
|
@ -28,8 +28,8 @@
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef PIOS_MPXV_H__
|
||||
#define PIOS_MPXV_H__
|
||||
#ifndef PIOS_MPXV_H
|
||||
#define PIOS_MPXV_H
|
||||
|
||||
typedef enum{ PIOS_MPXV_UNKNOWN,PIOS_MPXV_5004,PIOS_MPXV_7002 } PIOS_MPXV_sensortype;
|
||||
typedef struct{
|
||||
@ -63,4 +63,4 @@ uint16_t PIOS_MPXV_Measure(PIOS_MPXV_descriptor *desc);
|
||||
uint16_t PIOS_MPXV_Calibrate(PIOS_MPXV_descriptor *desc, uint16_t measurement);
|
||||
float PIOS_MPXV_CalcAirspeed (PIOS_MPXV_descriptor *desc,uint16_t measurement);
|
||||
|
||||
#endif // PIOS_MPXV_H__
|
||||
#endif /* PIOS_MPXV_H */
|
||||
|
@ -31,18 +31,16 @@
|
||||
#ifndef PIOS_MS5611_H
|
||||
#define PIOS_MS5611_H
|
||||
|
||||
#include <pios.h>
|
||||
|
||||
/* BMP085 Addresses */
|
||||
#define MS5611_I2C_ADDR 0x77
|
||||
#define MS5611_RESET 0x1E
|
||||
#define MS5611_CALIB_ADDR 0xA2 /* First sample is factory stuff */
|
||||
#define MS5611_CALIB_LEN 16
|
||||
#define MS5611_ADC_READ 0x00
|
||||
#define MS5611_PRES_ADDR 0x40
|
||||
#define MS5611_TEMP_ADDR 0x50
|
||||
#define MS5611_ADC_MSB 0xF6
|
||||
#define MS5611_P0 101.3250f
|
||||
#define MS5611_CALIB_ADDR 0xA2 /* First sample is factory stuff */
|
||||
#define MS5611_CALIB_LEN 16
|
||||
#define MS5611_ADC_READ 0x00
|
||||
#define MS5611_PRES_ADDR 0x40
|
||||
#define MS5611_TEMP_ADDR 0x50
|
||||
#define MS5611_ADC_MSB 0xF6
|
||||
#define MS5611_P0 101.3250f
|
||||
|
||||
/* Local Types */
|
||||
typedef struct {
|
||||
|
@ -40,5 +40,4 @@ typedef enum {FALSE = 0, TRUE = !FALSE} bool;
|
||||
//#define PIOS_SERVO_NUM_OUTPUTS 8
|
||||
//#define PIOS_SERVO_NUM_TIMERS PIOS_SERVO_NUM_OUTPUTS
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* PIOS_POSIX_H */
|
||||
|
@ -31,8 +31,6 @@
|
||||
#ifndef PIOS_SDCARD_H
|
||||
#define PIOS_SDCARD_H
|
||||
|
||||
#if defined(PIOS_INCLUDE_SDCARD)
|
||||
|
||||
/* Public Functions */
|
||||
typedef struct {
|
||||
uint8_t CSDStruct; /* CSD structure */
|
||||
@ -113,6 +111,4 @@ extern int32_t PIOS_SDCARD_ReadLine(PFILEINFO fileinfo, uint8_t * buffer, uint32
|
||||
extern int32_t PIOS_SDCARD_FileCopy(char *Source, char *Destination);
|
||||
extern int32_t PIOS_SDCARD_FileDelete(char *Filename);
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* PIOS_SDCARD_H */
|
||||
|
@ -60,6 +60,7 @@ struct pios_spi_dev {
|
||||
};
|
||||
|
||||
extern int32_t PIOS_SPI_Init(uint32_t * spi_id, const struct pios_spi_cfg * cfg);
|
||||
|
||||
#endif /* PIOS_SPI_PRIV_H */
|
||||
|
||||
/**
|
||||
|
@ -7,6 +7,12 @@
|
||||
* @member: the name of the member within the struct.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef PIOS_STRUCT_HELPER_H
|
||||
#define PIOS_STRUCT_HELPER_H
|
||||
|
||||
#define container_of(ptr, type, member) ({ \
|
||||
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
|
||||
(type *)( (char *)__mptr - offsetof(type,member) );})
|
||||
|
||||
#endif /* PIOS_STRUCT_HELPER_H */
|
||||
|
@ -31,8 +31,6 @@
|
||||
#ifndef PIOS_USART_H
|
||||
#define PIOS_USART_H
|
||||
|
||||
#include <pios_stm32.h>
|
||||
|
||||
/* Global Types */
|
||||
/* Public Functions */
|
||||
|
||||
|
@ -34,7 +34,7 @@
|
||||
|
||||
extern int32_t PIOS_USB_DESC_HID_CDC_Init(void);
|
||||
|
||||
#endif /* PIOS_USB_DESC_HID_CDC_PRIV_H */
|
||||
#endif /* PIOS_USB_DESC_HID_CDC_PRIV_H */
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
@ -34,7 +34,7 @@
|
||||
|
||||
extern int32_t PIOS_USB_DESC_HID_ONLY_Init(void);
|
||||
|
||||
#endif /* PIOS_USB_DESC_HID_ONLY_PRIV_H */
|
||||
#endif /* PIOS_USB_DESC_HID_ONLY_PRIV_H */
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
@ -47,4 +47,3 @@ extern int32_t PIOS_USB_Init(uint32_t * usb_id, const struct pios_usb_cfg * cfg)
|
||||
* @}
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
@ -1,3 +1,8 @@
|
||||
#ifndef PIOS_USB_RCTX_H
|
||||
#define PIOS_USB_RCTX_H
|
||||
|
||||
extern uint32_t pios_usb_rctx_id;
|
||||
|
||||
extern void PIOS_USB_RCTX_Update(uint32_t usbrctx_id, const uint16_t channel[], const int16_t channel_min[], const int16_t channel_max[], uint8_t num_channels);
|
||||
|
||||
#endif /* PIOS_USB_RCTX_H */
|
||||
|
@ -32,11 +32,6 @@
|
||||
#ifndef PIOS_VIDEO_H
|
||||
#define PIOS_VIDEO_H
|
||||
|
||||
#include <pios.h>
|
||||
|
||||
// *****************************************************************************
|
||||
#if defined(PIOS_INCLUDE_VIDEO)
|
||||
|
||||
#include <pios_stm32.h>
|
||||
#include <pios_spi_priv.h>
|
||||
|
||||
@ -107,5 +102,4 @@ extern bool PIOS_Vsync_ISR();
|
||||
// Macro to swap buffers given a temporary pointer.
|
||||
#define SWAP_BUFFS(tmp, a, b) { tmp = a; a = b; b = tmp; }
|
||||
|
||||
#endif
|
||||
#endif /* PIOS_VIDEO_H */
|
||||
|
@ -32,12 +32,8 @@
|
||||
#ifndef PIOS_WAVPLAY_H
|
||||
#define PIOS_WAVPLAY_H
|
||||
|
||||
#include <pios.h>
|
||||
|
||||
// *****************************************************************************
|
||||
#if defined(PIOS_INCLUDE_WAVE)
|
||||
|
||||
#include <pios_stm32.h>
|
||||
|
||||
#define BUFFERSIZE 512 //Defines the buffer size to hold data from the SD card.
|
||||
|
||||
struct pios_dac_cfg {
|
||||
@ -53,5 +49,4 @@ struct pios_dac_cfg {
|
||||
extern void PIOS_WavPlay_Init(const struct pios_dac_cfg * cfg);
|
||||
extern uint8_t WavePlayer_Start(void);
|
||||
|
||||
#endif
|
||||
#endif /* PIOS_VIDEO_H */
|
||||
#endif /* PIOS_WAVPLAY_H */
|
||||
|
@ -28,8 +28,8 @@
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef PIOS_WDG
|
||||
#define PIOS_WDG
|
||||
#ifndef PIOS_WDG_H
|
||||
#define PIOS_WDG_H
|
||||
|
||||
uint16_t PIOS_WDG_Init();
|
||||
bool PIOS_WDG_RegisterFlag(uint16_t flag_requested);
|
||||
@ -38,4 +38,4 @@ uint16_t PIOS_WDG_GetBootupFlags();
|
||||
uint16_t PIOS_WDG_GetActiveFlags();
|
||||
void PIOS_WDG_Clear(void);
|
||||
|
||||
#endif
|
||||
#endif /* PIOS_WDG_H */
|
||||
|
Loading…
x
Reference in New Issue
Block a user