diff options
author | Damien George <damien.p.george@gmail.com> | 2014-03-17 13:03:41 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-03-17 13:03:41 +0000 |
commit | fb431bf556d26ec298f223963c6f1be9a00a5cb7 (patch) | |
tree | b02e0c1350d6861adb740cc9069b1649fdac0457 /stmhal/sdcard.h | |
parent | c44115f831046b832dffdd0f7ab9acee89c69251 (diff) | |
download | micropython-fb431bf556d26ec298f223963c6f1be9a00a5cb7.tar.gz micropython-fb431bf556d26ec298f223963c6f1be9a00a5cb7.zip |
stmhal: Add SD card support.
Just low-level read/write support. No filesystem yet.
Diffstat (limited to 'stmhal/sdcard.h')
-rw-r--r-- | stmhal/sdcard.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/stmhal/sdcard.h b/stmhal/sdcard.h new file mode 100644 index 0000000000..da7dbddabb --- /dev/null +++ b/stmhal/sdcard.h @@ -0,0 +1,12 @@ +// this is a fixed size and should not be changed +#define SDCARD_BLOCK_SIZE (512) + +void sdcard_init(void); +bool sdcard_is_present(void); +bool sdcard_power_on(void); +void sdcard_power_off(void); +uint64_t sdcard_get_capacity_in_bytes(void); +bool sdcard_read_block(uint8_t *dest, uint32_t block_num); +bool sdcard_write_block(const uint8_t *src, uint32_t block_num); + +extern const struct _mp_obj_base_t pyb_sdcard_obj; |