AliOS Things API HAL SOC SD Guide - Shaofa/AliOS-Things-Certification-Manual GitHub Wiki

API INDEX


1-hal_sd_init

int32_t hal_sd_init(sd_dev_t *sd)
  • Description

    Initialises a sd interface

  • Parameters

    IN/OUT NAME DESC
    [in] sd the interface which should be initialised
  • Returns

    0 : on success, EIO : if an error occurred with any step

2-hal_sd_blks_read

int32_t hal_sd_blks_read(sd_dev_t *sd, uint8_t *data, uint32_t blk_addr,
                         uint32_t blks, uint32_t timeout)
  • Description

    Read sd blocks

  • Parameters

    IN/OUT NAME DESC
    [in] sd the interface which should be initialised
    [out] data pointer to the buffer which will store incoming data
    [in] blk_addr sd blk addr
    [in] blks sd blks
    [in] timeout timeout in milisecond
  • Returns

    0 : on success, EIO : if an error occurred with any step

3-hal_sd_blks_write

int32_t hal_sd_blks_write(sd_dev_t *sd, uint8_t *data, uint32_t blk_addr,
                          uint32_t blks, uint32_t timeout)
  • Description

    Write sd blocks

  • Parameters

    IN/OUT NAME DESC
    [in] sd the interface which should be initialised
    [in] data pointer to the buffer which will store incoming data
    [in] blk_addr sd blk addr
    [in] blks sd blks
    [in] timeout timeout in milisecond
  • Returns

    0 : on success, EIO : if an error occurred with any step

4-hal_sd_erase

int32_t hal_sd_erase(sd_dev_t *sd, uint32_t blk_start_addr, uint32_t blk_end_addr)
  • Description

    Erase sd blocks

  • Parameters

    IN/OUT NAME DESC
    [in] sd the interface which should be initialised
    [in] blk_start_addr sd blocks start addr
    [in] blk_end_addr sd blocks end add
  • Returns

    0 : on success, EIO : if an error occurred with any step

5-hal_sd_stat_get

int32_t hal_sd_stat_get(sd_dev_t *sd, hal_sd_stat *stat)
  • Description

    Get sd state

  • Parameters

    IN/OUT NAME DESC
    [in] sd the interface which should be initialised
    [out] stat pointer to the buffer which will store incoming dat
  • Returns

    0 : on success, EIO : if an error occurred with any step

6-hal_sd_info_get

int32_t hal_sd_info_get(sd_dev_t *sd, hal_sd_info_t *info)
  • Description

    Get sd info

  • Parameters

    IN/OUT NAME DESC
    [in] sd the interface which should be initialised
    [out] stat pointer to the buffer which will store incoming dat
  • Returns

    0 : on success, EIO : if an error occurred with any step

7-hal_sd_finalize

int32_t hal_sd_finalize(sd_dev_t *sd)
  • Description

    Deinitialises a sd interface

  • Parameters

    IN/OUT NAME DESC
    [in] sd the interface which should be initialised
  • Returns

    0 : on success, EIO : if an error occurred with any step

⚠️ **GitHub.com Fallback** ⚠️