Paparazzi UAS  v6.2_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 
sdlogger_spi_direct_start
void sdlogger_spi_direct_start(void)
Definition: sdlogger_spi_direct.c:282
sdlogger_spi
struct sdlogger_spi_periph sdlogger_spi
Definition: sdlogger_spi_direct.c:114
uint32_t
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
Definition: vl53l1_types.h:78
uint8_t
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
Definition: vl53l1_types.h:98
sdlogger_spi_periph::status
enum SDLoggerStatus status
Definition: sdlogger_spi_direct.h:50
sdlogger_spi_periph::command
uint8_t command
Definition: sdlogger_spi_direct.h:57
SDLogger_Error
@ SDLogger_Error
Definition: sdlogger_spi_direct.h:36
sdlogger_spi_direct_char_available
int sdlogger_spi_direct_char_available(void *p)
Definition: sdlogger_spi_direct.c:467
SDLoggerStatus
SDLoggerStatus
Definition: sdlogger_spi_direct.h:34
sdlogger_spi_direct_check_free_space
int sdlogger_spi_direct_check_free_space(struct sdlogger_spi_periph *p, long *fd, uint16_t len)
Definition: sdlogger_spi_direct.c:422
sdlogger_spi_periph::last_completed
uint8_t last_completed
Definition: sdlogger_spi_direct.h:52
sdlogger_spi_direct_put_buffer
void sdlogger_spi_direct_put_buffer(struct sdlogger_spi_periph *p, long fd, uint8_t *data, uint16_t len)
Definition: sdlogger_spi_direct.c:454
sdlogger_spi_periph::download_address
uint32_t download_address
Definition: sdlogger_spi_direct.h:59
sdlogger_spi_periph::next_available_address
uint32_t next_available_address
Definition: sdlogger_spi_direct.h:51
sdlogger_spi_direct_stop
void sdlogger_spi_direct_stop(void)
Definition: sdlogger_spi_direct.c:283
SDLogger_StoppedLogging
@ SDLogger_StoppedLogging
Definition: sdlogger_spi_direct.h:42
SDLogger_RetreivingIndex
@ SDLogger_RetreivingIndex
Definition: sdlogger_spi_direct.h:38
SDLogger_UnInit
@ SDLogger_UnInit
Definition: sdlogger_spi_direct.h:35
sdlogger_spi_periph::download_length
uint32_t download_length
Definition: sdlogger_spi_direct.h:60
sdlogger_spi_periph::log_len
uint32_t log_len
Definition: sdlogger_spi_direct.h:56
sdlogger_spi_periph::do_log
uint8_t do_log
Definition: sdlogger_spi_direct.h:62
SDLOGGER_BUFFER_SIZE
#define SDLOGGER_BUFFER_SIZE
Definition: sdlogger_spi_direct.h:29
sdlogger_spi_periph::device
struct link_device device
Definition: sdlogger_spi_direct.h:61
sdlogger_spi_direct_send_message
void sdlogger_spi_direct_send_message(void *p, long fd)
Definition: sdlogger_spi_direct.c:462
SDLogger_UpdatingIndex
@ SDLogger_UpdatingIndex
Definition: sdlogger_spi_direct.h:44
sdlogger_spi_direct_init
void sdlogger_spi_direct_init(void)
sdlogger_spi_direct_init Initialize the logger and SD Card.
Definition: sdlogger_spi_direct.c:120
sdlogger_spi_periph::buffer
uint8_t buffer[SDLOGGER_BUFFER_SIZE]
Definition: sdlogger_spi_direct.h:54
sdlogger_spi_direct_command
void sdlogger_spi_direct_command(void)
Definition: sdlogger_spi_direct.c:400
sdlogger_spi_periph::download_id
uint8_t download_id
Definition: sdlogger_spi_direct.h:58
sdcard_spi.h
Interface for reading and writing blocks of data to and from an SD card directly over SPI.
SDLogger_Initializing
@ SDLogger_Initializing
Definition: sdlogger_spi_direct.h:37
SDLogger_GettingIndexForDownload
@ SDLogger_GettingIndexForDownload
Definition: sdlogger_spi_direct.h:45
sdlogger_spi_direct_put_byte
void sdlogger_spi_direct_put_byte(struct sdlogger_spi_periph *p, long fd, uint8_t data)
Definition: sdlogger_spi_direct.c:434
sdlogger_spi_direct_get_byte
uint8_t sdlogger_spi_direct_get_byte(void *p)
Definition: sdlogger_spi_direct.c:472
sdlogger_spi_periph
Definition: sdlogger_spi_direct.h:49
fd
int fd
Definition: serial.c:26
SDLogger_GettingIndexForUpdate
@ SDLogger_GettingIndexForUpdate
Definition: sdlogger_spi_direct.h:43
sdlogger_spi_periph::sdcard_buf_idx
uint16_t sdcard_buf_idx
Definition: sdlogger_spi_direct.h:53
SDLogger_Logging
@ SDLogger_Logging
Definition: sdlogger_spi_direct.h:40
sdlogger_spi_direct_multiwrite_written
void sdlogger_spi_direct_multiwrite_written(void)
sdlogger_spi_direct_multiwrite_written Called when a multiwrite is complete.
Definition: sdlogger_spi_direct.c:385
sdlogger_spi_direct_periodic
void sdlogger_spi_direct_periodic(void)
sdlogger_spi_direct_periodic Periodic function called at module frequency
Definition: sdlogger_spi_direct.c:162
SDLogger_Downloading
@ SDLogger_Downloading
Definition: sdlogger_spi_direct.h:46
SDLogger_LoggingFinalBlock
@ SDLogger_LoggingFinalBlock
Definition: sdlogger_spi_direct.h:41
SDLogger_Ready
@ SDLogger_Ready
Definition: sdlogger_spi_direct.h:39
uint16_t
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
Definition: vl53l1_types.h:88
p
static float p[2][2]
Definition: ins_alt_float.c:257
sdlogger_spi_direct_index_received
void sdlogger_spi_direct_index_received(void)
sdlogger_spi_direct_index_received Callback from SD Card when block at index location is received.
Definition: sdlogger_spi_direct.c:289
sdlogger_spi_periph::idx
uint8_t idx
Definition: sdlogger_spi_direct.h:55