The unified diff between revisions [3dc5e7ac..] and [08a35a66..] is displayed below. It can also be downloaded as a raw diff.
# # old_revision [3dc5e7ac4bcb952cc267892653dd78ed095d8778] # new_revision [08a35a6680cdf8985cfb16fa6779ee6db7202a9c] # # delete "wmp.h" # # add_file "log.h" # content [cf6c3993627371d7378725e9369f05fd4bb3a99d] # # add_file "mpu6050.h" # content [581013ac4c5c82226aa9233b4fc5ec6d74ef481f] # # add_file "sdcard.h" # content [ac49ee3e6fa49554de89f3753fc75ce7208de84c] # # add_file "spi.h" # content [1f74d3616d4a621fa0aa100dd59f8b1633fa7914] # ============================================================ --- /dev/null +++ log.h cf6c3993627371d7378725e9369f05fd4bb3a99d @@ -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 */ ============================================================ --- /dev/null +++ mpu6050.h 581013ac4c5c82226aa9233b4fc5ec6d74ef481f @@ -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 */ ============================================================ --- /dev/null +++ sdcard.h ac49ee3e6fa49554de89f3753fc75ce7208de84c @@ -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 */ ============================================================ --- /dev/null +++ spi.h 1f74d3616d4a621fa0aa100dd59f8b1633fa7914 @@ -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 */ ============================================================ --- wmp.h 6e0068d0e91c6fdc5f17e8569a6d05895be6cb65 +++ /dev/null @@ -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 */