flash_sdcard.h File Reference

library to communicate with an SD card flash memory using the SPI mode (API) More...

Go to the source code of this file.

## Functions

bool | flash_sdcard_setup (void)
| setup communication with SD card More...
uint64_t | flash_sdcard_size (void)
| get size of SD card flash memory More...
uint32_t | flash_sdcard_erase_size (void)
| get size of a erase block More...
bool | flash_sdcard_read_data (uint32_t block, uint8_t *data)
| read data on flash of SD card More...
bool | flash_sdcard_write_data (uint32_t block, uint8_t *data)
| write data on flash of SD card More...

## Detailed Description

library to communicate with an SD card flash memory using the SPI mode (API)

Author
  King Kévin kingk.nosp@m.evin.nosp@m.@cuvo.nosp@m.odoo.nosp@m..info

Date
  2017

Note
  peripherals used: SPI SPI used to communication with SD card

Warning
  all calls are blocking

Definition in file flash_sdcard.h.

## Function Documentation

## flash_sdcard_erase_size()

uint32_t flash_sdcard_erase_size | ( | void |  | ) |

get size of a erase block

Returns
  size of a erase block (in bytes)

Definition at line 562 of file flash_sdcard.c.

## flash_sdcard_read_data()

bool flash_sdcard_read_data | ( | uint32_t | block,
|  | uint8_t * | data
| ) |  |

read data on flash of SD card

Parameters

  [in] | block | address of data to read (in block in 512 bytes unit)
  [out] | data | data block to read (with a size of 512 bytes)

Returns
  if read succeeded

Definition at line 567 of file flash_sdcard.c.

## flash_sdcard_setup()

bool flash_sdcard_setup | ( | void |  | ) |

setup communication with SD card

Returns
  if card has been initialized correctly

Definition at line 381 of file flash_sdcard.c.

## flash_sdcard_size()

uint64_t flash_sdcard_size | ( | void |  | ) |

get size of SD card flash memory

Returns
  size of SD card flash memory (in bytes)

Definition at line 557 of file flash_sdcard.c.

## flash_sdcard_write_data()

bool flash_sdcard_write_data | ( | uint32_t | block,
|  | uint8_t * | data
| ) |  |

write data on flash of SD card

Parameters

  [in] | block | address of data to write (in block in 512 bytes unit)
  [in] | data | data block to write (with a size of 512 bytes)

Returns
  if write succeeded

Definition at line 582 of file flash_sdcard.c.