Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
sdlogger_spi_direct.h File Reference
#include "pprzlink/pprzlink_device.h"
#include "peripherals/sdcard_spi.h"
+ Include dependency graph for sdlogger_spi_direct.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  sdlogger_spi_periph
 

Macros

#define SDLOGGER_BUFFER_SIZE   128
 

Enumerations

enum  SDLoggerStatus {
  SDLogger_UnInit , SDLogger_Error , SDLogger_Initializing , SDLogger_RetreivingIndex ,
  SDLogger_Ready , SDLogger_Logging , SDLogger_LoggingFinalBlock , SDLogger_StoppedLogging ,
  SDLogger_GettingIndexForUpdate , SDLogger_UpdatingIndex , SDLogger_GettingIndexForDownload , SDLogger_Downloading
}
 

Functions

void sdlogger_spi_direct_init (void)
 sdlogger_spi_direct_init Initialize the logger and SD Card. More...
 
void sdlogger_spi_direct_periodic (void)
 sdlogger_spi_direct_periodic Periodic function called at module frequency More...
 
void sdlogger_spi_direct_start (void)
 
void sdlogger_spi_direct_stop (void)
 
void sdlogger_spi_direct_index_received (void)
 sdlogger_spi_direct_index_received Callback from SD Card when block at index location is received. More...
 
void sdlogger_spi_direct_multiwrite_written (void)
 sdlogger_spi_direct_multiwrite_written Called when a multiwrite is complete. More...
 
void sdlogger_spi_direct_command (void)
 
int sdlogger_spi_direct_check_free_space (struct sdlogger_spi_periph *p, long *fd, uint16_t len)
 
void sdlogger_spi_direct_put_byte (struct sdlogger_spi_periph *p, long fd, uint8_t data)
 
void sdlogger_spi_direct_put_buffer (struct sdlogger_spi_periph *p, long fd, uint8_t *data, uint16_t len)
 
void sdlogger_spi_direct_send_message (void *p, long fd)
 
int sdlogger_spi_direct_char_available (void *p)
 
uint8_t sdlogger_spi_direct_get_byte (void *p)
 

Variables

struct sdlogger_spi_periph sdlogger_spi
 

Detailed Description

Author
Bart Slinger SPI SD Logger that saves pprzlog messages to SD Card.

Definition in file sdlogger_spi_direct.h.


Data Structure Documentation

◆ sdlogger_spi_periph

struct sdlogger_spi_periph

Definition at line 49 of file sdlogger_spi_direct.h.

+ Collaboration diagram for sdlogger_spi_periph:
Data Fields
uint8_t buffer[SDLOGGER_BUFFER_SIZE]
uint8_t command
struct link_device device
uint8_t do_log
uint32_t download_address
uint8_t download_id
uint32_t download_length
uint8_t idx
uint8_t last_completed
uint32_t log_len
uint32_t next_available_address
uint16_t sdcard_buf_idx
enum SDLoggerStatus status

Macro Definition Documentation

◆ SDLOGGER_BUFFER_SIZE

#define SDLOGGER_BUFFER_SIZE   128

Definition at line 29 of file sdlogger_spi_direct.h.

Enumeration Type Documentation

◆ SDLoggerStatus

Enumerator
SDLogger_UnInit 
SDLogger_Error 
SDLogger_Initializing 
SDLogger_RetreivingIndex 
SDLogger_Ready 
SDLogger_Logging 
SDLogger_LoggingFinalBlock 
SDLogger_StoppedLogging 
SDLogger_GettingIndexForUpdate 
SDLogger_UpdatingIndex 
SDLogger_GettingIndexForDownload 
SDLogger_Downloading 

Definition at line 34 of file sdlogger_spi_direct.h.

Function Documentation

◆ sdlogger_spi_direct_char_available()

int sdlogger_spi_direct_char_available ( void *  p)

Definition at line 467 of file sdlogger_spi_direct.c.

References p.

Referenced by sdlogger_spi_direct_init().

+ Here is the caller graph for this function:

◆ sdlogger_spi_direct_check_free_space()

int sdlogger_spi_direct_check_free_space ( struct sdlogger_spi_periph p,
long *  fd,
uint16_t  len 
)

Definition at line 422 of file sdlogger_spi_direct.c.

References p, SDLOGGER_BUFFER_SIZE, and SDLogger_Logging.

Referenced by sdlogger_spi_direct_init().

+ Here is the caller graph for this function:

◆ sdlogger_spi_direct_command()

◆ sdlogger_spi_direct_get_byte()

uint8_t sdlogger_spi_direct_get_byte ( void *  p)

Definition at line 472 of file sdlogger_spi_direct.c.

References p.

Referenced by sdlogger_spi_direct_init().

+ Here is the caller graph for this function:

◆ sdlogger_spi_direct_index_received()

◆ sdlogger_spi_direct_init()

◆ sdlogger_spi_direct_multiwrite_written()

void sdlogger_spi_direct_multiwrite_written ( void  )

sdlogger_spi_direct_multiwrite_written Called when a multiwrite is complete.

Data stored in the logger buffer is then moved to the SD Card buffer, which is now available again.

Definition at line 385 of file sdlogger_spi_direct.c.

References sdlogger_spi_periph::buffer, sdlogger_spi_periph::idx, sdlogger_spi_periph::log_len, SDCard::output_buf, sdcard1, sdlogger_spi_periph::sdcard_buf_idx, and sdlogger_spi.

Referenced by sdlogger_spi_direct_periodic(), and sdlogger_spi_direct_put_byte().

+ Here is the caller graph for this function:

◆ sdlogger_spi_direct_periodic()

◆ 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 at line 454 of file sdlogger_spi_direct.c.

References fd, p, and sdlogger_spi_direct_put_byte().

Referenced by sdlogger_spi_direct_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sdlogger_spi_direct_put_byte()

void sdlogger_spi_direct_put_byte ( struct sdlogger_spi_periph p,
long  fd,
uint8_t  data 
)

Definition at line 434 of file sdlogger_spi_direct.c.

References SDCard::output_buf, p, sdcard1, SDCard_MultiWriteIdle, sdcard_spi_multiwrite_next(), SDLOGGER_BUFFER_SIZE, sdlogger_spi_direct_multiwrite_written(), and SDCard::status.

Referenced by sdlogger_spi_direct_init(), and sdlogger_spi_direct_put_buffer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sdlogger_spi_direct_send_message()

void sdlogger_spi_direct_send_message ( void *  p,
long  fd 
)

Definition at line 462 of file sdlogger_spi_direct.c.

References p.

Referenced by sdlogger_spi_direct_init().

+ Here is the caller graph for this function:

◆ sdlogger_spi_direct_start()

void sdlogger_spi_direct_start ( void  )

Definition at line 282 of file sdlogger_spi_direct.c.

◆ sdlogger_spi_direct_stop()

void sdlogger_spi_direct_stop ( void  )

Definition at line 283 of file sdlogger_spi_direct.c.

Variable Documentation

◆ sdlogger_spi