diff --git a/.gitmodules b/.gitmodules index e94dcda15..73e2247ca 100644 --- a/.gitmodules +++ b/.gitmodules @@ -2,5 +2,8 @@ path = nuttx url = ../spresense-nuttx.git [submodule "externals/nnabla-c-runtime"] - path = externals/nnabla-c-runtime + path = externals/nnablart/nnabla-c-runtime url = https://github.com/sony/nnabla-c-runtime +[submodule "sdk/apps"] + path = sdk/apps + url = ../spresense-nuttx-apps.git diff --git a/LICENSE b/LICENSE index f0715a271..61f7aff03 100644 --- a/LICENSE +++ b/LICENSE @@ -1,7 +1,7 @@ 1. License of Spresense SDK ======================================================================== -Copyright 2018 Sony Semiconductor Solutions Corporation +Copyright 2018,2019,2020 Sony Semiconductor Solutions Corporation Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -32,7 +32,240 @@ ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ======================================================================== -cmsis/CMSIS_5/docs +externals/cmsis/CMSIS_5 + +a original LICENSE description for above codes places under the following path. +externals/cmsis/CMSIS_5/LICENSE.txt + +------------------------------------------------------------------------ +externals/cmsis/nn + +Copyright (C) 2010-2018 Arm Limited or its affiliates. All rights reserved. +Copyright 2018 Sony Corporation + +------------------------------------------------------------------------ +externals/nnablart/nnabla-c-runtime + +a original LICENSE description for above codes places under the following path. +externals/nnabla-c-runtime/LICENSE + +Copyright 2017, 2018 Sony Corporation + +------------------------------------------------------------------------ +externals/mbedtls +externals/alt_stubs/mbedtls/include/mbedtls + +Unless specifically indicated otherwise in a file, files are licensed +under the Apache 2.0 license. + +Copyright (C) 2006-2015, ARM Limited, All Rights Reserved + +------------------------------------------------------------------------ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +======================================================================== +externals/cmsis/CMSIS_5/docs search.js in original CMSIS_5 @@ -40,6 +273,10 @@ The code in this file is loosly based on main.js, part of Natural Docs, which is Copyright (C) 2003-2008 Greg Valure Natural Docs is licensed under the GPL. +------------------------------------------------------------------------ + +/sdk/apps/examples/modbus/modbus_main.c + ------------------------------------------------------------------------ GNU GENERAL PUBLIC LICENSE @@ -382,1165 +619,15 @@ consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. - ======================================================================== -externals/cmsis/CMSIS_5 - -a original LICENSE description for above codes places under the following path. -externals/cmsis/CMSIS_5/LICENSE.txt - ------------------------------------------------------------------------- -externals/cmsis/nn - -Copyright (C) 2010-2018 Arm Limited or its affiliates. All rights reserved. -Copyright 2018 Sony Corporation - ------------------------------------------------------------------------- -externals/nnabla-c-runtime +xmodem -a original LICENSE description for above codes places under the following path. -externals/nnabla-c-runtime/LICENSE +sdk/system/xmodem/ -Copyright 2017, 2018 Sony Corporation - ------------------------------------------------------------------------- -externals/mbedtls - -Unless specifically indicated otherwise in a file, files are licensed -under the Apache 2.0 license. - -Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - ------------------------------------------------------------------------- - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -======================================================================== -newlib - -The newlib subdirectory is a collection of software from several sources. - -Each file may have its own copyright/license that is embedded in the source -file. Unless otherwise noted in the body of the source file(s), the following copyright -notices will apply to the contents of the newlib subdirectory: - -(1) Red Hat Incorporated - -Copyright (c) 1994-2009 Red Hat, Inc. All rights reserved. - -This copyrighted material is made available to anyone wishing to use, -modify, copy, or redistribute it subject to the terms and conditions -of the BSD License. This program is distributed in the hope that -it will be useful, but WITHOUT ANY WARRANTY expressed or implied, -including the implied warranties of MERCHANTABILITY or FITNESS FOR -A PARTICULAR PURPOSE. A copy of this license is available at -http://www.opensource.org/licenses. Any Red Hat trademarks that are -incorporated in the source code or documentation are not subject to -the BSD License and may only be used or replicated with the express -permission of Red Hat, Inc. - -(2) University of California, Berkeley - -Copyright (c) 1981-2000 The Regents of the University of California. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY -OF SUCH DAMAGE. - -(3) David M. Gay (AT&T 1991, Lucent 1998) - -The author of this software is David M. Gay. - -Copyright (c) 1991 by AT&T. - -Permission to use, copy, modify, and distribute this software for any -purpose without fee is hereby granted, provided that this entire notice -is included in all copies of any software which is or includes a copy -or modification of this software and in all copies of the supporting -documentation for such software. - -THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED -WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR AT&T MAKES ANY -REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY -OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. - -------------------------------------------------------------------- - -The author of this software is David M. Gay. - -Copyright (C) 1998-2001 by Lucent Technologies -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and -its documentation for any purpose and without fee is hereby -granted, provided that the above copyright notice appear in all -copies and that both that the copyright notice and this -permission notice and warranty disclaimer appear in supporting -documentation, and that the name of Lucent or any of its entities -not be used in advertising or publicity pertaining to -distribution of the software without specific, written prior -permission. - -LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. -IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY -SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER -IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF -THIS SOFTWARE. - - -(4) Advanced Micro Devices - -Copyright 1989, 1990 Advanced Micro Devices, Inc. - -This software is the property of Advanced Micro Devices, Inc (AMD) which -specifically grants the user the right to modify, use and distribute this -software provided this notice is not removed or altered. All other rights -are reserved by AMD. - -AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS -SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL -DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR -USE OF THIS SOFTWARE. - -So that all may benefit from your experience, please report any problems -or suggestions about this software to the 29K Technical Support Center at -800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or -0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118. - -Advanced Micro Devices, Inc. -29K Support Products -Mail Stop 573 -5900 E. Ben White Blvd. -Austin, TX 78741 -800-292-9263 - -(5) C.W. Sandmann - -Copyright (C) 1993 C.W. Sandmann - -This file may be freely distributed as long as the author's name remains. - -(6) Eric Backus - -(C) Copyright 1992 Eric Backus - -This software may be used freely so long as this copyright notice is -left intact. There is no warrantee on this software. - -(7) Sun Microsystems - -Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - -Developed at SunPro, a Sun Microsystems, Inc. business. -Permission to use, copy, modify, and distribute this -software is freely granted, provided that this notice is preserved. - -(8) Hewlett Packard - -(c) Copyright 1986 HEWLETT-PACKARD COMPANY - -To anyone who acknowledges that this file is provided "AS IS" -without any express or implied warranty: - permission to use, copy, modify, and distribute this file -for any purpose is hereby granted without fee, provided that -the above copyright notice and this notice appears in all -copies, and that the name of Hewlett-Packard Company not be -used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. -Hewlett-Packard Company makes no representations about the -suitability of this software for any purpose. - -(9) Hans-Peter Nilsson - -Copyright (C) 2001 Hans-Peter Nilsson - -Permission to use, copy, modify, and distribute this software is -freely granted, provided that the above copyright notice, this notice -and the following disclaimer are preserved with no changes. - -THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. - -(10) Stephane Carrez (m68hc11-elf/m68hc12-elf targets only) - -Copyright (C) 1999, 2000, 2001, 2002 Stephane Carrez (stcarrez@nerim.fr) - -The authors hereby grant permission to use, copy, modify, distribute, -and license this software and its documentation for any purpose, provided -that existing copyright notices are retained in all copies and that this -notice is included verbatim in any distributions. No written agreement, -license, or royalty fee is required for any of the authorized uses. -Modifications to this software may be copyrighted by their authors -and need not follow the licensing terms described here, provided that -the new terms are clearly indicated on the first page of each file where -they apply. - -(11) Christopher G. Demetriou - -Copyright (c) 2001 Christopher G. Demetriou -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -(12) SuperH, Inc. - -Copyright 2002 SuperH, Inc. All rights reserved - -This software is the property of SuperH, Inc (SuperH) which specifically -grants the user the right to modify, use and distribute this software -provided this notice is not removed or altered. All other rights are -reserved by SuperH. - -SUPERH MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO -THIS SOFTWARE. IN NO EVENT SHALL SUPERH BE LIABLE FOR INDIRECT, SPECIAL, -INCIDENTAL OR CONSEQUENTIAL DAMAGES IN CONNECTION WITH OR ARISING FROM -THE FURNISHING, PERFORMANCE, OR USE OF THIS SOFTWARE. - -So that all may benefit from your experience, please report any problems -or suggestions about this software to the SuperH Support Center via -e-mail at softwaresupport@superh.com . - -SuperH, Inc. -405 River Oaks Parkway -San Jose -CA 95134 -USA - -(13) Royal Institute of Technology - -Copyright (c) 1999 Kungliga Tekniska Hogskolan -(Royal Institute of Technology, Stockholm, Sweden). -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -3. Neither the name of KTH nor the names of its contributors may be - used to endorse or promote products derived from this software without - specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY KTH AND ITS CONTRIBUTORS ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL KTH OR ITS CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -(14) Alexey Zelkin - -Copyright (c) 2000, 2001 Alexey Zelkin -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -(15) Andrey A. Chernov - -Copyright (C) 1997 by Andrey A. Chernov, Moscow, Russia. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -(16) FreeBSD - -Copyright (c) 1997-2002 FreeBSD Project. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -(17) S. L. Moshier - -Author: S. L. Moshier. - -Copyright (c) 1984,2000 S.L. Moshier - -Permission to use, copy, modify, and distribute this software for any -purpose without fee is hereby granted, provided that this entire notice -is included in all copies of any software which is or includes a copy -or modification of this software and in all copies of the supporting -documentation for such software. - -THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED -WARRANTY. IN PARTICULAR, THE AUTHOR MAKES NO REPRESENTATION -OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY OF THIS -SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. - -(18) Citrus Project - -Copyright (c)1999 Citrus Project, -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -(19) Todd C. Miller - -Copyright (c) 1998 Todd C. Miller -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, -INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL -THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -(20) DJ Delorie (i386) -Copyright (C) 1991 DJ Delorie -All rights reserved. - -Redistribution and use in source and binary forms is permitted -provided that the above copyright notice and following paragraph are -duplicated in all such forms. - -This file is distributed WITHOUT ANY WARRANTY; without even the implied -warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -(21) Free Software Foundation LGPL License (*-linux* targets only) - - Copyright (C) 1990-1999, 2000, 2001 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Mark Kettenis , 1997. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301 USA. - -(22) Xavier Leroy LGPL License (i[3456]86-*-linux* targets only) - -Copyright (C) 1996 Xavier Leroy (Xavier.Leroy@inria.fr) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Library General Public License for more details. - -(23) Intel (i960) - -Copyright (c) 1993 Intel Corporation - -Intel hereby grants you permission to copy, modify, and distribute this -software and its documentation. Intel grants this permission provided -that the above copyright notice appears in all copies and that both the -copyright notice and this permission notice appear in supporting -documentation. In addition, Intel grants this permission provided that -you prominently mark as "not part of the original" any modifications -made to this software or documentation, and that the name of Intel -Corporation not be used in advertising or publicity pertaining to -distribution of the software or the documentation without specific, -written prior permission. - -Intel Corporation provides this AS IS, WITHOUT ANY WARRANTY, EXPRESS OR -IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY -OR FITNESS FOR A PARTICULAR PURPOSE. Intel makes no guarantee or -representations regarding the use of, or the results of the use of, -the software and documentation in terms of correctness, accuracy, -reliability, currentness, or otherwise; and you rely on the software, -documentation and results solely at your own risk. - -IN NO EVENT SHALL INTEL BE LIABLE FOR ANY LOSS OF USE, LOSS OF BUSINESS, -LOSS OF PROFITS, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES -OF ANY KIND. IN NO EVENT SHALL INTEL'S TOTAL LIABILITY EXCEED THE SUM -PAID TO INTEL FOR THE PRODUCT LICENSED HEREUNDER. - -(24) Hewlett-Packard (hppa targets only) - -(c) Copyright 1986 HEWLETT-PACKARD COMPANY - -To anyone who acknowledges that this file is provided "AS IS" -without any express or implied warranty: - permission to use, copy, modify, and distribute this file -for any purpose is hereby granted without fee, provided that -the above copyright notice and this notice appears in all -copies, and that the name of Hewlett-Packard Company not be -used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. -Hewlett-Packard Company makes no representations about the -suitability of this software for any purpose. - -(25) Henry Spencer (only *-linux targets) - -Copyright 1992, 1993, 1994 Henry Spencer. All rights reserved. -This software is not subject to any license of the American Telephone -and Telegraph Company or of the Regents of the University of California. - -Permission is granted to anyone to use this software for any purpose on -any computer system, and to alter it and redistribute it, subject -to the following restrictions: - -1. The author is not responsible for the consequences of use of this - software, no matter how awful, even if they arise from flaws in it. - -2. The origin of this software must not be misrepresented, either by - explicit claim or by omission. Since few users ever read sources, - credits must appear in the documentation. - -3. Altered versions must be plainly marked as such, and must not be - misrepresented as being the original software. Since few users - ever read sources, credits must appear in the documentation. - -4. This notice may not be removed or altered. - -(26) Mike Barcroft - -Copyright (c) 2001 Mike Barcroft -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -(27) Konstantin Chuguev (--enable-newlib-iconv) - -Copyright (c) 1999, 2000 - Konstantin Chuguev. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - - iconv (Charset Conversion Library) v2.0 - -(28) Artem Bityuckiy (--enable-newlib-iconv) - -Copyright (c) 2003, Artem B. Bityuckiy, SoftMine Corporation. -Rights transferred to Franklin Electronic Publishers. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -(29) IBM, Sony, Toshiba (only spu-* targets) - - (C) Copyright 2001,2006, - International Business Machines Corporation, - Sony Computer Entertainment, Incorporated, - Toshiba Corporation, - - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the names of the copyright holders nor the names of their - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -(30) - Alex Tatmanjants (targets using libc/posix) - - Copyright (c) 1995 Alex Tatmanjants - at Electronni Visti IA, Kiev, Ukraine. - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - -(31) - M. Warner Losh (targets using libc/posix) - - Copyright (c) 1998, M. Warner Losh - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - -(32) - Andrey A. Chernov (targets using libc/posix) - - Copyright (C) 1996 by Andrey A. Chernov, Moscow, Russia. - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - -(33) - Daniel Eischen (targets using libc/posix) - - Copyright (c) 2001 Daniel Eischen . - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - -(34) - Jon Beniston (only lm32-* targets) - - Contributed by Jon Beniston - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - -(35) - ARM Ltd (arm and thumb variant targets only) - - Copyright (c) 2009 ARM Ltd - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. The name of the company may not be used to endorse or promote - products derived from this software without specific prior written - permission. - - THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED - WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED - TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -(36) - Xilinx, Inc. (microblaze-* and powerpc-* targets) - -Copyright (c) 2004, 2009 Xilinx, Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - -1. Redistributions source code must retain the above copyright notice, -this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution. - -3. Neither the name of Xilinx nor the names of its contributors may be -used to endorse or promote products derived from this software without -specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS -IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -(37) Texas Instruments Incorporated (tic6x-* targets) - -Copyright (c) 1996-2010 Texas Instruments Incorporated -http://www.ti.com/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - Neither the name of Texas Instruments Incorporated nor the names - of its contributors may be used to endorse or promote products - derived from this software without specific prior written - permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -(38) National Semiconductor (cr16-* and crx-* targets) - -Copyright (c) 2004 National Semiconductor Corporation - -The authors hereby grant permission to use, copy, modify, distribute, -and license this software and its documentation for any purpose, provided -that existing copyright notices are retained in all copies and that this -notice is included verbatim in any distributions. No written agreement, -license, or royalty fee is required for any of the authorized uses. -Modifications to this software may be copyrighted by their authors -and need not follow the licensing terms described here, provided that -the new terms are clearly indicated on the first page of each file where -they apply. - - -(39) LCD driver - -sdk/drivers/lcd - - Copyright (C) 2014 Marco Krahl. All rights reserved. - Author: Marco Krahl - - Copyright 2018 Sony Semiconductor Solutions Corporation - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. -3. Neither the name NuttX nor the names of its contributors may be - used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -(40) xmodem - -sdk/system/xmodem/ - -Copyright 2001-2019 Georges Menie (www.menie.org) -All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: +Copyright 2001-2019 Georges Menie (www.menie.org) +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. @@ -1553,575 +640,79 @@ modification, are permitted provided that the following conditions are met: THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -(41) websocket - -examples/lte_websocket - -The MIT License (MIT) - -Copyright (c) 2014 Jeremy Hahn - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -(42) flash_writer - -sdk/tools/flash_writer - - -Copyright (c) 2010 Wijnand Modderman -Copyright (c) 1981 Chuck Forsberg - -This software is distributed under MIT license. ------------------------------------------------------------------------- -Permission is hereby granted, free of charge, to any person obtaining a copy of this software -and associated documentation files (the "Software"), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, publish, distribute, -sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or -substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING -BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - ------------------------------------------------------------------------- -Copyright (C) 2018 Sony Semiconductor Solutions Corp - -This software is distributed under LGPL-2.1 license. - ------------------------------------------------------------------------- - - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. +------------------------------------------------------------------------ +websocket -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. +examples/lte_websocket -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. +The MIT License (MIT) - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. +Copyright (c) 2014 Jeremy Hahn +Copyright 2020 Sony Corporation - NO WARRANTY +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). +------------------------------------------------------------------------ +flash_writer - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. +sdk/tools/flash_writer/scripts/xmodem.py - - Copyright (C) +Copyright (c) 2010 Wijnand Modderman +Copyright (c) 1981 Chuck Forsberg - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. +This software is distributed under MIT license. +------------------------------------------------------------------------ +Permission is hereby granted, free of charge, to any person obtaining a copy of this software +and associated documentation files (the "Software"), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, publish, distribute, +sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. +The above copyright notice and this permission notice shall be included in all copies or +substantial portions of the Software. - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -Also add information on how to contact you by electronic and paper mail. +------------------------------------------------------------------------ +sdk/tools/flash_writer/scripts/flash_writer.py -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: +Copyright (C) 2018 Sony Semiconductor Solutions Corp. - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. +sdk/tools/flash_writer/scripts/xmodem_writer.py - , 1 April 1990 - Ty Coon, President of Vice +Copyright (C) 2018, 2019 Sony Semiconductor Solutions Corp. + +This software is distributed under LGPL-2.1 license. -That's all there is to it! ------------------------------------------------------------------------ =======================================================================m @@ -2129,23 +720,66 @@ That's all there is to it! 2. License of NuttX ======================================================================== -COPYING -- Describes the terms under which Nuttx is distributed. A -copy of the BSD-style licensing is included in this file. In my -words -- I believe that you should free to use NuttX in any -environment, private, private, commercial, open, closed, etc. -provided only that you repect the modest copyright notices as -described in license (below). Please feel free to contact me if you -have any licensing concerns. + +This software includes open source software subject to the licensing +described in the following file: + + nuttx/COPYING + +the license description is as below. +------------------------------------------------------------------------ +COPYING +======= + +Describes the terms under which Nuttx is distributed. A copy of the BSD- +style licensing is included in this file. In my words -- I believe that you +should free to use NuttX in any environment, private, private, commercial, +open, closed, etc. provided only that you respect the modest copyright +notices as described in license (below), respect Trademarks, and include a +copy of the BSD license. Please feel free to contact me if you have any +icensing concerns. + +Tool Licenses +------------- + +Tools under the nuttx/tools directory are not intended for binary +distribution. You may find other licensing on individual tools in that +directory. If you intend to redistribute these tools in binary form, please +respect the individual license of each tool as identified in the file header +of the tool source files. + +Copyright Date Notation +----------------------- + +Copyright information is provided in the header of each file. This +copyright information includes the name of the copyright holder and the +year(s) in which copyrighted additions to the file were made to the file. +A comma (',') is used to separate years in the list of years. A hyphen ('-') +is used as a more compact notation when additions were made over several +consecutive years. So for example, "2007, 2011" would mean that copyrighted +additions were made during the years of 2007 and 2011 whereas "2007-2011" +would indicate copyrighted additions in the years 2007, 2008, 2009, 2010, +and 2011. + +Copyright Line Continuation +--------------------------- + +Copy information which exceeds the usable line lengh may be broken and +continued on the following line, such as: + + Copyright (C) 2007-2010, 2012, 2014-2015, 2017 Gregory Nutt. All + rights reserved. NuttX -^^^^^^ +===== -License for NuttX in general (authorship and copyright dates on -individual files will vary): +License for NuttX in general (authorship and copyright dates on individual +files will vary): -/************************************************************************* +/**************************************************************************** + * directory path/filename * - * Copyright (C) 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2019 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -2175,10 +809,10 @@ individual files will vary): * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - *************************************************************************/ + ****************************************************************************/ FAT Long File Names -^^^^^^^^^^^^^^^^^^^ +=================== NOTE: If CONFIG_FAT_LFN is defined in your NuttX configuration file, then there may be some legal, patent issues. The following was extracted from @@ -2208,12 +842,12 @@ FAT Long File Names This Wikipedia entry has been updated with recent legal decisions in favor of Microsoft. Refer to: - http://en.wikipedia.org/wiki/File_Allocation_Table#Legal_issues + https://en.wikipedia.org/wiki/File_Allocation_Table#Patents So you have been forewarned: Use the long filename at your own risk! uIP -^^^ +=== Many lower-level networking components of NuttX derive from uIP which has a similar BSD style license: @@ -2221,8 +855,18 @@ has a similar BSD style license: Copyright (c) 2001-2003, Adam Dunkels. All rights reserved. +Rhombus Math Library +==================== + +The math library used in NuttX derives from the Rhombus OS by Nick Johnson +(with many, many addtions). The Rhombus OS is/was distributed under the ISC +license. The ISC licsense is a permissive license that allows people do +anything with your code with proper attribution and without warranty. The +ISC license is functionally equivalent to the BSD 2-Clause and MIT licenses, +removing some language that is no longer necessary. + IGMP -^^^^ +=== IGMP support, if enabled, adds additional logic by Steve Reynolds: @@ -2230,7 +874,7 @@ IGMP support, if enabled, adds additional logic by Steve Reynolds: All rights reserved. The HID Parser in drivers/usbhost -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +================================= Adapted from the LUFA Library (MIT license): @@ -2258,8 +902,8 @@ The HID Parser in drivers/usbhost Certain functions in the NuttX C-library derive from other BSD-compatible sources: -fs/nfs: -^^^^^^^ +fs/nfs +====== NFS: @@ -2279,14 +923,38 @@ fs/nfs: "This product includes software developed by the University of California, Berkeley and its contributors." -strtod(): -^^^^^^^^ +fs/spiffs +========= + + The MIT License (MIT) + + Copyright (c) 2013-2017 Peter Andersson (pelleplutt1976gmail.com) + + Permission is hereby granted, free of charge, to any person obtaining a copy of + this software and associated documentation files (the "Software"), to deal in + the Software without restriction, including without limitation the rights to + use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + the Software, and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +strtod() +======== Copyright (C) 2002 Michael Ringgaard. All rights reserved. Copyright (C) 2006-2007 H. Peter Anvin. -dtoa(): -^^^^^^ +dtoa() +====== If you enable floating point conversions with CONFIG_LIBC_FLOATINGPOINT, then some files with an unmodified BSD license will be included. That @@ -2297,7 +965,7 @@ dtoa(): California, Berkeley and its contributors." libc/string/lib_vikmemcpy.c -^^^^^^^^^^^^^^^^^^^^^^^^^^^ +=========================== If you enable CONFIG_MEMCPY_VIK, then you will build with the optimized version of memcpy from Daniel Vik. Licensing information for that version @@ -2325,8 +993,8 @@ libc/string/lib_vikmemcpy.c 3. This notice may not be removed or altered from any source distribution. -libc/math -^^^^^^^^^ +libs/libc/math +============== If you enable CONFIG_LIB, you will build the math library at libc/math. This library was taken from the math library developed for the Rhombus @@ -2348,7 +1016,7 @@ libc/math ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF drivers/video/ov2640 -^^^^^^^^^^^^^^^^^^^^ +==================== WARNING: Some of the information in the data tables in this file came from other projects with conflicting licenses: Linux and ArduCAM. Those @@ -2356,10 +1024,217 @@ drivers/video/ov2640 content of those tables and still retain this BSD license. I am guessing so, but I am not a copyright attorney so you should use this driver in products at your own risk. + +------------------------------------------------------------------------ + +=======================================================================m + + +3. License of NuttX apps + +======================================================================== + +This software includes open source software subject to the licensing +described in the following file: + + sdk/apps/COPYING + +the license description is as below. +------------------------------------------------------------------------ +COPYING -- Describes the terms under which Nuttx is distributed. A +copy of the BSD-style licensing is included in this file. In my +words -- I believe that you should free to use NuttX in any +environment, private, private, commercial, open, closed, etc. +provided only that you repect the modest copyright notices as +described in license (below). Please feel free to contact me if you +have any licensing concerns. + +NuttX +^^^^^^ + +License for NuttX in general (authorship of individual files may vary): + + Copyright (C) 2007-2012 Gregory Nutt. All rights reserved. + Author: Gregory Nutt + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. +3. Neither the name NuttX nor the names of its contributors may be + used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +uIP +^^^ + +Some lower-level networking middle-ware components of NuttX +derive from uIP which has a similar BSD style license: + + Copyright (c) 2001-2003, Adam Dunkels. + All rights reserved. + +FreeModbus +^^^^^^^^^ + +FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU. +Copyright (c) 2006 Christian Walter +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Mini Basic +^^^^^^^^^^ + +The Mini Basic implementation at apps/interpreters derives from version 1.0 +by Malcolm McLean, Leeds University, and was released under the Creative +Commons Attibution license. I am not legal expert, but this license +appears to be compatible with the NuttX BSD license see: +https://creativecommons.org/licenses/ . I, however, cannot take +responsibility for any actions that you might take based on my +understanding. Please use your own legal judgement. + +THTTPD +^^^^^^ + +Derived from the original THTTPD package: + + Copyright ゥ 1995,1998,1999,2000,2001 by Jef Poskanzer . + All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +cJSON +^^^^^ + +Derives from the cJSON Project which has an MIT license: + + Copyright (c) 2009 Dave Gamble + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +apps/netutils/pppd +^^^^^^^^^^^^^^^^^^ + + This implementation of PPPD has a license that is mostly compatible the + NuttX 3-clause BSD license, but includes a fourth clause that required + acknowledgement of Mike Johnson/Mycal Labs if it is built into your + product: + + Copyright (C) 2000, Mycal Labs www.mycal.com + Copyright (c) 2003, Mike Johnson, Mycal Labs, www.mycal.net + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + This product includes software developed by Mike Johnson/Mycal Labs + www.mycal.net. + 4. The name of the author may not be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +------------------------------------------------------------------------ + ======================================================================== -3. License of ARM(tm) CMSIS +4. License of ARM(tm) CMSIS ======================================================================== Apache License @@ -2563,10 +1438,11 @@ drivers/video/ov2640 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. + ======================================================================== -4. License of Binary Firmwares (loader.espk, gnssfw.espk) +5. License of Binary Firmwares (loader.espk, gnssfw.espk) ======================================================================== ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -3078,38 +1954,39 @@ proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. + ======================================================================== -5. License of libjpeg +6. License of awsiot ======================================================================== -externals/libjpeg +externals/awsiot/aws-iot-device-sdk-embedded-C -This software is based in part on the work of the Independent JPEG Group. +This software includes open source software subject to the licensing +described in the following file: -This software includes open source software provided by the Independent -JPEG Group. More information is included in the following file: + externals/awsiot/aws-iot-device-sdk-embedded-C/LICENSE.txt - externals/libjpeg/README - ======================================================================== -6. License of awsiot +7. License of libjpeg ======================================================================== -externals/awsiot/aws-iot-device-sdk-embedded-C +externals/libjpeg -This software includes open source software subject to the licensing -described in the following file: +This software is based in part on the work of the Independent JPEG Group. - externals/awsiot/aws-iot-device-sdk-embedded-C/LICENSE.txt +This software includes open source software provided by the Independent +JPEG Group. More information is included in the following file: + externals/libjpeg/README + ======================================================================== -7. License of lwm2m +8. License of lwm2m ======================================================================== externals/lwm2m/wakaama @@ -3122,7 +1999,7 @@ described in the following file: ======================================================================== -8. License of mqtt +9. License of mqtt ======================================================================== externals/mqtt/paho.mqtt.embedded-c/ @@ -3136,7 +2013,7 @@ following file: ======================================================================== -9. License of wavelib +10. License of wavelib ======================================================================== externals/wavelib @@ -3149,7 +2026,7 @@ described in the following file: ======================================================================== -10. License of websocket +11. License of websocket ======================================================================== externals/websocket/cwebsocket diff --git a/examples/.sdksubdir b/examples/.sdksubdir new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/examples/.sdksubdir @@ -0,0 +1 @@ + diff --git a/examples/Application.mk b/examples/Application.mk deleted file mode 100644 index 5f7652845..000000000 --- a/examples/Application.mk +++ /dev/null @@ -1,147 +0,0 @@ -############################################################################ -# -# Copyright (C) 2015 Gregory Nutt. All rights reserved. -# Copyright (C) 2015 Omni Hoverboards Inc. All rights reserved. -# Authors: Gregory Nutt -# Paul Alexander Patience -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# 3. Neither the name NuttX nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# -############################################################################ - --include $(SDKDIR)/.config -include $(APPDIR)/Make.defs - -CXXEXT ?= .cxx - -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -CXXOBJS = $(CXXSRCS:$(CXXEXT)=$(OBJEXT)) - -ifeq ($(suffix $(MAINSRC)),$(CXXEXT)) - MAINOBJ = $(MAINSRC:$(CXXEXT)=$(OBJEXT)) -else - MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) -endif - -SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) $(CXXOBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),y) - OBJS += $(MAINOBJ) -endif - -ifeq ($(WINTOOL),y) - BIN = "${shell cygpath -w $(APPDIR)$(DELIM)libexamples$(LIBEXT)}" - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - BIN = $(APPDIR)$(DELIM)libexamples$(LIBEXT) - INSTALL_DIR = $(BIN_DIR) -endif - -ROOTDEPPATH += --dep-path . -VPATH += - -all: .built -.PHONY: clean preconfig depend distclean -.PRECIOUS: $(APPDIR)/libexamples$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -$(CXXOBJS): %$(OBJEXT): %$(CXXEXT) - $(call COMPILEXX, $<, $@) - -ifeq ($(suffix $(MAINSRC)),$(CXXEXT)) -$(MAINOBJ): %$(OBJEXT): %$(CXXEXT) - $(call COMPILEXX, $<, $@) -else -$(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) -endif - -.built: $(OBJS) - $(Q) touch $@ - -ifeq ($(CONFIG_BUILD_KERNEL),y) -$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) - @echo "LD: $(PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME) -else -install: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) -endif - -preconfig: - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -ifneq ($(APPNAME),) -ifneq ($(PRIORITY),) -ifneq ($(STACKSIZE),) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) - -context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat -else -context: -endif -else -context: -endif -else -context: -endif -else -context: -endif - -.depend: Makefile $(SRCS) -ifeq ($(filter %$(CXXEXT),$(SRCS)),) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep -else - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CXX)" -- $(CXXFLAGS) -- $(SRCS) >Make.dep -endif - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - --include Make.dep diff --git a/examples/LibTarget.mk b/examples/LibTarget.mk deleted file mode 100644 index 79874f602..000000000 --- a/examples/LibTarget.mk +++ /dev/null @@ -1,42 +0,0 @@ -############################################################################ -# LibTarget.mk -# -# Copyright 2018 Sony Semiconductor Solutions Corporation -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# 3. Neither the name of Sony Semiconductor Solutions Corporation nor -# the names of its contributors may be used to endorse or promote -# products derived from this software without specific prior written -# permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# -############################################################################ - -$(SDKDIR)$(DELIM)..$(DELIM)examples$(DELIM)libexamples$(LIBEXT): context - $(Q) $(MAKE) -C $(dir $@) TOPDIR="$(TOPDIR)" SDKDIR="$(SDKDIR)" $(notdir $@) - -lib$(DELIM)libexamples$(LIBEXT): $(SDKDIR)$(DELIM)..$(DELIM)examples$(DELIM)libexamples$(LIBEXT) - $(Q) install $< $@ - -EXTLIBS += lib$(DELIM)libexamples$(LIBEXT) diff --git a/examples/Makefile b/examples/Makefile index a8868f8b3..263d50e9e 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -35,6 +35,4 @@ MENUDESC = "Examples" -BIN = libexamples$(LIBEXT) - -include $(SDKDIR)/Makefile.ext +include $(SDKDIR)/tools/Sdk.mk diff --git a/examples/accel/Kconfig b/examples/accel/Kconfig index 3982db192..ceedae3ad 100644 --- a/examples/accel/Kconfig +++ b/examples/accel/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_ACCEL - bool "Accelerometer sensor example" + tristate "Accelerometer sensor example" default n ---help--- Enable the sensor via SCU example @@ -14,7 +14,6 @@ if EXAMPLES_ACCEL config EXAMPLES_ACCEL_PROGNAME string "Program name" default "accel" - depends on BUILD_KERNEL ---help--- This is the name of the program that will be use when the NSH ELF program is installed. diff --git a/examples/accel/Make.defs b/examples/accel/Make.defs index 1f9101852..1d153b909 100644 --- a/examples/accel/Make.defs +++ b/examples/accel/Make.defs @@ -33,6 +33,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_ACCEL),y) +ifneq ($(CONFIG_EXAMPLES_ACCEL),) CONFIGURED_APPS += accel endif diff --git a/examples/accel/Makefile b/examples/accel/Makefile index 3bd2f0787..cc5b4d557 100644 --- a/examples/accel/Makefile +++ b/examples/accel/Makefile @@ -34,23 +34,16 @@ ############################################################################ -include $(TOPDIR)/Make.defs --include $(SDKDIR)/Make.defs -# sensor built-in application info +# Accelerometer sensor built-in application info -CONFIG_EXAMPLES_ACCEL_PRIORITY ?= SCHED_PRIORITY_DEFAULT -CONFIG_EXAMPLES_ACCEL_STACKSIZE ?= 2048 - -APPNAME = accel -PRIORITY = $(CONFIG_EXAMPLES_ACCEL_PRIORITY) +PROGNAME = $(CONFIG_EXAMPLES_ACCEL_PROGNAME) +PRIORITY = $(CONFIG_EXAMPLES_ACCEL_PRIORITY) STACKSIZE = $(CONFIG_EXAMPLES_ACCEL_STACKSIZE) +MODULE = $(CONFIG_EXAMPLES_ACCEL) -# sensor Example +# Accelerometor Sensor Example -ASRCS = MAINSRC = accel_main.c -CONFIG_EXAMPLES_ACCEL_PROGNAME ?= accel$(EXEEXT) -PROGNAME = $(CONFIG_EXAMPLES_ACCEL_PROGNAME) - include $(APPDIR)/Application.mk diff --git a/examples/accel/accel_main.c b/examples/accel/accel_main.c index be5cda65a..d853060d7 100644 --- a/examples/accel/accel_main.c +++ b/examples/accel/accel_main.c @@ -48,7 +48,7 @@ #include #include -#include +#include /**************************************************************************** * Pre-processor Definitions @@ -225,15 +225,12 @@ static void sensing_main(int fd) /**************************************************************************** * Public Functions ****************************************************************************/ + /**************************************************************************** * sensor_main ****************************************************************************/ -#ifdef CONFIG_BUILD_KERNEL int main(int argc, FAR char *argv[]) -#else -int accel_main(int argc, char *argv[]) -#endif { int fd; diff --git a/examples/adc/Kconfig b/examples/adc/Kconfig deleted file mode 100644 index 044378ef0..000000000 --- a/examples/adc/Kconfig +++ /dev/null @@ -1,51 +0,0 @@ -# -# For a description of the syntax of this configuration file, -# see the file kconfig-language.txt in the NuttX tools repository. -# - -config EXAMPLES_ADC - bool "ADC example" - default n - depends on CXD56_ADC - ---help--- - Enable the ADC example - -if EXAMPLES_ADC - -config EXAMPLES_ADC_PROGNAME - string "Program name" - default "adc" - depends on BUILD_KERNEL - ---help--- - This is the name of the program that will be use when the NSH ELF - program is installed. - -config EXAMPLES_ADC_PRIORITY - int "ADC example task priority" - default 100 - -config EXAMPLES_ADC_STACKSIZE - int "ADC example stack size" - default 2048 - -config EXAMPLES_ADC_DEVPATH - string "ADC device path" - default "/dev/lpadc0" - ---help--- - The default path to the ADC device. Default: /dev/lpadc0 - -config EXAMPLES_ADC_READCOUNT - int "Number of reads" - default 10 - ---help--- - Number of data reads. - -config EXAMPLES_ADC_BUFSIZE - int "Buffer size" - default 16 - ---help--- - Buffer size of ADC example. - The maximum size that can be read with one read is minimum value - between this size and the scu fifo size. - -endif diff --git a/examples/adc/Make.defs b/examples/adc/Make.defs deleted file mode 100644 index aad3460b6..000000000 --- a/examples/adc/Make.defs +++ /dev/null @@ -1,38 +0,0 @@ -############################################################################ -# adc/Make.defs -# -# Copyright 2018 Sony Semiconductor Solutions Corporation -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# 3. Neither the name of Sony Semiconductor Solutions Corporation nor -# the names of its contributors may be used to endorse or promote -# products derived from this software without specific prior written -# permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# -############################################################################ - -ifeq ($(CONFIG_EXAMPLES_ADC),y) -CONFIGURED_APPS += adc -endif diff --git a/examples/adc/Makefile b/examples/adc/Makefile deleted file mode 100644 index 3a3f86ab5..000000000 --- a/examples/adc/Makefile +++ /dev/null @@ -1,56 +0,0 @@ -############################################################################ -# adc/Makefile -# -# Copyright 2018 Sony Semiconductor Solutions Corporation -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# 3. Neither the name of Sony Semiconductor Solutions Corporation nor -# the names of its contributors may be used to endorse or promote -# products derived from this software without specific prior written -# permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# -############################################################################ - --include $(TOPDIR)/Make.defs --include $(SDKDIR)/Make.defs - -# sensor built-in application info - -CONFIG_EXAMPLES_ADC_PRIORITY ?= SCHED_PRIORITY_DEFAULT -CONFIG_EXAMPLES_ADC_STACKSIZE ?= 2048 - -APPNAME = adc -PRIORITY = $(CONFIG_EXAMPLES_ADC_PRIORITY) -STACKSIZE = $(CONFIG_EXAMPLES_ADC_STACKSIZE) - -# sensor Example - -ASRCS = -MAINSRC = adc_main.c - -CONFIG_EXAMPLES_ADC_PROGNAME ?= adc$(EXEEXT) -PROGNAME = $(CONFIG_EXAMPLES_ADC_PROGNAME) - -include $(APPDIR)/Application.mk diff --git a/examples/adc/README.txt b/examples/adc/README.txt deleted file mode 100644 index 3b8859b9f..000000000 --- a/examples/adc/README.txt +++ /dev/null @@ -1,29 +0,0 @@ -examples/adc -^^^^^^^^^^^^ - - This is simple example of take AD conversion data using Sensor Control - Unit. Available as nsh built-in command. - This example obtains and shows AD conversion data in every 1 second. - It will end when the read count is reached to CONFIG_EXAMPLES_ADC_READCOUNT. - - This application depends on its ADC and SCU configuration. - - Configuration Pre-requisites: - - CONFIG_CXD56_ADC - CXD56xx ADC - CONFIG_CXD56_SCU - CXD56xx Sensor Control Unit - - Example Configuration: - - CONFIG_EXAMPLES_ADC - Enable this example - CONFIG_EXAMPLES_ADC_PROGNAME - Program name. - CONFIG_EXAMPLES_ADC_PRIORITY - Example priority. Default: 100 - CONFIG_EXAMPLES_ADC_STACKSIZE - Example stack size. Default: 2048 - CONFIG_EXAMPLES_ADC_DEVPATH - ADC device path. Default: /dev/lpadc0 - CONFIG_EXAMPLES_ADC_READCOUNT - Number of reads. Default: 10 - CONFIG_EXAMPLES_ADC_BUFSIZE - Buffer size of ADC example. - - Operation: - - No console operation is needed. You can see the average, maximum and - minimum value of AD conversion result. diff --git a/examples/adc/adc_main.c b/examples/adc/adc_main.c deleted file mode 100644 index bdfa1c206..000000000 --- a/examples/adc/adc_main.c +++ /dev/null @@ -1,415 +0,0 @@ -/**************************************************************************** - * adc/adc_main.c - * - * Copyright 2018 Sony Semiconductor Solutions Corporation - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name of Sony Semiconductor Solutions Corporation nor - * the names of its contributors may be used to endorse or promote - * products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#ifdef CONFIG_CXD56_ADC -#include -#include -#endif - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#ifndef CONFIG_EXAMPLES_ADC_DEVPATH -# define CONFIG_EXAMPLES_ADC_DEVPATH "/dev/lpadc0" -#endif - -#ifndef CONFIG_EXAMPLES_ADC_READCOUNT -# define CONFIG_EXAMPLES_ADC_READCOUNT 0 -#endif - -#ifndef CONFIG_EXAMPLES_ADC_BUFSIZE -# define CONFIG_EXAMPLES_ADC_BUFSIZE 0 -#endif - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -struct adc_state_s -{ - bool initialized; - FAR char *devpath; - int count; - int bufsize; -}; - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -static struct adc_state_s g_adcstate; - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: adc_devpath - ****************************************************************************/ - -static void adc_devpath(FAR struct adc_state_s *adc, - FAR const char *devpath) -{ - /* Get rid of any old device path */ - - if (adc->devpath) - { - free(adc->devpath); - } - - /* Then set-up the new device path by copying the string */ - - adc->devpath = strdup(devpath); -} - -/**************************************************************************** - * Name: adc_help - ****************************************************************************/ - -static void adc_help(FAR struct adc_state_s *adc) -{ - printf("Usage: adc [OPTIONS]\n"); - printf("\nArguments are \"sticky\". For example, once the ADC device is\n"); - printf("specified, that device will be re-used until it is changed.\n"); - printf("\n\"sticky\" OPTIONS include:\n"); - printf(" [-p devpath] selects the ADC device. " - "/dev/lpadc0, 1, 2, 3, /dev/hpadc0, 1 Current: %s\n", - adc->devpath ? adc->devpath : "NONE"); - printf(" [-n count] set the number of reads. " - "Current: %d\n", adc->count); - printf(" [-h] shows this message and exits\n"); -} - -/**************************************************************************** - * Name: arg_string - ****************************************************************************/ - -static int arg_string(FAR char **arg, FAR char **value) -{ - FAR char *ptr = *arg; - - if (ptr[2] == '\0') - { - *value = arg[1]; - return 2; - } - else - { - *value = &ptr[2]; - return 1; - } -} - -/**************************************************************************** - * Name: arg_decimal - ****************************************************************************/ - -static int arg_decimal(FAR char **arg, FAR long *value) -{ - FAR char *string; - int ret; - - ret = arg_string(arg, &string); - *value = strtol(string, NULL, 10); - return ret; -} - -/**************************************************************************** - * Name: parse_args - ****************************************************************************/ - -static void parse_args(FAR struct adc_state_s *adc, int argc, - FAR char **argv) -{ - FAR char *ptr; - FAR char *str; - long value; - int index; - int nargs; - - for (index = 1; index < argc; ) - { - ptr = argv[index]; - if (ptr[0] != '-') - { - printf("Invalid options format: %s\n", ptr); - exit(0); - } - - switch (ptr[1]) - { - case 'n': - nargs = arg_decimal(&argv[index], &value); - if (value < 0) - { - printf("Count must be non-negative: %ld\n", value); - exit(1); - } - - adc->count = (uint32_t)value; - index += nargs; - break; - - case 'p': - nargs = arg_string(&argv[index], &str); - adc_devpath(adc, str); - index += nargs; - break; - - case 'h': - adc_help(adc); - exit(0); - - default: - printf("Unsupported option: %s\n", ptr); - adc_help(adc); - exit(1); - } - } -} - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: adc_main - ****************************************************************************/ - -#ifdef CONFIG_BUILD_KERNEL -int main(int argc, FAR char *argv[]) -#else -int adc_main(int argc, char *argv[]) -#endif -{ - int ret; - int errval = 0; - int fd; - char *buftop = NULL; - uint32_t loopcnt = 0; - ssize_t nbytes; - - /* Check if we have initialized */ - - if (!g_adcstate.initialized) - { - /* Set the default values */ - - adc_devpath(&g_adcstate, CONFIG_EXAMPLES_ADC_DEVPATH); - g_adcstate.count = CONFIG_EXAMPLES_ADC_READCOUNT; - if (g_adcstate.count == 0) - { - g_adcstate.count = 10; - } - g_adcstate.bufsize = CONFIG_EXAMPLES_ADC_BUFSIZE; - if (g_adcstate.bufsize == 0) - { - g_adcstate.bufsize = 16; - } - g_adcstate.initialized = true; - } - - /* Parse the command line */ - - parse_args(&g_adcstate, argc, argv); - - loopcnt = g_adcstate.count; - - buftop = (char *)malloc(g_adcstate.bufsize); - if (!buftop) - { - printf("malloc failed. size:%d\n", g_adcstate.bufsize); - errval = 3; - goto errout; - } - - printf("ADC example - Name:%s bufsize:%d\n", g_adcstate.devpath, g_adcstate.bufsize); - - fd = open(g_adcstate.devpath, O_RDONLY); - if (fd < 0) - { - printf("open %s failed: %d\n", g_adcstate.devpath, errno); - errval = 4; - goto errout; - } - - /* SCU FIFO overwrite */ - - ret = ioctl(fd, SCUIOC_SETFIFOMODE, 1); - if (ret < 0) - { - errval = errno; - printf("ioctl(SETFIFOMODE) failed: %d\n", errval); - goto errout_with_dev; - } - - /* Start A/D conversion */ - - ret = ioctl(fd, ANIOC_CXD56_START, 0); - if (ret < 0) - { - errval = errno; - printf("ioctl(START) failed: %d\n", errval); - goto errout_with_dev; - } - - for (; loopcnt > 0; loopcnt--) - { - fflush(stdout); - - /* wait */ - - up_mdelay(1000); - - /* read data */ - - nbytes = read(fd, buftop, g_adcstate.bufsize); - - if (nbytes < 0) - { - errval = errno; - printf("read failed:%d\n", errval); - goto errout_with_dev; - } - else if (nbytes == 0) - { - printf("read data size = 0\n"); - } - else - { - if (nbytes & 1) - { - printf("read size=%ld is not a multiple of sample size=%d\n", - (long)nbytes, sizeof(uint16_t)); - } - else - { - int32_t count = 0; - char *start = buftop; - char *end = buftop + g_adcstate.bufsize; - int16_t data = 0, min = 0, max = 0; - int32_t sum = 0; - - if (g_adcstate.bufsize > nbytes) - { - end = buftop + nbytes; - } - - while (1) - { - data = (int16_t)(*(uint16_t *)(start)); - min = ((min == 0) || (data < min)) ? data : min; - max = ((max == 0) || (data > max)) ? data : max; - sum += (int32_t)data; - count++; - start += sizeof(uint16_t); - if (start >= end) - { - break; - } - } - - if (count > 0) - { - printf("Ave:%d Min:%d Max:%d Cnt:%d\n", sum / count, min, max, count); - } - } - } - } - - /* Stop A/D conversion */ - - ret = ioctl(fd, ANIOC_CXD56_STOP, 0); - if (ret < 0) - { - int errcode = errno; - printf("ioctl(STOP) failed: %d\n", errcode); - } - - close(fd); - - if (buftop) - { - free(buftop); - buftop = NULL; - } - - printf("ADC example end\n"); - - return OK; - - /* Error exits */ - -errout_with_dev: - close(fd); - -errout: - printf("ADC Example terminating!\n"); - if (buftop) - { - free(buftop); - buftop = NULL; - } - fflush(stdout); - return errval; -} diff --git a/examples/adc_monitor/Kconfig b/examples/adc_monitor/Kconfig new file mode 100644 index 000000000..c699617c4 --- /dev/null +++ b/examples/adc_monitor/Kconfig @@ -0,0 +1,50 @@ +# +# For a description of the syntax of this configuration file, +# see the file kconfig-language.txt in the NuttX tools repository. +# + +config EXAMPLES_ADC_MONITOR + tristate "ADC monitor example" + default n + depends on CXD56_ADC + ---help--- + Enable the ADC_MONITOR example + +if EXAMPLES_ADC_MONITOR + +config EXAMPLES_ADC_MONITOR_PROGNAME + string "Program name" + default "adc_monitor" + ---help--- + This is the name of the program that will be use when the NSH ELF + program is installed. + +config EXAMPLES_ADC_MONITOR_PRIORITY + int "ADC_MONITOR example task priority" + default 100 + +config EXAMPLES_ADC_MONITOR_STACKSIZE + int "ADC_MONITOR example stack size" + default 2048 + +config EXAMPLES_ADC_MONITOR_DEVPATH + string "ADC device path" + default "/dev/lpadc0" + ---help--- + The default path to the ADC device. Default: /dev/lpadc0 + +config EXAMPLES_ADC_MONITOR_READCOUNT + int "Number of reads" + default 10 + ---help--- + Number of data reads. + +config EXAMPLES_ADC_MONITOR_BUFSIZE + int "Buffer size" + default 16 + ---help--- + Buffer size of ADC_MONITOR example. + The maximum size that can be read with one read is minimum value + between this size and the scu fifo size. + +endif diff --git a/examples/adc_monitor/Make.defs b/examples/adc_monitor/Make.defs new file mode 100644 index 000000000..4b23a58ee --- /dev/null +++ b/examples/adc_monitor/Make.defs @@ -0,0 +1,38 @@ +############################################################################ +# adc_monitor/Make.defs +# +# Copyright 2020 Sony Semiconductor Solutions Corporation +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# 3. Neither the name of Sony Semiconductor Solutions Corporation nor +# the names of its contributors may be used to endorse or promote +# products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +############################################################################ + +ifneq ($(CONFIG_EXAMPLES_ADC_MONITOR),) +CONFIGURED_APPS += adc_monitor +endif diff --git a/examples/adc_monitor/Makefile b/examples/adc_monitor/Makefile new file mode 100644 index 000000000..617e49a9f --- /dev/null +++ b/examples/adc_monitor/Makefile @@ -0,0 +1,50 @@ +############################################################################ +# adc_monitor/Makefile +# +# Copyright 2020 Sony Semiconductor Solutions Corporation +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# 3. Neither the name of Sony Semiconductor Solutions Corporation nor +# the names of its contributors may be used to endorse or promote +# products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +############################################################################ + +-include $(TOPDIR)/Make.defs +-include $(SDKDIR)/Make.defs + +# ADC_MONITOR example + +MAINSRC = adc_monitor_main.c + +# application info + +PROGNAME = $(CONFIG_EXAMPLES_ADC_MONITOR_PROGNAME) +PRIORITY = $(CONFIG_EXAMPLES_ADC_MONITOR_PRIORITY) +STACKSIZE = $(CONFIG_EXAMPLES_ADC_MONITOR_STACKSIZE) +MODULE = $(CONFIG_EXAMPLES_ADC_MONITOR) + +include $(APPDIR)/Application.mk diff --git a/examples/adc_monitor/README.txt b/examples/adc_monitor/README.txt new file mode 100644 index 000000000..9ad0aded2 --- /dev/null +++ b/examples/adc_monitor/README.txt @@ -0,0 +1,29 @@ +examples/adc_monitor +^^^^^^^^^^^^^^^^^^^^ + + This is simple example of take AD conversion data using Sensor Control + Unit. Available as nsh built-in command. + This example obtains and shows AD conversion data in every 1 second. + It will end when the read count is reached to CONFIG_EXAMPLES_ADC_MONITOR_READCOUNT. + + This application depends on its ADC and SCU configuration. + + Configuration Pre-requisites: + + CONFIG_CXD56_ADC - CXD56xx ADC + CONFIG_CXD56_SCU - CXD56xx Sensor Control Unit + + Example Configuration: + + CONFIG_EXAMPLES_ADC_MONITOR - Enable this example + CONFIG_EXAMPLES_ADC_MONITOR_PROGNAME - Program name. + CONFIG_EXAMPLES_ADC_MONITOR_PRIORITY - Example priority. Default: 100 + CONFIG_EXAMPLES_ADC_MONITOR_STACKSIZE - Example stack size. Default: 2048 + CONFIG_EXAMPLES_ADC_MONITOR_DEVPATH - ADC device path. Default: /dev/lpadc0 + CONFIG_EXAMPLES_ADC_MONITOR_READCOUNT - Number of reads. Default: 10 + CONFIG_EXAMPLES_ADC_MONITOR_BUFSIZE - Buffer size of ADC_MONITOR example. + + Operation: + + No console operation is needed. You can see the average, maximum and + minimum value of AD conversion result. diff --git a/examples/adc_monitor/adc_monitor_main.c b/examples/adc_monitor/adc_monitor_main.c new file mode 100644 index 000000000..878bfc6f9 --- /dev/null +++ b/examples/adc_monitor/adc_monitor_main.c @@ -0,0 +1,404 @@ +/**************************************************************************** + * adc_monitor/adc_monitor_main.c + * + * Copyright 2020 Sony Semiconductor Solutions Corporation + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name of Sony Semiconductor Solutions Corporation nor + * the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#ifdef CONFIG_CXD56_ADC +#include +#include +#endif + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#ifndef CONFIG_EXAMPLES_ADC_MONITOR_DEVPATH +# define CONFIG_EXAMPLES_ADC_MONITOR_DEVPATH "/dev/lpadc0" +#endif + +#ifndef CONFIG_EXAMPLES_ADC_MONITOR_READCOUNT +# define CONFIG_EXAMPLES_ADC_MONITOR_READCOUNT 0 +#endif + +#ifndef CONFIG_EXAMPLES_ADC_MONITOR_BUFSIZE +# define CONFIG_EXAMPLES_ADC_MONITOR_BUFSIZE 0 +#endif + +/**************************************************************************** + * Private Types + ****************************************************************************/ + +struct adc_state_s +{ + bool initialized; + FAR char *devpath; + int count; + int bufsize; +}; + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +static struct adc_state_s g_adcstate; + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: adc_devpath + ****************************************************************************/ + +static void adc_devpath(FAR struct adc_state_s *adc, + FAR const char *devpath) +{ + /* Get rid of any old device path */ + + if (adc->devpath) + { + free(adc->devpath); + } + + /* Then set-up the new device path by copying the string */ + + adc->devpath = strdup(devpath); +} + +/**************************************************************************** + * Name: adc_help + ****************************************************************************/ + +static void adc_help(FAR struct adc_state_s *adc) +{ + printf("Usage: adc_monitor [OPTIONS]\n"); + printf("\nArguments are \"sticky\". For example, once the ADC device is\n"); + printf("specified, that device will be re-used until it is changed.\n"); + printf("\n\"sticky\" OPTIONS include:\n"); + printf(" [-p devpath] selects the ADC device.\n" + " /dev/lpadc{0,1,2,3}, /dev/hpadc{0,1} Current: %s\n", + adc->devpath ? adc->devpath : "NONE"); + printf(" [-n count] set the number of reads." + "Current: %d\n", adc->count); + printf(" [-h] shows this message and exits\n"); +} + +/**************************************************************************** + * Name: arg_string + ****************************************************************************/ + +static int arg_string(FAR char **arg, FAR char **value) +{ + FAR char *ptr = *arg; + + if (ptr[2] == '\0') + { + *value = arg[1]; + return 2; + } + else + { + *value = &ptr[2]; + return 1; + } +} + +/**************************************************************************** + * Name: arg_decimal + ****************************************************************************/ + +static int arg_decimal(FAR char **arg, FAR long *value) +{ + FAR char *string; + int ret; + + ret = arg_string(arg, &string); + *value = strtol(string, NULL, 10); + return ret; +} + +/**************************************************************************** + * Name: parse_args + ****************************************************************************/ + +static void parse_args(FAR struct adc_state_s *adc, int argc, + FAR char **argv) +{ + FAR char *ptr; + FAR char *str; + long value; + int index; + int nargs; + + for (index = 1; index < argc; ) + { + ptr = argv[index]; + if (ptr[0] != '-') + { + printf("Invalid options format: %s\n", ptr); + exit(0); + } + + switch (ptr[1]) + { + case 'n': + nargs = arg_decimal(&argv[index], &value); + if (value < 0) + { + printf("Count must be non-negative: %ld\n", value); + exit(1); + } + + adc->count = (uint32_t)value; + index += nargs; + break; + + case 'p': + nargs = arg_string(&argv[index], &str); + adc_devpath(adc, str); + index += nargs; + break; + + case 'h': + adc_help(adc); + exit(0); + + default: + printf("Unsupported option: %s\n", ptr); + adc_help(adc); + exit(1); + } + } +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: adc_monitor_main + ****************************************************************************/ + +int main(int argc, FAR char *argv[]) +{ + int ret; + int errval = 0; + int fd; + char *buftop = NULL; + uint32_t loopcnt = 0; + ssize_t nbytes; + + /* Check if we have initialized */ + + if (!g_adcstate.initialized) + { + /* Set the default values */ + + adc_devpath(&g_adcstate, CONFIG_EXAMPLES_ADC_MONITOR_DEVPATH); + g_adcstate.count = CONFIG_EXAMPLES_ADC_MONITOR_READCOUNT; + if (g_adcstate.count == 0) + { + g_adcstate.count = 10; + } + g_adcstate.bufsize = CONFIG_EXAMPLES_ADC_MONITOR_BUFSIZE; + if (g_adcstate.bufsize == 0) + { + g_adcstate.bufsize = 16; + } + g_adcstate.initialized = true; + } + + /* Parse the command line */ + + parse_args(&g_adcstate, argc, argv); + + loopcnt = g_adcstate.count; + + buftop = (char *)malloc(g_adcstate.bufsize); + if (!buftop) + { + printf("malloc failed. size:%d\n", g_adcstate.bufsize); + errval = 3; + goto errout; + } + + printf("ADC monitor example - Name:%s bufsize:%d\n", + g_adcstate.devpath, g_adcstate.bufsize); + + fd = open(g_adcstate.devpath, O_RDONLY); + if (fd < 0) + { + printf("open %s failed: %d\n", g_adcstate.devpath, errno); + errval = 4; + goto errout; + } + + /* SCU FIFO overwrite */ + + ret = ioctl(fd, SCUIOC_SETFIFOMODE, 1); + if (ret < 0) + { + errval = errno; + printf("ioctl(SETFIFOMODE) failed: %d\n", errval); + goto errout_with_dev; + } + + /* Start A/D conversion */ + + ret = ioctl(fd, ANIOC_CXD56_START, 0); + if (ret < 0) + { + errval = errno; + printf("ioctl(START) failed: %d\n", errval); + goto errout_with_dev; + } + + for (; loopcnt > 0; loopcnt--) + { + fflush(stdout); + + /* wait */ + + up_mdelay(1000); + + /* read data */ + + nbytes = read(fd, buftop, g_adcstate.bufsize); + + if (nbytes < 0) + { + errval = errno; + printf("read failed:%d\n", errval); + goto errout_with_dev; + } + else if (nbytes == 0) + { + printf("read data size = 0\n"); + } + else + { + if (nbytes & 1) + { + printf("read size=%ld is not a multiple of sample size=%d\n", + (long)nbytes, sizeof(uint16_t)); + } + else + { + int32_t count = 0; + char *start = buftop; + char *end = buftop + g_adcstate.bufsize; + int16_t data = 0, min = 0, max = 0; + int32_t sum = 0; + + if (g_adcstate.bufsize > nbytes) + { + end = buftop + nbytes; + } + + while (1) + { + data = (int16_t)(*(uint16_t *)(start)); + min = ((min == 0) || (data < min)) ? data : min; + max = ((max == 0) || (data > max)) ? data : max; + sum += (int32_t)data; + count++; + start += sizeof(uint16_t); + if (start >= end) + { + break; + } + } + + if (count > 0) + { + printf("Ave:%d Min:%d Max:%d Cnt:%d\n", sum / count, min, max, count); + } + } + } + } + + /* Stop A/D conversion */ + + ret = ioctl(fd, ANIOC_CXD56_STOP, 0); + if (ret < 0) + { + int errcode = errno; + printf("ioctl(STOP) failed: %d\n", errcode); + } + + close(fd); + + if (buftop) + { + free(buftop); + buftop = NULL; + } + + printf("ADC monitor example end\n"); + + return OK; + + /* Error exits */ + +errout_with_dev: + close(fd); + +errout: + printf("ADC monitor example terminating!\n"); + if (buftop) + { + free(buftop); + buftop = NULL; + } + fflush(stdout); + return errval; +} diff --git a/examples/alarm/Kconfig b/examples/alarm/Kconfig deleted file mode 100644 index 79eab88ce..000000000 --- a/examples/alarm/Kconfig +++ /dev/null @@ -1,38 +0,0 @@ -# -# For a description of the syntax of this configuration file, -# see the file kconfig-language.txt in the NuttX tools repository. -# - -config EXAMPLES_ALARM - bool "RTC alarm driver example" - default n - ---help--- - Enable the RTC driver alarm test - -if EXAMPLES_ALARM - -config EXAMPLES_ALARM_PROGNAME - string "Program name" - default "alarm" - depends on BUILD_KERNEL - ---help--- - This is the name of the program that will be use when the NSH ELF - program is installed. - -config EXAMPLES_ALARM_PRIORITY - int "Alarm task priority" - default 100 - -config EXAMPLES_ALARM_STACKSIZE - int "Alarm stack size" - default 2048 - -config EXAMPLES_ALARM_DEVPATH - string "RTC device path" - default "/dev/rtc0" - -config EXAMPLES_ALARM_SIGNO - int "Alarm signal" - default 1 - -endif # EXAMPLES_ALARM diff --git a/examples/alarm/Make.defs b/examples/alarm/Make.defs deleted file mode 100644 index fc9829c4c..000000000 --- a/examples/alarm/Make.defs +++ /dev/null @@ -1,39 +0,0 @@ -############################################################################ -# apps/examples/alarm/Make.defs -# Adds selected applications to apps/ build -# -# Copyright (C) 2016 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# 3. Neither the name NuttX nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# -############################################################################ - -ifeq ($(CONFIG_EXAMPLES_ALARM),y) -CONFIGURED_APPS += alarm -endif diff --git a/examples/alarm/Makefile b/examples/alarm/Makefile deleted file mode 100644 index 8d9cf678d..000000000 --- a/examples/alarm/Makefile +++ /dev/null @@ -1,57 +0,0 @@ -############################################################################ -# alarm/Makefile -# -# Copyright (C) 2016 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# 3. Neither the name NuttX nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# -############################################################################ - --include $(TOPDIR)/Make.defs --include $(SDKDIR)/Make.defs - -# RTC driver alarm test built-in application info - -CONFIG_EXAMPLES_ALARM_PRIORITY ?= SCHED_PRIORITY_DEFAULT -CONFIG_EXAMPLES_ALARM_STACKSIZE ?= 2048 - -APPNAME = alarm -PRIORITY = $(CONFIG_EXAMPLES_ALARM_PRIORITY) -STACKSIZE = $(CONFIG_EXAMPLES_ALARM_STACKSIZE) - -# RTC driver alarm test - -ASRCS = -CSRCS = -MAINSRC = alarm_main.c - -CONFIG_EXAMPLES_ALARM_PROGNAME ?= alarm$(EXEEXT) -PROGNAME = $(CONFIG_EXAMPLES_ALARM_PROGNAME) - -include $(APPDIR)/Application.mk diff --git a/examples/alarm/alarm_main.c b/examples/alarm/alarm_main.c deleted file mode 100644 index 1d2471fda..000000000 --- a/examples/alarm/alarm_main.c +++ /dev/null @@ -1,312 +0,0 @@ -/**************************************************************************** - * alarm/alarm_main.c - * - * Copyright (C) 2016 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -static bool g_alarm_daemon_started; -static pid_t g_alarm_daeon_pid; -static bool g_alarm_received[CONFIG_RTC_NALARMS]; - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: alarm_handler - ****************************************************************************/ - -static void alarm_handler(int signo, FAR siginfo_t *info, FAR void *ucontext) -{ - int almndx = info->si_value.sival_int; - if (almndx >= 0 && almndx < CONFIG_RTC_NALARMS) - { - g_alarm_received[almndx] = true; - } -} - -/**************************************************************************** - * Name: alarm_daemon - ****************************************************************************/ - -static int alarm_daemon(int argc, FAR char *argv[]) -{ - struct sigaction act; - sigset_t set; - int ret; - int i; - - /* Indicate that we are running */ - - g_alarm_daemon_started = true; - printf("alarm_daemon: Running\n"); - - /* Make sure that the alarm signal is unmasked */ - - (void)sigemptyset(&set); - (void)sigaddset(&set, CONFIG_EXAMPLES_ALARM_SIGNO); - ret = sigprocmask(SIG_UNBLOCK, &set, NULL); - if (ret != OK) - { - int errcode = errno; - fprintf(stderr, "ERROR: sigprocmask failed: %d\n", - errcode); - goto errout; - } - - /* Register alarm signal handler */ - - act.sa_sigaction = alarm_handler; - act.sa_flags = SA_SIGINFO; - - (void)sigfillset(&act.sa_mask); - (void)sigdelset(&act.sa_mask, CONFIG_EXAMPLES_ALARM_SIGNO); - - ret = sigaction(CONFIG_EXAMPLES_ALARM_SIGNO, &act, NULL); - if (ret < 0) - { - int errcode = errno; - fprintf(stderr, "ERROR: sigaction failed: %d\n", - errcode); - goto errout; - } - - /* Now loop forever, waiting for alarm signals */ - - for (; ; ) - { - /* Check if any alarms fired. - * - * NOTE that there are race conditions here... if we missing an alarm, - * we will just report it a half second late. - */ - - for (i = 0; i < CONFIG_RTC_NALARMS; i++) - { - if (g_alarm_received[i]) - { - printf("alarm_demon: alarm %d received\n", i) ; - g_alarm_received[i] = false; - } - } - - /* Now wait a little while and poll again. If a signal is received - * this should cuase us to awken earlier. - */ - - usleep(500*1000L); - } - -errout: - g_alarm_daemon_started = false; - - printf("alarm_daemon: Terminating\n"); - return EXIT_FAILURE; -} - -/**************************************************************************** - * Name: start_daemon - ****************************************************************************/ - -static int start_daemon(void) -{ - if (!g_alarm_daemon_started) - { - g_alarm_daeon_pid = - task_create("alarm_daemon", CONFIG_EXAMPLES_ALARM_PRIORITY, - CONFIG_EXAMPLES_ALARM_STACKSIZE, alarm_daemon, - NULL); - if (g_alarm_daeon_pid < 0) - { - int errcode = errno; - fprintf(stderr, "ERROR: Failed to start alarm_daemon: %d\n", - errcode); - return -errcode; - } - - printf("alarm_daemon started\n"); - usleep(500*1000L); - } - - return OK; -} - -/**************************************************************************** - * Name: show_usage - ****************************************************************************/ - -static void show_usage(FAR const char *progname) -{ - fprintf(stderr, "USAGE:\n"); -#if CONFIG_RTC_NALARMS > 1 - fprintf(stderr, "\t%s [-a ] \n", progname); - fprintf(stderr, "Where:\n"); - fprintf(stderr, "\t-a \n"); - fprintf(stderr, "\t\t selects the alarm: 0..%d\n", - CONFIG_RTC_NALARMS - 1); -#else - fprintf(stderr, "\t%s \n", progname); - fprintf(stderr, "Where:\n"); -#endif - fprintf(stderr, "\t\n"); - fprintf(stderr, "\t\tThe number of seconds until the alarm expires.\n"); -} - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * alarm_main - ****************************************************************************/ - -#ifdef CONFIG_BUILD_KERNEL -int main(int argc, FAR char *argv[]) -#else -int alarm_main(int argc, FAR char *argv[]) -#endif -{ - struct rtc_setrelative_s setrel; - unsigned long seconds; - int alarmid = 0; - int secndx; - int fd; - int ret; - - /* Make sure that the alarm daemon is running */ - - ret = start_daemon(); - if (ret < 0) - { - fprintf(stderr, "ERROR: Unrecognized option: %s\n", argv[1]); - show_usage(argv[0]); - return EXIT_FAILURE; - } - -#if CONFIG_RTC_NALARMS > 1 - /* Check for an optional alarm ID */ - - if (argc == 4) - { - if (strcmp(argv[1], "-a") != 0) - { - fprintf(stderr, "ERROR: Unrecognized option: %s\n", argv[1]); - show_usage(argv[0]); - return EXIT_FAILURE; - } - - alarmid = atoi(argv[2]); - secndx = 3; - } - else -#endif - if (argc == 2) - { - secndx = 1; - } - else - { - fprintf(stderr, "ERROR: Invalid number of arguments: %d\n", argc - 1); - show_usage(argv[0]); - return EXIT_FAILURE; - } - - /* Get the number of seconds until the alarm expiration */ - - seconds = strtoul(argv[secndx], NULL, 10); - if (seconds < 1) - { - fprintf(stderr, "ERROR: Invalid number of seconds: %lu\n", seconds); - show_usage(argv[0]); - return EXIT_FAILURE; - } - - /* Open the RTC driver */ - - printf("Opening %s\n", CONFIG_EXAMPLES_ALARM_DEVPATH); - - fd = open(CONFIG_EXAMPLES_ALARM_DEVPATH, O_WRONLY); - if (fd < 0) - { - int errcode = errno; - fprintf(stderr, "ERROR: Failed to open %s: %d\n", - CONFIG_EXAMPLES_ALARM_DEVPATH, errcode); - return EXIT_FAILURE; - } - - /* Set the alarm */ - - setrel.id = alarmid; - setrel.signo = CONFIG_EXAMPLES_ALARM_SIGNO; - setrel.pid = g_alarm_daeon_pid; - setrel.reltime = (time_t)seconds; - - setrel.sigvalue.sival_int = alarmid; - - ret = ioctl(fd, RTC_SET_RELATIVE, (unsigned long)((uintptr_t)&setrel)); - if (ret < 0) - { - int errcode = errno; - - fprintf(stderr, "ERROR: RTC_SET_RELATIVE ioctl failed: %d\n", - errcode); - - (void)close(fd); - return EXIT_FAILURE; - } - - printf("Alarm %d set in %lu seconds\n", alarmid, seconds); - - (void)close(fd); - return EXIT_SUCCESS; -} diff --git a/examples/asmp/Kconfig b/examples/asmp/Kconfig index a86326b17..705fc0dc2 100644 --- a/examples/asmp/Kconfig +++ b/examples/asmp/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_ASMP - bool "ASMP ELF Loader Example" + tristate "ASMP ELF Loader Example" depends on ASMP default n ---help--- @@ -12,6 +12,21 @@ config EXAMPLES_ASMP if EXAMPLES_ASMP +config EXAMPLES_ASMP_PROGNAME + string "Program name" + default "asmp" + ---help--- + This is the name of the program that will be use when the NSH ELF + program is installed. + +config EXAMPLES_ASMP_PRIORITY + int "asmp task priority" + default 100 + +config EXAMPLES_ASMP_STACKSIZE + int "asmp stack size" + default 2048 + config EXAMPLES_ASMP_WORKER_STACKSIZE int "Example worker stack size" default 1024 diff --git a/examples/asmp/Make.defs b/examples/asmp/Make.defs index a3307f38d..5d13bd921 100644 --- a/examples/asmp/Make.defs +++ b/examples/asmp/Make.defs @@ -33,6 +33,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_ASMP),y) +ifneq ($(CONFIG_EXAMPLES_ASMP),) CONFIGURED_APPS += asmp endif diff --git a/examples/asmp/Makefile b/examples/asmp/Makefile index f19f9a168..1bb779c1f 100644 --- a/examples/asmp/Makefile +++ b/examples/asmp/Makefile @@ -34,110 +34,32 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs --include $(SDKDIR)/Make.defs -include $(APPDIR)/Make.defs +include $(SDKDIR)/Make.defs -# ELF Example +# ASMP Example -APPNAME = asmp -PRIORITY = SCHED_PRIORITY_DEFAULT -STACKSIZE = 4096 +PROGNAME = $(CONFIG_EXAMPLES_ASMP_PROGNAME) +PRIORITY = $(CONFIG_EXAMPLES_ASMP_PRIORITY) +STACKSIZE = $(CONFIG_EXAMPLES_ASMP_STACKSIZE) +MODULE = $(CONFIG_EXAMPLES_ASMP) -ASRCS = -CSRCS = MAINSRC = asmp_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) +include $(APPDIR)/Application.mk -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),y) - OBJS += $(MAINOBJ) -endif - -ifeq ($(WINTOOL),y) - BIN = "${shell cygpath -w $(APPDIR)$(DELIM)libexamples$(LIBEXT)}" - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - BIN = $(APPDIR)$(DELIM)libexamples$(LIBEXT) - INSTALL_DIR = $(BIN_DIR) +ifeq ($(CONFIG_FS_ROMFS),y) +.depend: worker/romfs.h +worker/romfs.h: + @echo >$@ endif -CONFIG_ASMP_PROGNAME ?= asmp$(EXEEXT) -PROGNAME = $(CONFIG_ASMP_PROGNAME) - -ROOTDEPPATH = --dep-path . --dep-path worker -VPATH = worker - -# Build targets - -all: .built -.PHONY: .built really_build clean_worker clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -really_build: $(OBJS) - @touch .built - -.built: +build_worker: @$(MAKE) -C worker TOPDIR="$(TOPDIR)" SDKDIR="$(SDKDIR)" APPDIR="$(APPDIR)" CROSSDEV=$(CROSSDEV) - @$(MAKE) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" really_build - -ifeq ($(CONFIG_BUILD_KERNEL),y) -$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) - @echo "LD: $(PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) -install: $(BIN_DIR)$(DELIM)$(PROGNAME) +$(OBJS): build_worker -else -install: - $(call ARCHIVE, $(BIN), $(OBJS)) - -endif - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) - -context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat -else -context: -endif - -# Generate dummy romfs.h for avoid error on depend process - -worker/romfs.h: - @echo > $@ - -.depend: worker/romfs.h - @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - @$(MAKE) -C worker TOPDIR="$(TOPDIR)" SDKDIR="$(SDKDIR)" APPDIR="$(APPDIR)" CROSSDEV=$(CROSSDEV) depend - @touch $@ - -depend: .depend +clean:: clean_worker clean_worker: @$(MAKE) -C worker TOPDIR="$(TOPDIR)" SDKDIR="$(SDKDIR)" APPDIR="$(APPDIR)" CROSSDEV=$(CROSSDEV) clean - -clean: clean_worker - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - --include Make.dep -.PHONY: preconfig -preconfig: diff --git a/examples/asmp/asmp_main.c b/examples/asmp/asmp_main.c index 5999bc4be..e50de9fb4 100644 --- a/examples/asmp/asmp_main.c +++ b/examples/asmp/asmp_main.c @@ -37,7 +37,7 @@ * Included Files ****************************************************************************/ -#include +#include #include #include @@ -264,11 +264,7 @@ static int run_worker(const char *filename) * Name: asmp_main ****************************************************************************/ -#ifdef CONFIG_BUILD_KERNEL int main(int argc, FAR char *argv[]) -#else -int asmp_main(int argc, char *argv[]) -#endif { #ifdef CONFIG_FS_ROMFS int ret; diff --git a/examples/asmp/worker/Makefile b/examples/asmp/worker/Makefile index 8cc7b9742..619f89f37 100644 --- a/examples/asmp/worker/Makefile +++ b/examples/asmp/worker/Makefile @@ -43,7 +43,7 @@ SUBDIRS = $(dir $(WORKER_ELFS)) define DIR_template $(1)_$(2): - $(Q) $(MAKE) -C $(1) $(3) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" CROSSDEV=$(CROSSDEV) + $(Q) $(MAKE) -C $(1) $(3) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" SDKDIR="$(SDKDIR)" CROSSDEV=$(CROSSDEV) endef all: romfs.h diff --git a/examples/asmp/worker/hello/Makefile b/examples/asmp/worker/hello/Makefile index 29ace9916..dfd3b8537 100644 --- a/examples/asmp/worker/hello/Makefile +++ b/examples/asmp/worker/hello/Makefile @@ -63,6 +63,8 @@ endif AOBJS = $(ASRCS:.S=$(OBJEXT)) COBJS = $(CSRCS:.c=$(OBJEXT)) +OBJEXT ?= .o + all: $(BIN) $(COBJS): %$(OBJEXT): %.c diff --git a/examples/audio_beep/Kconfig b/examples/audio_beep/Kconfig index 2ea4a3ea4..df732eb7a 100644 --- a/examples/audio_beep/Kconfig +++ b/examples/audio_beep/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_AUDIO_BEEP - bool "Audio beep example" + tristate "Audio beep example" default n depends on CXD56_AUDIO ---help--- diff --git a/examples/audio_beep/Make.defs b/examples/audio_beep/Make.defs index a3b755128..14bf138f1 100644 --- a/examples/audio_beep/Make.defs +++ b/examples/audio_beep/Make.defs @@ -33,6 +33,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_AUDIO_BEEP),y) +ifneq ($(CONFIG_EXAMPLES_AUDIO_BEEP),) CONFIGURED_APPS += audio_beep endif diff --git a/examples/audio_beep/Makefile b/examples/audio_beep/Makefile index 608cc7451..8fd3a3aea 100644 --- a/examples/audio_beep/Makefile +++ b/examples/audio_beep/Makefile @@ -33,19 +33,15 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs --include $(SDKDIR)/Make.defs -include $(APPDIR)/Make.defs +include $(SDKDIR)/Make.defs # Audio application info -CONFIG_EXAMPLES_AUDIO_BEEP_PRIORITY ?= SCHED_PRIORITY_DEFAULT -CONFIG_EXAMPLES_AUDIO_BEEP_STACKSIZE ?= 2048 - -APPNAME = audio_beep +PROGNAME = $(CONFIG_EXAMPLES_AUDIO_BEEP_PROGNAME) PRIORITY = $(CONFIG_EXAMPLES_AUDIO_BEEP_PRIORITY) STACKSIZE = $(CONFIG_EXAMPLES_AUDIO_BEEP_STACKSIZE) +MODULE = $(CONFIG_EXAMPLES_AUDIO_BEEP) # Audio Example @@ -57,15 +53,8 @@ AUDIODIR = $(SDKDIR)$(DELIM)modules$(DELIM)audio # Audio Example flags -ifeq ($(WINTOOL),y) -CXXFLAGS += -I "${shell cygpath -w $(AUDIODIR)}" -else -CXXFLAGS += -I $(AUDIODIR) -endif +CXXFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" "$(AUDIODIR)"} CXXFLAGS += -D_POSIX -CONFIG_EXAMPLES_AUDIO_BEEP_PROGNAME ?= audio_beep$(EXEEXT) -PROGNAME = $(CONFIG_EXAMPLES_AUDIO_BEEP_PROGNAME) - include $(APPDIR)/Application.mk diff --git a/examples/audio_beep/audio_beep_main.cxx b/examples/audio_beep/audio_beep_main.cxx index af318e386..85c64545a 100644 --- a/examples/audio_beep/audio_beep_main.cxx +++ b/examples/audio_beep/audio_beep_main.cxx @@ -39,7 +39,7 @@ #include #include -#include +#include /**************************************************************************** * Pre-processor Definitions @@ -183,11 +183,7 @@ static bool app_beep(bool en = false, int16_t vol = 255, uint16_t freq = 0) * Public Functions ****************************************************************************/ -#ifdef CONFIG_BUILD_KERNEL extern "C" int main(int argc, FAR char *argv[]) -#else -extern "C" int audio_beep_main(int argc, char *argv[]) -#endif { /* Define beep scale and pronunciation time */ diff --git a/examples/audio_dual_players/Kconfig b/examples/audio_dual_players/Kconfig index 483ef4542..11abe7e28 100644 --- a/examples/audio_dual_players/Kconfig +++ b/examples/audio_dual_players/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_AUDIO_DUAL_PLAYERS - bool "Audio dual players example" + tristate "Audio dual players example" default n depends on CXD56_AUDIO ---help--- diff --git a/examples/audio_dual_players/Make.defs b/examples/audio_dual_players/Make.defs index b167480b8..4a75d7890 100644 --- a/examples/audio_dual_players/Make.defs +++ b/examples/audio_dual_players/Make.defs @@ -33,6 +33,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_AUDIO_DUAL_PLAYERS),y) +ifneq ($(CONFIG_EXAMPLES_AUDIO_DUAL_PLAYERS),) CONFIGURED_APPS += audio_dual_players endif diff --git a/examples/audio_dual_players/Makefile b/examples/audio_dual_players/Makefile index 5eaa3e7d7..aa4287bb3 100644 --- a/examples/audio_dual_players/Makefile +++ b/examples/audio_dual_players/Makefile @@ -33,19 +33,15 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs --include $(SDKDIR)/Make.defs -include $(APPDIR)/Make.defs +include $(SDKDIR)/Make.defs # Audio application info -CONFIG_EXAMPLES_AUDIO_DUAL_PLAYERS_PRIORITY ?= SCHED_PRIORITY_DEFAULT -CONFIG_EXAMPLES_AUDIO_DUAL_PLAYERS_STACKSIZE ?= 2048 - -APPNAME = audio_dual_players +PROGNAME = $(CONFIG_EXAMPLES_AUDIO_DUAL_PLAYERS_PROGNAME) PRIORITY = $(CONFIG_EXAMPLES_AUDIO_DUAL_PLAYERS_PRIORITY) STACKSIZE = $(CONFIG_EXAMPLES_AUDIO_DUAL_PLAYERS_STACKSIZE) +MODULE = $(CONFIG_EXAMPLES_AUDIO_DUAL_PLAYERS) # Audio Example @@ -53,21 +49,14 @@ MAINSRC = audio_dual_players_main.cxx # Audio Example paths -AUDIODIR = $(SDKDIR)$(DELIM)modules$(DELIM)audio +#AUDIODIR = $(SDKDIR)$(DELIM)modules$(DELIM)audio # Audio Example flags -ifeq ($(WINTOOL),y) -CXXFLAGS += -I "${shell cygpath -w $(AUDIODIR)}" -else -CXXFLAGS += -I $(AUDIODIR) -endif - +# XXX: Do NOT add module directory, please use modules/include. +#CXXFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" "$(AUDIODIR)"} CXXFLAGS += -D_POSIX CXXFLAGS += -DUSE_MEMMGR_FENCE CXXFLAGS += -DATTENTION_USE_FILENAME_LINE -CONFIG_EXAMPLES_AUDIO_DUAL_PLAYERS_PROGNAME ?= audio_dual_players$(EXEEXT) -PROGNAME = $(CONFIG_EXAMPLES_AUDIO_DUAL_PLAYERS_PROGNAME) - include $(APPDIR)/Application.mk diff --git a/examples/audio_dual_players/audio_dual_players_main.cxx b/examples/audio_dual_players/audio_dual_players_main.cxx index 2378a38c8..eb929a2c2 100644 --- a/examples/audio_dual_players/audio_dual_players_main.cxx +++ b/examples/audio_dual_players/audio_dual_players_main.cxx @@ -961,11 +961,7 @@ static int player_thread(int argc, FAR char *argv[]) * Public Functions ****************************************************************************/ -#ifdef CONFIG_BUILD_KERNEL extern "C" int main(int argc, FAR char *argv[]) -#else -extern "C" int audio_dual_players_main(int argc, char *argv[]) -#endif { int clk_mode = -1; int tsk0 = -1; diff --git a/examples/audio_oscillator/Kconfig b/examples/audio_oscillator/Kconfig new file mode 100644 index 000000000..7045cc0af --- /dev/null +++ b/examples/audio_oscillator/Kconfig @@ -0,0 +1,31 @@ +# +# For a description of the syntax of this configuration file, +# see the file kconfig-language.txt in the NuttX tools repository. +# + +config EXAMPLES_AUDIO_OSCILLATOR + tristate "Audio oscillator example" + default n + depends on CXD56_AUDIO + ---help--- + Enable the audio recorder example + +if EXAMPLES_AUDIO_OSCILLATOR + +config EXAMPLES_AUDIO_OSCILLATOR_PROGNAME + string "Program name" + default "audio_oscillator" + +config EXAMPLES_AUDIO_OSCILLATOR_PRIORITY + int "Audio oscillator task priority" + default 100 + +config EXAMPLES_AUDIO_OSCILLATOR_STACKSIZE + int "Audio oscillator stack size" + default 2048 + +config EXAMPLES_AUDIO_OSCILLATOR_USEPOSTPROC + bool "Use Posstprocess" + default n + +endif diff --git a/examples/audio_oscillator/Make.defs b/examples/audio_oscillator/Make.defs new file mode 100644 index 000000000..69696d2c5 --- /dev/null +++ b/examples/audio_oscillator/Make.defs @@ -0,0 +1,38 @@ +############################################################################ +# audio_oscillator/Make.defs +# +# Copyright 2020 Sony Semiconductor Solutions Corporation +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# 3. Neither the name of Sony Semiconductor Solutions Corporation nor +# the names of its contributors may be used to endorse or promote +# products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +############################################################################ + +ifneq ($(CONFIG_EXAMPLES_AUDIO_OSCILLATOR),) +CONFIGURED_APPS += audio_oscillator +endif diff --git a/examples/audio_oscillator/Makefile b/examples/audio_oscillator/Makefile new file mode 100644 index 000000000..45787ba5a --- /dev/null +++ b/examples/audio_oscillator/Makefile @@ -0,0 +1,82 @@ +############################################################################ +# audio_oscillator/Makefile +# +# Copyright 2020 Sony Semiconductor Solutions Corporation +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# 3. Neither the name of Sony Semiconductor Solutions Corporation nor +# the names of its contributors may be used to endorse or promote +# products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +############################################################################ + +-include $(TOPDIR)/Make.defs +include $(SDKDIR)/Make.defs + +# Audio oscillator application info + +PROGNAME = $(CONFIG_EXAMPLES_AUDIO_OSCILLATOR_PROGNAME) +PRIORITY = $(CONFIG_EXAMPLES_AUDIO_OSCILLATOR_PRIORITY) +STACKSIZE = $(CONFIG_EXAMPLES_AUDIO_OSCILLATOR_STACKSIZE) +MODULE = $(CONFIG_EXAMPLES_AUDIO_OSCILLATOR) + +# Audio oscillator Example + +CXXSRCS = audio_oscillator_init.cxx audio_synthesizer.cxx +MAINSRC = audio_oscillator_main.cxx + +# Audio oscillator Example paths + +AUDIODIR = $(SDKDIR)$(DELIM)modules$(DELIM)audio + +# Audio oscillator Example flags + +CXXFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" "$(AUDIODIR)"} +CXXFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" "$(AUDIODIR)$(DELIM)include"} +CXXFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" worker_oscillator$(DELIM)userproc$(DELIM)include} +ifeq ($(CONFIG_EXAMPLES_AUDIO_OSCILLATOR_USEPOSTPROC),y) +CXXFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" worker_postproc$(DELIM)userproc$(DELIM)include} +endif + +CXXFLAGS += -D_POSIX +CXXFLAGS += -DUSE_MEMMGR_FENCE +CXXFLAGS += -DATTENTION_USE_FILENAME_LINE + +include $(APPDIR)/Application.mk + +build_worker: + $(Q) $(MAKE) -C worker_oscillator TOPDIR="$(TOPDIR)" SDKDIR="$(SDKDIR)" APPDIR="$(APPDIR)" CROSSDEV=$(CROSSDEV) +ifeq ($(CONFIG_EXAMPLES_AUDIO_OSCILLATOR_USEPOSTPROC),y) + $(Q) $(MAKE) -C worker_postproc TOPDIR="$(TOPDIR)" SDKDIR="$(SDKDIR)" APPDIR="$(APPDIR)" CROSSDEV=$(CROSSDEV) +endif + +.built: build_worker + +clean_worker: + @$(MAKE) -C worker_oscillator TOPDIR="$(TOPDIR)" SDKDIR="$(SDKDIR)" APPDIR="$(APPDIR)" CROSSDEV=$(CROSSDEV) clean + @$(MAKE) -C worker_postproc TOPDIR="$(TOPDIR)" SDKDIR="$(SDKDIR)" APPDIR="$(APPDIR)" CROSSDEV=$(CROSSDEV) clean + +clean:: clean_worker diff --git a/examples/audio_oscillator/README.txt b/examples/audio_oscillator/README.txt new file mode 100644 index 000000000..8e0e34966 --- /dev/null +++ b/examples/audio_oscillator/README.txt @@ -0,0 +1,47 @@ + +Usage of audio_oscillator +=========================== + +In this example, the oscillator DSP creates up to eight different frequency +waveforms. Next, the post-processing DSP synthesizes this waveform and +outputs it to the speaker. +The oscillator DSP can also apply an envelope to each waveform. + +Usage +--------------------------- + +Select options in below. + +- [CXD56xx Configuration] + [SDIO SD Card] <= Y + [Audio] <= Y +- [SDK audio] <= Y + [Audio Utilities] + [Audio Synthesizer] <= Y +- [Memory manager] <= Y +- [ASMP] <= Y +- [Examples] + [Audio oscillator example] <= Y + +Or use audio_oscillator default configuration + +$ ./tools/config.py examples/audio_oscillator + +Build and install +-------------------------- + +Type 'make' to build SDK. +Install 'nuttx.spk' to system. + +After that, you can see worker binary 'OSCPROC', 'POSTPROC' +in directory worker_postproc, worker_postproc. +Store worker binary in the path specified by option. + - Default path + worker binary : /mnt/sd0/BIN + +Execute +-------------------------- + +Type 'audio_oscillator' on nsh. +nsh>audio_oscillator + diff --git a/examples/audio_oscillator/audio_oscillator_init.cxx b/examples/audio_oscillator/audio_oscillator_init.cxx new file mode 100644 index 000000000..486cf8c45 --- /dev/null +++ b/examples/audio_oscillator/audio_oscillator_init.cxx @@ -0,0 +1,490 @@ +/**************************************************************************** + * audio_oscillator/audio_oscillator_init.cxx + * + * Copyright 2020 Sony Semiconductor Solutions Corporation + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name of Sony Semiconductor Solutions Corporation nor + * the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#include +#include "memutils/memory_manager/MemHandle.h" +#include "memutils/message/Message.h" +#include "include/msgq_id.h" +#include "include/mem_layout.h" +#include "include/memory_layout.h" +#include "include/msgq_pool.h" +#include "include/pool_layout.h" +#include "include/fixed_fence.h" +#include "audio/audio_synthesizer_api.h" +#include "audio/audio_outputmix_api.h" +#include "audio/audio_renderer_api.h" +#ifdef CONFIG_EXAMPLES_AUDIO_OSCILLATOR_USEPOSTPROC +#include "userproc_command.h" +#endif + +using namespace MemMgrLite; + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* Section number of memory layout to use */ + +#define AUDIO_SECTION SECTION_NO0 + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +/* For share memory. */ + +static mpshm_t s_shm; + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +static bool receive_object_reply(void) +{ + AudioObjReply reply_info; + + AS_ReceiveObjectReply(MSGQ_AUD_APP, &reply_info); + + return true; +} + +/* ------------------------------------------------------------------------ */ +static bool create_audio_sub_system(bool is_enable = true) +{ + bool result = true; + + /* Create mixer feature. */ + + AsCreateOutputMixParams_t mix_param = + { + .msgq_id = + { + .mixer = MSGQ_AUD_OUTPUT_MIX, + .mng = MSGQ_AUD_APP, + .render_path0_filter_dsp = MSGQ_AUD_PFDSP0, + .render_path1_filter_dsp = MSGQ_AUD_PFDSP1, + }, + .pool_id = + { + .render_path0_filter_pcm = S0_PF0_PCM_BUF_POOL, + .render_path1_filter_pcm = S0_PF1_PCM_BUF_POOL, + .render_path0_filter_dsp = S0_PF0_APU_CMD_POOL, + .render_path1_filter_dsp = S0_PF1_APU_CMD_POOL, + }, + }; + + result = AS_CreateOutputMixer(&mix_param, NULL); + + if (!result) + { + printf("Error: AS_CreateOutputMixer() failed. system memory insufficient!\n"); + return false; + } + + /* Create renderer feature. */ + + AsCreateRendererParam_t rend_param = + { + .msgq_id = + { + .dev0_req = MSGQ_AUD_RND_PLY0, + .dev0_sync = MSGQ_AUD_RND_PLY0_SYNC, + .dev1_req = MSGQ_AUD_RND_PLY1, + .dev1_sync = MSGQ_AUD_RND_PLY1_SYNC, + }, + }; + + result = AS_CreateRenderer(&rend_param); + + if (!result) + { + printf("Error: AS_CreateRenderer() failure. system memory insufficient!\n"); + return false; + } + + return result; +} + +/* ------------------------------------------------------------------------ */ +static void deact_audio_sub_system(void) +{ + /* The following delete process is not executed when it is not initialized */ + + AS_DeleteOutputMix(); /* Delete OutputMixer. */ + + AS_DeleteRenderer(); /* Delete Renderer. */ + + AS_DeleteMediaSynthesizer(); /* Delete Oscillator. */ +} + +/* ------------------------------------------------------------------------ */ +static bool activate_baseband(void) +{ + CXD56_AUDIO_ECODE error_code; + + /* Power on audio device */ + + error_code = cxd56_audio_poweron(); + + if (error_code != CXD56_AUDIO_ECODE_OK) + { + printf("cxd56_audio_poweron() error! [%d]\n", error_code); + return false; + } + + /* Activate OutputMixer */ + + AsActivateOutputMixer mixer_act = + { + .output_device = HPOutputDevice, + .mixer_type = MainOnly, +#ifdef CONFIG_EXAMPLES_AUDIO_OSCILLATOR_USEPOSTPROC + .post_enable = PostFilterEnable, +#else + .post_enable = PostFilterDisable, +#endif + .cb = NULL, + }; + + AS_ActivateOutputMixer(OutputMixer0, &mixer_act); + + if (!receive_object_reply()) + { + return false; + } + + AS_ActivateOutputMixer(OutputMixer1, &mixer_act); + + return receive_object_reply(); +} + +/* ------------------------------------------------------------------------ */ +static bool deactivate_baseband(void) +{ + /* Deactivate OutputMixer */ + + AsDeactivateOutputMixer mixer_deact; + + AS_DeactivateOutputMixer(OutputMixer0, &mixer_deact); + + if (!receive_object_reply()) + { + printf("AS_DeactivateOutputMixer(0) error!\n"); + } + + AS_DeactivateOutputMixer(OutputMixer1, &mixer_deact); + + if (!receive_object_reply()) + { + printf("AS_DeactivateOutputMixer(1) error!\n"); + } + + CXD56_AUDIO_ECODE error_code; + + /* Power off audio device */ + + error_code = cxd56_audio_poweroff(); + + if (error_code != CXD56_AUDIO_ECODE_OK) + { + printf("cxd56_audio_poweroff() error! [%d]\n", error_code); + return false; + } + + return true; +} + +/* ------------------------------------------------------------------------ */ +static bool set_clkmode(void) +{ + CXD56_AUDIO_ECODE error_code; + + error_code = cxd56_audio_set_clkmode(CXD56_AUDIO_CLKMODE_NORMAL); + + if (error_code != CXD56_AUDIO_ECODE_OK) + { + printf("cxd56_audio_set_clkmode() error! [%d]\n", error_code); + return false; + } + + return true; +} + +/* ------------------------------------------------------------------------ */ +static bool init_libraries(void) +{ + int ret; + uint32_t addr = AUD_SRAM_ADDR; + + /* Initialize shared memory.*/ + + ret = mpshm_init(&s_shm, 1, AUD_SRAM_SIZE); + if (ret < 0) + { + printf("Error: mpshm_init() failure. %d\n", ret); + return false; + } + + ret = mpshm_remap(&s_shm, (void *)addr); + if (ret < 0) + { + printf("Error: mpshm_remap() failure. %d\n", ret); + return false; + } + + /* Initalize MessageLib. */ + + err_t err = MsgLib::initFirst(NUM_MSGQ_POOLS, MSGQ_TOP_DRM); + if (err != ERR_OK) + { + printf("Error: MsgLib::initFirst() failure. 0x%x\n", err); + return false; + } + + err = MsgLib::initPerCpu(); + if (err != ERR_OK) + { + printf("Error: MsgLib::initPerCpu() failure. 0x%x\n", err); + return false; + } + + void* mml_data_area = translatePoolAddrToVa(MEMMGR_DATA_AREA_ADDR); + err = Manager::initFirst(mml_data_area, MEMMGR_DATA_AREA_SIZE); + if (err != ERR_OK) + { + printf("Error: Manager::initFirst() failure. 0x%x\n", err); + return false; + } + + err = Manager::initPerCpu(mml_data_area, static_pools, pool_num, layout_no); + if (err != ERR_OK) + { + printf("Error: Manager::initPerCpu() failure. 0x%x\n", err); + return false; + } + + /* Create static memory pool of VoiceCall. */ + + const uint8_t sec_no = AUDIO_SECTION; + const NumLayout layout_no = MEM_LAYOUT_OSCILLATOR; + void* work_va = translatePoolAddrToVa(S0_MEMMGR_WORK_AREA_ADDR); + const PoolSectionAttr *ptr = &MemoryPoolLayouts[AUDIO_SECTION][layout_no][0]; + err = Manager::createStaticPools(sec_no, + layout_no, + work_va, + S0_MEMMGR_WORK_AREA_SIZE, + ptr); + if (err != ERR_OK) + { + printf("Error: Manager::createStaticPools() failure. %d\n", err); + return false; + } + + return true; +} + +/* ------------------------------------------------------------------------ */ +static bool finalize_libraries(void) +{ + /* Finalize MessageLib. */ + + MsgLib::finalize(); + + /* Destroy static pools. */ + + MemMgrLite::Manager::destroyStaticPools(AUDIO_SECTION); + + /* Finalize memory manager. */ + + MemMgrLite::Manager::finalize(); + + /* Destroy shared memory. */ + + int ret = mpshm_detach(&s_shm); + + if (ret < 0) + { + printf("Error: mpshm_detach() failure. %d\n", ret); + return false; + } + + ret = mpshm_destroy(&s_shm); + + if (ret < 0) + { + printf("Error: mpshm_destroy() failure. %d\n", ret); + return false; + } + + return true; +} + +/**************************************************************************** + * public Functions + ****************************************************************************/ + +bool app_initialize(void) +{ + bool ret = false; + + /* First, initialize the shared memory and memory utility used by AudioSubSystem. */ + + if (!init_libraries()) + { + printf("Error: init_libraries() failure.\n"); + } + + /* Next, Create the features used by AudioSubSystem. */ + + else if (!create_audio_sub_system()) + { + printf("Error: act_audiosubsystem() failure.\n"); + } + + /* Change AudioSubsystem to Ready state so that I/O parameters can be changed. */ + + else if (!activate_baseband()) + { + printf("Error: activate_baseband() failure.\n"); + } + + /* Set audio clock mode. */ + + else if (!set_clkmode()) + { + printf("Error: set_clkmode() failure.\n"); + } + else + { + /* Complete! */ + + ret = true; + } + + return ret; +} + +/* ------------------------------------------------------------------------ */ +void app_finalize(void) +{ + /* Deactivate baseband */ + + if (!deactivate_baseband()) + { + printf("Error: deactivate_baseband() failure.\n"); + } + + /* Deactivate the features used by AudioSubSystem. */ + + deact_audio_sub_system(); + + /* finalize the shared memory and memory utility used by AudioSubSystem. */ + + if (!finalize_libraries()) + { + printf("Error: finalize_libraries() failure.\n"); + } +} + +/* ------------------------------------------------------------------------ */ +bool app_set_volume(int master_db) +{ + /* Set volume to audio driver */ + + CXD56_AUDIO_ECODE error_code; + + error_code = cxd56_audio_set_vol(CXD56_AUDIO_VOLID_MIXER_OUT, master_db); + + if (error_code != CXD56_AUDIO_ECODE_OK) + { + printf("cxd56_audio_set_vol() error! [%d]\n", error_code); + return false; + } + + error_code = cxd56_audio_set_vol(CXD56_AUDIO_VOLID_MIXER_IN1, 0); + + if (error_code != CXD56_AUDIO_ECODE_OK) + { + printf("cxd56_audio_set_vol() error! [%d]\n", error_code); + return false; + } + + error_code = cxd56_audio_set_vol(CXD56_AUDIO_VOLID_MIXER_IN2, 0); + + if (error_code != CXD56_AUDIO_ECODE_OK) + { + printf("cxd56_audio_set_vol() error! [%d]\n", error_code); + return false; + } + + return true; +} + +/* ------------------------------------------------------------------------ */ +bool app_init_postproc(uint8_t channel_num, + uint8_t bit_width, + uint32_t sampling_rate) +{ +#ifdef CONFIG_EXAMPLES_AUDIO_OSCILLATOR_USEPOSTPROC + + AsInitPostProc init; + InitParam initpostcmd; + + initpostcmd.input_channel_num = channel_num; + + init.addr = reinterpret_cast(&initpostcmd); + init.size = sizeof(initpostcmd); + + AS_InitPostprocOutputMixer(OutputMixer0, &init); + + if (!receive_object_reply()) + { + return false; + } + + AS_InitPostprocOutputMixer(OutputMixer1, &init); + + return receive_object_reply(); + +#else + return true; +#endif +} diff --git a/examples/audio_oscillator/audio_oscillator_main.cxx b/examples/audio_oscillator/audio_oscillator_main.cxx new file mode 100644 index 000000000..a5b9e539b --- /dev/null +++ b/examples/audio_oscillator/audio_oscillator_main.cxx @@ -0,0 +1,240 @@ +/**************************************************************************** + * audio_oscillator/audio_oscillator_main.cxx + * + * Copyright 2020 Sony Semiconductor Solutions Corporation + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name of Sony Semiconductor Solutions Corporation nor + * the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#include +#include "oscillator.h" +#include "audio/audio_synthesizer_api.h" +#include "audio_synthesizer_melody.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* Default Volume. -20dB */ + +#define VOLUME -160 + +/* Maximum number of channels */ + +#define CHANNEL_NUMBER 8 + +/* Oscillator parameter */ + +#define OSC_CH_NUM CHANNEL_NUMBER +#define OSC_BIT_LEN AS_BITLENGTH_16 +#define OSC_SAMPLING_RATE AS_SAMPLINGRATE_48000 +#define OSC_SAMPLE_SIZE 240 +#define OSC_EFFECT_ATTACK 10 +#define OSC_EFFECT_DECAY 50 +#define OSC_EFFECT_SUSTAIN 100 +#define OSC_EFFECT_RELEASE 200 + +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +extern bool app_initialize(void); +extern void app_finalize(void); +extern bool app_set_volume(int master_db); +extern bool app_init_postproc(uint8_t channel_num, + uint8_t bit_width, + uint32_t sampling_rate); + +/* Synthesizer */ + +extern bool app_create_synthesizer(void); +extern bool app_set_synthesizer_status(void); +extern bool app_start_synthesizer(void); +extern bool app_stop_synthesizer(void); +extern bool app_deactive_synthesizer(void); +extern bool app_set_frequency_synthesizer(uint8_t channel_number, + uint32_t frequency[]); +extern bool app_set_envelope_synthesizer(uint8_t channel_no, + uint16_t attack, + uint16_t decay, + uint16_t sustain, + uint16_t release); +extern bool app_init_synthesizer(uint8_t channel_num, + uint8_t bit_width, + uint32_t sampling_rate, + uint16_t sample_size); + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +static void app_main_process(void) +{ + p_node = node; + + /* Set output mute. */ + + if (board_external_amp_mute_control(false) != OK) + { + printf("Error: board_external_amp_mute_control(false) failuer.\n"); + } + + /* Start synthesizer operation. */ + + if (!app_start_synthesizer()) + { + printf("Error: app_start_synthesizer() failure.\n"); + return; + } + + /* Try the effect on channel 0 */ + + app_set_envelope_synthesizer(0, + OSC_EFFECT_ATTACK, + OSC_EFFECT_DECAY, + OSC_EFFECT_SUSTAIN, + OSC_EFFECT_RELEASE); + + printf("Running...\n"); + + for (; p_node->fs[0] != M_END; p_node++) + { + /* Set frequency. */ + + if (!app_set_frequency_synthesizer(CHANNEL_NUMBER, + p_node->fs)) + { + printf("Error: app_set_frequency_synthesizer() failure.\n"); + break; + } + + usleep(300 * 1000); + } + + /* Set output mute. */ + + if (board_external_amp_mute_control(true) != OK) + { + printf("Error: board_external_amp_mute_control(true) failuer.\n"); + } + + /* Stop synthesizer operation. */ + + if (!app_stop_synthesizer()) + { + printf("Error: app_stop_operation() failure.\n"); + } +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +extern "C" int main(int argc, FAR char *argv[]) +{ + printf("Start AudioOscillator example\n"); + + /* Waiting for SD card mounting. */ + + sleep(1); + + /* Initialize */ + + if (!app_initialize()) + { + printf("Error: app_initialize() failure.\n"); + } + + /* Sreate synthesizer sub system */ + + else if (!app_create_synthesizer()) + { + printf("Error: app_initialize() failure.\n"); + } + + else if (!app_init_postproc(OSC_CH_NUM, + OSC_BIT_LEN, + OSC_SAMPLING_RATE)) + { + printf("Error: app_init_postproc() failure.\n"); + } + + /* Set synthesizer operation mode. */ + + else if (!app_set_synthesizer_status()) + { + printf("Error: app_set_synthesizer_status() failure.\n"); + } + + /* Initialize synthesizer. */ + + else if (!app_init_synthesizer(OSC_CH_NUM, + OSC_BIT_LEN, + OSC_SAMPLING_RATE, + OSC_SAMPLE_SIZE)) + { + printf("Error: app_init_synthesizer() failure.\n"); + } + else + { + /* Set volume */ + + app_set_volume(VOLUME); + + /* Running... */ + + app_main_process(); + } + + /* Unload synthesizer operation. */ + + if (!app_deactive_synthesizer()) + { + printf("Error: app_deactive_synthesizer failuer.\n"); + } + + /* Finalize */ + + app_finalize(); + + printf("Exit AudioOscillator example\n"); + + return 0; +} diff --git a/examples/audio_oscillator/audio_synthesizer.cxx b/examples/audio_oscillator/audio_synthesizer.cxx new file mode 100644 index 000000000..8f61acf31 --- /dev/null +++ b/examples/audio_oscillator/audio_synthesizer.cxx @@ -0,0 +1,311 @@ +/**************************************************************************** + * audio_oscillator/audio_synthesizer.cxx + * + * Copyright 2020 Sony Semiconductor Solutions Corporation + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name of Sony Semiconductor Solutions Corporation nor + * the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "audio/audio_synthesizer_api.h" +#include "audio/audio_outputmix_api.h" +#include "include/mem_layout.h" +#include "include/msgq_id.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* DSP file path */ + +#define DSPBIN_PATH "/mnt/sd0/BIN" + +/* Waiting for reception */ + +#define RECEIVE_OBJECT_REPLY() receive_object_reply(__LINE__) + +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ + +/**************************************************************************** + * Private Type Declarations + ****************************************************************************/ + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +#ifndef CONFIG_EXAMPLES_AUDIO_OSCILLATOR_USEPOSTPROC +static struct +{ + uint8_t channel_num; + uint8_t bit_width; +} +osc_param; +#endif + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +#ifndef CONFIG_EXAMPLES_AUDIO_OSCILLATOR_USEPOSTPROC +static void synthesizer_done_callback(AsPcmDataParam param) +{ + /* You can process a data here. + * + * Example) + * + * Outputs the waveform of the number of channels + * input from the oscillator as two channels. + * + */ + + uint8_t input_ch = osc_param.channel_num; + uint16_t byte_length = osc_param.bit_width / 8; + int16_t *input = (int16_t *)param.mh.getPa(); + int16_t *output = input; + uint32_t size = param.size / (byte_length * input_ch); + int32_t data_l; + + for (uint32_t j = 0; j < size; j++) + { + data_l = 0; + + for (uint8_t i = 0; i < input_ch; i++) + { + data_l += *input++; + } + + data_l /= input_ch; + + *output++ = data_l; + *output++ = data_l; + } + + param.size = ((uint8_t *)output - (uint8_t *)param.mh.getPa()); + + /* Notify the processed data to the mixer */ + + AsSendDataOutputMixer data; + + data.handle = OutputMixer0; + data.callback = param.callback; + data.pcm = param; + + AS_SendDataOutputMixer(&data); +} +#endif + +/* ------------------------------------------------------------------------ */ +static bool receive_object_reply(int line_no) +{ + AudioObjReply info; + + AS_ReceiveObjectReply(MSGQ_AUD_APP, &info); + + if (info.result != OK) + { + printf("RECEIVE_OBJECT_REPLY[%d] error!\n", line_no); + printf(" id 0x%x\n", info.id); + printf(" type 0x%x\n", info.type); + printf(" module_id 0x%x\n", info.module_id); + printf(" result 0x%x\n", info.result); + return false; + } + + return true; +} + +/* ------------------------------------------------------------------------ */ +bool app_create_synthesizer(void) +{ + /* Create Synthesizer */ + + AsCreateSynthesizerParam_t syn = + { + .msgq_id = + { + .synthesizer = MSGQ_AUD_SYNTHESIZER, + .mng = MSGQ_AUD_APP, + .dsp = MSGQ_AUD_DSP, + }, + .pool_id = + { + .output = S0_REND_PCM_BUF_POOL, + .dsp = S0_OSC_APU_CMD_POOL, + } + }; + + return AS_CreateMediaSynthesizer(&syn, NULL); +} + +/* ------------------------------------------------------------------------ */ +bool app_set_synthesizer_status(void) +{ + AsActivateSynthesizer act; + + act.cb = NULL; + + AS_ActivateMediaSynthesizer(&act); + + return RECEIVE_OBJECT_REPLY(); +} + +/* ------------------------------------------------------------------------ */ +bool app_init_synthesizer(uint8_t channel_num, + uint8_t bit_width, + uint32_t sampling_rate, + uint16_t sample_size, + uint16_t attack, + uint16_t decay, + uint16_t sustain, + uint16_t release) +{ + AsInitSynthesizerParam init; + + init.type = AsSynthesizerSinWave; + init.channel_num = channel_num; + init.sampling_rate = sampling_rate; + init.bit_width = bit_width; + init.sample_size = sample_size; + + /* PCM data path setting */ + +#ifdef CONFIG_EXAMPLES_AUDIO_OSCILLATOR_USEPOSTPROC + init.data_path = AsSynthesizerDataPathMessage; + init.dest.msg.id = MSGQ_AUD_OUTPUT_MIX; + init.dest.msg.identifier = OutputMixer0; +#else + osc_param.channel_num = channel_num; + osc_param.bit_width = bit_width; + init.data_path = AsSynthesizerDataPathCallback; + init.dest.cb = synthesizer_done_callback; +#endif + + /* Initial value setting of envelope generator */ + + init.attack = attack; + init.decay = decay; + init.sustain = sustain; + init.release = release; + + sprintf(init.dsp_path, "%s/%s", DSPBIN_PATH, "OSCPROC"); + + AS_InitMediaSynthesizer(&init); + + return RECEIVE_OBJECT_REPLY(); +} + +/* ------------------------------------------------------------------------ */ +bool app_init_synthesizer(uint8_t channel_num, + uint8_t bit_width, + uint32_t sampling_rate, + uint16_t sample_size) +{ + return app_init_synthesizer(channel_num, + bit_width, + sampling_rate, + sample_size, + 1, + 1, + 100, + 1); +} + +/* ------------------------------------------------------------------------ */ +bool app_start_synthesizer(void) +{ + AS_StartMediaSynthesizer(); + + return RECEIVE_OBJECT_REPLY(); +} + +/* ------------------------------------------------------------------------ */ +bool app_stop_synthesizer(void) +{ + AS_StopMediaSynthesizer(); + + return RECEIVE_OBJECT_REPLY(); +} + +/* ------------------------------------------------------------------------ */ +bool app_deactive_synthesizer(void) +{ + AS_DeactivateMediaSynthesizer(); + + return RECEIVE_OBJECT_REPLY(); +} + +/* ------------------------------------------------------------------------ */ +bool app_set_frequency_synthesizer(uint8_t channel_number, + uint32_t frequency[]) +{ + AsSetSynthesizer set_param; + bool res = true; + + for (int i = 0; i < channel_number; i++) + { + set_param.channel_no = i; + set_param.frequency = frequency[i]; + + AS_SetFrequencyMediaSynthesizer(&set_param); + + if (!(res = RECEIVE_OBJECT_REPLY())) + { + break; + } + } + + return res; +} + +/* ------------------------------------------------------------------------ */ +bool app_set_envelope_synthesizer(uint8_t channel_no, + uint16_t attack, + uint16_t decay, + uint16_t sustain, + uint16_t release) +{ + AsSetSynthesizer set_param; + + set_param.channel_no = channel_no; + set_param.attack = attack; + set_param.decay = decay; + set_param.sustain = sustain; + set_param.release = release; + + AS_SetEnvelopeMediaSynthesizer(&set_param); + + return RECEIVE_OBJECT_REPLY(); +} diff --git a/examples/audio_oscillator/audio_synthesizer_melody.h b/examples/audio_oscillator/audio_synthesizer_melody.h new file mode 100644 index 000000000..d385faea5 --- /dev/null +++ b/examples/audio_oscillator/audio_synthesizer_melody.h @@ -0,0 +1,161 @@ +/**************************************************************************** + * audio_oscillator/audio_synthesizer_melody.h + * + * Copyright 2020 Sony Semiconductor Solutions Corporation + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name of Sony Semiconductor Solutions Corporation nor + * the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +#ifndef __AUDIO_SYNTHESIZER_MELODY +#define __AUDIO_SYNTHESIZER_MELODY + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* Musical scale */ + +#define M_C_4 262 /* Do */ +#define M_CC4 277 +#define M_D_4 294 /* Re */ +#define M_DD4 311 +#define M_E_4 330 /* Mi */ +#define M_F_4 349 /* Fa */ +#define M_FF4 370 +#define M_G_4 392 /* So */ +#define M_GG4 415 +#define M_A_4 440 /* Ra */ +#define M_AA4 466 +#define M_B_4 494 /* Si */ +#define M_C_5 523 +#define M_END 9999 + +/**************************************************************************** + * Private data + ****************************************************************************/ + +/* Define beep scale */ + +static struct { + uint32_t fs[8]; +} +node[] = { + {M_C_4, 0, 0, 0, 0, 0, 0, 0}, + {M_D_4, 0, 0, 0, 0, 0, 0, 0}, + {M_E_4, 0, 0, 0, 0, 0, 0, 0}, + {M_F_4, 0, 0, 0, 0, 0, 0, 0}, + {M_E_4, 0, 0, 0, 0, 0, 0, 0}, + {M_D_4, 0, 0, 0, 0, 0, 0, 0}, + {M_C_4, 0, 0, 0, 0, 0, 0, 0}, + {M_C_4, 0, 0, 0, 0, 0, 0, 0}, + {M_E_4, M_C_4, 0, 0, 0, 0, 0, 0}, + {M_F_4, M_D_4, 0, 0, 0, 0, 0, 0}, + {M_G_4, M_E_4, 0, 0, 0, 0, 0, 0}, + {M_A_4, M_F_4, 0, 0, 0, 0, 0, 0}, + {M_G_4, M_E_4, 0, 0, 0, 0, 0, 0}, + {M_F_4, M_D_4, 0, 0, 0, 0, 0, 0}, + {M_E_4, M_C_4, 0, 0, 0, 0, 0, 0}, + {M_E_4, M_C_4, 0, 0, 0, 0, 0, 0}, + {M_C_4, M_E_4, M_C_4, 0, 0, 0, 0, 0}, + { 0, M_F_4, M_D_4, 0, 0, 0, 0, 0}, + {M_C_4, M_G_4, M_E_4, 0, 0, 0, 0, 0}, + { 0, M_A_4, M_F_4, 0, 0, 0, 0, 0}, + {M_C_4, M_G_4, M_E_4, 0, 0, 0, 0, 0}, + { 0, M_F_4, M_D_4, 0, 0, 0, 0, 0}, + {M_C_4, M_E_4, M_C_4, 0, 0, 0, 0, 0}, + { 0, M_E_4, M_C_4, 0, 0, 0, 0, 0}, + {M_C_4, M_C_4, M_E_4, M_C_4, 0, 0, 0, 0}, + {M_D_4, 1, M_F_4, M_D_4, 0, 0, 0, 0}, + {M_E_4, M_C_4, M_G_4, M_E_4, 0, 0, 0, 0}, + {M_F_4, 1, M_A_4, M_F_4, 0, 0, 0, 0}, + {M_E_4, M_C_4, M_G_4, M_E_4, 0, 0, 0, 0}, + {M_D_4, 1, M_F_4, M_D_4, 0, 0, 0, 0}, + {M_C_4, M_C_4, M_E_4, M_C_4, 0, 0, 0, 0}, + { 0, 1, M_E_4, M_C_4, 0, 0, 0, 0}, + { 0, M_C_4, M_C_4, M_E_4, M_C_4, 0, 0, 0}, + { 0, M_D_4, 1, M_F_4, M_D_4, 0, 0, 0}, + { 0, M_E_4, M_C_4, M_G_4, M_E_4, 0, 0, 0}, + { 0, M_F_4, 1, M_A_4, M_F_4, 0, 0, 0}, + { 0, M_E_4, M_C_4, M_G_4, M_E_4, 0, 0, 0}, + { 0, M_D_4, 1, M_F_4, M_D_4, 0, 0, 0}, + { 0, M_C_4, M_C_4, M_E_4, M_C_4, 0, 0, 0}, + { 0, 0, 1, M_E_4, M_C_4, 0, 0, 0}, + { 0, 0, M_C_4, M_C_4, M_E_4, M_C_4, 0, 0}, + { 0, 0, M_D_4, 1, M_F_4, M_D_4, 0, 0}, + { 0, 0, M_E_4, M_C_4, M_G_4, M_E_4, 0, 0}, + { 0, 0, M_F_4, 1, M_A_4, M_F_4, 0, 0}, + { 0, 0, M_E_4, M_C_4, M_G_4, M_E_4, 0, 0}, + { 0, 0, M_D_4, 1, M_F_4, M_D_4, 0, 0}, + { 0, 0, M_C_4, M_C_4, M_E_4, M_C_4, 0, 0}, + { 0, 0, 0, 1, M_E_4, M_C_4, 0, 0}, + { 0, 0, 0, M_C_4, M_C_4, M_E_4, M_C_4, 0}, + { 0, 0, 0, M_D_4, 1, M_F_4, M_D_4, 0}, + { 0, 0, 0, M_E_4, M_C_4, M_G_4, M_E_4, 0}, + { 0, 0, 0, M_F_4, 1, M_A_4, M_F_4, 0}, + { 0, 0, 0, M_E_4, M_C_4, M_G_4, M_E_4, 0}, + { 0, 0, 0, M_D_4, 1, M_F_4, M_D_4, 0}, + { 0, 0, 0, M_C_4, M_C_4, M_E_4, M_C_4, 0}, + { 0, 0, 0, 0, 1, M_E_4, M_C_4, 0}, + { 0, 0, 0, 0, M_C_4, M_C_4, M_E_4, M_C_4}, + { 0, 0, 0, 0, M_D_4, 1, M_F_4, M_D_4}, + { 0, 0, 0, 0, M_E_4, M_C_4, M_G_4, M_E_4}, + { 0, 0, 0, 0, M_F_4, 1, M_A_4, M_F_4}, + { 0, 0, 0, 0, M_E_4, M_C_4, M_G_4, M_E_4}, + { 0, 0, 0, 0, M_D_4, 1, M_F_4, M_D_4}, + { 0, 0, 0, 0, M_C_4, M_C_4, M_E_4, M_C_4}, + { 0, 0, 0, 0, 0, 1, M_E_4, M_C_4}, + { 0, 0, 0, 0, 0, M_C_4, M_C_4, M_E_4}, + { 0, 0, 0, 0, 0, M_D_4, 1, M_F_4}, + { 0, 0, 0, 0, 0, M_E_4, M_C_4, M_G_4}, + { 0, 0, 0, 0, 0, M_F_4, 1, M_A_4}, + { 0, 0, 0, 0, 0, M_E_4, M_C_4, M_G_4}, + { 0, 0, 0, 0, 0, M_D_4, 1, M_F_4}, + { 0, 0, 0, 0, 0, M_C_4, M_C_4, M_E_4}, + { 0, 0, 0, 0, 0, 0, 1, M_E_4}, + { 0, 0, 0, 0, 0, 0, M_C_4, M_C_4}, + { 0, 0, 0, 0, 0, 0, M_D_4, 1}, + { 0, 0, 0, 0, 0, 0, M_E_4, M_C_4}, + { 0, 0, 0, 0, 0, 0, M_F_4, 1}, + { 0, 0, 0, 0, 0, 0, M_E_4, M_C_4}, + { 0, 0, 0, 0, 0, 0, M_D_4, 1}, + { 0, 0, 0, 0, 0, 0, M_C_4, M_C_4}, + { 0, 0, 0, 0, 0, 0, 0, 1}, + { 0, 0, 0, 0, 0, 0, 0, M_C_4}, + { 0, 0, 0, 0, 0, 0, 0, M_D_4}, + { 0, 0, 0, 0, 0, 0, 0, M_E_4}, + { 0, 0, 0, 0, 0, 0, 0, M_F_4}, + { 0, 0, 0, 0, 0, 0, 0, M_E_4}, + { 0, 0, 0, 0, 0, 0, 0, M_D_4}, + { 0, 0, 0, 0, 0, 0, 0, M_C_4}, + {M_END, 0, 0, 0, 0, 0, 0, 0}, +}, +*p_node; + +#endif /* __AUDIO_SYNTHESIZER_MELODY */ diff --git a/examples/audio_oscillator/config/mem_layout.conf b/examples/audio_oscillator/config/mem_layout.conf new file mode 100644 index 000000000..d835670ae --- /dev/null +++ b/examples/audio_oscillator/config/mem_layout.conf @@ -0,0 +1,166 @@ +#!/usr/bin/env python3 +############################################################################ +# examples/audio_oscillator/config/mem_layout.conf +# +# Copyright 2020 Sony Semiconductor Solutions Corporation +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# 3. Neither the name of Sony Semiconductor Solutions Corporation nor +# the names of its contributors may be used to endorse or promote +# products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +############################################################################ + +import sys + +sys.path.append('../../../sdk/tools') + +############################################################################# +# MemoryManager Configuration +# +UseFence = True # Use of a pool fence + +from mem_layout import * + +############################################################################# +# User defined constants +# Start with "U_" so that it does not overlap with the definition +# in the script, only upper case letters, numbers and "_". +# When defined with a name starting with "U_MEM_", +# macros of the same name are output to output_header +# +U_STD_ALIGN = 8 # standard alignment +U_TILE_ALIGN = 0x20000 # Memory Tile Align 128KB + +############################################################################# +# Memory device definition +# The name_ADDR macro and the name_SIZE macro are output to output_header +# +# name: Device name (3 or more characters, starting with upper case letters, +# capital letters, numbers, "_" can be used) +# ram : True if the device is RAM. False otherwise +# addr: Address (value of multiples of 4) +# size: Size in bytes (values of multiples of 4 excluding 0) +# +MemoryDevices.init( + # name ram addr size + ["AUD_SRAM", True, 0x000c0000, 0x00040000], + None # end of definition +) + +############################################################################# +# Fixed area definition +# name_ALIGN, name_ADDR, name_SIZE macros are output to output_header +# If the fence is valid, the name_L_FENCE and name _U_FENCE macros +# are also output +# +# name : Area name (name beginning with uppercase letters and ending +# with "_AREA", uppercase letters, +# numbers, "_" can be used) +# device: Device name of MemoryDevices securing space +# align : Starting alignment of the region. +# Specify a multiple of MinAlign (= 4) except 0 +# size : Starting alignment of the region. +# Specify a multiple of MinAlign (= 4) except 0 +# In the final area of each device, you can specify RemainderSize +# indicating the remaining size +# fence : Specify validity / invalidity of fence +# (This item is ignored when UseFence is False) +# +FixedAreas.init( + # name, device, align, size, fence + ["AUDIO_WORK_AREA", "AUD_SRAM", U_STD_ALIGN, 0x0003d000, False], # Audio work area + ["MSG_QUE_AREA", "AUD_SRAM", U_STD_ALIGN, 0x00002000, False], # message queue area + ["MEMMGR_WORK_AREA", "AUD_SRAM", U_STD_ALIGN, 0x00000200, False], # MemMgrLite WORK Area + ["MEMMGR_DATA_AREA", "AUD_SRAM", U_STD_ALIGN, 0x00000100, False], # MemMgrLite DATA Area + None # end of definition +) + +############################################################################## +# Pool layout definition +# For output_header, pool ID and NUM_MEM_POOLS, NUM_MEM_LAYOUTS and +# Lx_name_ALIGN, Lx_name_ADDR, Lx_name_SIZE, Lx_name_NUM_SEG, Lx_name_SEG_SIZE +# Macros are output (x is the layout number) +# If the fence is valid, the Lx_name_L_FENCE and Lx_name_U_FENCE macros +# are also output +# +# name : Pool name (name beginning with upper case letters and ending +# with "_POOL", upper case letters, numbers, "_" can be used) +# area : Area name of FixedArea to be used as pool area. +# The area must be located in the RAM +# align: Starting alignment of the pool. +# Specify a multiple of MinAlign (= 4) except 0 +# size : Size of the pool. A value of a multiple of 4 except 0. +# In the Basic pool, you can specify segment size * number of segments. +# In the final area of each area, RemainderSize indicating +# the remaining size can be specified +# seg : Specify the number of segments (1 or more, 255 or 65535 or less). +# See UseOver255Segments. +# For Basic pool, size / seg is the size of each segment +# (the remainder is ignored) +# fence: Specify whether the fence is valid or invalid. +# This item is ignored when UseFence is false +# + +#---------------------# +# Setting for normal mode +#---------------------# + +# Definition for REND_PCM_BUF_POOL +U_REND_PCM_BUF_SIZE = 4096 +U_REND_PCM_BUF_SEG_NUM = 5 +U_REND_PCM_BUF_POOL_SIZE = U_REND_PCM_BUF_SIZE * U_REND_PCM_BUF_SEG_NUM + +# Definition for OSC_APU_CMD_POOL +U_APU_CMD_SIZE = 92 +U_OSC_APU_CMD_SEG_NUM = 5 +U_OSC_APU_CMD_POLL_SIZE = U_APU_CMD_SIZE * U_OSC_APU_CMD_SEG_NUM + +# Definition for PFx_PCM_BUF_POOL +U_POF_PCM_BUF_SEG_NUM = 1 +U_POF_PCM_BUF_POOL_SIZE = U_REND_PCM_BUF_SIZE * U_POF_PCM_BUF_SEG_NUM + +# Definition for PFx_APU_CMD_POOL +U_POF_APU_CMD_SEG_NUM = 10 +U_POF_APU_CMD_POOL_SIZE = U_APU_CMD_SIZE * U_POF_APU_CMD_SEG_NUM + +PoolAreas.init( + [ # layout 0 for Recorder + #[ name, area, align, pool-size, seg, fence] + ["REND_PCM_BUF_POOL", "AUDIO_WORK_AREA", U_STD_ALIGN, U_REND_PCM_BUF_POOL_SIZE, U_REND_PCM_BUF_SEG_NUM, True ], + ["OSC_APU_CMD_POOL", "AUDIO_WORK_AREA", U_STD_ALIGN, U_OSC_APU_CMD_POLL_SIZE, U_OSC_APU_CMD_SEG_NUM, True ], + ["PF0_PCM_BUF_POOL", "AUDIO_WORK_AREA", U_STD_ALIGN, U_POF_PCM_BUF_POOL_SIZE, U_POF_PCM_BUF_SEG_NUM, True ], + ["PF1_PCM_BUF_POOL", "AUDIO_WORK_AREA", U_STD_ALIGN, U_POF_PCM_BUF_POOL_SIZE, U_POF_PCM_BUF_SEG_NUM, True ], + ["PF0_APU_CMD_POOL", "AUDIO_WORK_AREA", U_STD_ALIGN, U_POF_APU_CMD_POOL_SIZE, U_POF_APU_CMD_SEG_NUM, True ], + ["PF1_APU_CMD_POOL", "AUDIO_WORK_AREA", U_STD_ALIGN, U_POF_APU_CMD_POOL_SIZE, U_POF_APU_CMD_SEG_NUM, True ], + None # end of each layout + ], # end of layout 0 + + None # end of definition +) + +# generate header files +generate_files() diff --git a/examples/audio_oscillator/config/msgq_layout.conf b/examples/audio_oscillator/config/msgq_layout.conf new file mode 100644 index 000000000..8758a5d62 --- /dev/null +++ b/examples/audio_oscillator/config/msgq_layout.conf @@ -0,0 +1,123 @@ +#!/usr/bin/env python3 +############################################################################## +# examples/audio_recorder/config/msgq_layout.conf +# +# Copyright 2020 Sony Semiconductor Solutions Corporation +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# 3. Neither the name of Sony Semiconductor Solutions Corporation nor +# the names of its contributors may be used to endorse or promote +# products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +############################################################################ + +import sys + +sys.path.append('../../../sdk/tools') + +import msgq_layout + +# User-defined constants must be the names of uppercase letters and +# numbers starting with "U_". +# When defined with a name beginning with "U_MSGQ_", +# it is also output as a define macro to msgq_id.h + +############################################################################## +# Message queue pool definition +# +# ID: The name of the message queue pool ID is specified by a +# character string beginning with "MSGQ_". +# The following are forbidden because they are reserved. +# "MSGQ_NULL", "MSGQ_TOP", "MSGQ_END" +# +# n_size: The number of bytes (8 or more and 512 or less) +# of each element of the normal priority queue. +# Specify fixed header length (8 bytes) + parameter length +# as a multiple of 4. +# In the case of a shared queue, it is rounded up to the value +# of a multiple of 64 in the tool. +# +# n_num: Number of elements of the normal priority queue +# (1 or more and 16384 or less). +# +# h_size: Number of bytes (0 or 8 to 512 inclusive) for each element +# of the high priority queue. +# Specify 0 when not in use. +# Specify fixed header length (8 bytes) + parameter length +# as a multiple of 4. +# In the case of a shared queue, it is rounded up to the value +# of a multiple of 64 in the tool. +# +# h_num: Number of elements in the high priority queue +# (0 or 1 to 16384 or less). +# Specify 0 when not in use. +# +msgq_layout.MsgQuePool = [ +# [ ID, n_size n_num h_size h_num + # For Audio + ["MSGQ_AUD_MGR", 88, 30, 0, 0], + ["MSGQ_AUD_APP", 64, 2, 0, 0], + ["MSGQ_AUD_DSP", 20, 5, 0, 0], + ["MSGQ_AUD_SYNTHESIZER", 88, 30, 0, 0], + ["MSGQ_AUD_OUTPUT_MIX", 48, 8, 0, 0], + ["MSGQ_AUD_RND_PLY0", 32, 16, 0, 0], + ["MSGQ_AUD_RND_PLY0_SYNC", 16, 8, 0, 0], + ["MSGQ_AUD_RND_PLY1", 32, 16, 0, 0], + ["MSGQ_AUD_RND_PLY1_SYNC", 16, 8, 0, 0], + ["MSGQ_AUD_PFDSP0", 20, 5, 0, 0], + ["MSGQ_AUD_PFDSP1", 20, 5, 0, 0], + None # end of user definition +] # end of MsgQuePool + +############################################################################# +# For debugging, specify the value that fills the area after message pop +# with 8 bits. +# When it is 0, no area filling is done. Specify 0 except when debugging. +# When specifying something other than 0, you need to change the +# following file. +# sdk/modules/memutils/message/include/MsgQue.h +# Change the value of the following description. +# #define MSG_FILL_VALUE_AFTER_POP 0x0 +# +msgq_layout.MsgFillValueAfterPop = 0x00 + +############################################################################# +# Whether checking whether the type of message parameter matches transmission +# and reception. +# Only in-CPU messages are targeted. +# When true is specified, a 4-byte area is added to each element +# of the queue whose element size is larger than 8, and the processing time +# also increases. +# Usually, specify false. +# If you specify something other than false, change the following file. +# sdk/modules/memutils/message/include/MsgPacket.h +# Change the value of the following description. +# #define MSG_PARAM_TYPE_MATCH_CHECK false +# +msgq_layout.MsgParamTypeMatchCheck = False + +# generate header files +msgq_layout.generate_files() diff --git a/examples/audio_oscillator/include/fixed_fence.h b/examples/audio_oscillator/include/fixed_fence.h new file mode 100644 index 000000000..e7fc8ccda --- /dev/null +++ b/examples/audio_oscillator/include/fixed_fence.h @@ -0,0 +1,49 @@ +/* This file is generated automatically. */ +/**************************************************************************** + * fixed_fence.h + * + * Copyright 2019 Sony Semiconductor Solutions Corporation + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name of Sony Semiconductor Solutions Corporation nor + * the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +#ifndef FIXED_FENCE_H_INCLUDED +#define FIXED_FENCE_H_INCLUDED + +#include "memutils/memory_manager/MemMgrTypes.h" + +namespace MemMgrLite { + +extern PoolAddr const FixedAreaFences[] = { +}; /* end of FixedAreaFences */ + +} /* end of namespace MemMgrLite */ + +#endif /* FIXED_FENCE_H_INCLUDED */ diff --git a/examples/audio_oscillator/include/mem_layout.h b/examples/audio_oscillator/include/mem_layout.h new file mode 100644 index 000000000..d1c20d9fc --- /dev/null +++ b/examples/audio_oscillator/include/mem_layout.h @@ -0,0 +1,172 @@ +/* This file is generated automatically. */ +/**************************************************************************** + * mem_layout.h + * + * Copyright 2019 Sony Semiconductor Solutions Corporation + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name of Sony Semiconductor Solutions Corporation nor + * the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +#ifndef MEM_LAYOUT_H_INCLUDED +#define MEM_LAYOUT_H_INCLUDED + +/* + * Memory devices + */ + +/* AUD_SRAM: type=RAM, use=0x0003f300, remainder=0x00000d00 */ + +#define AUD_SRAM_ADDR 0x000c0000 +#define AUD_SRAM_SIZE 0x00040000 + +/* + * Fixed areas + */ + +#define AUDIO_WORK_AREA_ALIGN 0x00000008 +#define AUDIO_WORK_AREA_ADDR 0x000c0000 +#define AUDIO_WORK_AREA_DRM 0x000c0000 /* _DRM is obsolete macro. to use _ADDR */ +#define AUDIO_WORK_AREA_SIZE 0x0003d000 + +#define MSG_QUE_AREA_ALIGN 0x00000008 +#define MSG_QUE_AREA_ADDR 0x000fd000 +#define MSG_QUE_AREA_DRM 0x000fd000 /* _DRM is obsolete macro. to use _ADDR */ +#define MSG_QUE_AREA_SIZE 0x00002000 + +#define MEMMGR_WORK_AREA_ALIGN 0x00000008 +#define MEMMGR_WORK_AREA_ADDR 0x000ff000 +#define MEMMGR_WORK_AREA_DRM 0x000ff000 /* _DRM is obsolete macro. to use _ADDR */ +#define MEMMGR_WORK_AREA_SIZE 0x00000200 + +#define MEMMGR_DATA_AREA_ALIGN 0x00000008 +#define MEMMGR_DATA_AREA_ADDR 0x000ff200 +#define MEMMGR_DATA_AREA_DRM 0x000ff200 /* _DRM is obsolete macro. to use _ADDR */ +#define MEMMGR_DATA_AREA_SIZE 0x00000100 + +/* + * Memory Manager max work area size + */ + +#define S0_MEMMGR_WORK_AREA_ADDR MEMMGR_WORK_AREA_ADDR +#define S0_MEMMGR_WORK_AREA_SIZE 0x000000a8 + +/* + * Section IDs + */ + +#define SECTION_NO0 0 + +/* + * Number of sections + */ + +#define NUM_MEM_SECTIONS 1 + +/* + * Pool IDs + */ + +const MemMgrLite::PoolId S0_NULL_POOL = { 0, SECTION_NO0}; /* 0 */ +const MemMgrLite::PoolId S0_REND_PCM_BUF_POOL = { 1, SECTION_NO0}; /* 1 */ +const MemMgrLite::PoolId S0_OSC_APU_CMD_POOL = { 2, SECTION_NO0}; /* 2 */ +const MemMgrLite::PoolId S0_PF0_PCM_BUF_POOL = { 3, SECTION_NO0}; /* 3 */ +const MemMgrLite::PoolId S0_PF1_PCM_BUF_POOL = { 4, SECTION_NO0}; /* 4 */ +const MemMgrLite::PoolId S0_PF0_APU_CMD_POOL = { 5, SECTION_NO0}; /* 5 */ +const MemMgrLite::PoolId S0_PF1_APU_CMD_POOL = { 6, SECTION_NO0}; /* 6 */ + +#define NUM_MEM_S0_LAYOUTS 1 +#define NUM_MEM_S0_POOLS 7 + +#define NUM_MEM_LAYOUTS 1 +#define NUM_MEM_POOLS 7 + +/* + * Pool areas + */ + +/* Section0 Layout0: */ + +#define MEMMGR_S0_L0_WORK_SIZE 0x000000a8 + +/* Skip 0x0004 bytes for alignment. */ + +#define S0_L0_REND_PCM_BUF_POOL_ALIGN 0x00000008 +#define S0_L0_REND_PCM_BUF_POOL_L_FENCE 0x000c0004 +#define S0_L0_REND_PCM_BUF_POOL_ADDR 0x000c0008 +#define S0_L0_REND_PCM_BUF_POOL_SIZE 0x00005000 +#define S0_L0_REND_PCM_BUF_POOL_U_FENCE 0x000c5008 +#define S0_L0_REND_PCM_BUF_POOL_NUM_SEG 0x00000005 +#define S0_L0_REND_PCM_BUF_POOL_SEG_SIZE 0x00001000 + +#define S0_L0_OSC_APU_CMD_POOL_ALIGN 0x00000008 +#define S0_L0_OSC_APU_CMD_POOL_L_FENCE 0x000c500c +#define S0_L0_OSC_APU_CMD_POOL_ADDR 0x000c5010 +#define S0_L0_OSC_APU_CMD_POOL_SIZE 0x000001cc +#define S0_L0_OSC_APU_CMD_POOL_U_FENCE 0x000c51dc +#define S0_L0_OSC_APU_CMD_POOL_NUM_SEG 0x00000005 +#define S0_L0_OSC_APU_CMD_POOL_SEG_SIZE 0x0000005c + +/* Skip 0x0004 bytes for alignment. */ + +#define S0_L0_PF0_PCM_BUF_POOL_ALIGN 0x00000008 +#define S0_L0_PF0_PCM_BUF_POOL_L_FENCE 0x000c51e4 +#define S0_L0_PF0_PCM_BUF_POOL_ADDR 0x000c51e8 +#define S0_L0_PF0_PCM_BUF_POOL_SIZE 0x00001000 +#define S0_L0_PF0_PCM_BUF_POOL_U_FENCE 0x000c61e8 +#define S0_L0_PF0_PCM_BUF_POOL_NUM_SEG 0x00000001 +#define S0_L0_PF0_PCM_BUF_POOL_SEG_SIZE 0x00001000 + +#define S0_L0_PF1_PCM_BUF_POOL_ALIGN 0x00000008 +#define S0_L0_PF1_PCM_BUF_POOL_L_FENCE 0x000c61ec +#define S0_L0_PF1_PCM_BUF_POOL_ADDR 0x000c61f0 +#define S0_L0_PF1_PCM_BUF_POOL_SIZE 0x00001000 +#define S0_L0_PF1_PCM_BUF_POOL_U_FENCE 0x000c71f0 +#define S0_L0_PF1_PCM_BUF_POOL_NUM_SEG 0x00000001 +#define S0_L0_PF1_PCM_BUF_POOL_SEG_SIZE 0x00001000 + +#define S0_L0_PF0_APU_CMD_POOL_ALIGN 0x00000008 +#define S0_L0_PF0_APU_CMD_POOL_L_FENCE 0x000c71f4 +#define S0_L0_PF0_APU_CMD_POOL_ADDR 0x000c71f8 +#define S0_L0_PF0_APU_CMD_POOL_SIZE 0x00000398 +#define S0_L0_PF0_APU_CMD_POOL_U_FENCE 0x000c7590 +#define S0_L0_PF0_APU_CMD_POOL_NUM_SEG 0x0000000a +#define S0_L0_PF0_APU_CMD_POOL_SEG_SIZE 0x0000005c + +#define S0_L0_PF1_APU_CMD_POOL_ALIGN 0x00000008 +#define S0_L0_PF1_APU_CMD_POOL_L_FENCE 0x000c7594 +#define S0_L0_PF1_APU_CMD_POOL_ADDR 0x000c7598 +#define S0_L0_PF1_APU_CMD_POOL_SIZE 0x00000398 +#define S0_L0_PF1_APU_CMD_POOL_U_FENCE 0x000c7930 +#define S0_L0_PF1_APU_CMD_POOL_NUM_SEG 0x0000000a +#define S0_L0_PF1_APU_CMD_POOL_SEG_SIZE 0x0000005c + +/* Remainder AUDIO_WORK_AREA=0x000356cc */ + +#endif /* MEM_LAYOUT_H_INCLUDED */ diff --git a/examples/audio_oscillator/include/memory_layout.h b/examples/audio_oscillator/include/memory_layout.h new file mode 100644 index 000000000..5a161538e --- /dev/null +++ b/examples/audio_oscillator/include/memory_layout.h @@ -0,0 +1,40 @@ +/**************************************************************************** + * audio_recorder/include/memory_layout.h + * + * Copyright 2020 Sony Semiconductor Solutions Corporation + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name of Sony Semiconductor Solutions Corporation nor + * the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ +#ifndef __AUDIO_LAYOUT_H_INCLUDED__ +#define __AUDIO_LAYOUT_H_INCLUDED__ + +#define MEM_LAYOUT_OSCILLATOR (0) + +#endif /* __AUDIO_LAYOUT_H_INCLUDED__ */ diff --git a/examples/audio_oscillator/include/msgq_id.h b/examples/audio_oscillator/include/msgq_id.h new file mode 100644 index 000000000..835988a9c --- /dev/null +++ b/examples/audio_oscillator/include/msgq_id.h @@ -0,0 +1,160 @@ +/* This file is generated automatically. */ +/**************************************************************************** + * msgq_id.h + * + * Copyright 2019 Sony Semiconductor Solutions Corporation + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name of Sony Semiconductor Solutions Corporation nor + * the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +#ifndef MSGQ_ID_H_INCLUDED +#define MSGQ_ID_H_INCLUDED + +/* Message area size: 8188 bytes */ + +#define MSGQ_TOP_DRM 0xfd000 +#define MSGQ_END_DRM 0xfeffc + +/* Message area fill value after message poped */ + +#define MSG_FILL_VALUE_AFTER_POP 0x0 + +/* Message parameter type match check */ + +#define MSG_PARAM_TYPE_MATCH_CHECK false + +/* Message queue pool IDs */ + +#define MSGQ_NULL 0 +#define MSGQ_AUD_MGR 1 +#define MSGQ_AUD_APP 2 +#define MSGQ_AUD_DSP 3 +#define MSGQ_AUD_SYNTHESIZER 4 +#define MSGQ_AUD_OUTPUT_MIX 5 +#define MSGQ_AUD_RND_PLY0 6 +#define MSGQ_AUD_RND_PLY0_SYNC 7 +#define MSGQ_AUD_RND_PLY1 8 +#define MSGQ_AUD_RND_PLY1_SYNC 9 +#define MSGQ_AUD_PFDSP0 10 +#define MSGQ_AUD_PFDSP1 11 +#define NUM_MSGQ_POOLS 12 + +/* User defined constants */ + +/************************************************************************/ +#define MSGQ_AUD_MGR_QUE_BLOCK_DRM 0xfd044 +#define MSGQ_AUD_MGR_N_QUE_DRM 0xfd330 +#define MSGQ_AUD_MGR_N_SIZE 88 +#define MSGQ_AUD_MGR_N_NUM 30 +#define MSGQ_AUD_MGR_H_QUE_DRM 0xffffffff +#define MSGQ_AUD_MGR_H_SIZE 0 +#define MSGQ_AUD_MGR_H_NUM 0 +/************************************************************************/ +#define MSGQ_AUD_APP_QUE_BLOCK_DRM 0xfd088 +#define MSGQ_AUD_APP_N_QUE_DRM 0xfdd80 +#define MSGQ_AUD_APP_N_SIZE 64 +#define MSGQ_AUD_APP_N_NUM 2 +#define MSGQ_AUD_APP_H_QUE_DRM 0xffffffff +#define MSGQ_AUD_APP_H_SIZE 0 +#define MSGQ_AUD_APP_H_NUM 0 +/************************************************************************/ +#define MSGQ_AUD_DSP_QUE_BLOCK_DRM 0xfd0cc +#define MSGQ_AUD_DSP_N_QUE_DRM 0xfde00 +#define MSGQ_AUD_DSP_N_SIZE 20 +#define MSGQ_AUD_DSP_N_NUM 5 +#define MSGQ_AUD_DSP_H_QUE_DRM 0xffffffff +#define MSGQ_AUD_DSP_H_SIZE 0 +#define MSGQ_AUD_DSP_H_NUM 0 +/************************************************************************/ +#define MSGQ_AUD_SYNTHESIZER_QUE_BLOCK_DRM 0xfd110 +#define MSGQ_AUD_SYNTHESIZER_N_QUE_DRM 0xfde64 +#define MSGQ_AUD_SYNTHESIZER_N_SIZE 88 +#define MSGQ_AUD_SYNTHESIZER_N_NUM 30 +#define MSGQ_AUD_SYNTHESIZER_H_QUE_DRM 0xffffffff +#define MSGQ_AUD_SYNTHESIZER_H_SIZE 0 +#define MSGQ_AUD_SYNTHESIZER_H_NUM 0 +/************************************************************************/ +#define MSGQ_AUD_OUTPUT_MIX_QUE_BLOCK_DRM 0xfd154 +#define MSGQ_AUD_OUTPUT_MIX_N_QUE_DRM 0xfe8b4 +#define MSGQ_AUD_OUTPUT_MIX_N_SIZE 48 +#define MSGQ_AUD_OUTPUT_MIX_N_NUM 8 +#define MSGQ_AUD_OUTPUT_MIX_H_QUE_DRM 0xffffffff +#define MSGQ_AUD_OUTPUT_MIX_H_SIZE 0 +#define MSGQ_AUD_OUTPUT_MIX_H_NUM 0 +/************************************************************************/ +#define MSGQ_AUD_RND_PLY0_QUE_BLOCK_DRM 0xfd198 +#define MSGQ_AUD_RND_PLY0_N_QUE_DRM 0xfea34 +#define MSGQ_AUD_RND_PLY0_N_SIZE 32 +#define MSGQ_AUD_RND_PLY0_N_NUM 16 +#define MSGQ_AUD_RND_PLY0_H_QUE_DRM 0xffffffff +#define MSGQ_AUD_RND_PLY0_H_SIZE 0 +#define MSGQ_AUD_RND_PLY0_H_NUM 0 +/************************************************************************/ +#define MSGQ_AUD_RND_PLY0_SYNC_QUE_BLOCK_DRM 0xfd1dc +#define MSGQ_AUD_RND_PLY0_SYNC_N_QUE_DRM 0xfec34 +#define MSGQ_AUD_RND_PLY0_SYNC_N_SIZE 16 +#define MSGQ_AUD_RND_PLY0_SYNC_N_NUM 8 +#define MSGQ_AUD_RND_PLY0_SYNC_H_QUE_DRM 0xffffffff +#define MSGQ_AUD_RND_PLY0_SYNC_H_SIZE 0 +#define MSGQ_AUD_RND_PLY0_SYNC_H_NUM 0 +/************************************************************************/ +#define MSGQ_AUD_RND_PLY1_QUE_BLOCK_DRM 0xfd220 +#define MSGQ_AUD_RND_PLY1_N_QUE_DRM 0xfecb4 +#define MSGQ_AUD_RND_PLY1_N_SIZE 32 +#define MSGQ_AUD_RND_PLY1_N_NUM 16 +#define MSGQ_AUD_RND_PLY1_H_QUE_DRM 0xffffffff +#define MSGQ_AUD_RND_PLY1_H_SIZE 0 +#define MSGQ_AUD_RND_PLY1_H_NUM 0 +/************************************************************************/ +#define MSGQ_AUD_RND_PLY1_SYNC_QUE_BLOCK_DRM 0xfd264 +#define MSGQ_AUD_RND_PLY1_SYNC_N_QUE_DRM 0xfeeb4 +#define MSGQ_AUD_RND_PLY1_SYNC_N_SIZE 16 +#define MSGQ_AUD_RND_PLY1_SYNC_N_NUM 8 +#define MSGQ_AUD_RND_PLY1_SYNC_H_QUE_DRM 0xffffffff +#define MSGQ_AUD_RND_PLY1_SYNC_H_SIZE 0 +#define MSGQ_AUD_RND_PLY1_SYNC_H_NUM 0 +/************************************************************************/ +#define MSGQ_AUD_PFDSP0_QUE_BLOCK_DRM 0xfd2a8 +#define MSGQ_AUD_PFDSP0_N_QUE_DRM 0xfef34 +#define MSGQ_AUD_PFDSP0_N_SIZE 20 +#define MSGQ_AUD_PFDSP0_N_NUM 5 +#define MSGQ_AUD_PFDSP0_H_QUE_DRM 0xffffffff +#define MSGQ_AUD_PFDSP0_H_SIZE 0 +#define MSGQ_AUD_PFDSP0_H_NUM 0 +/************************************************************************/ +#define MSGQ_AUD_PFDSP1_QUE_BLOCK_DRM 0xfd2ec +#define MSGQ_AUD_PFDSP1_N_QUE_DRM 0xfef98 +#define MSGQ_AUD_PFDSP1_N_SIZE 20 +#define MSGQ_AUD_PFDSP1_N_NUM 5 +#define MSGQ_AUD_PFDSP1_H_QUE_DRM 0xffffffff +#define MSGQ_AUD_PFDSP1_H_SIZE 0 +#define MSGQ_AUD_PFDSP1_H_NUM 0 + +#endif /* MSGQ_ID_H_INCLUDED */ diff --git a/examples/audio_oscillator/include/msgq_pool.h b/examples/audio_oscillator/include/msgq_pool.h new file mode 100644 index 000000000..9e78197fa --- /dev/null +++ b/examples/audio_oscillator/include/msgq_pool.h @@ -0,0 +1,60 @@ +/* This file is generated automatically. */ +/**************************************************************************** + * msgq_pool.h + * + * Copyright 2019 Sony Semiconductor Solutions Corporation + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name of Sony Semiconductor Solutions Corporation nor + * the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +#ifndef MSGQ_POOL_H_INCLUDED +#define MSGQ_POOL_H_INCLUDED + +#include "msgq_id.h" + +extern const MsgQueDef MsgqPoolDefs[NUM_MSGQ_POOLS] = +{ + /* n_drm, n_size, n_num, h_drm, h_size, h_num */ + + { 0x00000000, 0, 0, 0x00000000, 0, 0, 0 }, /* MSGQ_NULL */ + { 0xfd330, 88, 30, 0xffffffff, 0, 0 }, /* MSGQ_AUD_MGR */ + { 0xfdd80, 64, 2, 0xffffffff, 0, 0 }, /* MSGQ_AUD_APP */ + { 0xfde00, 20, 5, 0xffffffff, 0, 0 }, /* MSGQ_AUD_DSP */ + { 0xfde64, 88, 30, 0xffffffff, 0, 0 }, /* MSGQ_AUD_SYNTHESIZER */ + { 0xfe8b4, 48, 8, 0xffffffff, 0, 0 }, /* MSGQ_AUD_OUTPUT_MIX */ + { 0xfea34, 32, 16, 0xffffffff, 0, 0 }, /* MSGQ_AUD_RND_PLY0 */ + { 0xfec34, 16, 8, 0xffffffff, 0, 0 }, /* MSGQ_AUD_RND_PLY0_SYNC */ + { 0xfecb4, 32, 16, 0xffffffff, 0, 0 }, /* MSGQ_AUD_RND_PLY1 */ + { 0xfeeb4, 16, 8, 0xffffffff, 0, 0 }, /* MSGQ_AUD_RND_PLY1_SYNC */ + { 0xfef34, 20, 5, 0xffffffff, 0, 0 }, /* MSGQ_AUD_PFDSP0 */ + { 0xfef98, 20, 5, 0xffffffff, 0, 0 }, /* MSGQ_AUD_PFDSP1 */ +}; + +#endif /* MSGQ_POOL_H_INCLUDED */ diff --git a/examples/audio_oscillator/include/pool_layout.h b/examples/audio_oscillator/include/pool_layout.h new file mode 100644 index 000000000..ad1514db6 --- /dev/null +++ b/examples/audio_oscillator/include/pool_layout.h @@ -0,0 +1,71 @@ +/* This file is generated automatically. */ +/**************************************************************************** + * pool_layout.h + * + * Copyright 2019 Sony Semiconductor Solutions Corporation + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name of Sony Semiconductor Solutions Corporation nor + * the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +#ifndef POOL_LAYOUT_H_INCLUDED +#define POOL_LAYOUT_H_INCLUDED + +#include "memutils/memory_manager/MemMgrTypes.h" + +namespace MemMgrLite { + +MemPool* static_pools_block[NUM_MEM_SECTIONS][NUM_MEM_POOLS]; +MemPool** static_pools[NUM_MEM_SECTIONS] = { + static_pools_block[0], +}; +uint8_t layout_no[NUM_MEM_SECTIONS] = { + BadLayoutNo, +}; +uint8_t pool_num[NUM_MEM_SECTIONS] = { + NUM_MEM_S0_POOLS, +}; +extern const PoolSectionAttr MemoryPoolLayouts[NUM_MEM_SECTIONS][NUM_MEM_LAYOUTS][7] = { + { /* Section:0 */ + {/* Layout:0 */ + /* pool_ID type seg fence addr size */ + { S0_REND_PCM_BUF_POOL , BasicType , 5, true, 0x000c0008, 0x00005000 }, /* AUDIO_WORK_AREA */ + { S0_OSC_APU_CMD_POOL , BasicType , 5, true, 0x000c5010, 0x000001cc }, /* AUDIO_WORK_AREA */ + { S0_PF0_PCM_BUF_POOL , BasicType , 1, true, 0x000c51e8, 0x00001000 }, /* AUDIO_WORK_AREA */ + { S0_PF1_PCM_BUF_POOL , BasicType , 1, true, 0x000c61f0, 0x00001000 }, /* AUDIO_WORK_AREA */ + { S0_PF0_APU_CMD_POOL , BasicType , 10, true, 0x000c71f8, 0x00000398 }, /* AUDIO_WORK_AREA */ + { S0_PF1_APU_CMD_POOL , BasicType , 10, true, 0x000c7598, 0x00000398 }, /* AUDIO_WORK_AREA */ + { S0_NULL_POOL, 0, 0, false, 0, 0 }, + }, + }, +}; /* end of MemoryPoolLayouts */ + +} /* end of namespace MemMgrLite */ + +#endif /* POOL_LAYOUT_H_INCLUDED */ diff --git a/examples/audio_oscillator/worker_oscillator/Makefile b/examples/audio_oscillator/worker_oscillator/Makefile new file mode 100644 index 000000000..71d228d52 --- /dev/null +++ b/examples/audio_oscillator/worker_oscillator/Makefile @@ -0,0 +1,118 @@ +############################################################################ +# audio_oscillator/worker_oscillator/Makefile +# +# Copyright 2020 Sony Semiconductor Solutions Corporation +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# 3. Neither the name of Sony Semiconductor Solutions Corporation nor +# the names of its contributors may be used to endorse or promote +# products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +############################################################################ + +-include $(TOPDIR)/.config +-include $(TOPDIR)/Make.defs +include $(SDKDIR)/Make.defs + +ifeq ($(WINTOOL),y) +LIB_DIR = "${shell cygpath -w lib}" +else +LIB_DIR = "lib" +endif + +VPATH = userproc/src + +LDLIBPATH += -L $(LIB_DIR) +LDLIBPATH += -L $(TOPDIR)/staging + +LDLIBS += -lasmpw + +# Setup to build and linking CMSIS DSP library + +CMSIS_DSP = libarm_cortexM4lf_math$(LIBEXT) +CMSIS_DSP_DIR = $(EXTERNAL_DIR)$(DELIM)cmsis$(DELIM)dsp +LDLIBPATH += -L $(CMSIS_DSP_DIR) +LDLIBS += -larm_cortexM4lf_math + +WORKER_ELF = OSCPROC + +CXXSRCS = main.cpp oscillator.cpp + +CXXELFFLAGS += -Os +ifeq ($(WINTOOL),y) +CXXELFFLAGS += -I"$(shell cygpath -w userproc$(DELIM)include)" +CXXELFFLAGS += -I"$(shell cygpath -w $(APPDIR))" +else +CXXELFFLAGS += -Iuserproc/include +CXXELFFLAGS += -I$(APPDIR) +CXXELFFLAGS += -I$(SDKDIR)/modules/audio/include +endif + +CXXFLAGS += -D_POSIX + +CXXOBJS = $(CXXSRCS:.cpp=$(OBJEXT)) + +# Build + +all: lib $(WORKER_ELF) + +# Build ASMP worker library + +libasmpw.a: + $(Q) $(MAKE) -C lib TOPDIR="$(TOPDIR)" SDKDIR="$(SDKDIR)" APPDIR="$(APPDIR)" CROSSDEV=$(CROSSDEV) + +lib: libasmpw.a $(CMSIS_DSP_DIR)/$(CMSIS_DSP) + +$(CMSIS_DSP_DIR)/$(CMSIS_DSP): + $(Q) $(MAKE) -C $(CMSIS_DSP_DIR) TOPDIR="$(TOPDIR)" SDKDIR="$(SDKDIR)" APPDIR="$(APPDIR)" CROSSDEV=$(CROSSDEV) + +# Complile + +$(CXXOBJS): %$(OBJEXT):%.cpp + @echo "CXX: $<" + $(Q) $(CXX) -c $(CXXELFFLAGS) $< -o $@ + +# Build workers + +$(WORKER_ELF): $(CXXOBJS) + @echo "LD: $@" + $(Q) $(LD) $(LDRAWELFFLAGS) -e main --gc-sections $(LDLIBPATH) -o $@ \ + --start-group $(ARCHCRT0OBJ) $^ $(LDLIBS) $(LIBGCC) --end-group + $(Q) $(STRIP) -d $(WORKER_ELF) + +.depend: + $(Q) $(MAKE) -C lib TOPDIR="$(TOPDIR)" SDKDIR="$(SDKDIR)" APPDIR="$(APPDIR)" CROSSDEV=$(CROSSDEV) depend + @touch $@ + +depend: .depend + +lib_clean: + $(Q) $(MAKE) -C lib TOPDIR="$(TOPDIR)" SDKDIR="$(SDKDIR)" APPDIR="$(APPDIR)" CROSSDEV=$(CROSSDEV) clean + +clean: lib_clean + $(call DELFILE, $(WORKER_ELF)) + $(call CLEAN) + diff --git a/examples/audio_oscillator/worker_oscillator/README.txt b/examples/audio_oscillator/worker_oscillator/README.txt new file mode 100644 index 000000000..b910a1b4a --- /dev/null +++ b/examples/audio_oscillator/worker_oscillator/README.txt @@ -0,0 +1,59 @@ + +About postfilter worker +=========================== + +This directory is a build environment for postfilter worker. +You are able to build postfilter worker and implement as you like. +For example, low pass filter, band pass filter, and any more. + +--------------------------- +Directorys and files + +-[lib] + + Including Makefile to build ASMP library which is used for inter CPU communication. + Source codes are place at SDK directory, and you don't need to change them. + +-[postfilter] + + Files for postfilter processing is here. + Internaly, separete some directories. + + -[command] + + This directory includes header file which defines command formet of Postfilter worker. + This command format is not need to change. User defined format could be written other file. (explain after.) + + -[framework] + + There are source codes for framework of Postfilter worker. + Basically, you should not edit files. But you can edit too. + If you edit these files, the operation cannot be guaranteed. + + -[userproc] + + Under this directory, all files are able edit by user freely. + + -include/userproc_packet_defs.h + + Command format defition. + + -include/userproc.h + + Header file of your source code. + + -src/userproc.cxx + + Your source code. you can edit and write any process here. + + + Postfilter source codes are there. Only templete is written. You are able to implement + as you like. + +--------------------------- +Build + +Postfilter worker build will be automatically run when build this(audio_player_pf) example. +When build complete "POSTFILTER" elf binary file will be created "postfilter" directory. + + diff --git a/examples/audio_oscillator/worker_oscillator/lib/Makefile b/examples/audio_oscillator/worker_oscillator/lib/Makefile new file mode 100644 index 000000000..9461050a5 --- /dev/null +++ b/examples/audio_oscillator/worker_oscillator/lib/Makefile @@ -0,0 +1,59 @@ +############################################################################ +# audio_oscillator/worker_oscillator/lib/Makefile +# +# Copyright 2020 Sony Semiconductor Solutions Corporation +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# 3. Neither the name of Sony Semiconductor Solutions Corporation nor +# the names of its contributors may be used to endorse or promote +# products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +############################################################################ + +-include $(TOPDIR)/Make.defs +-include $(SDKDIR)/Make.defs + +BIN = libasmpw$(LIBEXT) +WORKER_DIR = $(SDKDIR)$(DELIM)modules$(DELIM)asmp$(DELIM)worker +LIB = $(WORKER_DIR)$(DELIM)libasmpw$(LIBEXT) + +all: $(BIN) +.PHONY: depend clean distclean + +depend: + $(Q) $(MAKE) -C $(WORKER_DIR) TOPDIR="$(TOPDIR)" SDKDIR="$(SDKDIR)" depend + +$(LIB): depend + $(Q) $(MAKE) -C $(WORKER_DIR) TOPDIR="$(TOPDIR)" SDKDIR="$(SDKDIR)" $(BIN) + +$(BIN): $(LIB) + $(Q) install $< $@ + +clean: + $(call DELFILE, $(BIN)) + $(call CLEAN) + +distclean: clean diff --git a/examples/audio_oscillator/worker_oscillator/main.cpp b/examples/audio_oscillator/worker_oscillator/main.cpp new file mode 100644 index 000000000..e098873af --- /dev/null +++ b/examples/audio_oscillator/worker_oscillator/main.cpp @@ -0,0 +1,152 @@ +/**************************************************************************** + * audio_oscillator/worker_oscillator/main.cpp + * + * Copyright 2020 Sony Semiconductor Solutions Corporation + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name of Sony Semiconductor Solutions Corporation nor + * the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +#include + +#include +#include + +extern "C" +{ +#include +#include +#include +#include +#include "apus/dsp_audio_version.h" +} + +#include "oscillator.h" + +#define KEY_MQ 2 +#define KEY_SHM 1 +#define COMMAND_DATATYPE_ADDRESS 0 +#define COMMAND_DATATYPE_VALUE 1 + +#define MSGID_PROCMODE_SHIFT 4 +#define MSGID_DATATYPE_MASK 0x01 + +#define CRE_MSGID(mode, type) ((mode << MSGID_PROCMODE_SHIFT) | (type & MSGID_DATATYPE_MASK)) + +static mpmq_t s_mq; +static Oscillator s_oscillator; + +extern "C" { + +/*--------------------------------------------------------------------*/ +static void reply_to_spu(void *addr) +{ + uint8_t msg_id = 0; + uint32_t msg_data = 0; + + /* Create message ID */ + + msg_id = CRE_MSGID(Wien2::Apu::OscMode, COMMAND_DATATYPE_ADDRESS); + + /* Message data is address of APU command */ + + msg_data = reinterpret_cast(addr); + + /* Send */ + + int ret = mpmq_send(&s_mq, msg_id, msg_data); + if (ret != 0) + { + /* error */ + } +} + +}; + +/*--------------------------------------------------------------------*/ +int main() +{ + int ret = 0; + + /* Initialize MP message queue, + * On the worker side, 3rd argument is ignored. + */ + + ret = mpmq_init(&s_mq, KEY_MQ, 0); + if (ret != 0) + { + /* error */ + } + + /* Reply "boot complete" + * MsgID is taken as part of message parameters. + */ + + uint8_t msg_id = 0; + + msg_id = CRE_MSGID(Wien2::Apu::CommonMode, COMMAND_DATATYPE_VALUE); + + ret = mpmq_send(&s_mq, msg_id, DSP_OSC_VERSION); + if (ret != 0) + { + /* error */ + } + + /* Excution loop */ + + while (true) + { + /* Receive message from SPU + * Process is blocked until receive a message + * (mpmq_receive() is polling message internally) + */ + + int command = 0; + uint32_t msgdata = 0; + + command = mpmq_receive(&s_mq, &msgdata); + + uint8_t type = command & MSGID_DATATYPE_MASK; + + /* Parse and execute message */ + + if (type == COMMAND_DATATYPE_ADDRESS) + { + s_oscillator.parse(reinterpret_cast(msgdata)); + } + else + { + /* write error process here. */ + } + + /* Send Reply */ + + reply_to_spu(reinterpret_cast(msgdata)); + } +} diff --git a/examples/audio_oscillator/worker_oscillator/userproc/include/oscillator.h b/examples/audio_oscillator/worker_oscillator/userproc/include/oscillator.h new file mode 100644 index 000000000..bc23e4b28 --- /dev/null +++ b/examples/audio_oscillator/worker_oscillator/userproc/include/oscillator.h @@ -0,0 +1,180 @@ +/**************************************************************************** + * audio_oscillator/worker_oscillator/userproc/include/oscillator.h + * + * Copyright 2020 Sony Semiconductor Solutions Corporation + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name of Sony Semiconductor Solutions Corporation nor + * the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +#ifndef __OSCILLATOR_H__ +#define __OSCILLATOR_H__ + +#include +#include + +#include +#include "../../arm-none-eabi/include/math.h" +#include "arm_math.h" + +#define MAX_CHANNEL_NUMBER 8 + +/*--------------------------------------------------------------------*/ +/* Wave Generator */ +/*--------------------------------------------------------------------*/ +class GeneratorBase +{ +public: + void init(uint8_t, uint32_t, uint8_t); + void set(uint32_t); + +protected: + q15_t* update_sample(q15_t* ptr, q15_t val); + + uint32_t m_sampling_rate; /**< Sampling rate of data */ + q15_t m_theta; + q15_t m_omega; + uint8_t m_channels; +}; + +class SinGenerator : public GeneratorBase +{ +public: + void exec(q15_t*, uint16_t); +}; + +class RectGenerator : public GeneratorBase +{ +public: + void exec(q15_t*, uint16_t); + +}; + +class SawGenerator : public GeneratorBase +{ +public: + void exec(q15_t*, uint16_t); +}; + +/*--------------------------------------------------------------------*/ +/* Envelope Generator */ +/*--------------------------------------------------------------------*/ +class EnvelopeGenerator +{ +public: + void init(uint8_t, /* bit_length */ + uint8_t /* channel_num */); + + void set(uint16_t, /* Attack :ms */ + uint16_t, /* Decay :ms */ + uint16_t, /* Sustain:% */ + uint16_t /* Release:ms */ + ); + + void exec(q15_t*, uint16_t); + + void start(void); + + void stop(void); + +private: + + enum EgState + { + Attack_state = 0, + Decay_state, + Sustain_state, + Release_state, + Ready_state, + EgStateNum + }; + + float m_cur_coef; + EgState m_cur_state; + + float m_a_delta; + float m_d_delta; + float m_r_delta; + q15_t m_s_level; + + uint8_t m_channels; + uint8_t m_bits; + + uint16_t attack(q15_t**, uint16_t); + uint16_t decay(q15_t**, uint16_t); + uint16_t sustain(q15_t**, uint16_t); + uint16_t release(q15_t**, uint16_t); + uint16_t ready(q15_t**, uint16_t); +}; + +/*--------------------------------------------------------------------*/ +/* Oscillator */ +/*--------------------------------------------------------------------*/ +class Oscillator +{ +public: + + Oscillator() + : m_state(Booted) + {} + + void parse(Wien2::Apu::Wien2ApuCmd *cmd); + + void illegal(Wien2::Apu::Wien2ApuCmd *cmd); + void init(Wien2::Apu::Wien2ApuCmd *cmd); + void exec(Wien2::Apu::Wien2ApuCmd *cmd); + void flush(Wien2::Apu::Wien2ApuCmd *cmd); + void set(Wien2::Apu::Wien2ApuCmd *cmd); + +private: + Wien2::WaveMode m_type; + uint8_t m_channel_num; + uint8_t m_bit_length; + GeneratorBase* m_wave[MAX_CHANNEL_NUMBER]; + SinGenerator m_sin[MAX_CHANNEL_NUMBER]; + RectGenerator m_rect[MAX_CHANNEL_NUMBER]; + SawGenerator m_saw[MAX_CHANNEL_NUMBER]; + EnvelopeGenerator m_envlop[MAX_CHANNEL_NUMBER]; + + enum OscState + { + Booted = 0, + Ready, + Active, + + OscStateNum + }; + + OscState m_state; + + typedef void (Oscillator::*CtrlProc)(Wien2::Apu::Wien2ApuCmd *cmd); + static CtrlProc CtrlFuncTbl[Wien2::Apu::ApuEventTypeNum][OscStateNum]; +}; + +#endif /* __OSCILLATOR_H__ */ diff --git a/examples/audio_oscillator/worker_oscillator/userproc/src/oscillator.cpp b/examples/audio_oscillator/worker_oscillator/userproc/src/oscillator.cpp new file mode 100644 index 000000000..834945212 --- /dev/null +++ b/examples/audio_oscillator/worker_oscillator/userproc/src/oscillator.cpp @@ -0,0 +1,452 @@ +/**************************************************************************** + * audio_oscillator/worker_oscillator/userproc/src/oscillator.cpp + * + * Copyright 2020 Sony Semiconductor Solutions Corporation + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name of Sony Semiconductor Solutions Corporation nor + * the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +#include "oscillator.h" +#include