/* It is an open source software to implement SD routines to small embedded systems. This is a free software and is opened for education, research and commercial developments under license policy of following trems. (C) 2013 vinxru (aleksey.f.morozov@gmail.com) It is a free software and there is NO WARRANTY. No restriction on use. You can use, modify and redistribute it for personal, non-profit or commercial use UNDER YOUR RESPONSIBILITY. Redistributions of source code must retain the above copyright notice. Version 0.99 5-05-2013 */ #ifndef _SD_H_ #define _SD_H_ #ifdef __cplusplus extern "C" { #endif #include #define LED1_PORT PORTB #define LED1_DDR DDRB #define LED1_PIN PB4 #define LED2_PORT PORTB #define LED2_DDR DDRB #define LED2_PIN PB5 #define LED_R_ON() (LED1_PORT |= (1 << LED1_PIN)) #define LED_R_OFF() (LED1_PORT &= ~(1 << LED1_PIN)) #define LED_W_ON() (LED2_PORT |= (1 << LED2_PIN)) #define LED_W_OFF() (LED2_PORT &= ~(1 << LED2_PIN)) uint8_t sd_init(); /* Инициализация карты */ uint8_t sd_check(); /* Проверка наличия карты */ uint8_t sd_read(uint8_t* buffer, uint32_t sector, uint16_t offsetInSector, uint16_t length); /* Чтение части сектора */ uint8_t sd_write512(uint8_t* buffer, uint32_t sector); /* Запись сектора */ #ifdef __cplusplus } #endif #endif