Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
sdlogger_spi_direct.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) Bart Slinger
3  *
4  * This file is part of paparazzi
5  *
6  * paparazzi is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * paparazzi is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with paparazzi; see the file COPYING. If not, see
18  * <http://www.gnu.org/licenses/>.
19  */
26 #ifndef SDLOGGER_SPI_H
27 #define SDLOGGER_SPI_H
28 
29 #define SDLOGGER_BUFFER_SIZE 128
30 
31 #include "pprzlink/pprzlink_device.h"
32 #include "peripherals/sdcard_spi.h"
33 
47 };
48 
61  struct link_device device;
63 };
64 
65 extern struct sdlogger_spi_periph sdlogger_spi;
66 
67 extern void sdlogger_spi_direct_init(void);
68 extern void sdlogger_spi_direct_periodic(void);
69 extern void sdlogger_spi_direct_start(void);
70 extern void sdlogger_spi_direct_stop(void);
71 
72 extern void sdlogger_spi_direct_index_received(void);
74 extern void sdlogger_spi_direct_command(void);
75 
77 extern void sdlogger_spi_direct_put_byte(struct sdlogger_spi_periph *p, long fd, uint8_t data);
78 extern void sdlogger_spi_direct_put_buffer(struct sdlogger_spi_periph *p, long fd, uint8_t *data, uint16_t len);
79 extern void sdlogger_spi_direct_send_message(void *p, long fd);
80 extern int sdlogger_spi_direct_char_available(void *p);
82 
83 #endif
84 
static float p[2][2]
Interface for reading and writing blocks of data to and from an SD card directly over SPI.
uint8_t buffer[SDLOGGER_BUFFER_SIZE]
void sdlogger_spi_direct_index_received(void)
sdlogger_spi_direct_index_received Callback from SD Card when block at index location is received.
uint8_t sdlogger_spi_direct_get_byte(void *p)
void sdlogger_spi_direct_command(void)
void sdlogger_spi_direct_put_buffer(struct sdlogger_spi_periph *p, long fd, uint8_t *data, uint16_t len)
SDLoggerStatus
@ SDLogger_Initializing
@ SDLogger_StoppedLogging
@ SDLogger_RetreivingIndex
@ SDLogger_GettingIndexForDownload
@ SDLogger_UpdatingIndex
@ SDLogger_Ready
@ SDLogger_UnInit
@ SDLogger_Error
@ SDLogger_GettingIndexForUpdate
@ SDLogger_Logging
@ SDLogger_LoggingFinalBlock
@ SDLogger_Downloading
struct link_device device
struct sdlogger_spi_periph sdlogger_spi
void sdlogger_spi_direct_init(void)
sdlogger_spi_direct_init Initialize the logger and SD Card.
enum SDLoggerStatus status
void sdlogger_spi_direct_put_byte(struct sdlogger_spi_periph *p, long fd, uint8_t data)
void sdlogger_spi_direct_stop(void)
void sdlogger_spi_direct_multiwrite_written(void)
sdlogger_spi_direct_multiwrite_written Called when a multiwrite is complete.
#define SDLOGGER_BUFFER_SIZE
void sdlogger_spi_direct_send_message(void *p, long fd)
void sdlogger_spi_direct_periodic(void)
sdlogger_spi_direct_periodic Periodic function called at module frequency
int sdlogger_spi_direct_char_available(void *p)
int sdlogger_spi_direct_check_free_space(struct sdlogger_spi_periph *p, long *fd, uint16_t len)
void sdlogger_spi_direct_start(void)
int fd
Definition: serial.c:26
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
Definition: vl53l1_types.h:88
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
Definition: vl53l1_types.h:78
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
Definition: vl53l1_types.h:98