The "GR-PEACH_Audio_Playback_7InchLCD_Sample" is a sample code that can provides high-resolution audio playback of FLAC format files. It also allows the user to audio-playback control functions such as play, pause, and stop by manipulating key switches.

Dependencies:   GR-PEACH_video R_BSP TLV320_RBSP USBHost_custom

Fork of GR-PEACH_Audio_Playback_Sample by Renesas

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers sys_scan_folder.h Source File

sys_scan_folder.h

00001 /*******************************************************************************
00002 * DISCLAIMER
00003 * This software is supplied by Renesas Electronics Corporation and is only
00004 * intended for use with Renesas products. No other uses are authorized. This
00005 * software is owned by Renesas Electronics Corporation and is protected under
00006 * all applicable laws, including copyright laws.
00007 * THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
00008 * THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT
00009 * LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
00010 * AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
00011 * TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS
00012 * ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE
00013 * FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR
00014 * ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE
00015 * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
00016 * Renesas reserves the right, without notice, to make changes to this software
00017 * and to discontinue the availability of this software. By using this software,
00018 * you agree to the additional terms and conditions found by accessing the
00019 * following link:
00020 * http://www.renesas.com/disclaimer*
00021 * Copyright (C) 2015 Renesas Electronics Corporation. All rights reserved.
00022 *******************************************************************************/
00023 
00024 #ifndef SYS_SCAN_FOLDER_H
00025 #define SYS_SCAN_FOLDER_H
00026 
00027 #include "r_typedefs.h"
00028 #include "system.h"
00029 
00030 /*--- User defined types ---*/
00031 /* Information of a folder / track. */
00032 typedef struct {
00033     char_t      name[SYS_MAX_NAME_LENGTH + 1];  /* Name of a folder / track. */
00034     uint32_t    parent_number;                  /* Number of the parent folder. */
00035 } item_t;
00036 
00037 /* Information of folder scan in USB memory */
00038 typedef struct {
00039     item_t      folder_list[SYS_MAX_FOLDER_NUM];    /* Folder list */
00040     item_t      track_list[SYS_MAX_TRACK_NUM];      /* Track list */
00041     uint32_t    total_folder;                       /* Total number of folders */
00042     uint32_t    total_track;                        /* Total number of tracks */
00043     char_t      work_buf[SYS_MAX_PATH_LENGTH + 1];  /* Work */
00044                                                     /* (Including the null terminal character.) */
00045 } fid_scan_folder_t;
00046 
00047 /** Initializes the folder structure of USB memory
00048  *
00049  *  @param p_info Pointer to the control data of folder scan module.
00050  */
00051 void fid_init(fid_scan_folder_t * const p_info);
00052 
00053 /** Scans the folder structure of USB memory
00054  *
00055  *  @param p_info Pointer to the control data of folder scan module.
00056  *
00057  *  @returns 
00058  *    Results of process. true is success. false is failure.
00059  */
00060 bool fid_scan_folder_struct(fid_scan_folder_t * const p_info);
00061 
00062 /** Gets the total number of detected tracks
00063  *
00064  *  @param p_info Pointer to the control data of folder scan module.
00065  *
00066  *  @returns 
00067  *    the total number of tracks
00068  */
00069 uint32_t fid_get_total_track(const fid_scan_folder_t * const p_info);
00070 
00071 /** Gets the track name
00072  *
00073  *  @param p_info Pointer to the control data of folder scan module.
00074  *  @param track_id Track ID [0 - (total track - 1)]
00075  *
00076  *  @returns 
00077  *    Pointer to the track name.
00078  */
00079 const char_t *fid_get_track_name(const fid_scan_folder_t * const p_info, 
00080                                                 const uint32_t track_id);
00081 
00082 /** Opens the track
00083  *
00084  *  @param p_info Pointer to the control data of folder scan module.
00085  *  @param track_id Track ID [0 - (total track - 1)]
00086  *
00087  *  @returns 
00088  *    Pointer to the track handle
00089  */
00090 FILE *fid_open_track(fid_scan_folder_t * const p_info, const uint32_t track_id);
00091 
00092 /** Closes the track
00093  *
00094  *  @param fp Pointer to the track handle
00095  */
00096 void fid_close_track(FILE * const fp);
00097 
00098 #endif /* SYS_SCAN_FOLDER_H */