NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
sdcard.h File Reference
#include <stdint.h>
#include <stdbool.h>
Include dependency graph for sdcard.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  sdcardMetadata_t
 

Typedefs

typedef struct sdcardMetadata_t sdcardMetadata_t
 
typedef void(* sdcard_operationCompleteCallback_c )(sdcardBlockOperation_e operation, uint32_t blockIndex, uint8_t *buffer, uint32_t callbackData)
 
typedef void(* sdcard_profilerCallback_c )(sdcardBlockOperation_e operation, uint32_t blockIndex, uint32_t duration)
 

Enumerations

enum  sdcardBlockOperation_e { SDCARD_BLOCK_OPERATION_READ, SDCARD_BLOCK_OPERATION_WRITE, SDCARD_BLOCK_OPERATION_ERASE }
 
enum  sdcardOperationStatus_e { SDCARD_OPERATION_IN_PROGRESS, SDCARD_OPERATION_BUSY, SDCARD_OPERATION_SUCCESS, SDCARD_OPERATION_FAILURE }
 

Functions

void sdcard_init (bool useDMA)
 
bool sdcard_readBlock (uint32_t blockIndex, uint8_t *buffer, sdcard_operationCompleteCallback_c callback, uint32_t callbackData)
 
sdcardOperationStatus_e sdcard_beginWriteBlocks (uint32_t blockIndex, uint32_t blockCount)
 
sdcardOperationStatus_e sdcard_writeBlock (uint32_t blockIndex, uint8_t *buffer, sdcard_operationCompleteCallback_c callback, uint32_t callbackData)
 
void sdcardInsertionDetectDeinit (void)
 
void sdcardInsertionDetectInit (void)
 
bool sdcard_isInserted (void)
 
bool sdcard_isInitialized (void)
 
bool sdcard_isFunctional (void)
 
bool sdcard_poll (void)
 
const sdcardMetadata_tsdcard_getMetadata (void)
 
void sdcard_setProfilerCallback (sdcard_profilerCallback_c callback)
 

Typedef Documentation

typedef void(* sdcard_operationCompleteCallback_c)(sdcardBlockOperation_e operation, uint32_t blockIndex, uint8_t *buffer, uint32_t callbackData)
typedef void(* sdcard_profilerCallback_c)(sdcardBlockOperation_e operation, uint32_t blockIndex, uint32_t duration)

Enumeration Type Documentation

Enumerator
SDCARD_BLOCK_OPERATION_READ 
SDCARD_BLOCK_OPERATION_WRITE 
SDCARD_BLOCK_OPERATION_ERASE 
Enumerator
SDCARD_OPERATION_IN_PROGRESS 
SDCARD_OPERATION_BUSY 
SDCARD_OPERATION_SUCCESS 
SDCARD_OPERATION_FAILURE 

Function Documentation

sdcardOperationStatus_e sdcard_beginWriteBlocks ( uint32_t  blockIndex,
uint32_t  blockCount 
)
const sdcardMetadata_t* sdcard_getMetadata ( void  )
void sdcard_init ( bool  useDMA)
bool sdcard_isFunctional ( void  )
bool sdcard_isInitialized ( void  )
bool sdcard_isInserted ( void  )
bool sdcard_poll ( void  )
bool sdcard_readBlock ( uint32_t  blockIndex,
uint8_t *  buffer,
sdcard_operationCompleteCallback_c  callback,
uint32_t  callbackData 
)
void sdcard_setProfilerCallback ( sdcard_profilerCallback_c  callback)
sdcardOperationStatus_e sdcard_writeBlock ( uint32_t  blockIndex,
uint8_t *  buffer,
sdcard_operationCompleteCallback_c  callback,
uint32_t  callbackData 
)
void sdcardInsertionDetectDeinit ( void  )
void sdcardInsertionDetectInit ( void  )