Commit graph

47 commits

Author SHA1 Message Date
Reto Schneider
0b4b3ae4dd cmake, samples, tests: Use semi-accurate project names
When using an IDE (e.g. Eclipse, Qt Creator), the project name gets
displayed. This greatly simplifies the navigation between projects when
having many of them open at the same time. Naming multiple projects
"NONE" defeats this functionality.

This patch tries to use sensible project names while not duplicating
too much of what is already represented in the path. This is done by
using the name of the directory the relevant CMakeLists.txt file is
stored in. To ensure unique project names, small, manual adjustments
have been done.

See also 7eabab2f5d ("samples, tests: Use semi-accurate project names")

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2020-06-09 08:18:29 -04:00
Kumar Gala
a1b77fd589 zephyr: replace zephyr integer types with C99 types
git grep -l 'u\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/u\(8\|16\|32\|64\)_t/uint\1_t/g"
	git grep -l 's\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/s\(8\|16\|32\|64\)_t/int\1_t/g"

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-08 08:23:57 -05:00
Marc Herbert
2cd51a33ce samples: make find_package(Zephyr...) REQUIRED
This provides a better error message when building with CMake and
forgetting ZEPHYR_BASE or not registering Zephyr in the CMake package
registry. See parent commit for more details (split from parent for
better readability).

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-05-29 10:47:25 +02:00
Joakim Andersson
44bcf98962 samples: boards: intel_s1000_crb: Rename to README.rst
Rename the sample .rst files to README.rst to be consistent with other
samples.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-05-15 17:18:56 +02:00
Carles Cufi
9ba20dd48e drivers: audio: Port to the new timeout API
Port the I2S and DMIC drivers to the new timeout API so that they do
not need to enable legacy timeouts.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-05-07 11:01:55 +02:00
Peter Bigot
45f126f871 coccinelle: re-run timeout conversion semantic patch
This fixes a variety of K_THREAD_DEFINE issues that were missed.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-04-15 08:28:57 -05:00
Kumar Gala
f8f044249c samples: boards: Convert to new DT_INST macros
Convert older DT_INST_ macro use the new include/devicetree.h
DT_INST macro APIs.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-31 07:14:21 -05:00
Torsten Rasmussen
407b49b35c cmake: use find_package to locate Zephyr
Using find_package to locate Zephyr.

Old behavior was to use $ENV{ZEPHYR_BASE} for inclusion of boiler plate
code.

Whenever an automatic run of CMake happend by the build system / IDE
then it was required that ZEPHYR_BASE was defined.
Using ZEPHYR_BASE only to locate the Zephyr package allows CMake to
cache the base variable and thus allowing subsequent invocation even
if ZEPHYR_BASE is not set in the environment.

It also removes the risk of strange build results if a user switchs
between different Zephyr based project folders and forgetting to reset
ZEPHYR_BASE before running ninja / make.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-03-27 16:23:46 +01:00
Daniel Leung
e78704251b samples: intel_s1000_crb/audio: fix return for non-void function
The usb_transport_init() does not return a value when it fails to
initialize the USB device. So add a return value there.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-01-07 17:09:38 +01:00
Emil Obalski
2128750138 usb: api: Add user device status callback
By this commit user gets possibility to register USB
device satutus callback. This callback represents device state
and is added so user could know what happend to USB device.

Callback is registered by providing it to usb_enable()
USB api is extended by this callback handler.

Samples using using USB are by default provide no callback
and the usb_enable() is called with NULL parameter.

Status callback registered by hid class is deleted as now
USB device has global callback for all classes within device.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2019-12-19 13:08:55 +01:00
Emil Obalski
d65027d8c0 usb: samples: Application calling usb_enable by itself
User app is reponsible for issuing usb_enable and
making USB hardware operative.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2019-12-19 13:08:55 +01:00
Kumar Gala
24ae1b1aa7 include: Fix use of <misc/FOO.h> -> <sys/FOO.h>
Fix #include <misc/FOO.h> as misc/FOO.h has been deprecated and
should be #include <sys/FOO.h>.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-12-10 08:39:37 -05:00
Daniel Leung
7cb9286895 samples: intel_s1000_crb: set CONFIG_NEWLIB_LIBC for math.h
Including math.h requires Newlib so enable it in project
configuration file.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-11-13 06:26:10 -06:00
Daniel Leung
eca4d69f02 samples: intel_s1000_crb: fix no return on non-void func error
There are compiler error about the entry functions of two threads
not returning anything. So add return statement to fix it.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-11-13 06:26:10 -06:00
Daniel Leung
66aefdbb93 samples: intel_s1000/i2s: fix uninitialized use warning
One of the return variable is declared and used, but never
assigned values. So fix it.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-11-13 06:26:10 -06:00
Charles E. Youse
ce46e0df4d cmake: samples/tests: update cmake_minimum_required() to 3.13.1
Some samples/tests are still referring to 3.8.x versions.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-09-27 23:09:24 -04:00
Ulf Magnusson
2481a12529 samples: intel_s1000: Simplify code and fix pylint warning
Empty sequences in Python are falsy, so

    if len(config_file) != 0:

can be simplified to

    if config_file:

pylint warning:

    C1801: Do not use `len(SEQUENCE)` to determine if a sequence is
    empty (len-as-condition)

Simplify the code a bit with os.path.join(), which indirectly gets rid
of the warning. os.path.join('', 'foo') returns 'foo', so things work
out when os.path.basename() returns '' (no directory) as well.

I'm getting rid of pylint warnings for a CI check.

Also replace a '== None' with 'is None', which is more common.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-09-07 08:13:02 -04:00
Carles Cufi
afcbc9992c doc: Use west everywhere to build and flash
Instead of having a mix of west and CMake/ninja instructions for
building and flashing, document it using only west. This will help
clarify that west is the default build tool in Zephyr and should also
reduce confusion over what tool to use.
Note that the biggest change is changing the default in
doc/extensions/zephyr/application.py for :tool:, from all to west.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-08-27 19:36:24 +02:00
Sathish Kuttan
3d32acf376 samples: intel_s1000: update sample audio app doc
Update to documentation for the sample audio application running
on Sue Creek S1000 board from Intel.
Added section on how to control the audio application on target
from a Linux host and updated the console output section
accordingly.

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-07-05 10:13:51 -04:00
Sathish Kuttan
a4c3de16f2 samples: intel_s1000: script to control from host
Add python script and associated configuration YAML file
to control audio sample application running on
Intel Sue Creek S1000 from a Linux host.

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-07-05 10:13:51 -04:00
Sathish Kuttan
192ca06a9e samples: intel_s1000: add files to cmake build
Add tuning driver, audio block processing threads,
background processing thread and USB transport driver
to the cmake build in audio sample app.

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-07-05 10:13:51 -04:00
Sathish Kuttan
dff993ba11 samples: intel_s1000: update project configration
Add USB HID configurations to the audio sample app project
configuration.

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-07-05 10:13:51 -04:00
Sathish Kuttan
c3bf362c28 samples: intel_s1000: tuning commands in audio app
Add processing of sample tuning commands in the audio
sample app.
Add audio processing stubs.

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-07-05 10:13:51 -04:00
Sathish Kuttan
47e2e624c8 samples: intel_s1000: track status of audio app
Add a status check to start/stop audio in order to start
audio only if it's not already running and to stop audio
only if it is running.

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-07-05 10:13:51 -04:00
Sathish Kuttan
75ff541a01 samples: intel_s1000: add background thread
Add background thread in audio sample app for
Intel® Sue Creek S1000 board

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-07-05 10:13:51 -04:00
Sathish Kuttan
a2f1ad41e8 samples: intel_s1000: audio processing threads
Add processing threads for small/large audio blocks
in audio sample app for Intel® Sue Creek S1000 board

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-07-05 10:13:51 -04:00
Sathish Kuttan
881971ad26 samples: intel_s1000: tuning driver for audio app
Add a tuning interface driver to send receive tuning/control
commands over a USB transport.

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-07-05 10:13:51 -04:00
Sathish Kuttan
3adf7e034e samples: intel_s1000: USB control for audio sample
Add USB transport driver to control the sample application
from a host connected to Intel® Sue Creek S1000 board
via an USB interface.

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-07-05 10:13:51 -04:00
Anas Nashif
f2e35134b0 cleanup: include/: move i2s.h to drivers/i2s.h
move i2s.h to drivers/i2s.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
f2cb20c772 docs: fix misspelling across the tree
Found a few annoying typos and figured I better run script and
fix anything it can find, here are the results...

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-19 15:34:13 -05:00
Carles Cufi
b476643695 doc: Cleanup references to cmake
Clean up some stray references to cmake in doc, boards and
samples that don't make explicit use of the zephyr app extension,
as well as other minor doc fixes.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-06-17 10:09:57 -07:00
Kumar Gala
d4a0c3a2aa dts: Convert new/missed DT_<COMPAT>_<INSTANCE>_<PROP> to DT_INST...
Change code from using now deprecated DT_<COMPAT>_<INSTANCE>_<PROP>
defines to using DT_INST_<INSTANCE>_<COMPAT>_<PROP>.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-06-15 07:14:12 -04:00
Sathish Kuttan
9d5a63b9c1 samples: intel_s1000: audio buffers in lpsram
Place audio buffers in LPSRAM using linker section attribute
for the 2-way audio sample application

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-06-11 16:36:30 -04:00
Sathish Kuttan
32b89b9841 samples: intel_s1000: audio buffers in lpsram
Place audio buffers in LPSRAM using linker section attribute
for the I2S audio sample application

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-06-11 16:36:30 -04:00
Sathish Kuttan
1cba619e87 samples: intel_s1000: audio buffers in lpsram
Place audio buffers in LPSRAM using linker section attribute
for the digital mic audio sample application

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-06-11 16:36:30 -04:00
Anas Nashif
3ae52624ff license: cleanup: add SPDX Apache-2.0 license identifier
Update the files which contain no license information with the
'Apache-2.0' SPDX license identifier.  Many source files in the tree are
missing licensing information, which makes it harder for compliance
tools to determine the correct license.

By default all files without license information are under the default
license of Zephyr, which is Apache version 2.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-04-07 08:45:22 -04:00
Anas Nashif
da5f185e06 samples: add test identifier
Add unique identifier instead of just 'test' for samples.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-03-29 17:44:11 -04:00
Sathish Kuttan
12c98eceb1 samples: intel_s1000: remove DCACHE_WRITEBACK
Remove DCACHE_WRITEBACK Kconfig variable from DMIC sample app project
Cache configuration is fixed and the cache operation routines
internally take appropriate action based on the cache configuration.

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-02-20 07:33:11 -05:00
Sathish Kuttan
31ab23fce8 doc: intel_s1000: 2-Way audio sample documentation
Documentation for a sample application to demonstrate audio
capture and playback on an Intel S1000 CRB connected to a
host over I2S.

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-02-19 10:43:52 -05:00
Sathish Kuttan
acd2ff70dc samples: intel_s1000: 2-Way Audio Sample Application
Sample application to demonstrate 2-way audio capture/playback from a
host connected over I2S to S1000

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-02-19 10:43:52 -05:00
Sathish Kuttan
d079ce05c7 doc: intel_s1000: update I2S sample app doc
Added documentation on loopback of audio to host

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-02-18 08:23:53 -05:00
Sathish Kuttan
1ef423e2bb samples: intel_s1000: loopback audio to I2S host
Updated I2S sample app for Intel S1000 CRB to loopback
the audio from host in addition to playing audio out to codec

When AUDIO_PLAY_FROM_HOST=Y, audio from host is both looped back
and played out to codec

When AUDIO_PLAY_FROM_HOST=N, audio from host is looped back and
app generated ones are played out to codec.

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-02-18 08:23:53 -05:00
Sathish Kuttan
acf0e24c6e doc: intel_s1000: I2S sample app documentation
Documentation for the I2S audio sample application for the
Intel S1000 board.

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-02-12 21:20:17 -05:00
Sathish Kuttan
53dcc07889 samples: intel_s1000: App for I2S audio playback
Added a sample app to play audio over I2S through an onboard
Audio DAC on an Intel S1000 CRB.

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-02-12 21:20:17 -05:00
Sathish Kuttan
108ca81a17 samples: intel_s1000_crb: add doc for dmic sample
Add short documentation on sample app for DMIC driver usage
on Intel S1000 CRB.

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-01-07 16:50:49 -05:00
Sathish Kuttan
6292a2fc3b samples: intel_s1000_crb: set BOARD for dmic sample
Set BOARD variable in CMakeLists.txt for DMIC Sample App
Since this sample app is for intel_s1000_crb, setting BOARD
in CMakeLists.txt will eliminate the need to specify in
cmake command line every time during build.

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-01-07 16:50:49 -05:00
Sathish Kuttan
4e6728eb3e samples: intel_s1000_crb: add DMIC sample app
Add a sample application to demonstrate usage of digital microphones
in an Intel S1000 CRB

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-01-07 16:50:49 -05:00