Main functions for USB host mass storage example.
Copyright (c) 2012-2018 Microchip Technology Inc. and its subsidiaries.
Macros | |
#define | MAX_DRIVE _VOLUMES |
#define | MSG_TEST "Test UHI MSC\n" |
#define | TEST_FILE_NAME "0:uhi_msc_test.txt" |
Typedefs | |
typedef enum test_state | test_state_t |
Enumerations | |
enum | test_state { TEST_NULL, TEST_OK, TEST_NO_PRESENT, TEST_ERROR, TEST_NULL, TEST_OK, TEST_NO_PRESENT, TEST_ERROR } |
Functions | |
int | main (void) |
Main function. Execution starts here. More... | |
static int | main_count_states (test_state_t state) |
static void | main_reset_states (void) |
void | main_usb_connection_event (uhc_device_t *dev, bool b_present) |
Notify that a USB device has been connected or disconnected. More... | |
void | main_usb_sof_event (void) |
Notify that a SOF has been sent (each 1 ms) More... | |
Variables | |
static FIL | file_object |
static FATFS | fs |
static test_state_t | lun_states [MAX_DRIVE] |
static volatile uint16_t | main_usb_sof_counter = 0 |
static char | test_file_name [] |
#define MAX_DRIVE _VOLUMES |
Referenced by main(), main_count_states(), and main_reset_states().
#define MSG_TEST "Test UHI MSC\n" |
Referenced by main().
#define TEST_FILE_NAME "0:uhi_msc_test.txt" |
typedef enum test_state test_state_t |
enum test_state |
int main | ( | void | ) |
Main function. Execution starts here.
References board_init(), cpu_irq_enable(), f_close(), f_mount(), f_open(), f_puts(), FA_CREATE_ALWAYS, FA_WRITE, FR_INVALID_DRIVE, FR_NOT_READY, FR_OK, irq_initialize_vectors, LUN_ID_USB, lun_states, main_count_states(), main_usb_sof_counter, MAX_DRIVE, MSG_TEST, sleepmgr_init(), system_init(), TEST_ERROR, test_file_name, TEST_NO_PRESENT, TEST_NULL, TEST_OK, uhc_start(), uhi_msc_mem_get_lun(), ui_init(), ui_test_finish(), and ui_test_flag_reset().
|
static |
References count, i, lun_states, and MAX_DRIVE.
Referenced by main().
|
static |
References i, lun_states, MAX_DRIVE, and TEST_NULL.
Referenced by main_usb_connection_event().
void main_usb_connection_event | ( | uhc_device_t * | dev, |
bool | b_present | ||
) |
Notify that a USB device has been connected or disconnected.
dev | Pointer on USB device information |
b_present | true, if the device has been connected |
References main_reset_states(), and ui_usb_connection_event().
void main_usb_sof_event | ( | void | ) |
Notify that a SOF has been sent (each 1 ms)
References main_usb_sof_counter, and ui_usb_sof_event().
|
static |
|
static |
|
static |
Referenced by main(), main_count_states(), and main_reset_states().
|
static |
Referenced by main(), and main_usb_sof_event().
|
static |
Referenced by main().