Skip to content

Commit d00aaf4

Browse files
committed
added firmware again to repo
1 parent 3ad88e4 commit d00aaf4

File tree

1,356 files changed

+270800
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,356 files changed

+270800
-0
lines changed

firmware/Friend/bootloader/Seeed_XIAO_nRF52840_Sense_bootloader-0.6.1_s140_7.3.0.hex

Lines changed: 11846 additions & 0 deletions
Large diffs are not rendered by default.
Binary file not shown.

firmware/Friend/bootloader/xiao_nrf52840_ble_sense_bootloader-0.9.0_s140_7.3.0.hex

Lines changed: 11735 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
cmake_minimum_required(VERSION 3.20.0)
4+
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
5+
project(nrf52840_nordic)
6+
enable_language(C ASM)
7+
8+
target_sources(app PRIVATE
9+
src/main.c
10+
src/transport.c
11+
src/mic.c
12+
src/led.c
13+
src/audio.c
14+
src/codec.c
15+
src/lib/battery/battery.c
16+
)
17+
18+
target_sources_ifdef(CONFIG_CODEC_OPUS app PRIVATE
19+
src/lib/opus-1.2.1/A2NLSF.c
20+
src/lib/opus-1.2.1/CNG.c
21+
src/lib/opus-1.2.1/HP_variable_cutoff.c
22+
src/lib/opus-1.2.1/LPC_analysis_filter.c
23+
src/lib/opus-1.2.1/LPC_fit.c
24+
src/lib/opus-1.2.1/LPC_inv_pred_gain.c
25+
src/lib/opus-1.2.1/LP_variable_cutoff.c
26+
src/lib/opus-1.2.1/LTP_analysis_filter_FIX.c
27+
src/lib/opus-1.2.1/LTP_scale_ctrl_FIX.c
28+
src/lib/opus-1.2.1/NLSF2A.c
29+
src/lib/opus-1.2.1/NLSF_VQ.c
30+
src/lib/opus-1.2.1/NLSF_VQ_weights_laroia.c
31+
src/lib/opus-1.2.1/NLSF_decode.c
32+
src/lib/opus-1.2.1/NLSF_del_dec_quant.c
33+
src/lib/opus-1.2.1/NLSF_encode.c
34+
src/lib/opus-1.2.1/NLSF_stabilize.c
35+
src/lib/opus-1.2.1/NLSF_unpack.c
36+
src/lib/opus-1.2.1/NSQ.c
37+
src/lib/opus-1.2.1/NSQ_del_dec.c
38+
src/lib/opus-1.2.1/PLC.c
39+
src/lib/opus-1.2.1/VAD.c
40+
src/lib/opus-1.2.1/VQ_WMat_EC.c
41+
src/lib/opus-1.2.1/ana_filt_bank_1.c
42+
src/lib/opus-1.2.1/analysis.c
43+
src/lib/opus-1.2.1/apply_sine_window_FIX.c
44+
src/lib/opus-1.2.1/autocorr_FIX.c
45+
src/lib/opus-1.2.1/bands.c
46+
src/lib/opus-1.2.1/biquad_alt.c
47+
src/lib/opus-1.2.1/burg_modified_FIX.c
48+
src/lib/opus-1.2.1/bwexpander.c
49+
src/lib/opus-1.2.1/bwexpander_32.c
50+
src/lib/opus-1.2.1/celt.c
51+
src/lib/opus-1.2.1/celt_decoder.c
52+
src/lib/opus-1.2.1/celt_encoder.c
53+
src/lib/opus-1.2.1/celt_lpc.c
54+
src/lib/opus-1.2.1/arm/celt_pitch_xcorr_arm_gcc.s
55+
src/lib/opus-1.2.1/check_control_input.c
56+
src/lib/opus-1.2.1/code_signs.c
57+
src/lib/opus-1.2.1/control_SNR.c
58+
src/lib/opus-1.2.1/control_audio_bandwidth.c
59+
src/lib/opus-1.2.1/control_codec.c
60+
src/lib/opus-1.2.1/corrMatrix_FIX.c
61+
src/lib/opus-1.2.1/cwrs.c
62+
src/lib/opus-1.2.1/debug.c
63+
src/lib/opus-1.2.1/dec_API.c
64+
src/lib/opus-1.2.1/decode_core.c
65+
src/lib/opus-1.2.1/decode_frame.c
66+
src/lib/opus-1.2.1/decode_indices.c
67+
src/lib/opus-1.2.1/decode_parameters.c
68+
src/lib/opus-1.2.1/decode_pitch.c
69+
src/lib/opus-1.2.1/decode_pulses.c
70+
src/lib/opus-1.2.1/decoder_set_fs.c
71+
src/lib/opus-1.2.1/enc_API.c
72+
src/lib/opus-1.2.1/encode_frame_FIX.c
73+
src/lib/opus-1.2.1/encode_indices.c
74+
src/lib/opus-1.2.1/encode_pulses.c
75+
src/lib/opus-1.2.1/entcode.c
76+
src/lib/opus-1.2.1/entdec.c
77+
src/lib/opus-1.2.1/entenc.c
78+
src/lib/opus-1.2.1/find_LPC_FIX.c
79+
src/lib/opus-1.2.1/find_LTP_FIX.c
80+
src/lib/opus-1.2.1/find_pitch_lags_FIX.c
81+
src/lib/opus-1.2.1/find_pred_coefs_FIX.c
82+
src/lib/opus-1.2.1/gain_quant.c
83+
src/lib/opus-1.2.1/init_decoder.c
84+
src/lib/opus-1.2.1/init_encoder.c
85+
src/lib/opus-1.2.1/inner_prod_aligned.c
86+
src/lib/opus-1.2.1/interpolate.c
87+
src/lib/opus-1.2.1/k2a_FIX.c
88+
src/lib/opus-1.2.1/k2a_Q16_FIX.c
89+
src/lib/opus-1.2.1/kiss_fft.c
90+
src/lib/opus-1.2.1/laplace.c
91+
src/lib/opus-1.2.1/lin2log.c
92+
src/lib/opus-1.2.1/log2lin.c
93+
src/lib/opus-1.2.1/mathops.c
94+
src/lib/opus-1.2.1/mdct.c
95+
src/lib/opus-1.2.1/mlp.c
96+
src/lib/opus-1.2.1/mlp_data.c
97+
src/lib/opus-1.2.1/modes.c
98+
src/lib/opus-1.2.1/noise_shape_analysis_FIX.c
99+
src/lib/opus-1.2.1/opus.c
100+
src/lib/opus-1.2.1/opus_decoder.c
101+
src/lib/opus-1.2.1/opus_encoder.c
102+
src/lib/opus-1.2.1/opus_multistream.c
103+
src/lib/opus-1.2.1/opus_multistream_decoder.c
104+
src/lib/opus-1.2.1/opus_multistream_encoder.c
105+
src/lib/opus-1.2.1/pitch.c
106+
src/lib/opus-1.2.1/pitch_analysis_core_FIX.c
107+
src/lib/opus-1.2.1/pitch_est_tables.c
108+
src/lib/opus-1.2.1/process_NLSFs.c
109+
src/lib/opus-1.2.1/process_gains_FIX.c
110+
src/lib/opus-1.2.1/quant_LTP_gains.c
111+
src/lib/opus-1.2.1/quant_bands.c
112+
src/lib/opus-1.2.1/rate.c
113+
src/lib/opus-1.2.1/regularize_correlations_FIX.c
114+
src/lib/opus-1.2.1/repacketizer.c
115+
src/lib/opus-1.2.1/resampler.c
116+
src/lib/opus-1.2.1/resampler_down2.c
117+
src/lib/opus-1.2.1/resampler_down2_3.c
118+
src/lib/opus-1.2.1/resampler_private_AR2.c
119+
src/lib/opus-1.2.1/resampler_private_IIR_FIR.c
120+
src/lib/opus-1.2.1/resampler_private_down_FIR.c
121+
src/lib/opus-1.2.1/resampler_private_up2_HQ.c
122+
src/lib/opus-1.2.1/resampler_rom.c
123+
src/lib/opus-1.2.1/residual_energy16_FIX.c
124+
src/lib/opus-1.2.1/residual_energy_FIX.c
125+
src/lib/opus-1.2.1/schur64_FIX.c
126+
src/lib/opus-1.2.1/schur_FIX.c
127+
src/lib/opus-1.2.1/shell_coder.c
128+
src/lib/opus-1.2.1/sigm_Q15.c
129+
src/lib/opus-1.2.1/sort.c
130+
src/lib/opus-1.2.1/stereo_LR_to_MS.c
131+
src/lib/opus-1.2.1/stereo_MS_to_LR.c
132+
src/lib/opus-1.2.1/stereo_decode_pred.c
133+
src/lib/opus-1.2.1/stereo_encode_pred.c
134+
src/lib/opus-1.2.1/stereo_find_predictor.c
135+
src/lib/opus-1.2.1/stereo_quant_pred.c
136+
src/lib/opus-1.2.1/sum_sqr_shift.c
137+
src/lib/opus-1.2.1/table_LSF_cos.c
138+
src/lib/opus-1.2.1/tables_LTP.c
139+
src/lib/opus-1.2.1/tables_NLSF_CB_NB_MB.c
140+
src/lib/opus-1.2.1/tables_NLSF_CB_WB.c
141+
src/lib/opus-1.2.1/tables_gain.c
142+
src/lib/opus-1.2.1/tables_other.c
143+
src/lib/opus-1.2.1/tables_pitch_lag.c
144+
src/lib/opus-1.2.1/tables_pulses_per_block.c
145+
src/lib/opus-1.2.1/vector_ops_FIX.c
146+
src/lib/opus-1.2.1/vq.c
147+
src/lib/opus-1.2.1/warped_autocorrelation_FIX.c
148+
src/lib/opus-1.2.1/arm/celt_pitch_xcorr_arm_gcc.s
149+
)
150+
151+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DARM_MATH_CM4")
152+
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DVAR_ARRAYS")
153+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DOPUS_ARM_ASM")
154+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DOPUS_ARM_INLINE_ASM")
155+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DOPUS_ARM_INLINE_EDSP")
156+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DOPUS_ARM_INLINE_MEDIA")
157+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DOPUS_ARM_MAY_HAVE_EDSP")
158+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DOPUS_ARM_PRESUME_EDSP")
159+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DOPUS_BUILD")
160+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_ALLOCA")
161+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DFIXED_POINT -DDISABLE_FLOAT_API")
162+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DHAVE_CONFIG_H")
163+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DHAVE_ALLOCA_H")
164+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsingle-precision-constant") # A lot of constants are written as doubles
165+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DHAVE_LRINT -DHAVE_LRINTF")
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
source "Kconfig.zephyr"
2+
3+
config CODEC_OPUS
4+
bool "Opus Audio Codec Support"
5+
default n
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
.. zephyr:code-sample:: blinky
2+
:name: Blinky
3+
:relevant-api: gpio_interface
4+
5+
Blink an LED forever using the GPIO API.
6+
7+
Overview
8+
********
9+
10+
The Blinky sample blinks an LED forever using the :ref:`GPIO API <gpio_api>`.
11+
12+
The source code shows how to:
13+
14+
#. Get a pin specification from the :ref:`devicetree <dt-guide>` as a
15+
:c:struct:`gpio_dt_spec`
16+
#. Configure the GPIO pin as an output
17+
#. Toggle the pin forever
18+
19+
See :zephyr:code-sample:`pwm-blinky` for a similar sample that uses the PWM API instead.
20+
21+
.. _blinky-sample-requirements:
22+
23+
Requirements
24+
************
25+
26+
Your board must:
27+
28+
#. Have an LED connected via a GPIO pin (these are called "User LEDs" on many of
29+
Zephyr's :ref:`boards`).
30+
#. Have the LED configured using the ``led0`` devicetree alias.
31+
32+
Building and Running
33+
********************
34+
35+
Build and flash Blinky as follows, changing ``reel_board`` for your board:
36+
37+
.. zephyr-app-commands::
38+
:zephyr-app: samples/basic/blinky
39+
:board: reel_board
40+
:goals: build flash
41+
:compact:
42+
43+
After flashing, the LED starts to blink. If a runtime error occurs, the sample
44+
exits without printing to the console.
45+
46+
Build errors
47+
************
48+
49+
You will see a build error at the source code line defining the ``struct
50+
gpio_dt_spec led`` variable if you try to build Blinky for an unsupported
51+
board.
52+
53+
On GCC-based toolchains, the error looks like this:
54+
55+
.. code-block:: none
56+
57+
error: '__device_dts_ord_DT_N_ALIAS_led_P_gpios_IDX_0_PH_ORD' undeclared here (not in a function)
58+
59+
Adding board support
60+
********************
61+
62+
To add support for your board, add something like this to your devicetree:
63+
64+
.. code-block:: DTS
65+
66+
/ {
67+
aliases {
68+
led0 = &myled0;
69+
};
70+
71+
leds {
72+
compatible = "gpio-leds";
73+
myled0: led_0 {
74+
gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
75+
};
76+
};
77+
};
78+
79+
The above sets your board's ``led0`` alias to use pin 13 on GPIO controller
80+
``gpio0``. The pin flags :c:macro:`GPIO_ACTIVE_HIGH` mean the LED is on when
81+
the pin is set to its high state, and off when the pin is in its low state.
82+
83+
Tips:
84+
85+
- See :dtcompatible:`gpio-leds` for more information on defining GPIO-based LEDs
86+
in devicetree.
87+
88+
- If you're not sure what to do, check the devicetrees for supported boards which
89+
use the same SoC as your target. See :ref:`get-devicetree-outputs` for details.
90+
91+
- See :zephyr_file:`include/zephyr/dt-bindings/gpio/gpio.h` for the flags you can use
92+
in devicetree.
93+
94+
- If the LED is built in to your board hardware, the alias should be defined in
95+
your :ref:`BOARD.dts file <devicetree-in-out-files>`. Otherwise, you can
96+
define one in a :ref:`devicetree overlay <set-devicetree-overlays>`.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
set -e
2+
west build
3+
cp build/zephyr/zephyr.uf2 /Volumes/XIAO-SENSE/
294 KB
Binary file not shown.

0 commit comments

Comments
 (0)