Browse Source

Remove old header file and add more missing header files

master
Gavan Fantom 10 years ago
parent
commit
53a8072424
  1. 36
      log.h
  2. 15
      mpu6050.h
  3. 12
      sdcard.h
  4. 19
      spi.h
  5. 25
      wmp.h

36
log.h

@ -0,0 +1,36 @@
/* log.h */
#ifndef __LOG_H
#define __LOG_H
#include "types.h"
char log_get_byte(void);
void log_put_byte(char c);
void log_put_uint16(unsigned int i);
void log_put_uint(unsigned int i);
void log_put_float(float f);
void log_put_header(unsigned int timestamp);
void log_put_array(char *data, int length);
void log_mark_busy(void);
void log_mark_idle(void);
unsigned int log_read_busytime(void);
/* Needed by log.c and sdcard.c only */
#define LOG_MAGIC 0x00000CFC
#define LOG_BUFFERSIZE 4096
extern unsigned int log_bufferstart;
extern unsigned int log_bufferend;
extern bool log_enabled;
extern char log_buffer[];
extern unsigned int log_generation;
#define LOG_BUFFER_EMPTY (log_bufferstart == log_bufferend)
#define LOG_BUFFER_BYTES ((log_bufferend - log_bufferstart) % \
LOG_BUFFERSIZE)
#endif /* __LOG_H */

15
mpu6050.h

@ -0,0 +1,15 @@
#ifndef __MPU6050_H
#define __MPU6050_H
#include "types.h"
bool mpu6050_init(void);
bool mpu6050_start_sample(void);
void mpu6050_start_zero(void);
void mpu6050_write_log(void);
#if 0
bool mpu6050_sample(void);
#endif
#endif /* __MPU6050_H */

12
sdcard.h

@ -0,0 +1,12 @@
/* sdcard.h */
#ifndef __SDCARD_H
#define __SDCARD_H
#include "types.h"
bool init_sdcard(void);
bool sdcard_read(unsigned int address, char *buffer, unsigned int length);
void sdcard_poll(void);
#endif /* __SDCARD_H */

19
spi.h

@ -0,0 +1,19 @@
/* spi.h */
#ifndef __SPI_H
#define __SPI_H
#include "types.h"
void init_spi(void);
void spi_speedup(void);
void spi_write_byte(char byte);
char spi_read_byte(void);
void spi_write_bytes(char *data, int len);
void spi_read_bytes(char *data, int len);
void spi_transaction_start(void);
void spi_transaction_stop(void);
void spi_drain(void);
#endif /* __SPI_H */

25
wmp.h

@ -1,25 +0,0 @@
#ifndef __WMP_H
#define __WMP_H
#include "types.h"
extern unsigned int wmp_yaw;
extern unsigned int wmp_pitch;
extern unsigned int wmp_roll;
extern unsigned char wmp_calibration_data[];
extern bool wmp_yaw_fast;
extern bool wmp_pitch_fast;
extern bool wmp_roll_fast;
extern bool wmp_zero;
bool wmp_init(void);
bool wmp_sample(void);
bool wmp_read_calibration_data(void);
bool wmp_start_sample(void);
void wmp_event_handler(void);
void wmp_start_zero(void);
#endif /* __WMP_H */
Loading…
Cancel
Save