ATmega8GPSLoggerBasismodul  20131018
mmc.h File Reference
#include <avr/io.h>
Include dependency graph for mmc.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SPI_Mode   1
 
#define MMC_Write   PORTB
 
#define MMC_Read   PINB
 
#define MMC_Direction_REG   DDRB
 
#define MMC_Disable()   MMC_Write|= (1<<MMC_Chip_Select);
 
#define MMC_Enable()   MMC_Write&=~(1<<MMC_Chip_Select);
 
#define SDC_PutSector   mmc_write_sector
 
#define SDC_GetSector   mmc_read_sector
 
#define nop()   __asm__ __volatile__ ("nop" ::)
 

Functions

unsigned char mmc_read_byte (void)
 
void mmc_write_byte (unsigned char)
 
void mmc_read_block (unsigned char *, unsigned char *, unsigned in)
 
unsigned char mmc_init (void)
 
unsigned char mmc_read_sector (unsigned long, unsigned char *)
 
unsigned char mmc_write_sector (unsigned long, unsigned char *)
 
unsigned char mmc_write_command (unsigned char *)
 
unsigned char mmc_read_csd (unsigned char *)
 
unsigned char mmc_read_cid (unsigned char *)
 

Macro Definition Documentation

#define MMC_Direction_REG   DDRB

Definition at line 17 of file mmc.h.

Referenced by mmc_init().

#define MMC_Disable ( )    MMC_Write|= (1<<MMC_Chip_Select);

Definition at line 63 of file mmc.h.

Referenced by mmc_init(), mmc_read_block(), mmc_write_command(), and mmc_write_sector().

#define MMC_Enable ( )    MMC_Write&=~(1<<MMC_Chip_Select);

Definition at line 66 of file mmc.h.

Referenced by mmc_write_command().

#define MMC_Read   PINB

Definition at line 16 of file mmc.h.

Referenced by mmc_read_byte().

#define MMC_Write   PORTB

Definition at line 15 of file mmc.h.

Referenced by mmc_init(), mmc_read_byte(), and mmc_write_byte().

#define nop ( )    __asm__ __volatile__ ("nop" ::)

Definition at line 72 of file mmc.h.

Referenced by mmc_init().

#define SDC_PutSector   mmc_write_sector

Definition at line 68 of file mmc.h.

Referenced by AppendCluster(), CreateDirectoryEntry(), fflush_(), FindNextFreeCluster(), and fputchar_().

#define SPI_Mode   1

Definition at line 12 of file mmc.h.

Function Documentation

unsigned char mmc_init ( void  )

Definition at line 32 of file mmc.c.

References MMC_Direction_REG, MMC_Disable, MMC_Write, mmc_write_byte(), mmc_write_command(), and nop.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

void mmc_read_block ( unsigned char *  ,
unsigned char *  ,
unsigned  in 
)
unsigned char mmc_read_byte ( void  )

Definition at line 135 of file mmc.c.

References MMC_Read, and MMC_Write.

Referenced by mmc_read_block(), mmc_write_command(), and mmc_write_sector().

Here is the caller graph for this function:

unsigned char mmc_read_cid ( unsigned char *  )

Definition at line 309 of file mmc.c.

References mmc_read_block().

Here is the call graph for this function:

unsigned char mmc_read_csd ( unsigned char *  )

Definition at line 322 of file mmc.c.

References mmc_read_block().

Here is the call graph for this function:

unsigned char mmc_read_sector ( unsigned  long,
unsigned char *   
)

Definition at line 286 of file mmc.c.

References mmc_read_block().

Here is the call graph for this function:

void mmc_write_byte ( unsigned  char)

Definition at line 166 of file mmc.c.

References MMC_Write.

Referenced by mmc_init(), mmc_write_command(), and mmc_write_sector().

Here is the caller graph for this function:

unsigned char mmc_write_command ( unsigned char *  )

Definition at line 99 of file mmc.c.

References MMC_Disable, MMC_Enable, mmc_read_byte(), and mmc_write_byte().

Referenced by mmc_init(), mmc_read_block(), and mmc_write_sector().

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned char mmc_write_sector ( unsigned  long,
unsigned char *   
)

Definition at line 195 of file mmc.c.

References MMC_Disable, mmc_read_byte(), mmc_write_byte(), and mmc_write_command().

Here is the call graph for this function: