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

Note

For a sample program of without LCD Board, please refer to GR-PEACH_Audio_Playback_Sample.

Introduction

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.

1. Overview of the Sample Code

1.1 Software Block Diagram

Figure 1.1 shows the software block diagram.

/media/uploads/1050186/lcd_figure1_1.png

1.2 Pin Definitions

Table 1.1 shows the pins used in this sample code.

/media/uploads/1050186/lcd_table1_1.png

2. Sample Code Operating Environment

In order to operate this sample code, GR-PEACH, Audio Camera Shield and 7.1 inch LCD Shield must be needed. For details on Audio Camera Shield and 7.1 inch LCD Shield, please refer to the following links, respectively:

In this section, it is described that how board is configured and to control audio playback via command line and touch screen.

2.1 Operating Environment

Figure 2.1 shows the overview of the operating environment for this sample code.

/media/uploads/1050186/lcd_figure2_1.png

Figure 2.2 and 2.3 show how to configure GR-PEACH, Audio Camera Shield and 7.1 inch LCD shield when using USB0 and USB1, respectively.

/media/uploads/1050186/lcd_figure2_2.png /media/uploads/1050186/lcd_figure2_3.png

Table 2.1 lists the overview of Graphical User Interface (GUI) of this sample code.

/media/uploads/1050186/lcd_table2_1.png

2.2 List of User Operations

Table 2.2 shows the relationship among Audio Playback, Command Line and Onboard Switch.

/media/uploads/1050186/lcd_table2_2.png

3. Function Outline

Table 3.1, 3.2 and 3.3 shows the overview of functions implemented in this sample code.

/media/uploads/1050186/lcd_table3_1.png /media/uploads/1050186/lcd_table3_2.png /media/uploads/1050186/lcd_table3_3.png /media/uploads/1050186/lcd_figure3_1.png

3.1 Playback Control

This sample program supports the operation "play", "pause", "stop", "play next song" and "play previous song".

3.2 Trick Play Control

In order to enable/disable Repeat Mode, user need to type "repeat" on command line or click the corresponding icon shown in Table 2.2. By derault, Repeat Mode is enabled. When Repeat Mode is enabled, the first song is played back after the playback of the last song is finished. Otherwise, the playback is shopped when finishing to play back the last song.

3.3 How to see Song Information

The information of the song being played back can be seen by typing playinfo on command line. Table 3.4 lists the items user can see on the terminal.

/media/uploads/dkato/audioplayback_table3_4.png

3.4 How to analyze the folder structure in USB stick

In this sample code, the folder structure in USB stick is analyzed in the breadth-first order. Table 3.5 shows how the files in USB stick are numbered.

/media/uploads/dkato/audioplayback_table3_5.png

4.Others

4.1 Serial Communication Setting

With respect to the default serial communication related setting on mbed, please refer to the follwing link:
https://developer.mbed.org/teams/Renesas/wiki/GR-PEACH-Getting-Started#install-the-usb-serial-communication
Please set up the terminal software you would like to use on your PC in consideration of the above. For example, 9600 should be specified for the baud rate on the terminal in order to control this sample via command line.

4.2 Necessary modification when using GCC ARM Embedded

If you would like to use GCC ARM Embedded, you must revise the following linker script incorporated in mbed OS 5 package as follows:

  • Linker Script to be modified
    $(PROJECT_ROOT)/mbed-os/targets/TARGET_RENESAS/TARGET_RZ_A1H/device/TOOLCHAIN_GCC_ARM/RZA1H.ld

    Please note that $(PROJECT_ROOT) in the above denotes the root directory of this sample code

  • Before Modification

RZA1H.ld

/* Linker script for mbed RZ_A1H */

/* Linker script to configure memory regions. */
MEMORY
{
  ROM   (rx)  : ORIGIN = 0x00000000, LENGTH = 0x02000000
  BOOT_LOADER (rx) : ORIGIN = 0x18000000, LENGTH = 0x00004000 
  SFLASH (rx) : ORIGIN = 0x18004000, LENGTH = 0x07FFC000 
  L_TTB (rw)  : ORIGIN = 0x20000000, LENGTH = 0x00004000 
  RAM (rwx) : ORIGIN = 0x20020000, LENGTH = 0x00700000
  RAM_NC (rwx) : ORIGIN = 0x20900000, LENGTH = 0x00100000
}
(snip)
  • After Modification

RZA1H.ld

/* Linker script for mbed RZ_A1H */

/* Linker script to configure memory regions. */
MEMORY
{
  ROM   (rx)  : ORIGIN = 0x00000000, LENGTH = 0x02000000
  BOOT_LOADER (rx) : ORIGIN = 0x18000000, LENGTH = 0x00004000 
  SFLASH (rx) : ORIGIN = 0x18004000, LENGTH = 0x07FFC000 
  L_TTB (rw)  : ORIGIN = 0x20000000, LENGTH = 0x00004000 
  RAM (rwx) : ORIGIN = 0x20020000, LENGTH = 0x00180000
  RAM_NC (rwx) : ORIGIN = 0x20200000, LENGTH = 0x00680000
}
(snip)
Committer:
Osamu Nakamura
Date:
Tue Apr 11 12:42:10 2017 +0900
Revision:
6:a957aaa284f0
Parent:
0:ee40da884cfc
Update R-BSP from rev. cbb9d60c8748 to fb9eda52224e so that this program can be compiled with IAR toolchain.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
dkato 0:ee40da884cfc 1 GNU LESSER GENERAL PUBLIC LICENSE
dkato 0:ee40da884cfc 2 Version 2.1, February 1999
dkato 0:ee40da884cfc 3
dkato 0:ee40da884cfc 4 Copyright (C) 1991, 1999 Free Software Foundation, Inc.
dkato 0:ee40da884cfc 5 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
dkato 0:ee40da884cfc 6 Everyone is permitted to copy and distribute verbatim copies
dkato 0:ee40da884cfc 7 of this license document, but changing it is not allowed.
dkato 0:ee40da884cfc 8
dkato 0:ee40da884cfc 9 [This is the first released version of the Lesser GPL. It also counts
dkato 0:ee40da884cfc 10 as the successor of the GNU Library Public License, version 2, hence
dkato 0:ee40da884cfc 11 the version number 2.1.]
dkato 0:ee40da884cfc 12
dkato 0:ee40da884cfc 13 Preamble
dkato 0:ee40da884cfc 14
dkato 0:ee40da884cfc 15 The licenses for most software are designed to take away your
dkato 0:ee40da884cfc 16 freedom to share and change it. By contrast, the GNU General Public
dkato 0:ee40da884cfc 17 Licenses are intended to guarantee your freedom to share and change
dkato 0:ee40da884cfc 18 free software--to make sure the software is free for all its users.
dkato 0:ee40da884cfc 19
dkato 0:ee40da884cfc 20 This license, the Lesser General Public License, applies to some
dkato 0:ee40da884cfc 21 specially designated software packages--typically libraries--of the
dkato 0:ee40da884cfc 22 Free Software Foundation and other authors who decide to use it. You
dkato 0:ee40da884cfc 23 can use it too, but we suggest you first think carefully about whether
dkato 0:ee40da884cfc 24 this license or the ordinary General Public License is the better
dkato 0:ee40da884cfc 25 strategy to use in any particular case, based on the explanations below.
dkato 0:ee40da884cfc 26
dkato 0:ee40da884cfc 27 When we speak of free software, we are referring to freedom of use,
dkato 0:ee40da884cfc 28 not price. Our General Public Licenses are designed to make sure that
dkato 0:ee40da884cfc 29 you have the freedom to distribute copies of free software (and charge
dkato 0:ee40da884cfc 30 for this service if you wish); that you receive source code or can get
dkato 0:ee40da884cfc 31 it if you want it; that you can change the software and use pieces of
dkato 0:ee40da884cfc 32 it in new free programs; and that you are informed that you can do
dkato 0:ee40da884cfc 33 these things.
dkato 0:ee40da884cfc 34
dkato 0:ee40da884cfc 35 To protect your rights, we need to make restrictions that forbid
dkato 0:ee40da884cfc 36 distributors to deny you these rights or to ask you to surrender these
dkato 0:ee40da884cfc 37 rights. These restrictions translate to certain responsibilities for
dkato 0:ee40da884cfc 38 you if you distribute copies of the library or if you modify it.
dkato 0:ee40da884cfc 39
dkato 0:ee40da884cfc 40 For example, if you distribute copies of the library, whether gratis
dkato 0:ee40da884cfc 41 or for a fee, you must give the recipients all the rights that we gave
dkato 0:ee40da884cfc 42 you. You must make sure that they, too, receive or can get the source
dkato 0:ee40da884cfc 43 code. If you link other code with the library, you must provide
dkato 0:ee40da884cfc 44 complete object files to the recipients, so that they can relink them
dkato 0:ee40da884cfc 45 with the library after making changes to the library and recompiling
dkato 0:ee40da884cfc 46 it. And you must show them these terms so they know their rights.
dkato 0:ee40da884cfc 47
dkato 0:ee40da884cfc 48 We protect your rights with a two-step method: (1) we copyright the
dkato 0:ee40da884cfc 49 library, and (2) we offer you this license, which gives you legal
dkato 0:ee40da884cfc 50 permission to copy, distribute and/or modify the library.
dkato 0:ee40da884cfc 51
dkato 0:ee40da884cfc 52 To protect each distributor, we want to make it very clear that
dkato 0:ee40da884cfc 53 there is no warranty for the free library. Also, if the library is
dkato 0:ee40da884cfc 54 modified by someone else and passed on, the recipients should know
dkato 0:ee40da884cfc 55 that what they have is not the original version, so that the original
dkato 0:ee40da884cfc 56 author's reputation will not be affected by problems that might be
dkato 0:ee40da884cfc 57 introduced by others.
dkato 0:ee40da884cfc 58
dkato 0:ee40da884cfc 59 Finally, software patents pose a constant threat to the existence of
dkato 0:ee40da884cfc 60 any free program. We wish to make sure that a company cannot
dkato 0:ee40da884cfc 61 effectively restrict the users of a free program by obtaining a
dkato 0:ee40da884cfc 62 restrictive license from a patent holder. Therefore, we insist that
dkato 0:ee40da884cfc 63 any patent license obtained for a version of the library must be
dkato 0:ee40da884cfc 64 consistent with the full freedom of use specified in this license.
dkato 0:ee40da884cfc 65
dkato 0:ee40da884cfc 66 Most GNU software, including some libraries, is covered by the
dkato 0:ee40da884cfc 67 ordinary GNU General Public License. This license, the GNU Lesser
dkato 0:ee40da884cfc 68 General Public License, applies to certain designated libraries, and
dkato 0:ee40da884cfc 69 is quite different from the ordinary General Public License. We use
dkato 0:ee40da884cfc 70 this license for certain libraries in order to permit linking those
dkato 0:ee40da884cfc 71 libraries into non-free programs.
dkato 0:ee40da884cfc 72
dkato 0:ee40da884cfc 73 When a program is linked with a library, whether statically or using
dkato 0:ee40da884cfc 74 a shared library, the combination of the two is legally speaking a
dkato 0:ee40da884cfc 75 combined work, a derivative of the original library. The ordinary
dkato 0:ee40da884cfc 76 General Public License therefore permits such linking only if the
dkato 0:ee40da884cfc 77 entire combination fits its criteria of freedom. The Lesser General
dkato 0:ee40da884cfc 78 Public License permits more lax criteria for linking other code with
dkato 0:ee40da884cfc 79 the library.
dkato 0:ee40da884cfc 80
dkato 0:ee40da884cfc 81 We call this license the "Lesser" General Public License because it
dkato 0:ee40da884cfc 82 does Less to protect the user's freedom than the ordinary General
dkato 0:ee40da884cfc 83 Public License. It also provides other free software developers Less
dkato 0:ee40da884cfc 84 of an advantage over competing non-free programs. These disadvantages
dkato 0:ee40da884cfc 85 are the reason we use the ordinary General Public License for many
dkato 0:ee40da884cfc 86 libraries. However, the Lesser license provides advantages in certain
dkato 0:ee40da884cfc 87 special circumstances.
dkato 0:ee40da884cfc 88
dkato 0:ee40da884cfc 89 For example, on rare occasions, there may be a special need to
dkato 0:ee40da884cfc 90 encourage the widest possible use of a certain library, so that it becomes
dkato 0:ee40da884cfc 91 a de-facto standard. To achieve this, non-free programs must be
dkato 0:ee40da884cfc 92 allowed to use the library. A more frequent case is that a free
dkato 0:ee40da884cfc 93 library does the same job as widely used non-free libraries. In this
dkato 0:ee40da884cfc 94 case, there is little to gain by limiting the free library to free
dkato 0:ee40da884cfc 95 software only, so we use the Lesser General Public License.
dkato 0:ee40da884cfc 96
dkato 0:ee40da884cfc 97 In other cases, permission to use a particular library in non-free
dkato 0:ee40da884cfc 98 programs enables a greater number of people to use a large body of
dkato 0:ee40da884cfc 99 free software. For example, permission to use the GNU C Library in
dkato 0:ee40da884cfc 100 non-free programs enables many more people to use the whole GNU
dkato 0:ee40da884cfc 101 operating system, as well as its variant, the GNU/Linux operating
dkato 0:ee40da884cfc 102 system.
dkato 0:ee40da884cfc 103
dkato 0:ee40da884cfc 104 Although the Lesser General Public License is Less protective of the
dkato 0:ee40da884cfc 105 users' freedom, it does ensure that the user of a program that is
dkato 0:ee40da884cfc 106 linked with the Library has the freedom and the wherewithal to run
dkato 0:ee40da884cfc 107 that program using a modified version of the Library.
dkato 0:ee40da884cfc 108
dkato 0:ee40da884cfc 109 The precise terms and conditions for copying, distribution and
dkato 0:ee40da884cfc 110 modification follow. Pay close attention to the difference between a
dkato 0:ee40da884cfc 111 "work based on the library" and a "work that uses the library". The
dkato 0:ee40da884cfc 112 former contains code derived from the library, whereas the latter must
dkato 0:ee40da884cfc 113 be combined with the library in order to run.
dkato 0:ee40da884cfc 114
dkato 0:ee40da884cfc 115 GNU LESSER GENERAL PUBLIC LICENSE
dkato 0:ee40da884cfc 116 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
dkato 0:ee40da884cfc 117
dkato 0:ee40da884cfc 118 0. This License Agreement applies to any software library or other
dkato 0:ee40da884cfc 119 program which contains a notice placed by the copyright holder or
dkato 0:ee40da884cfc 120 other authorized party saying it may be distributed under the terms of
dkato 0:ee40da884cfc 121 this Lesser General Public License (also called "this License").
dkato 0:ee40da884cfc 122 Each licensee is addressed as "you".
dkato 0:ee40da884cfc 123
dkato 0:ee40da884cfc 124 A "library" means a collection of software functions and/or data
dkato 0:ee40da884cfc 125 prepared so as to be conveniently linked with application programs
dkato 0:ee40da884cfc 126 (which use some of those functions and data) to form executables.
dkato 0:ee40da884cfc 127
dkato 0:ee40da884cfc 128 The "Library", below, refers to any such software library or work
dkato 0:ee40da884cfc 129 which has been distributed under these terms. A "work based on the
dkato 0:ee40da884cfc 130 Library" means either the Library or any derivative work under
dkato 0:ee40da884cfc 131 copyright law: that is to say, a work containing the Library or a
dkato 0:ee40da884cfc 132 portion of it, either verbatim or with modifications and/or translated
dkato 0:ee40da884cfc 133 straightforwardly into another language. (Hereinafter, translation is
dkato 0:ee40da884cfc 134 included without limitation in the term "modification".)
dkato 0:ee40da884cfc 135
dkato 0:ee40da884cfc 136 "Source code" for a work means the preferred form of the work for
dkato 0:ee40da884cfc 137 making modifications to it. For a library, complete source code means
dkato 0:ee40da884cfc 138 all the source code for all modules it contains, plus any associated
dkato 0:ee40da884cfc 139 interface definition files, plus the scripts used to control compilation
dkato 0:ee40da884cfc 140 and installation of the library.
dkato 0:ee40da884cfc 141
dkato 0:ee40da884cfc 142 Activities other than copying, distribution and modification are not
dkato 0:ee40da884cfc 143 covered by this License; they are outside its scope. The act of
dkato 0:ee40da884cfc 144 running a program using the Library is not restricted, and output from
dkato 0:ee40da884cfc 145 such a program is covered only if its contents constitute a work based
dkato 0:ee40da884cfc 146 on the Library (independent of the use of the Library in a tool for
dkato 0:ee40da884cfc 147 writing it). Whether that is true depends on what the Library does
dkato 0:ee40da884cfc 148 and what the program that uses the Library does.
dkato 0:ee40da884cfc 149
dkato 0:ee40da884cfc 150 1. You may copy and distribute verbatim copies of the Library's
dkato 0:ee40da884cfc 151 complete source code as you receive it, in any medium, provided that
dkato 0:ee40da884cfc 152 you conspicuously and appropriately publish on each copy an
dkato 0:ee40da884cfc 153 appropriate copyright notice and disclaimer of warranty; keep intact
dkato 0:ee40da884cfc 154 all the notices that refer to this License and to the absence of any
dkato 0:ee40da884cfc 155 warranty; and distribute a copy of this License along with the
dkato 0:ee40da884cfc 156 Library.
dkato 0:ee40da884cfc 157
dkato 0:ee40da884cfc 158 You may charge a fee for the physical act of transferring a copy,
dkato 0:ee40da884cfc 159 and you may at your option offer warranty protection in exchange for a
dkato 0:ee40da884cfc 160 fee.
dkato 0:ee40da884cfc 161
dkato 0:ee40da884cfc 162 2. You may modify your copy or copies of the Library or any portion
dkato 0:ee40da884cfc 163 of it, thus forming a work based on the Library, and copy and
dkato 0:ee40da884cfc 164 distribute such modifications or work under the terms of Section 1
dkato 0:ee40da884cfc 165 above, provided that you also meet all of these conditions:
dkato 0:ee40da884cfc 166
dkato 0:ee40da884cfc 167 a) The modified work must itself be a software library.
dkato 0:ee40da884cfc 168
dkato 0:ee40da884cfc 169 b) You must cause the files modified to carry prominent notices
dkato 0:ee40da884cfc 170 stating that you changed the files and the date of any change.
dkato 0:ee40da884cfc 171
dkato 0:ee40da884cfc 172 c) You must cause the whole of the work to be licensed at no
dkato 0:ee40da884cfc 173 charge to all third parties under the terms of this License.
dkato 0:ee40da884cfc 174
dkato 0:ee40da884cfc 175 d) If a facility in the modified Library refers to a function or a
dkato 0:ee40da884cfc 176 table of data to be supplied by an application program that uses
dkato 0:ee40da884cfc 177 the facility, other than as an argument passed when the facility
dkato 0:ee40da884cfc 178 is invoked, then you must make a good faith effort to ensure that,
dkato 0:ee40da884cfc 179 in the event an application does not supply such function or
dkato 0:ee40da884cfc 180 table, the facility still operates, and performs whatever part of
dkato 0:ee40da884cfc 181 its purpose remains meaningful.
dkato 0:ee40da884cfc 182
dkato 0:ee40da884cfc 183 (For example, a function in a library to compute square roots has
dkato 0:ee40da884cfc 184 a purpose that is entirely well-defined independent of the
dkato 0:ee40da884cfc 185 application. Therefore, Subsection 2d requires that any
dkato 0:ee40da884cfc 186 application-supplied function or table used by this function must
dkato 0:ee40da884cfc 187 be optional: if the application does not supply it, the square
dkato 0:ee40da884cfc 188 root function must still compute square roots.)
dkato 0:ee40da884cfc 189
dkato 0:ee40da884cfc 190 These requirements apply to the modified work as a whole. If
dkato 0:ee40da884cfc 191 identifiable sections of that work are not derived from the Library,
dkato 0:ee40da884cfc 192 and can be reasonably considered independent and separate works in
dkato 0:ee40da884cfc 193 themselves, then this License, and its terms, do not apply to those
dkato 0:ee40da884cfc 194 sections when you distribute them as separate works. But when you
dkato 0:ee40da884cfc 195 distribute the same sections as part of a whole which is a work based
dkato 0:ee40da884cfc 196 on the Library, the distribution of the whole must be on the terms of
dkato 0:ee40da884cfc 197 this License, whose permissions for other licensees extend to the
dkato 0:ee40da884cfc 198 entire whole, and thus to each and every part regardless of who wrote
dkato 0:ee40da884cfc 199 it.
dkato 0:ee40da884cfc 200
dkato 0:ee40da884cfc 201 Thus, it is not the intent of this section to claim rights or contest
dkato 0:ee40da884cfc 202 your rights to work written entirely by you; rather, the intent is to
dkato 0:ee40da884cfc 203 exercise the right to control the distribution of derivative or
dkato 0:ee40da884cfc 204 collective works based on the Library.
dkato 0:ee40da884cfc 205
dkato 0:ee40da884cfc 206 In addition, mere aggregation of another work not based on the Library
dkato 0:ee40da884cfc 207 with the Library (or with a work based on the Library) on a volume of
dkato 0:ee40da884cfc 208 a storage or distribution medium does not bring the other work under
dkato 0:ee40da884cfc 209 the scope of this License.
dkato 0:ee40da884cfc 210
dkato 0:ee40da884cfc 211 3. You may opt to apply the terms of the ordinary GNU General Public
dkato 0:ee40da884cfc 212 License instead of this License to a given copy of the Library. To do
dkato 0:ee40da884cfc 213 this, you must alter all the notices that refer to this License, so
dkato 0:ee40da884cfc 214 that they refer to the ordinary GNU General Public License, version 2,
dkato 0:ee40da884cfc 215 instead of to this License. (If a newer version than version 2 of the
dkato 0:ee40da884cfc 216 ordinary GNU General Public License has appeared, then you can specify
dkato 0:ee40da884cfc 217 that version instead if you wish.) Do not make any other change in
dkato 0:ee40da884cfc 218 these notices.
dkato 0:ee40da884cfc 219
dkato 0:ee40da884cfc 220 Once this change is made in a given copy, it is irreversible for
dkato 0:ee40da884cfc 221 that copy, so the ordinary GNU General Public License applies to all
dkato 0:ee40da884cfc 222 subsequent copies and derivative works made from that copy.
dkato 0:ee40da884cfc 223
dkato 0:ee40da884cfc 224 This option is useful when you wish to copy part of the code of
dkato 0:ee40da884cfc 225 the Library into a program that is not a library.
dkato 0:ee40da884cfc 226
dkato 0:ee40da884cfc 227 4. You may copy and distribute the Library (or a portion or
dkato 0:ee40da884cfc 228 derivative of it, under Section 2) in object code or executable form
dkato 0:ee40da884cfc 229 under the terms of Sections 1 and 2 above provided that you accompany
dkato 0:ee40da884cfc 230 it with the complete corresponding machine-readable source code, which
dkato 0:ee40da884cfc 231 must be distributed under the terms of Sections 1 and 2 above on a
dkato 0:ee40da884cfc 232 medium customarily used for software interchange.
dkato 0:ee40da884cfc 233
dkato 0:ee40da884cfc 234 If distribution of object code is made by offering access to copy
dkato 0:ee40da884cfc 235 from a designated place, then offering equivalent access to copy the
dkato 0:ee40da884cfc 236 source code from the same place satisfies the requirement to
dkato 0:ee40da884cfc 237 distribute the source code, even though third parties are not
dkato 0:ee40da884cfc 238 compelled to copy the source along with the object code.
dkato 0:ee40da884cfc 239
dkato 0:ee40da884cfc 240 5. A program that contains no derivative of any portion of the
dkato 0:ee40da884cfc 241 Library, but is designed to work with the Library by being compiled or
dkato 0:ee40da884cfc 242 linked with it, is called a "work that uses the Library". Such a
dkato 0:ee40da884cfc 243 work, in isolation, is not a derivative work of the Library, and
dkato 0:ee40da884cfc 244 therefore falls outside the scope of this License.
dkato 0:ee40da884cfc 245
dkato 0:ee40da884cfc 246 However, linking a "work that uses the Library" with the Library
dkato 0:ee40da884cfc 247 creates an executable that is a derivative of the Library (because it
dkato 0:ee40da884cfc 248 contains portions of the Library), rather than a "work that uses the
dkato 0:ee40da884cfc 249 library". The executable is therefore covered by this License.
dkato 0:ee40da884cfc 250 Section 6 states terms for distribution of such executables.
dkato 0:ee40da884cfc 251
dkato 0:ee40da884cfc 252 When a "work that uses the Library" uses material from a header file
dkato 0:ee40da884cfc 253 that is part of the Library, the object code for the work may be a
dkato 0:ee40da884cfc 254 derivative work of the Library even though the source code is not.
dkato 0:ee40da884cfc 255 Whether this is true is especially significant if the work can be
dkato 0:ee40da884cfc 256 linked without the Library, or if the work is itself a library. The
dkato 0:ee40da884cfc 257 threshold for this to be true is not precisely defined by law.
dkato 0:ee40da884cfc 258
dkato 0:ee40da884cfc 259 If such an object file uses only numerical parameters, data
dkato 0:ee40da884cfc 260 structure layouts and accessors, and small macros and small inline
dkato 0:ee40da884cfc 261 functions (ten lines or less in length), then the use of the object
dkato 0:ee40da884cfc 262 file is unrestricted, regardless of whether it is legally a derivative
dkato 0:ee40da884cfc 263 work. (Executables containing this object code plus portions of the
dkato 0:ee40da884cfc 264 Library will still fall under Section 6.)
dkato 0:ee40da884cfc 265
dkato 0:ee40da884cfc 266 Otherwise, if the work is a derivative of the Library, you may
dkato 0:ee40da884cfc 267 distribute the object code for the work under the terms of Section 6.
dkato 0:ee40da884cfc 268 Any executables containing that work also fall under Section 6,
dkato 0:ee40da884cfc 269 whether or not they are linked directly with the Library itself.
dkato 0:ee40da884cfc 270
dkato 0:ee40da884cfc 271 6. As an exception to the Sections above, you may also combine or
dkato 0:ee40da884cfc 272 link a "work that uses the Library" with the Library to produce a
dkato 0:ee40da884cfc 273 work containing portions of the Library, and distribute that work
dkato 0:ee40da884cfc 274 under terms of your choice, provided that the terms permit
dkato 0:ee40da884cfc 275 modification of the work for the customer's own use and reverse
dkato 0:ee40da884cfc 276 engineering for debugging such modifications.
dkato 0:ee40da884cfc 277
dkato 0:ee40da884cfc 278 You must give prominent notice with each copy of the work that the
dkato 0:ee40da884cfc 279 Library is used in it and that the Library and its use are covered by
dkato 0:ee40da884cfc 280 this License. You must supply a copy of this License. If the work
dkato 0:ee40da884cfc 281 during execution displays copyright notices, you must include the
dkato 0:ee40da884cfc 282 copyright notice for the Library among them, as well as a reference
dkato 0:ee40da884cfc 283 directing the user to the copy of this License. Also, you must do one
dkato 0:ee40da884cfc 284 of these things:
dkato 0:ee40da884cfc 285
dkato 0:ee40da884cfc 286 a) Accompany the work with the complete corresponding
dkato 0:ee40da884cfc 287 machine-readable source code for the Library including whatever
dkato 0:ee40da884cfc 288 changes were used in the work (which must be distributed under
dkato 0:ee40da884cfc 289 Sections 1 and 2 above); and, if the work is an executable linked
dkato 0:ee40da884cfc 290 with the Library, with the complete machine-readable "work that
dkato 0:ee40da884cfc 291 uses the Library", as object code and/or source code, so that the
dkato 0:ee40da884cfc 292 user can modify the Library and then relink to produce a modified
dkato 0:ee40da884cfc 293 executable containing the modified Library. (It is understood
dkato 0:ee40da884cfc 294 that the user who changes the contents of definitions files in the
dkato 0:ee40da884cfc 295 Library will not necessarily be able to recompile the application
dkato 0:ee40da884cfc 296 to use the modified definitions.)
dkato 0:ee40da884cfc 297
dkato 0:ee40da884cfc 298 b) Use a suitable shared library mechanism for linking with the
dkato 0:ee40da884cfc 299 Library. A suitable mechanism is one that (1) uses at run time a
dkato 0:ee40da884cfc 300 copy of the library already present on the user's computer system,
dkato 0:ee40da884cfc 301 rather than copying library functions into the executable, and (2)
dkato 0:ee40da884cfc 302 will operate properly with a modified version of the library, if
dkato 0:ee40da884cfc 303 the user installs one, as long as the modified version is
dkato 0:ee40da884cfc 304 interface-compatible with the version that the work was made with.
dkato 0:ee40da884cfc 305
dkato 0:ee40da884cfc 306 c) Accompany the work with a written offer, valid for at
dkato 0:ee40da884cfc 307 least three years, to give the same user the materials
dkato 0:ee40da884cfc 308 specified in Subsection 6a, above, for a charge no more
dkato 0:ee40da884cfc 309 than the cost of performing this distribution.
dkato 0:ee40da884cfc 310
dkato 0:ee40da884cfc 311 d) If distribution of the work is made by offering access to copy
dkato 0:ee40da884cfc 312 from a designated place, offer equivalent access to copy the above
dkato 0:ee40da884cfc 313 specified materials from the same place.
dkato 0:ee40da884cfc 314
dkato 0:ee40da884cfc 315 e) Verify that the user has already received a copy of these
dkato 0:ee40da884cfc 316 materials or that you have already sent this user a copy.
dkato 0:ee40da884cfc 317
dkato 0:ee40da884cfc 318 For an executable, the required form of the "work that uses the
dkato 0:ee40da884cfc 319 Library" must include any data and utility programs needed for
dkato 0:ee40da884cfc 320 reproducing the executable from it. However, as a special exception,
dkato 0:ee40da884cfc 321 the materials to be distributed need not include anything that is
dkato 0:ee40da884cfc 322 normally distributed (in either source or binary form) with the major
dkato 0:ee40da884cfc 323 components (compiler, kernel, and so on) of the operating system on
dkato 0:ee40da884cfc 324 which the executable runs, unless that component itself accompanies
dkato 0:ee40da884cfc 325 the executable.
dkato 0:ee40da884cfc 326
dkato 0:ee40da884cfc 327 It may happen that this requirement contradicts the license
dkato 0:ee40da884cfc 328 restrictions of other proprietary libraries that do not normally
dkato 0:ee40da884cfc 329 accompany the operating system. Such a contradiction means you cannot
dkato 0:ee40da884cfc 330 use both them and the Library together in an executable that you
dkato 0:ee40da884cfc 331 distribute.
dkato 0:ee40da884cfc 332
dkato 0:ee40da884cfc 333 7. You may place library facilities that are a work based on the
dkato 0:ee40da884cfc 334 Library side-by-side in a single library together with other library
dkato 0:ee40da884cfc 335 facilities not covered by this License, and distribute such a combined
dkato 0:ee40da884cfc 336 library, provided that the separate distribution of the work based on
dkato 0:ee40da884cfc 337 the Library and of the other library facilities is otherwise
dkato 0:ee40da884cfc 338 permitted, and provided that you do these two things:
dkato 0:ee40da884cfc 339
dkato 0:ee40da884cfc 340 a) Accompany the combined library with a copy of the same work
dkato 0:ee40da884cfc 341 based on the Library, uncombined with any other library
dkato 0:ee40da884cfc 342 facilities. This must be distributed under the terms of the
dkato 0:ee40da884cfc 343 Sections above.
dkato 0:ee40da884cfc 344
dkato 0:ee40da884cfc 345 b) Give prominent notice with the combined library of the fact
dkato 0:ee40da884cfc 346 that part of it is a work based on the Library, and explaining
dkato 0:ee40da884cfc 347 where to find the accompanying uncombined form of the same work.
dkato 0:ee40da884cfc 348
dkato 0:ee40da884cfc 349 8. You may not copy, modify, sublicense, link with, or distribute
dkato 0:ee40da884cfc 350 the Library except as expressly provided under this License. Any
dkato 0:ee40da884cfc 351 attempt otherwise to copy, modify, sublicense, link with, or
dkato 0:ee40da884cfc 352 distribute the Library is void, and will automatically terminate your
dkato 0:ee40da884cfc 353 rights under this License. However, parties who have received copies,
dkato 0:ee40da884cfc 354 or rights, from you under this License will not have their licenses
dkato 0:ee40da884cfc 355 terminated so long as such parties remain in full compliance.
dkato 0:ee40da884cfc 356
dkato 0:ee40da884cfc 357 9. You are not required to accept this License, since you have not
dkato 0:ee40da884cfc 358 signed it. However, nothing else grants you permission to modify or
dkato 0:ee40da884cfc 359 distribute the Library or its derivative works. These actions are
dkato 0:ee40da884cfc 360 prohibited by law if you do not accept this License. Therefore, by
dkato 0:ee40da884cfc 361 modifying or distributing the Library (or any work based on the
dkato 0:ee40da884cfc 362 Library), you indicate your acceptance of this License to do so, and
dkato 0:ee40da884cfc 363 all its terms and conditions for copying, distributing or modifying
dkato 0:ee40da884cfc 364 the Library or works based on it.
dkato 0:ee40da884cfc 365
dkato 0:ee40da884cfc 366 10. Each time you redistribute the Library (or any work based on the
dkato 0:ee40da884cfc 367 Library), the recipient automatically receives a license from the
dkato 0:ee40da884cfc 368 original licensor to copy, distribute, link with or modify the Library
dkato 0:ee40da884cfc 369 subject to these terms and conditions. You may not impose any further
dkato 0:ee40da884cfc 370 restrictions on the recipients' exercise of the rights granted herein.
dkato 0:ee40da884cfc 371 You are not responsible for enforcing compliance by third parties with
dkato 0:ee40da884cfc 372 this License.
dkato 0:ee40da884cfc 373
dkato 0:ee40da884cfc 374 11. If, as a consequence of a court judgment or allegation of patent
dkato 0:ee40da884cfc 375 infringement or for any other reason (not limited to patent issues),
dkato 0:ee40da884cfc 376 conditions are imposed on you (whether by court order, agreement or
dkato 0:ee40da884cfc 377 otherwise) that contradict the conditions of this License, they do not
dkato 0:ee40da884cfc 378 excuse you from the conditions of this License. If you cannot
dkato 0:ee40da884cfc 379 distribute so as to satisfy simultaneously your obligations under this
dkato 0:ee40da884cfc 380 License and any other pertinent obligations, then as a consequence you
dkato 0:ee40da884cfc 381 may not distribute the Library at all. For example, if a patent
dkato 0:ee40da884cfc 382 license would not permit royalty-free redistribution of the Library by
dkato 0:ee40da884cfc 383 all those who receive copies directly or indirectly through you, then
dkato 0:ee40da884cfc 384 the only way you could satisfy both it and this License would be to
dkato 0:ee40da884cfc 385 refrain entirely from distribution of the Library.
dkato 0:ee40da884cfc 386
dkato 0:ee40da884cfc 387 If any portion of this section is held invalid or unenforceable under any
dkato 0:ee40da884cfc 388 particular circumstance, the balance of the section is intended to apply,
dkato 0:ee40da884cfc 389 and the section as a whole is intended to apply in other circumstances.
dkato 0:ee40da884cfc 390
dkato 0:ee40da884cfc 391 It is not the purpose of this section to induce you to infringe any
dkato 0:ee40da884cfc 392 patents or other property right claims or to contest validity of any
dkato 0:ee40da884cfc 393 such claims; this section has the sole purpose of protecting the
dkato 0:ee40da884cfc 394 integrity of the free software distribution system which is
dkato 0:ee40da884cfc 395 implemented by public license practices. Many people have made
dkato 0:ee40da884cfc 396 generous contributions to the wide range of software distributed
dkato 0:ee40da884cfc 397 through that system in reliance on consistent application of that
dkato 0:ee40da884cfc 398 system; it is up to the author/donor to decide if he or she is willing
dkato 0:ee40da884cfc 399 to distribute software through any other system and a licensee cannot
dkato 0:ee40da884cfc 400 impose that choice.
dkato 0:ee40da884cfc 401
dkato 0:ee40da884cfc 402 This section is intended to make thoroughly clear what is believed to
dkato 0:ee40da884cfc 403 be a consequence of the rest of this License.
dkato 0:ee40da884cfc 404
dkato 0:ee40da884cfc 405 12. If the distribution and/or use of the Library is restricted in
dkato 0:ee40da884cfc 406 certain countries either by patents or by copyrighted interfaces, the
dkato 0:ee40da884cfc 407 original copyright holder who places the Library under this License may add
dkato 0:ee40da884cfc 408 an explicit geographical distribution limitation excluding those countries,
dkato 0:ee40da884cfc 409 so that distribution is permitted only in or among countries not thus
dkato 0:ee40da884cfc 410 excluded. In such case, this License incorporates the limitation as if
dkato 0:ee40da884cfc 411 written in the body of this License.
dkato 0:ee40da884cfc 412
dkato 0:ee40da884cfc 413 13. The Free Software Foundation may publish revised and/or new
dkato 0:ee40da884cfc 414 versions of the Lesser General Public License from time to time.
dkato 0:ee40da884cfc 415 Such new versions will be similar in spirit to the present version,
dkato 0:ee40da884cfc 416 but may differ in detail to address new problems or concerns.
dkato 0:ee40da884cfc 417
dkato 0:ee40da884cfc 418 Each version is given a distinguishing version number. If the Library
dkato 0:ee40da884cfc 419 specifies a version number of this License which applies to it and
dkato 0:ee40da884cfc 420 "any later version", you have the option of following the terms and
dkato 0:ee40da884cfc 421 conditions either of that version or of any later version published by
dkato 0:ee40da884cfc 422 the Free Software Foundation. If the Library does not specify a
dkato 0:ee40da884cfc 423 license version number, you may choose any version ever published by
dkato 0:ee40da884cfc 424 the Free Software Foundation.
dkato 0:ee40da884cfc 425
dkato 0:ee40da884cfc 426 14. If you wish to incorporate parts of the Library into other free
dkato 0:ee40da884cfc 427 programs whose distribution conditions are incompatible with these,
dkato 0:ee40da884cfc 428 write to the author to ask for permission. For software which is
dkato 0:ee40da884cfc 429 copyrighted by the Free Software Foundation, write to the Free
dkato 0:ee40da884cfc 430 Software Foundation; we sometimes make exceptions for this. Our
dkato 0:ee40da884cfc 431 decision will be guided by the two goals of preserving the free status
dkato 0:ee40da884cfc 432 of all derivatives of our free software and of promoting the sharing
dkato 0:ee40da884cfc 433 and reuse of software generally.
dkato 0:ee40da884cfc 434
dkato 0:ee40da884cfc 435 NO WARRANTY
dkato 0:ee40da884cfc 436
dkato 0:ee40da884cfc 437 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
dkato 0:ee40da884cfc 438 WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
dkato 0:ee40da884cfc 439 EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
dkato 0:ee40da884cfc 440 OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
dkato 0:ee40da884cfc 441 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
dkato 0:ee40da884cfc 442 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
dkato 0:ee40da884cfc 443 PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
dkato 0:ee40da884cfc 444 LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
dkato 0:ee40da884cfc 445 THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
dkato 0:ee40da884cfc 446
dkato 0:ee40da884cfc 447 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
dkato 0:ee40da884cfc 448 WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
dkato 0:ee40da884cfc 449 AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
dkato 0:ee40da884cfc 450 FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
dkato 0:ee40da884cfc 451 CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
dkato 0:ee40da884cfc 452 LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
dkato 0:ee40da884cfc 453 RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
dkato 0:ee40da884cfc 454 FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
dkato 0:ee40da884cfc 455 SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
dkato 0:ee40da884cfc 456 DAMAGES.
dkato 0:ee40da884cfc 457
dkato 0:ee40da884cfc 458 END OF TERMS AND CONDITIONS
dkato 0:ee40da884cfc 459
dkato 0:ee40da884cfc 460 How to Apply These Terms to Your New Libraries
dkato 0:ee40da884cfc 461
dkato 0:ee40da884cfc 462 If you develop a new library, and you want it to be of the greatest
dkato 0:ee40da884cfc 463 possible use to the public, we recommend making it free software that
dkato 0:ee40da884cfc 464 everyone can redistribute and change. You can do so by permitting
dkato 0:ee40da884cfc 465 redistribution under these terms (or, alternatively, under the terms of the
dkato 0:ee40da884cfc 466 ordinary General Public License).
dkato 0:ee40da884cfc 467
dkato 0:ee40da884cfc 468 To apply these terms, attach the following notices to the library. It is
dkato 0:ee40da884cfc 469 safest to attach them to the start of each source file to most effectively
dkato 0:ee40da884cfc 470 convey the exclusion of warranty; and each file should have at least the
dkato 0:ee40da884cfc 471 "copyright" line and a pointer to where the full notice is found.
dkato 0:ee40da884cfc 472
dkato 0:ee40da884cfc 473 <one line to give the library's name and a brief idea of what it does.>
dkato 0:ee40da884cfc 474 Copyright (C) <year> <name of author>
dkato 0:ee40da884cfc 475
dkato 0:ee40da884cfc 476 This library is free software; you can redistribute it and/or
dkato 0:ee40da884cfc 477 modify it under the terms of the GNU Lesser General Public
dkato 0:ee40da884cfc 478 License as published by the Free Software Foundation; either
dkato 0:ee40da884cfc 479 version 2.1 of the License, or (at your option) any later version.
dkato 0:ee40da884cfc 480
dkato 0:ee40da884cfc 481 This library is distributed in the hope that it will be useful,
dkato 0:ee40da884cfc 482 but WITHOUT ANY WARRANTY; without even the implied warranty of
dkato 0:ee40da884cfc 483 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dkato 0:ee40da884cfc 484 Lesser General Public License for more details.
dkato 0:ee40da884cfc 485
dkato 0:ee40da884cfc 486 You should have received a copy of the GNU Lesser General Public
dkato 0:ee40da884cfc 487 License along with this library; if not, write to the Free Software
dkato 0:ee40da884cfc 488 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
dkato 0:ee40da884cfc 489
dkato 0:ee40da884cfc 490 Also add information on how to contact you by electronic and paper mail.
dkato 0:ee40da884cfc 491
dkato 0:ee40da884cfc 492 You should also get your employer (if you work as a programmer) or your
dkato 0:ee40da884cfc 493 school, if any, to sign a "copyright disclaimer" for the library, if
dkato 0:ee40da884cfc 494 necessary. Here is a sample; alter the names:
dkato 0:ee40da884cfc 495
dkato 0:ee40da884cfc 496 Yoyodyne, Inc., hereby disclaims all copyright interest in the
dkato 0:ee40da884cfc 497 library `Frob' (a library for tweaking knobs) written by James Random Hacker.
dkato 0:ee40da884cfc 498
dkato 0:ee40da884cfc 499 <signature of Ty Coon>, 1 April 1990
dkato 0:ee40da884cfc 500 Ty Coon, President of Vice
dkato 0:ee40da884cfc 501
dkato 0:ee40da884cfc 502 That's all there is to it!
dkato 0:ee40da884cfc 503
dkato 0:ee40da884cfc 504