├── .gitmodules ├── LICENSE ├── README.md ├── common ├── bridge │ ├── Bridge_Instructions.md │ ├── Device_Integration_To_Bridge.md │ ├── bridge.c │ ├── bridge.h │ ├── bridge_scs_device.xml │ └── bridge_wisce_device.xml ├── bsp_driver_if.h ├── buffers │ ├── data_ringbuf.c │ ├── data_ringbuf.h │ ├── dspbuf.c │ └── dspbuf.h ├── common.mk ├── compression │ ├── decompr.c │ ├── decompr.h │ ├── msbc.c │ ├── msbc.h │ ├── packed16.c │ └── packed16.h ├── debug.h ├── fw_img.c ├── fw_img.h ├── mem_alloc_wrapper.c ├── platform_bsp │ ├── blackstar │ │ ├── STM32F401CDYX_FLASH.ld │ │ ├── platform_bsp.c │ │ ├── stm32f4xx_hal_conf.h │ │ ├── stm32f4xx_it.c │ │ └── stm32f4xx_it.h │ ├── eestm32int │ │ ├── STM32F401RETX_FLASH.ld │ │ ├── platform_bsp.c │ │ ├── stm32f4xx_hal_conf.h │ │ ├── stm32f4xx_it.c │ │ └── stm32f4xx_it.h │ ├── holdout │ │ ├── STM32F401CDYX_FLASH.ld │ │ ├── platform_bsp.c │ │ ├── stm32f4xx_hal_conf.h │ │ ├── stm32f4xx_it.c │ │ └── stm32f4xx_it.h │ ├── live_oak │ │ ├── STM32F401CDYX_FLASH.ld │ │ ├── platform_bsp.c │ │ ├── stm32f4xx_hal_conf.h │ │ ├── stm32f4xx_it.c │ │ └── stm32f4xx_it.h │ ├── platform_bsp.h │ ├── platform_bsp.mk │ ├── syscalls.c │ ├── sysmem.c │ ├── test_tone_tables.c │ └── test_tone_tables.h ├── regmap.c ├── regmap.h ├── rth_types.h ├── scc.c └── scc.h ├── cs35l41 ├── artifact_info.txt ├── baremetal │ └── main.c ├── bsp │ ├── bsp_cs35l41.c │ └── bsp_dut.h ├── config │ ├── cs35l41_fs_switch_syscfg.c │ ├── cs35l41_fs_switch_syscfg.h │ ├── cs35l41_sym.h │ └── wisce_init.txt ├── cs35l41.c ├── cs35l41.h ├── cs35l41_ext.c ├── cs35l41_ext.h ├── cs35l41_spec.c ├── cs35l41_spec.h ├── freertos │ ├── FreeRTOSConfig.h │ └── main.c ├── fw │ ├── Protect_Lite_cal_6.43.0_7.0ohm_delta1ohm_L41_revB2.bin │ ├── Protect_Lite_full_6.43.0_7.0ohm_delta1ohm_L41_revB2.bin │ ├── cs35l41_tune_44p1_fw_img.c │ ├── cs35l41_tune_44p1_fw_img.h │ ├── cs35l41_tune_48_fw_img.c │ ├── cs35l41_tune_48_fw_img.h │ └── halo_cspl_RAM_revB2_29.75.0.wmfw └── makefile ├── cs35l42 ├── artifact_info.txt ├── bsp │ ├── bsp_cs35l42.c │ └── bsp_dut.h ├── config │ ├── cs35l42_sym.h │ └── wisce_init.txt ├── cs35l42.c ├── cs35l42.h ├── cs35l42_ext.c ├── cs35l42_ext.h ├── cs35l42_spec.h ├── freertos │ ├── FreeRTOSConfig.h │ └── main.c └── makefile ├── cs40l25 ├── AN0511R1_CS40L25_MCU_Driver_User_Guide.pdf ├── artifact_info.txt ├── baremetal │ ├── main.c │ └── main_ext_boost.c ├── bsp │ ├── bsp_cs40l25.c │ ├── bsp_dut.h │ ├── vregmap.c │ └── vregmap.h ├── config │ ├── cs40l25_cal_sym.h │ ├── cs40l25_sym.h │ ├── wisce_init.txt │ ├── wisce_init_l25b.txt │ └── wisce_init_l25b_ext_boost.txt ├── cs40l25.c ├── cs40l25.h ├── cs40l25_ext.c ├── cs40l25_ext.h ├── cs40l25_spec.c ├── cs40l25_spec.h ├── freertos │ ├── FreeRTOSConfig.h │ └── main.c ├── fw │ ├── default_clab.bin │ ├── default_wt.bin │ ├── dvl.bin │ ├── prince_haptics_ctrl_ram_remap_a2h_0A0603.wmfw │ ├── prince_haptics_ctrl_ram_remap_calib_0A0603.wmfw │ ├── prince_haptics_ctrl_ram_remap_clab_0A0402.wmfw │ ├── prince_haptics_ctrl_ram_remap_clab_0A0603.wmfw │ ├── prince_haptics_ctrl_ram_remap_df0_clab_0A0603.wmfw │ ├── prince_haptics_ctrl_ram_remap_ext_boost_0A0603.wmfw │ └── prince_haptics_ctrl_ram_remap_pwle_reg_0A0603.wmfw ├── live_oak │ └── main.c └── makefile ├── cs40l26 ├── artifact_info.txt ├── baremetal │ └── main.c ├── bsp │ ├── bsp_cs40l26.c │ ├── bsp_dut.h │ └── cs40l26_altos_bridge.xml ├── config │ ├── cs40l26_cal_sym.h │ ├── cs40l26_sym.h │ └── wisce_init.txt ├── cs40l26.c ├── cs40l26.h ├── cs40l26_ext.c ├── cs40l26_ext.h ├── cs40l26_spec.h ├── freertos │ ├── FreeRTOSConfig.h │ └── main.c ├── fw │ ├── cs40l26_waveform.c │ ├── cs40l26_waveform.h │ ├── cs40l26_wt.bin │ └── tuning.bin ├── holdout │ └── main.c └── makefile ├── cs40l50 ├── artifact_info.txt ├── baremetal │ └── main.c ├── blackstar │ └── main.c ├── bsp │ ├── bsp_cs40l50.c │ └── bsp_dut.h ├── config │ ├── cs40l50_sym.h │ ├── waveforms.hwt │ └── wisce_init.txt ├── cs40l50.c ├── cs40l50.h ├── cs40l50_spec.h ├── freertos │ ├── FreeRTOSConfig.h │ └── main.c ├── fw │ ├── CS40L50_Rev3.4.8.wmfw │ └── cs40l50_wt.bin └── makefile ├── cs47l15 ├── artifact_info.txt ├── baremetal │ └── main.c ├── bsp │ ├── bsp_cs47l15.c │ └── bsp_dut.h ├── config │ ├── cs47l15_sym.h │ └── wisce_init.txt ├── cs47l15.c ├── cs47l15.h ├── cs47l15_ext.c ├── cs47l15_ext.h ├── cs47l15_spec.h ├── freertos │ ├── FreeRTOSConfig.h │ └── main.c ├── fw │ ├── gaines_mp3_decoder_000001.wmfw │ └── gaines_passthru_030500.wmfw ├── makefile ├── mp3_test_01_441.c ├── mp3_test_01_441.h ├── mp3_test_01_48.c └── mp3_test_01_48.h ├── cs47l35 ├── artifact_info.txt ├── baremetal │ └── main.c ├── bsp │ ├── bsp_cs47l35.c │ └── bsp_dut.h ├── config │ ├── cs47l35_sym.h │ ├── cs47l35_sym_dsp3.h │ └── wisce_init.txt ├── cs47l35.c ├── cs47l35.h ├── cs47l35_ext.c ├── cs47l35_ext.h ├── cs47l35_spec.h ├── freertos │ ├── FreeRTOSConfig.h │ └── main.c ├── makefile ├── opus_test_01_16.c └── opus_test_01_16.h ├── cs47l63 ├── artifact_info.txt ├── baremetal │ └── main.c ├── bsp │ ├── bsp_cs47l63.c │ ├── bsp_dut.h │ ├── cs47l63_altos_bridge.xml │ ├── cs47l63_altos_bridge_vregs.xml │ ├── vregmap.c │ └── vregmap.h ├── config │ ├── cs47l63_sym.h │ └── wisce_init.txt ├── cs47l63.c ├── cs47l63.h ├── cs47l63_ext.c ├── cs47l63_ext.h ├── cs47l63_spec.h ├── freertos │ ├── FreeRTOSConfig.h │ └── main.c └── makefile ├── doc.zip ├── release_notes.txt ├── samples ├── README.md ├── haptics │ └── cs40l50 │ │ ├── CMakeLists.txt │ │ ├── Kconfig │ │ ├── README.md │ │ ├── boards │ │ └── nucleo_f401re.overlay │ │ ├── prj.conf │ │ ├── src │ │ ├── CMakeLists.txt │ │ ├── cs40l50_bsp.c │ │ ├── cs40l50_bsp.h │ │ ├── cs40l50_firmware.c │ │ ├── cs40l50_firmware.h │ │ ├── cs40l50_syscfg_regs.c │ │ ├── cs40l50_syscfg_regs.h │ │ ├── drivers │ │ │ ├── CMakeLists.txt │ │ │ └── haptics │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── Kconfig │ │ │ │ └── Kconfig.cs40l50 │ │ └── main.c │ │ └── zephyr │ │ └── module.yml └── helloworld │ └── cs40l50 │ ├── CMakeLists.txt │ ├── Kconfig │ ├── README.md │ ├── boards │ └── nucleo_f401re.overlay │ ├── prj.conf │ ├── src │ └── main.c │ └── zephyr │ └── module.yml ├── sdk_version.h ├── third_party ├── sbc.mk └── st │ └── st.mk └── tools ├── bridge_agent ├── bridge_agent.py └── run_bridge.py ├── create_ide_projects ├── .cproject ├── .project ├── blackstar_jlink.launch ├── blackstar_stlink.launch ├── create_ide_projects.py ├── holdout_jlink.launch ├── holdout_stlink.launch ├── live_oak_jlink.launch └── live_oak_stlink.launch ├── firmware_converter ├── binary_parser.py ├── c_h_file_templates.py ├── firmware_converter.py ├── firmware_exporter.py ├── firmware_exporter_factory.py ├── fw_img_v1.py ├── fw_img_v1_templates.py ├── json_exporter.py ├── wisce_file_templates.py ├── wmdr_parser.py └── wmfw_parser.py ├── hwt_to_waveform ├── hwt_to_waveform_converter.py └── hwt_to_waveform_templates.py ├── sdk_version └── sdk_version.py ├── smcio └── smcio.py ├── vregmap_generator ├── vregmap_classes.py ├── vregmap_exporter.py ├── vregmap_generator.py ├── vregmap_scs_xml_importer.py └── vregmap_wisce_xml_importer.py └── wisce_script_converter ├── c_array_exporter.py ├── c_function_exporter.py ├── script_importer.py ├── wisce_file_templates.py ├── wisce_script_converter.py ├── wisce_script_exporter.py ├── wisce_script_exporter_factory.py └── wisce_script_function.py /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "third_party/st/STM32CubeF4"] 2 | path = third_party/st/STM32CubeF4 3 | url = https://github.com/STMicroelectronics/STM32CubeF4.git 4 | [submodule "third_party/sbc"] 5 | path = third_party/sbc 6 | url = https://git.kernel.org/pub/scm/bluetooth/sbc 7 | -------------------------------------------------------------------------------- /common/bridge/Bridge_Instructions.md: -------------------------------------------------------------------------------- 1 | # Bridge Instructions 2 | 3 | The MCU Driver SDK now supports including an implementation of WISCE protocol over MCU UART, allowing control of supported Cirrus Logic devices from WISCE. The Bridge implementation also includes enumerating of a virtual device ("vregmap") that can allow the developer to drive use-case transitions or other functionality from WISCE. WISCE requires XML files copied to particular folders in the filesystem in order to correctly enumerate systems that include both a Cirrus Logic device and the virtual device. The instructions included here outline where to copy the XML files in the filesystem. 4 | 5 | # Using WISCE 6 | For connecting to the Bridge implementation via WISCE, the following steps must be followed: 7 | 8 | 1. Copy the file below: 9 | \/common/bridge/bridge_wisce_device.xml 10 | to 11 | \/Devices/bridge_wisce_device.xml 12 | 2. Build the desired example project with the make argument 'CONFIG_USE_VREGMAP=1' 13 | 3. Flash and run the compiled binary 14 | 4. In a terminal session, run \/tools/bridge_agent/run_bridge.py 15 | 5. Open WISCE - if a bridge implementation is running, it will automatically connect 16 | 6. Click on the device marked 'Unknown', and then click on 'Device' -> 'Properties...' 17 | 7. Click on 'Load' and navigate to the bridge_wisce_device.xml in the WISCE install 18 | 8. Click Accept 19 | -------------------------------------------------------------------------------- /common/bridge/bridge_scs_device.xml: -------------------------------------------------------------------------------- 1 |  2 | 24 | 25 | 26 | VREGS 27 | VREGS 28 | A 29 | 32 30 | 31 | 32 | SMbus_32inx_32dat 33 | 0x70 34 | 35 | 36 | 4wireSPI_32inx_32dat_32pad 37 | 38 | 39 | 40 | 41 | 42 | CONTROL 43 |
0x00000000
44 | 0x00000000 45 | R/W 46 |
47 | 48 | SDK_VERSION 49 |
0x0000FFFF
50 | 0x00000000 51 | R/O 52 |
53 |
54 | 55 | 56 | TOGGLE LED 57 |
CONTROL[0:0]
58 | 0x0 59 | R/W 60 | POR 61 | 62 | 63 | Binary 64 | 65 | 66 |
67 | 68 | MAJOR 69 |
SDK_VERSION[31:24]
70 | 0x0 71 | R/O 72 | POR 73 | 74 | 75 | Hex 76 | 77 | 78 |
79 | 80 | MINOR 81 |
SDK_VERSION[23:16]
82 | 0x0 83 | R/O 84 | POR 85 | 86 | 87 | Hex 88 | 89 | 90 |
91 | 92 | UPDATE 93 |
SDK_VERSION[15:8]
94 | 0x0 95 | R/O 96 | POR 97 | 98 | 99 | Hex 100 | 101 | 102 |
103 |
104 |
105 | -------------------------------------------------------------------------------- /common/bridge/bridge_wisce_device.xml: -------------------------------------------------------------------------------- 1 | 2 | 24 | 25 | 26 | VREGS 27 | VREGS 28 | A0 29 | 32 30 | 0 31 | 1 32 | 33 | 34 | SMbus_32inx_32dat 35 | 0x70 36 | 37 | 38 | 39 | 40 | 41 |
0x00000000
42 | CONTROL 43 | 0x00000000 44 | 45 | 46 | 47 | 48 | 49 | TOGGLE_LED 50 | Toggle LN2 GPIO1 LED. 51 | 0x00000000 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 |
64 | 65 |
0x0000FFFF
66 | SDK_VERSION 67 | 0x00000000 68 | 69 | 70 | 71 | 72 | MAJOR 73 | Major Version of the Alt-OS SDK. 74 | 0x00000000 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | MINOR 87 | Minor Version of the Alt-OS SDK. 88 | 0x00000000 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | UPDATE 101 | Update Version of the Alt-OS SDK. 102 | 0x00000000 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 |
114 |
115 |
116 | -------------------------------------------------------------------------------- /common/compression/decompr.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file decompr.c 3 | * 4 | * @brief Decompression API module 5 | * 6 | * @copyright 7 | * Copyright (c) Cirrus Logic 2023 All Rights Reserved, http://www.cirrus.com/ 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the License); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | */ 22 | /*********************************************************************************************************************** 23 | * INCLUDES 24 | **********************************************************************************************************************/ 25 | #include 26 | #include 27 | #include 28 | #include "debug.h" 29 | #include "decompr.h" 30 | #include "msbc.h" 31 | #include "packed16.h" 32 | 33 | /*********************************************************************************************************************** 34 | * LOCAL LITERAL SUBSTITUTIONS 35 | **********************************************************************************************************************/ 36 | 37 | /*********************************************************************************************************************** 38 | * LOCAL VARIABLES 39 | **********************************************************************************************************************/ 40 | 41 | /*********************************************************************************************************************** 42 | * LOCAL FUNCTIONS 43 | **********************************************************************************************************************/ 44 | 45 | /*********************************************************************************************************************** 46 | * API FUNCTIONS 47 | **********************************************************************************************************************/ 48 | 49 | uint32_t decompr_init(decompr_t *decompr, compr_enc_format_t enc_format, endian_t output_endian) 50 | { 51 | decompr->output_endian = output_endian; 52 | decompr->enc_format = enc_format; 53 | 54 | // Select the requested compressed stream encoding 55 | switch (decompr->enc_format) 56 | { 57 | case COMPR_ENC_FORMAT_PACKED16: 58 | decompr->init = &packed16_init; 59 | decompr->decompress = &packed16_decompress; 60 | decompr->deinit = &packed16_deinit; 61 | break; 62 | case COMPR_ENC_FORMAT_MSBC: 63 | decompr->init = &msbc_init; 64 | decompr->decompress = &msbc_decompress; 65 | decompr->deinit = &msbc_deinit; 66 | break; 67 | case COMPR_ENC_FORMAT_DEFAULT: // Do not change the buffer format (must be chosen for SCC lib v8.7.0 and older) 68 | decompr->init = &msbc_init; 69 | decompr->decompress = &msbc_decompress; 70 | decompr->deinit = &msbc_deinit; 71 | break; 72 | default: 73 | decompr->decompress = NULL; 74 | return DECOMPR_STATUS_FAIL; 75 | } 76 | 77 | // Call the decompression algorithms init to create a context 78 | decompr->context = decompr->init(output_endian); 79 | if (decompr->context == NULL) 80 | { 81 | return DECOMPR_STATUS_FAIL; 82 | } 83 | 84 | return DECOMPR_STATUS_OK; 85 | } 86 | 87 | uint32_t decompr_data(decompr_t *decompr, 88 | data_ringbuf_t *decompr_data_buf_ptr, 89 | data_ringbuf_t *compr_data_buf_ptr, 90 | uint32_t *bytes_decompressed) 91 | { 92 | return decompr->decompress(decompr->context, decompr_data_buf_ptr, compr_data_buf_ptr, bytes_decompressed); 93 | } 94 | 95 | void decompr_deinit(decompr_t *decompr) 96 | { 97 | decompr->deinit(decompr->context); 98 | decompr->context = NULL; 99 | decompr->init = NULL; 100 | decompr->decompress = NULL; 101 | decompr->deinit = NULL; 102 | } 103 | 104 | -------------------------------------------------------------------------------- /common/compression/msbc.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file msbc.h 3 | * 4 | * @brief Functions and prototypes for mSBC decompression module 5 | * 6 | * @copyright 7 | * Copyright (c) Cirrus Logic 2023 All Rights Reserved, http://www.cirrus.com/ 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the License); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | */ 22 | 23 | #ifndef MSBC_H 24 | #define MSBC_H 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /*********************************************************************************************************************** 31 | * INCLUDES 32 | **********************************************************************************************************************/ 33 | #include "decompr.h" 34 | 35 | /*********************************************************************************************************************** 36 | * LITERALS & CONSTANTS 37 | **********************************************************************************************************************/ 38 | 39 | /*********************************************************************************************************************** 40 | * MACROS 41 | **********************************************************************************************************************/ 42 | 43 | /*********************************************************************************************************************** 44 | * ENUMS, STRUCTS, UNIONS, TYPEDEFS 45 | **********************************************************************************************************************/ 46 | 47 | /*********************************************************************************************************************** 48 | * GLOBAL VARIABLES 49 | **********************************************************************************************************************/ 50 | 51 | /*********************************************************************************************************************** 52 | * API FUNCTIONS 53 | **********************************************************************************************************************/ 54 | 55 | /** 56 | * Allocate and initialize an msbc decompression structure with a given output endian format 57 | * 58 | * @param [in] 59 | * - output_endian The endianness to use for the output data 60 | * 61 | * @return 62 | * - void * An msbc context structure 63 | * - NULL Failed to allocation and initialize an msbc decompression structure 64 | * 65 | */ 66 | void *msbc_init(endian_t output_endian); 67 | 68 | /** 69 | * Decompress data in mSBC format 70 | * 71 | * @param [in] 72 | * - context Pointer to the msbc decompression state structure 73 | * - decompr_data_buf_ptr Pointer to the data buffer to decompress data to 74 | * - compr_data_buf_ptr Pointer to the data buffer containing the compressed data 75 | * 76 | * @param [out] 77 | * - bytes_decompressed Pointer to the length of data added to the decompr_data_buf_ptr 78 | * 79 | * @return 80 | * - DECOMPR_STATUS_FAIL Failed to decompress the given data 81 | * - DECOMPR_STATUS_OK otherwise 82 | * 83 | */ 84 | uint32_t msbc_decompress(void *context, 85 | data_ringbuf_t *decompr_data_buf_ptr, 86 | data_ringbuf_t *compr_data_buf_ptr, 87 | uint32_t *bytes_decompressed); 88 | 89 | /** 90 | * Deinitialize and free the msbc decompression structure, freeing all resources used 91 | * 92 | * @param [in] 93 | * - context Pointer to the msbc decompression state structure 94 | * 95 | */ 96 | void msbc_deinit(void *context); 97 | 98 | /**********************************************************************************************************************/ 99 | #ifdef __cplusplus 100 | } 101 | #endif 102 | 103 | #endif // MSBC_H 104 | -------------------------------------------------------------------------------- /common/compression/packed16.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file packed16.h 3 | * 4 | * @brief Functions and prototypes for packed16 decompression module 5 | * 6 | * @copyright 7 | * Copyright (c) Cirrus Logic 2023 All Rights Reserved, http://www.cirrus.com/ 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the License); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | */ 22 | 23 | #ifndef PACKED16_H 24 | #define PACKED16_H 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /*********************************************************************************************************************** 31 | * INCLUDES 32 | **********************************************************************************************************************/ 33 | #include "decompr.h" 34 | 35 | /*********************************************************************************************************************** 36 | * LITERALS & CONSTANTS 37 | **********************************************************************************************************************/ 38 | 39 | /*********************************************************************************************************************** 40 | * MACROS 41 | **********************************************************************************************************************/ 42 | 43 | /*********************************************************************************************************************** 44 | * ENUMS, STRUCTS, UNIONS, TYPEDEFS 45 | **********************************************************************************************************************/ 46 | 47 | /*********************************************************************************************************************** 48 | * GLOBAL VARIABLES 49 | **********************************************************************************************************************/ 50 | 51 | /*********************************************************************************************************************** 52 | * API FUNCTIONS 53 | **********************************************************************************************************************/ 54 | 55 | /** 56 | * Allocate and initialize an packed16 decompression structure with a given output endian format 57 | * 58 | * @param [in] 59 | * - output_endian The endianness to use for the output data 60 | * 61 | * @return 62 | * - void * A packed16 context structure 63 | * - NULL Failed to allocation and initialize an packed16 decompression structure 64 | * 65 | */ 66 | void *packed16_init(endian_t output_endian); 67 | 68 | /** 69 | * Decompress data in packed16 format 70 | * 71 | * @param [in] 72 | * - context Pointer to the packed16 decompression state structure 73 | * - decompr_data_buf_ptr Pointer to the data buffer to decompress data to 74 | * - compr_data_buf_ptr Pointer to the data buffer containing the compressed data 75 | * 76 | * @param [out] 77 | * - bytes_decompressed Pointer to the length of data added to the decompr_data_buf_ptr 78 | * 79 | * @return 80 | * - DECOMPR_STATUS_FAIL Failed to decompress the given data 81 | * - DECOMPR_STATUS_OK otherwise 82 | * 83 | */ 84 | uint32_t packed16_decompress(void *context, 85 | data_ringbuf_t *decompr_data_buf_ptr, 86 | data_ringbuf_t *compr_data_buf_ptr, 87 | uint32_t *bytes_decompressed); 88 | 89 | /** 90 | * Deinitialize and free the packed16 decompression structure, freeing all resources used 91 | * 92 | * @param [in] 93 | * - context Pointer to the packed16 decompression state structure 94 | * 95 | */ 96 | void packed16_deinit(void *context); 97 | 98 | /**********************************************************************************************************************/ 99 | #ifdef __cplusplus 100 | } 101 | #endif 102 | 103 | #endif // PACKED16_H 104 | -------------------------------------------------------------------------------- /common/debug.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file debug.h 3 | * 4 | * @brief Debug module 5 | * 6 | * @copyright 7 | * Copyright (c) Cirrus Logic 2023 All Rights Reserved, http://www.cirrus.com/ 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the License); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | */ 22 | 23 | #ifndef DEBUG_H 24 | #define DEBUG_H 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /*********************************************************************************************************************** 31 | * INCLUDES 32 | **********************************************************************************************************************/ 33 | #include 34 | #ifndef UNIT_TESTS 35 | #include "stm32f4xx_hal.h" 36 | #endif 37 | /*********************************************************************************************************************** 38 | * LITERALS & CONSTANTS 39 | **********************************************************************************************************************/ 40 | 41 | /*********************************************************************************************************************** 42 | * MACROS 43 | **********************************************************************************************************************/ 44 | /** 45 | * debug printf safe to use when semihosting is disabled 46 | */ 47 | #define debug_printf(...) printf("(%lu)", HAL_GetTick()) ; printf(__VA_ARGS__) 48 | 49 | /*********************************************************************************************************************** 50 | * ENUMS, STRUCTS, UNIONS, TYPEDEFS 51 | **********************************************************************************************************************/ 52 | 53 | /*********************************************************************************************************************** 54 | * GLOBAL VARIABLES 55 | **********************************************************************************************************************/ 56 | 57 | /*********************************************************************************************************************** 58 | * API FUNCTIONS 59 | **********************************************************************************************************************/ 60 | 61 | /**********************************************************************************************************************/ 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | 66 | #endif // DEBUG_H 67 | -------------------------------------------------------------------------------- /common/mem_alloc_wrapper.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file mem_alloc_wrapper.c 3 | * 4 | * @brief Wrappers for memory allocation functions to use with freertos 5 | * 6 | * @copyright 7 | * Copyright (c) Cirrus Logic 2023 All Rights Reserved, http://www.cirrus.com/ 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the License); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | */ 22 | /*********************************************************************************************************************** 23 | * INCLUDES 24 | **********************************************************************************************************************/ 25 | #include 26 | #include "FreeRTOS.h" 27 | 28 | /*********************************************************************************************************************** 29 | * LOCAL LITERAL SUBSTITUTIONS 30 | **********************************************************************************************************************/ 31 | 32 | /*********************************************************************************************************************** 33 | * LOCAL VARIABLES 34 | **********************************************************************************************************************/ 35 | 36 | /*********************************************************************************************************************** 37 | * LOCAL FUNCTIONS 38 | **********************************************************************************************************************/ 39 | 40 | /*********************************************************************************************************************** 41 | * API FUNCTIONS 42 | **********************************************************************************************************************/ 43 | 44 | #ifdef USE_CMSIS_OS 45 | void* __wrap_malloc(size_t size) 46 | { 47 | return pvPortMalloc(size); 48 | } 49 | 50 | void __wrap_free(void* ptr) 51 | { 52 | return vPortFree(ptr); 53 | } 54 | #endif 55 | -------------------------------------------------------------------------------- /common/platform_bsp/blackstar/stm32f4xx_it.h: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file stm32f4xx_it.h 5 | * @brief This file contains the headers of the interrupt handlers. 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | *

© Copyright (c) 2019 STMicroelectronics. 10 | * All rights reserved.

11 | * 12 | * This software component is licensed by ST under BSD 3-Clause license, 13 | * the "License"; You may not use this file except in compliance with the 14 | * License. You may obtain a copy of the License at: 15 | * opensource.org/licenses/BSD-3-Clause 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* USER CODE END Header */ 20 | 21 | /* Define to prevent recursive inclusion -------------------------------------*/ 22 | #ifndef __STM32F4xx_IT_H 23 | #define __STM32F4xx_IT_H 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | /* Private includes ----------------------------------------------------------*/ 30 | /* USER CODE BEGIN Includes */ 31 | 32 | /* USER CODE END Includes */ 33 | 34 | /* Exported types ------------------------------------------------------------*/ 35 | /* USER CODE BEGIN ET */ 36 | 37 | /* USER CODE END ET */ 38 | 39 | /* Exported constants --------------------------------------------------------*/ 40 | /* USER CODE BEGIN EC */ 41 | 42 | /* USER CODE END EC */ 43 | 44 | /* Exported macro ------------------------------------------------------------*/ 45 | /* USER CODE BEGIN EM */ 46 | 47 | /* USER CODE END EM */ 48 | 49 | /* Exported functions prototypes ---------------------------------------------*/ 50 | void NMI_Handler(void); 51 | void HardFault_Handler(void); 52 | void MemManage_Handler(void); 53 | void BusFault_Handler(void); 54 | void UsageFault_Handler(void); 55 | void SVC_Handler(void); 56 | void DebugMon_Handler(void); 57 | void PendSV_Handler(void); 58 | void SysTick_Handler(void); 59 | void I2C1_EV_IRQHandler(void); 60 | void I2C1_ER_IRQHandler(void); 61 | void DMA1_Stream4_IRQHandler(void); 62 | /* USER CODE BEGIN EFP */ 63 | 64 | /* USER CODE END EFP */ 65 | 66 | #ifdef __cplusplus 67 | } 68 | #endif 69 | 70 | #endif /* __STM32F4xx_IT_H */ 71 | 72 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 73 | -------------------------------------------------------------------------------- /common/platform_bsp/eestm32int/stm32f4xx_it.h: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file stm32f4xx_it.h 5 | * @brief This file contains the headers of the interrupt handlers. 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | *

© Copyright (c) 2019 STMicroelectronics. 10 | * All rights reserved.

11 | * 12 | * This software component is licensed by ST under BSD 3-Clause license, 13 | * the "License"; You may not use this file except in compliance with the 14 | * License. You may obtain a copy of the License at: 15 | * opensource.org/licenses/BSD-3-Clause 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* USER CODE END Header */ 20 | 21 | /* Define to prevent recursive inclusion -------------------------------------*/ 22 | #ifndef __STM32F4xx_IT_H 23 | #define __STM32F4xx_IT_H 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | /* Private includes ----------------------------------------------------------*/ 30 | /* USER CODE BEGIN Includes */ 31 | 32 | /* USER CODE END Includes */ 33 | 34 | /* Exported types ------------------------------------------------------------*/ 35 | /* USER CODE BEGIN ET */ 36 | 37 | /* USER CODE END ET */ 38 | 39 | /* Exported constants --------------------------------------------------------*/ 40 | /* USER CODE BEGIN EC */ 41 | 42 | /* USER CODE END EC */ 43 | 44 | /* Exported macro ------------------------------------------------------------*/ 45 | /* USER CODE BEGIN EM */ 46 | 47 | /* USER CODE END EM */ 48 | 49 | /* Exported functions prototypes ---------------------------------------------*/ 50 | void NMI_Handler(void); 51 | void HardFault_Handler(void); 52 | void MemManage_Handler(void); 53 | void BusFault_Handler(void); 54 | void UsageFault_Handler(void); 55 | void SVC_Handler(void); 56 | void DebugMon_Handler(void); 57 | void PendSV_Handler(void); 58 | void SysTick_Handler(void); 59 | void I2C1_EV_IRQHandler(void); 60 | void I2C1_ER_IRQHandler(void); 61 | void DMA1_Stream4_IRQHandler(void); 62 | void DMA1_Stream5_IRQHandler(void); 63 | /* USER CODE BEGIN EFP */ 64 | 65 | /* USER CODE END EFP */ 66 | 67 | #ifdef __cplusplus 68 | } 69 | #endif 70 | 71 | #endif /* __STM32F4xx_IT_H */ 72 | 73 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 74 | -------------------------------------------------------------------------------- /common/platform_bsp/holdout/stm32f4xx_it.h: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file stm32f4xx_it.h 5 | * @brief This file contains the headers of the interrupt handlers. 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | *

© Copyright (c) 2019 STMicroelectronics. 10 | * All rights reserved.

11 | * 12 | * This software component is licensed by ST under BSD 3-Clause license, 13 | * the "License"; You may not use this file except in compliance with the 14 | * License. You may obtain a copy of the License at: 15 | * opensource.org/licenses/BSD-3-Clause 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* USER CODE END Header */ 20 | 21 | /* Define to prevent recursive inclusion -------------------------------------*/ 22 | #ifndef __STM32F4xx_IT_H 23 | #define __STM32F4xx_IT_H 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | /* Private includes ----------------------------------------------------------*/ 30 | /* USER CODE BEGIN Includes */ 31 | 32 | /* USER CODE END Includes */ 33 | 34 | /* Exported types ------------------------------------------------------------*/ 35 | /* USER CODE BEGIN ET */ 36 | 37 | /* USER CODE END ET */ 38 | 39 | /* Exported constants --------------------------------------------------------*/ 40 | /* USER CODE BEGIN EC */ 41 | 42 | /* USER CODE END EC */ 43 | 44 | /* Exported macro ------------------------------------------------------------*/ 45 | /* USER CODE BEGIN EM */ 46 | 47 | /* USER CODE END EM */ 48 | 49 | /* Exported functions prototypes ---------------------------------------------*/ 50 | void NMI_Handler(void); 51 | void HardFault_Handler(void); 52 | void MemManage_Handler(void); 53 | void BusFault_Handler(void); 54 | void UsageFault_Handler(void); 55 | void SVC_Handler(void); 56 | void DebugMon_Handler(void); 57 | void PendSV_Handler(void); 58 | void SysTick_Handler(void); 59 | void I2C1_EV_IRQHandler(void); 60 | void I2C1_ER_IRQHandler(void); 61 | void DMA1_Stream4_IRQHandler(void); 62 | /* USER CODE BEGIN EFP */ 63 | 64 | /* USER CODE END EFP */ 65 | 66 | #ifdef __cplusplus 67 | } 68 | #endif 69 | 70 | #endif /* __STM32F4xx_IT_H */ 71 | 72 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 73 | -------------------------------------------------------------------------------- /common/platform_bsp/live_oak/stm32f4xx_it.h: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file stm32f4xx_it.h 5 | * @brief This file contains the headers of the interrupt handlers. 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | *

© Copyright (c) 2019 STMicroelectronics. 10 | * All rights reserved.

11 | * 12 | * This software component is licensed by ST under BSD 3-Clause license, 13 | * the "License"; You may not use this file except in compliance with the 14 | * License. You may obtain a copy of the License at: 15 | * opensource.org/licenses/BSD-3-Clause 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* USER CODE END Header */ 20 | 21 | /* Define to prevent recursive inclusion -------------------------------------*/ 22 | #ifndef __STM32F4xx_IT_H 23 | #define __STM32F4xx_IT_H 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | /* Private includes ----------------------------------------------------------*/ 30 | /* USER CODE BEGIN Includes */ 31 | 32 | /* USER CODE END Includes */ 33 | 34 | /* Exported types ------------------------------------------------------------*/ 35 | /* USER CODE BEGIN ET */ 36 | 37 | /* USER CODE END ET */ 38 | 39 | /* Exported constants --------------------------------------------------------*/ 40 | /* USER CODE BEGIN EC */ 41 | 42 | /* USER CODE END EC */ 43 | 44 | /* Exported macro ------------------------------------------------------------*/ 45 | /* USER CODE BEGIN EM */ 46 | 47 | /* USER CODE END EM */ 48 | 49 | /* Exported functions prototypes ---------------------------------------------*/ 50 | void NMI_Handler(void); 51 | void HardFault_Handler(void); 52 | void MemManage_Handler(void); 53 | void BusFault_Handler(void); 54 | void UsageFault_Handler(void); 55 | void SVC_Handler(void); 56 | void DebugMon_Handler(void); 57 | void PendSV_Handler(void); 58 | void SysTick_Handler(void); 59 | void I2C1_EV_IRQHandler(void); 60 | void I2C1_ER_IRQHandler(void); 61 | void DMA1_Stream4_IRQHandler(void); 62 | /* USER CODE BEGIN EFP */ 63 | 64 | /* USER CODE END EFP */ 65 | 66 | #ifdef __cplusplus 67 | } 68 | #endif 69 | 70 | #endif /* __STM32F4xx_IT_H */ 71 | 72 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 73 | -------------------------------------------------------------------------------- /common/platform_bsp/platform_bsp.mk: -------------------------------------------------------------------------------- 1 | ############################################################################## 2 | # 3 | # Makefile for Platform BSP Module 4 | # 5 | ############################################################################## 6 | # Licensed under the Apache License, Version 2.0 (the License); you may 7 | # not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an AS IS BASIS, WITHOUT 14 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | # Variable Assignments 21 | ############################################################################## 22 | 23 | # Assign variables 24 | ifeq ($(PLATFORM), eestm32int) 25 | else ifeq ($(PLATFORM), live_oak) 26 | else ifeq ($(PLATFORM), holdout) 27 | else ifeq ($(PLATFORM), blackstar) 28 | else 29 | $(error Invalid PLATFORM configuration given!) 30 | endif 31 | 32 | # Includes 33 | include $(REPO_PATH)/third_party/st/st.mk 34 | 35 | # Assign paths 36 | PLATFORM_PATH = $(REPO_PATH)/common/$(PLATFORM) 37 | 38 | # Assign flags 39 | ifeq ($(PLATFORM), eestm32int) 40 | LDFLAGS += -T"$(REPO_PATH)/common/platform_bsp/eestm32int/STM32F401RETX_FLASH.ld" 41 | else ifeq ($(PLATFORM), live_oak) 42 | LDFLAGS += -T"$(REPO_PATH)/common/platform_bsp/live_oak/STM32F401CDYX_FLASH.ld" 43 | else ifeq ($(PLATFORM), holdout) 44 | LDFLAGS += -T"$(REPO_PATH)/common/platform_bsp/holdout/STM32F401CDYX_FLASH.ld" 45 | else ifeq ($(PLATFORM), blackstar) 46 | LDFLAGS += -T"$(REPO_PATH)/common/platform_bsp/blackstar/STM32F401CDYX_FLASH.ld" 47 | endif 48 | 49 | # Assign sources 50 | C_SRCS += $(REPO_PATH)/common/platform_bsp/syscalls.c 51 | C_SRCS += $(REPO_PATH)/common/platform_bsp/sysmem.c 52 | C_SRCS += $(REPO_PATH)/common/platform_bsp/$(PLATFORM)/platform_bsp.c 53 | C_SRCS += $(REPO_PATH)/common/platform_bsp/$(PLATFORM)/stm32f4xx_it.c 54 | ifeq ($(PLATFORM), eestm32int) 55 | C_SRCS += $(REPO_PATH)/common/platform_bsp/test_tone_tables.c 56 | endif 57 | 58 | # Assign includes 59 | INCLUDES += -I$(REPO_PATH)/common/platform_bsp 60 | INCLUDES += -I$(REPO_PATH)/common/platform_bsp/$(PLATFORM) 61 | -------------------------------------------------------------------------------- /common/platform_bsp/sysmem.c: -------------------------------------------------------------------------------- 1 | /** 2 | ***************************************************************************** 3 | ** 4 | ** File : sysmem.c 5 | ** 6 | ** Author : Auto-generated by STM32CubeIDE 7 | ** 8 | ** Abstract : STM32CubeIDE Minimal System Memory calls file 9 | ** 10 | ** For more information about which c-functions 11 | ** need which of these lowlevel functions 12 | ** please consult the Newlib libc-manual 13 | ** 14 | ** Environment : STM32CubeIDE MCU 15 | ** 16 | ** Distribution: The file is distributed as is, without any warranty 17 | ** of any kind. 18 | ** 19 | ***************************************************************************** 20 | ** 21 | **

© COPYRIGHT(c) 2018 STMicroelectronics

22 | ** 23 | ** Redistribution and use in source and binary forms, with or without modification, 24 | ** are permitted provided that the following conditions are met: 25 | ** 1. Redistributions of source code must retain the above copyright notice, 26 | ** this list of conditions and the following disclaimer. 27 | ** 2. Redistributions in binary form must reproduce the above copyright notice, 28 | ** this list of conditions and the following disclaimer in the documentation 29 | ** and/or other materials provided with the distribution. 30 | ** 3. Neither the name of STMicroelectronics nor the names of its contributors 31 | ** may be used to endorse or promote products derived from this software 32 | ** without specific prior written permission. 33 | ** 34 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 35 | ** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 36 | ** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 37 | ** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 38 | ** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 39 | ** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 40 | ** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 41 | ** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 42 | ** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 43 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 44 | ** 45 | ** 46 | ***************************************************************************** 47 | */ 48 | 49 | /* Includes */ 50 | #include 51 | #include 52 | 53 | /* Variables */ 54 | extern int errno; 55 | register char * stack_ptr asm("sp"); 56 | 57 | /* Functions */ 58 | 59 | /** 60 | _sbrk 61 | Increase program data space. Malloc and related functions depend on this 62 | **/ 63 | void * _sbrk(int incr) 64 | { 65 | extern char end asm("end"); 66 | static char *heap_end; 67 | char *prev_heap_end; 68 | 69 | if (heap_end == 0) 70 | heap_end = &end; 71 | 72 | prev_heap_end = heap_end; 73 | if (heap_end + incr > stack_ptr) 74 | { 75 | errno = ENOMEM; 76 | return (void *) -1; 77 | } 78 | 79 | heap_end += incr; 80 | 81 | return (void *) prev_heap_end; 82 | } 83 | 84 | -------------------------------------------------------------------------------- /common/rth_types.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file rth_types.h 3 | * 4 | * @brief Contains the typedefs related to the RTH APIs 5 | * 6 | * @copyright 7 | * Copyright (c) Cirrus Logic 2022 All Rights Reserved, http://www.cirrus.com/ 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the License); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | */ 22 | #ifndef RTHTYPES_H 23 | #define RTHTYPES_H 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | /*********************************************************************************************************************** 29 | * INCLUDES 30 | **********************************************************************************************************************/ 31 | #include 32 | #include 33 | 34 | /*********************************************************************************************************************** 35 | * LITERALS & CONSTANTS 36 | **********************************************************************************************************************/ 37 | typedef struct 38 | { 39 | uint16_t duration; 40 | uint16_t level; 41 | uint16_t freq; 42 | bool chirp; 43 | bool half_cycles; 44 | } rth_pwle_section_t; 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #endif // RTHTYPES_H 51 | -------------------------------------------------------------------------------- /cs35l41/artifact_info.txt: -------------------------------------------------------------------------------- 1 | Artifact Info: 2 | Artifact : CS35L41 Alt-OS Driver: 4.24.2 - 13efce8883b6138d3a0f152fee4fc721c73d7f88 3 | Test Target MCU SDK: STM32Cube_FW_F4: 1.24.1 4 | Target toolchain : GNU Arm Embedded Toolchain: arm-none-eabi-gcc (Arm GNU Toolchain 13.2.rel1 (Build arm-13.7)) 13.2.1 20231009 5 | Build system : make: GNU Make 4.3 6 | OS : Linux: 5.14.0-503.35.1.el9_5.x86_64 7 | Shell : bash: GNU bash, version 5.1.8(1)-release (x86_64-redhat-linux-gnu) 8 | Host toolchain : MinGW GCC: gcc (GCC) 11.5.0 20240719 (Red Hat 11.5.0-5) 9 | Build Job : prince_alt_os_nightly: 1991 10 | Git SHA : 13efce8883b6138d3a0f152fee4fc721c73d7f88 11 | 12 | System resources: 13 | 14 | Build Configuration 1: 15 | 16 | Artifact filename : libcs35l41.a 17 | Driver TEXT : 7162 18 | Driver BSS : 0 19 | Driver DATA : 192 20 | Driver Max Stack : 192 (cs35l41_power -> cs35l41_wake -> cs35l41_restore -> cs35l41_write_post_boot_config -> regmap_write_array -> regmap_update_reg -> regmap_read -> uint32_t) 21 | 22 | Artifact filename : baremetal.elf 23 | Driver TEXT : 6556 24 | Driver BSS : 256 25 | Driver DATA : 192 26 | 27 | Artifact filename : cs35l41_cal_fw_img.o 28 | Driver TEXT : 888 29 | 30 | Artifact filename : cs35l41_fw_img.o 31 | Driver TEXT : 29936 32 | 33 | Artifact filename : cs35l41_tune_44p1_fw_img.o 34 | Driver TEXT : 248 35 | 36 | Artifact filename : cs35l41_tune_48_fw_img.o 37 | Driver TEXT : 248 38 | 39 | Artifact filename : cs35l41_tune_fw_img.o 40 | Driver TEXT : 3004 41 | 42 | Compiler flags: 43 | 44 | -------------------------------------------------------------------------------- /cs35l41/bsp/bsp_dut.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file bsp_dut.h 3 | * 4 | * @brief Functions and prototypes exported by the BSP module for the cs35l41 platform. 5 | * 6 | * @copyright 7 | * Copyright (c) Cirrus Logic 2021-2022 All Rights Reserved, http://www.cirrus.com/ 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the License); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | */ 22 | 23 | #ifndef BSP_DUT_H 24 | #define BSP_DUT_H 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /*********************************************************************************************************************** 31 | * INCLUDES 32 | **********************************************************************************************************************/ 33 | #include "bsp_driver_if.h" 34 | #include 35 | 36 | /*********************************************************************************************************************** 37 | * LITERALS & CONSTANTS 38 | **********************************************************************************************************************/ 39 | #define BSP_DUT_I2C_ADDRESS_8BIT (0x80) 40 | #define BSP_DUT_ID_LEFT (0x0) 41 | #define BSP_DUT_ID_RIGHT (0x1) 42 | 43 | /*********************************************************************************************************************** 44 | * MACROS 45 | **********************************************************************************************************************/ 46 | 47 | /*********************************************************************************************************************** 48 | * ENUMS, STRUCTS, UNIONS, TYPEDEFS 49 | **********************************************************************************************************************/ 50 | 51 | /*********************************************************************************************************************** 52 | * GLOBAL VARIABLES 53 | **********************************************************************************************************************/ 54 | 55 | /*********************************************************************************************************************** 56 | * API FUNCTIONS 57 | **********************************************************************************************************************/ 58 | uint32_t bsp_dut_initialize(void); 59 | uint32_t bsp_dut_reset(void); 60 | uint32_t bsp_dut_boot(bool cal_boot); 61 | uint32_t bsp_dut_calibrate(void); 62 | uint32_t bsp_dut_power_up(void); 63 | uint32_t bsp_dut_power_down(void); 64 | uint32_t bsp_dut_mute(bool is_mute); 65 | uint32_t bsp_dut_is_processing(bool *is_processing); 66 | uint32_t bsp_dut_hibernate(void); 67 | uint32_t bsp_dut_wake(void); 68 | uint32_t bsp_dut_get_id(uint8_t *id); 69 | uint32_t bsp_dut_set_dig_gain(float db); 70 | uint32_t bsp_dut_change_fs(uint32_t fs_hz); 71 | uint32_t bsp_dut_process(void); 72 | uint32_t bsp_dut_get_driver_handle(void **driver); 73 | 74 | /**********************************************************************************************************************/ 75 | #ifdef __cplusplus 76 | } 77 | #endif 78 | 79 | #endif // BSP_DUT_H 80 | -------------------------------------------------------------------------------- /cs35l41/config/cs35l41_fs_switch_syscfg.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file cs35l41_fs_switch_syscfg.c 3 | * 4 | * @brief Register values to be applied after CS35L41 Driver boot(). 5 | * 6 | * @copyright 7 | * Copyright (c) Cirrus Logic 2020-2021 All Rights Reserved, http://www.cirrus.com/ 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the License); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | */ 22 | /*********************************************************************************************************************** 23 | * INCLUDES 24 | **********************************************************************************************************************/ 25 | #include "cs35l41_fs_switch_syscfg.h" 26 | 27 | /*********************************************************************************************************************** 28 | * GLOBAL VARIABLES 29 | **********************************************************************************************************************/ 30 | const uint32_t cs35l41_fs_48kHz_syscfg[] = 31 | { 32 | 0x00002C04, 0x00000430, 33 | 0x00002C0C, 0x00000003, 34 | 0x00004804, 0x00000021, 35 | }; 36 | 37 | const uint32_t cs35l41_fs_44p1kHz_syscfg[] = 38 | { 39 | 0x00002C04, 0x000003F0, 40 | 0x00002C0C, 0x0000000B, 41 | 0x00004804, 0x0000001F, 42 | }; 43 | -------------------------------------------------------------------------------- /cs35l41/config/cs35l41_fs_switch_syscfg.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file cs35l41_fs_switch_syscfg.h 3 | * 4 | * @brief Register values to be applied after CS35L41 Driver boot(). 5 | * 6 | * @copyright 7 | * Copyright (c) Cirrus Logic 2020-2021 All Rights Reserved, http://www.cirrus.com/ 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the License); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | */ 22 | 23 | #ifndef CS35L41_FS_SWITCH_SYSCFG_H 24 | #define CS35L41_FS_SWITCH_SYSCFG_H 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /*********************************************************************************************************************** 31 | * INCLUDES 32 | **********************************************************************************************************************/ 33 | #include "stdint.h" 34 | #include "cs35l41_syscfg_regs.h" 35 | 36 | /*********************************************************************************************************************** 37 | * LITERALS & CONSTANTS 38 | **********************************************************************************************************************/ 39 | #define CS35L41_FS_48KHZ_SYSCFG_REGS_TOTAL (6) 40 | #define CS35L41_FS_44P1KHZ_SYSCFG_REGS_TOTAL (6) 41 | 42 | /*********************************************************************************************************************** 43 | * ENUMS, STRUCTS, UNIONS, TYPEDEFS 44 | **********************************************************************************************************************/ 45 | 46 | /*********************************************************************************************************************** 47 | * GLOBAL VARIABLES 48 | **********************************************************************************************************************/ 49 | extern const uint32_t cs35l41_fs_48kHz_syscfg[]; 50 | extern const uint32_t cs35l41_fs_44p1kHz_syscfg[]; 51 | 52 | #ifdef __cplusplus 53 | } 54 | #endif 55 | 56 | #endif // CS35L41_FS_SWITCH_SYSCFG_H 57 | 58 | -------------------------------------------------------------------------------- /cs35l41/config/cs35l41_sym.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * @file cs35l41_sym.h 4 | * 5 | * @brief Master table of known firmware symbols for the CS35L41 Driver module 6 | * 7 | * @copyright 8 | * Copyright (c) Cirrus Logic 2020, 2022 All Rights Reserved, http://www.cirrus.com/ 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the License); you may 11 | * not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 18 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | * 22 | * firmware_converter.py version: 3.0.0 23 | * Command: ..\..\tools\firmware_converter\firmware_converter.py --command fw_img_v1 --part cs35l41 --sym-input ..\cs35l41_sym.h --sym-output ..\cs35l41_sym.h --wmfw halo_cspl_RAM_revB2_29.33.0.wmfw 24 | * 25 | * 26 | */ 27 | 28 | #ifndef CS35L41_SYM_H 29 | #define CS35L41_SYM_H 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | /*********************************************************************************************************************** 36 | * LITERALS & CONSTANTS 37 | **********************************************************************************************************************/ 38 | 39 | /** 40 | * @defgroup CS35L41_ALGORITHMS 41 | * @brief Defines indicating presence of HALO Core Algorithms 42 | * 43 | * @{ 44 | */ 45 | #define CS35L41_ALGORITHM_FIRMWARE_HALO_CSPL 46 | #define CS35L41_ALGORITHM_CSPL 47 | /** @} */ 48 | 49 | /** 50 | * @defgroup CS35L41_SYM_ 51 | * @brief Single source of truth for firmware symbols known to the driver. 52 | * 53 | * @{ 54 | */ 55 | // FIRMWARE_HALO_CSPL 56 | #define CS35L41_SYM_FIRMWARE_HALO_CSPL_HALO_STATE (0x1) 57 | #define CS35L41_SYM_FIRMWARE_HALO_CSPL_HALO_HEARTBEAT (0x2) 58 | #define CS35L41_SYM_FIRMWARE_HALO_CSPL_HIBERNATE_WAKE_SOURCE (0x3) 59 | #define CS35L41_SYM_FIRMWARE_HALO_CSPL_HIBERNATE_WAKE_POLARITY (0x4) 60 | // CSPL 61 | #define CS35L41_SYM_CSPL_CSPL_STATE (0x5) 62 | #define CS35L41_SYM_CSPL_CSPL_TEMPERATURE (0x6) 63 | #define CS35L41_SYM_CSPL_CAL_R (0x7) 64 | #define CS35L41_SYM_CSPL_CAL_AMBIENT (0x8) 65 | #define CS35L41_SYM_CSPL_CAL_STATUS (0x9) 66 | #define CS35L41_SYM_CSPL_CAL_CHECKSUM (0xA) 67 | #define CS35L41_SYM_CSPL_CAL_R_SELECTED (0xB) 68 | #define CS35L41_SYM_CSPL_CAL_SET_STATUS (0xC) 69 | 70 | /** @} */ 71 | 72 | /**********************************************************************************************************************/ 73 | #ifdef __cplusplus 74 | } 75 | #endif 76 | 77 | #endif // CS35L41_SYM_H 78 | 79 | -------------------------------------------------------------------------------- /cs35l41/fw/Protect_Lite_cal_6.43.0_7.0ohm_delta1ohm_L41_revB2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CirrusLogic/mcu-drivers/91ee3d783221971d70a1351a28976a2cb62325b2/cs35l41/fw/Protect_Lite_cal_6.43.0_7.0ohm_delta1ohm_L41_revB2.bin -------------------------------------------------------------------------------- /cs35l41/fw/Protect_Lite_full_6.43.0_7.0ohm_delta1ohm_L41_revB2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CirrusLogic/mcu-drivers/91ee3d783221971d70a1351a28976a2cb62325b2/cs35l41/fw/Protect_Lite_full_6.43.0_7.0ohm_delta1ohm_L41_revB2.bin -------------------------------------------------------------------------------- /cs35l41/fw/cs35l41_tune_44p1_fw_img.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file cs35l41_tune_44p1_fw_img.c 3 | * 4 | * @brief CS35L41_TUNE_44P1 FW IMG Source File 5 | * 6 | * @copyright 7 | * Copyright (c) Cirrus Logic 2021 All Rights Reserved, http://www.cirrus.com/ 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the License); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | */ 22 | 23 | /*********************************************************************************************************************** 24 | * INCLUDES 25 | **********************************************************************************************************************/ 26 | #include "cs35l41_tune_44p1_fw_img.h" 27 | 28 | /*********************************************************************************************************************** 29 | * FW_IMG 30 | **********************************************************************************************************************/ 31 | 32 | /** 33 | * @defgroup CS35L41_TUNE_44P1_FW_IMG 34 | * @brief Firmware image 35 | * 36 | * @{ 37 | */ 38 | 39 | const uint8_t cs35l41_tune_44p1_fw_img[] = { 40 | // Header 41 | 0xFF,0x98,0xB9,0x54, // IMG_MAGIC_NUMBER_1 42 | 0x01,0x00,0x00,0x00, // IMG_FORMAT_REV 43 | 0xF8,0x00,0x00,0x00, // IMG_SIZE 44 | 0x00,0x00,0x00,0x00, // SYM_TABLE_SIZE 45 | 0x00,0x00,0x00,0x00, // ALG_LIST_SIZE 46 | 0xA4,0x00,0x04,0x00, // FW_ID 47 | 0x00,0x0D,0x00,0x00, // FW_VERSION 48 | 0x01,0x00,0x00,0x00, // DATA_BLOCKS 49 | // Symbol Linking Table 50 | // Algorithm ID List 51 | // Firmware Data 52 | 53 | // COEFF_DATA_BLOCKS_0 54 | 0xC8,0x00,0x00,0x00, // COEFF_BLOCK_SIZE_0_0 55 | 0xD0,0x01,0x40,0x03, // COEFF_BLOCK_ADDR_0_0 56 | 0x00,0x00,0x00,0x32,0x00,0x00,0x00,0x04,0x00,0x00,0x03,0x00,0x00,0x00,0x04,0xD4,0x00,0x00,0x00,0x4E,0x00,0x00,0x00,0x40, 57 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xAC,0x44,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x06, 58 | 0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x03, 59 | 0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00, 60 | 0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x11,0x00,0x00,0x00,0x00, 61 | 0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x11,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x05, 62 | 0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x04,0x00,0x23,0xFD,0x66, 63 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x04, 64 | 0x00,0x00,0x00,0x03,0x00,0xFF,0xFF,0xFF, 65 | 66 | // Footer 67 | 0xA6,0xE2,0x6B,0x93, // IMG_MAGIC_NUMBER_2 68 | 0x0F,0x0F,0xF0,0xF0, // IMG_CHECKSUM 69 | }; 70 | 71 | /** @} */ 72 | 73 | /**********************************************************************************************************************/ 74 | 75 | -------------------------------------------------------------------------------- /cs35l41/fw/cs35l41_tune_44p1_fw_img.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file cs35l41_tune_44p1_fw_img.h 3 | * 4 | * @brief CS35L41_TUNE_44P1 FW IMG Header File 5 | * 6 | * @copyright 7 | * Copyright (c) Cirrus Logic 2021 All Rights Reserved, http://www.cirrus.com/ 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the License); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | */ 22 | 23 | #ifndef CS35L41_TUNE_44P1_FW_IMG_H 24 | #define CS35L41_TUNE_44P1_FW_IMG_H 25 | 26 | /*********************************************************************************************************************** 27 | * INCLUDES 28 | **********************************************************************************************************************/ 29 | #include 30 | 31 | /*********************************************************************************************************************** 32 | * FW_IMG 33 | **********************************************************************************************************************/ 34 | 35 | extern const uint8_t cs35l41_tune_44p1_fw_img[]; 36 | 37 | /**********************************************************************************************************************/ 38 | 39 | #endif // CS35L41_TUNE_44P1_FW_IMG_H 40 | 41 | -------------------------------------------------------------------------------- /cs35l41/fw/cs35l41_tune_48_fw_img.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file cs35l41_tune_48_fw_img.c 3 | * 4 | * @brief CS35L41_TUNE_48 FW IMG Source File 5 | * 6 | * @copyright 7 | * Copyright (c) Cirrus Logic 2021 All Rights Reserved, http://www.cirrus.com/ 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the License); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | */ 22 | 23 | /*********************************************************************************************************************** 24 | * INCLUDES 25 | **********************************************************************************************************************/ 26 | #include "cs35l41_tune_48_fw_img.h" 27 | 28 | /*********************************************************************************************************************** 29 | * FW_IMG 30 | **********************************************************************************************************************/ 31 | 32 | /** 33 | * @defgroup CS35L41_TUNE_48_FW_IMG 34 | * @brief Firmware image 35 | * 36 | * @{ 37 | */ 38 | 39 | const uint8_t cs35l41_tune_48_fw_img[] = { 40 | // Header 41 | 0xFF,0x98,0xB9,0x54, // IMG_MAGIC_NUMBER_1 42 | 0x01,0x00,0x00,0x00, // IMG_FORMAT_REV 43 | 0xF8,0x00,0x00,0x00, // IMG_SIZE 44 | 0x00,0x00,0x00,0x00, // SYM_TABLE_SIZE 45 | 0x00,0x00,0x00,0x00, // ALG_LIST_SIZE 46 | 0xA4,0x00,0x04,0x00, // FW_ID 47 | 0x00,0x0D,0x00,0x00, // FW_VERSION 48 | 0x01,0x00,0x00,0x00, // DATA_BLOCKS 49 | // Symbol Linking Table 50 | // Algorithm ID List 51 | // Firmware Data 52 | 53 | // COEFF_DATA_BLOCKS_0 54 | 0xC8,0x00,0x00,0x00, // COEFF_BLOCK_SIZE_0_0 55 | 0xD0,0x01,0x40,0x03, // COEFF_BLOCK_ADDR_0_0 56 | 0x00,0x00,0x00,0x32,0x00,0x00,0x00,0x04,0x00,0x00,0x03,0x00,0x00,0x00,0x04,0xD4,0x00,0x00,0x00,0x4E,0x00,0x00,0x00,0x40, 57 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xBB,0x80,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x06, 58 | 0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x03, 59 | 0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00, 60 | 0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x11,0x00,0x00,0x00,0x00, 61 | 0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x11,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x05, 62 | 0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x04,0x00,0x23,0xFD,0x66, 63 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x04, 64 | 0x00,0x00,0x00,0x03,0x00,0xFF,0xFF,0xFF, 65 | 66 | // Footer 67 | 0xA6,0xE2,0x6B,0x93, // IMG_MAGIC_NUMBER_2 68 | 0x0F,0x0F,0xF0,0xF0, // IMG_CHECKSUM 69 | }; 70 | 71 | /** @} */ 72 | 73 | /**********************************************************************************************************************/ 74 | 75 | -------------------------------------------------------------------------------- /cs35l41/fw/cs35l41_tune_48_fw_img.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file cs35l41_tune_48_fw_img.h 3 | * 4 | * @brief CS35L41_TUNE_48 FW IMG Header File 5 | * 6 | * @copyright 7 | * Copyright (c) Cirrus Logic 2021 All Rights Reserved, http://www.cirrus.com/ 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the License); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | */ 22 | 23 | #ifndef CS35L41_TUNE_48_FW_IMG_H 24 | #define CS35L41_TUNE_48_FW_IMG_H 25 | 26 | /*********************************************************************************************************************** 27 | * INCLUDES 28 | **********************************************************************************************************************/ 29 | #include 30 | 31 | /*********************************************************************************************************************** 32 | * FW_IMG 33 | **********************************************************************************************************************/ 34 | 35 | extern const uint8_t cs35l41_tune_48_fw_img[]; 36 | 37 | /**********************************************************************************************************************/ 38 | 39 | #endif // CS35L41_TUNE_48_FW_IMG_H 40 | 41 | -------------------------------------------------------------------------------- /cs35l41/fw/halo_cspl_RAM_revB2_29.75.0.wmfw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CirrusLogic/mcu-drivers/91ee3d783221971d70a1351a28976a2cb62325b2/cs35l41/fw/halo_cspl_RAM_revB2_29.75.0.wmfw -------------------------------------------------------------------------------- /cs35l42/artifact_info.txt: -------------------------------------------------------------------------------- 1 | Artifact Info: 2 | Artifact : CS35L42 Alt-OS Driver: 4.24.2 - 13efce8883b6138d3a0f152fee4fc721c73d7f88 3 | Test Target MCU SDK: STM32Cube_FW_F4: 1.24.1 4 | Target toolchain : GNU Arm Embedded Toolchain: arm-none-eabi-gcc (Arm GNU Toolchain 13.2.rel1 (Build arm-13.7)) 13.2.1 20231009 5 | Build system : make: GNU Make 4.3 6 | OS : Linux: 5.14.0-503.35.1.el9_5.x86_64 7 | Shell : bash: GNU bash, version 5.1.8(1)-release (x86_64-redhat-linux-gnu) 8 | Host toolchain : MinGW GCC: gcc (GCC) 11.5.0 20240719 (Red Hat 11.5.0-5) 9 | Build Job : peart_a_alt_os_nightly: 962 10 | Git SHA : 13efce8883b6138d3a0f152fee4fc721c73d7f88 11 | 12 | System resources: 13 | 14 | Build Configuration 1: 15 | 16 | Artifact filename : libcs35l42.a 17 | Driver TEXT : 4848 18 | Driver BSS : 0 19 | Driver DATA : 120 20 | Driver Max Stack : 216 (cs35l42_power -> cs35l42_hibernate -> regmap_write_array -> regmap_update_reg -> regmap_read -> uint32_t) 21 | 22 | Artifact filename : freertos.elf 23 | Driver TEXT : 4302 24 | Driver BSS : 1044 25 | Driver DATA : 120 26 | 27 | Artifact filename : cs35l42_cal_fw_img.o 28 | Driver TEXT : 8564 29 | 30 | Artifact filename : cs35l42_fw_img.o 31 | Driver TEXT : 25512 32 | 33 | Compiler flags: 34 | 35 | -------------------------------------------------------------------------------- /cs35l42/bsp/bsp_dut.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file bsp_dut.h 3 | * 4 | * @brief Functions and prototypes exported by the BSP module for the cs35l42 platform. 5 | * 6 | * @copyright 7 | * Copyright (c) Cirrus Logic 2022 All Rights Reserved, http://www.cirrus.com/ 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the License); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | */ 22 | 23 | #ifndef BSP_DUT_H 24 | #define BSP_DUT_H 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /*********************************************************************************************************************** 31 | * INCLUDES 32 | **********************************************************************************************************************/ 33 | #include "bsp_driver_if.h" 34 | #include 35 | #include "platform_bsp.h" 36 | #include "cs35l42.h" 37 | #include "cs35l42_fw_img.h" 38 | #include "cs35l42_cal_fw_img.h" 39 | 40 | /*********************************************************************************************************************** 41 | * LITERALS & CONSTANTS 42 | **********************************************************************************************************************/ 43 | #define BSP_DUT_I2C_ADDRESS_8BIT (0x80) 44 | 45 | /*********************************************************************************************************************** 46 | * MACROS 47 | **********************************************************************************************************************/ 48 | 49 | /*********************************************************************************************************************** 50 | * ENUMS, STRUCTS, UNIONS, TYPEDEFS 51 | **********************************************************************************************************************/ 52 | 53 | /*********************************************************************************************************************** 54 | * GLOBAL VARIABLES 55 | **********************************************************************************************************************/ 56 | 57 | /*********************************************************************************************************************** 58 | * API FUNCTIONS 59 | **********************************************************************************************************************/ 60 | uint32_t bsp_dut_initialize(void); 61 | uint32_t bsp_dut_reset(void); 62 | uint32_t bsp_dut_boot(cs35l42_t *driver, 63 | fw_img_boot_state_t *boot_state, 64 | const uint8_t *fw_img, 65 | bool is_wmdr_only); 66 | uint32_t bsp_dut_power_up(void); 67 | uint32_t bsp_dut_power_down(void); 68 | uint32_t bsp_dut_hibernate(void); 69 | uint32_t bsp_dut_wake(void); 70 | uint32_t bsp_dut_set_dig_gain(float gain_db); 71 | uint32_t bsp_dut_mute(bool is_mute); 72 | uint32_t bsp_dut_calibrate(void); 73 | uint32_t bsp_dut_process(void); 74 | uint32_t bsp_dut_ping(void); 75 | uint32_t bsp_dut_get_driver_handle(void **driver); 76 | 77 | /**********************************************************************************************************************/ 78 | #ifdef __cplusplus 79 | } 80 | #endif 81 | 82 | #endif // BSP_DUT_H 83 | -------------------------------------------------------------------------------- /cs35l42/config/cs35l42_sym.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * @file cs35l42_sym.h 4 | * 5 | * @brief Master table of known firmware symbols for the CS35L42 Driver module 6 | * 7 | * @copyright 8 | * Copyright (c) Cirrus Logic 2022, 2024 All Rights Reserved, http://www.cirrus.com/ 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the License); you may 11 | * not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 18 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | * 22 | * firmware_converter.py SDK version: 4.12.0 - internal 23 | * Command: ../../tools/firmware_converter/firmware_converter.py fw_img_v2 cs35l42 CS35L42_L43_Rev7.13.1.wmfw 24 | * 25 | * 26 | */ 27 | 28 | #ifndef CS35L42_SYM_H 29 | #define CS35L42_SYM_H 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | /*********************************************************************************************************************** 36 | * LITERALS & CONSTANTS 37 | **********************************************************************************************************************/ 38 | 39 | /** 40 | * @defgroup CS35L42_ALGORITHMS 41 | * @brief Defines indicating presence of HALO Core Algorithms 42 | * 43 | * @{ 44 | */ 45 | #define CS35L42_ALGORITHM_FIRMWARE_PLAYBACK 46 | #define CS35L42_ALGORITHM_PM 47 | #define CS35L42_ALGORITHM_PROTECT_LITE 48 | /** @} */ 49 | 50 | /** 51 | * @defgroup CS35L42_SYM_ 52 | * @brief Single source of truth for firmware symbols known to the driver. 53 | * 54 | * @{ 55 | */ 56 | // FIRMWARE_PLAYBACK 57 | #define CS35L42_SYM_FIRMWARE_PLAYBACK_HALO_HEARTBEAT (0x01) 58 | // PM 59 | #define CS35L42_SYM_PM_PM_TIMER_TIMEOUT_TICKS (0x02) 60 | #define CS35L42_SYM_PM_PM_CUR_STATE (0x03) 61 | #define CS35L42_SYM_PM_POWER_ON_SEQUENCE (0x04) 62 | // PROTECT_LITE 63 | #define CS35L42_SYM_PROTECT_LITE_PROTECT_LITE_CTRL_PROTECT_LITE_ENABLE (0x05) 64 | #define CS35L42_SYM_PROTECT_LITE_PROTECT_LITE_CTRL_CALIBRATION_ENABLE (0x06) 65 | #define CS35L42_SYM_PROTECT_LITE_CALIB_DIAG_VAR_ARRAY_CAL_AMBIENT_TEMPERATURE (0x07) 66 | #define CS35L42_SYM_PROTECT_LITE_PROTECT_PILOT_TONE_PEART_CMPST_0_SINEGENERATORSENSE_0_THRESHOLD (0x08) 67 | #define CS35L42_SYM_PROTECT_LITE_R_CALIB_0_FIRST_RUN (0x09) 68 | #define CS35L42_SYM_PROTECT_LITE_RE_CALIB_SELECTOR_CMPST_0_RECALIBSELECTOR_0_SEL_RE_CAL (0x0a) 69 | #define CS35L42_SYM_PROTECT_LITE_VAR_ARRAY_IMPEDANCE_MEASURE_STATUS (0x0b) 70 | #define CS35L42_SYM_PROTECT_LITE_VAR_ARRAY_MEASURED_IMPEDANCE_CALIBRATION (0x0c) 71 | #define CS35L42_SYM_PROTECT_LITE_VAR_ARRAY_INITIAL_CALI_IMPEDANCE (0x0d) 72 | #define CS35L42_SYM_PROTECT_LITE_VAR_ARRAY_CHECK_SUM_CALIBRATION (0x0e) 73 | /** @} */ 74 | 75 | /**********************************************************************************************************************/ 76 | #ifdef __cplusplus 77 | } 78 | #endif 79 | 80 | #endif // CS35L42_SYM_H 81 | 82 | -------------------------------------------------------------------------------- /cs35l42/config/wisce_init.txt: -------------------------------------------------------------------------------- 1 | * ----- ------ -------------------- ------- --------- ------------------------------ 2 | * REG DATA ACCESS READ OR DEVICE 3 | * INDEX VALUE TYPE WRITE ADDRESS COMMENT (for information only) 4 | * ----- ------ -------------------- ------- --------- ------------------------------ 5 | 0x00002C04 0x00000430 SMbus_32inx_32dat Write 0x80 *REFCLK input enabled, BCLK = 3.072MHz 6 | 0x00002C0C 0x00000003 SMbus_32inx_32dat Write 0x80 *Device PCM (global) sample rate = 48 kHz 7 | 0x00004808 0x20200200 SMbus_32inx_32dat Write 0x80 *ASP format = I2S Mode, 32-bit wide slots 8 | 0x00004800 0x0003000F SMbus_32inx_32dat Write 0x80 *ASP_RX1 enabled (PCM input data), TX2 enabled IMON, TX1 VMON 9 | 10 | 0x0000242C 0x04000000 SMbus_32inx_32dat Write 0x80 *GP2_CTRL=INTb 11 | 12 | * DOUT to Hi-Z when unused 13 | 0x0000480C 0x00000001 SMbus_32inx_32dat Write 0x80 *dataif_ASP_CONTROL3(480CH): 0003 ASP_DOUT_HIZ_DLY=No additional delay in de-asserting TX data pin (DOUT) enable during unused timeslots, ASP_DOUT_HIZ_CTRL=Hi-Z during unused timeslots and while all transmit channels disabled 14 | 15 | 0x00002018 0x00003701 SMbus_32inx_32dat Write 0x80 *BLOCK_ENABLES -------------------------------------------------------------------------------- /cs35l42/cs35l42_ext.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file cs35l42_ext.c 3 | * 4 | * @brief The CS35L42 Driver Extended API module 5 | * 6 | * @copyright 7 | * Copyright (c) Cirrus Logic 2022 All Rights Reserved, http://www.cirrus.com/ 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the License); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | */ 22 | /*********************************************************************************************************************** 23 | * INCLUDES 24 | **********************************************************************************************************************/ 25 | #include 26 | #include "cs35l42_ext.h" 27 | 28 | /*********************************************************************************************************************** 29 | * LOCAL LITERAL SUBSTITUTIONS, TYPEDEFS 30 | **********************************************************************************************************************/ 31 | 32 | /*********************************************************************************************************************** 33 | * LOCAL VARIABLES 34 | **********************************************************************************************************************/ 35 | 36 | /*********************************************************************************************************************** 37 | * GLOBAL VARIABLES 38 | **********************************************************************************************************************/ 39 | 40 | /*********************************************************************************************************************** 41 | * LOCAL FUNCTIONS 42 | **********************************************************************************************************************/ 43 | 44 | /*********************************************************************************************************************** 45 | * API FUNCTIONS 46 | **********************************************************************************************************************/ 47 | 48 | /** 49 | * Set HW Digital Gain 50 | * 51 | */ 52 | uint32_t cs35l42_set_dig_gain(cs35l42_t *driver, uint32_t *gain) 53 | { 54 | uint32_t ret; 55 | regmap_cp_config_t *cp = REGMAP_GET_CP(driver); 56 | 57 | *gain <<= CS35L42_AMP_VOL_PCM_SHIFT; 58 | *gain &= CS35L42_AMP_VOL_PCM_MASK; 59 | 60 | ret = regmap_update_reg(cp, 61 | CS35L42_AMP_CTRL, 62 | CS35L42_AMP_VOL_PCM_MASK, 63 | *gain); 64 | 65 | return ret; 66 | } 67 | -------------------------------------------------------------------------------- /cs35l42/cs35l42_ext.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file cs35l42_ext.h 3 | * 4 | * @brief Functions and prototypes exported by the CS35L42 Driver Extended API module 5 | * 6 | * @copyright 7 | * Copyright (c) Cirrus Logic 2022 All Rights Reserved, http://www.cirrus.com/ 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the License); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | */ 22 | 23 | #ifndef CS35L42_EXT_H 24 | #define CS35L42_EXT_H 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /*********************************************************************************************************************** 31 | * INCLUDES 32 | **********************************************************************************************************************/ 33 | #include "cs35l42.h" 34 | 35 | /*********************************************************************************************************************** 36 | * LITERALS, CONSTANTS, MACROS 37 | **********************************************************************************************************************/ 38 | 39 | /*********************************************************************************************************************** 40 | * ENUMS, STRUCTS, UNIONS, TYPEDEFS 41 | **********************************************************************************************************************/ 42 | 43 | /*********************************************************************************************************************** 44 | * GLOBAL VARIABLES 45 | **********************************************************************************************************************/ 46 | 47 | /*********************************************************************************************************************** 48 | * API FUNCTIONS 49 | **********************************************************************************************************************/ 50 | 51 | /** 52 | * Set HW Digital Gain 53 | * 54 | * This will set the digital gain value. The 'gain' parameter will have range checking applied to it, but the only 55 | * correction will be masking to the size of the gain bitfield (11 bits). 56 | * 57 | * @param [in] driver Pointer to the driver state 58 | * @param [in,out] gain Pointer to integer gain value 59 | * 60 | * @return 61 | * - CS35L42_STATUS_FAIL if: 62 | * - Control port activity fails 63 | * - Gain is outside range 64 | * - CS35L42_STATUS_OK otherwise 65 | * 66 | */ 67 | uint32_t cs35l42_set_dig_gain(cs35l42_t *driver, uint32_t *gain); 68 | 69 | /**********************************************************************************************************************/ 70 | #ifdef __cplusplus 71 | } 72 | #endif 73 | 74 | #endif // CS35L42_EXT_H 75 | -------------------------------------------------------------------------------- /cs40l25/AN0511R1_CS40L25_MCU_Driver_User_Guide.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CirrusLogic/mcu-drivers/91ee3d783221971d70a1351a28976a2cb62325b2/cs40l25/AN0511R1_CS40L25_MCU_Driver_User_Guide.pdf -------------------------------------------------------------------------------- /cs40l25/artifact_info.txt: -------------------------------------------------------------------------------- 1 | Artifact Info: 2 | Artifact : CS40L25 Alt-OS Driver: 4.24.2 - 13efce8883b6138d3a0f152fee4fc721c73d7f88 3 | Test Target MCU SDK: STM32Cube_FW_F4: 1.24.1 4 | Target toolchain : GNU Arm Embedded Toolchain: arm-none-eabi-gcc (Arm GNU Toolchain 13.2.rel1 (Build arm-13.7)) 13.2.1 20231009 5 | Build system : make: GNU Make 4.3 6 | OS : Linux: 5.14.0-503.35.1.el9_5.x86_64 7 | Shell : bash: GNU bash, version 5.1.8(1)-release (x86_64-redhat-linux-gnu) 8 | Host toolchain : MinGW GCC: gcc (GCC) 11.5.0 20240719 (Red Hat 11.5.0-5) 9 | Build Job : princeh_alt_os_nightly: 1741 10 | Git SHA : 13efce8883b6138d3a0f152fee4fc721c73d7f88 11 | 12 | System resources: 13 | 14 | Build Configuration 1: 15 | 16 | Artifact filename : libcs40l25.a 17 | Driver TEXT : 6532 18 | Driver BSS : 0 19 | Driver DATA : 168 20 | Driver Max Stack : 176 (cs40l25_power -> cs40l25_power_down -> cs40l25_write_acked_fw_control -> regmap_write_acked_fw_control -> regmap_write_acked_reg -> regmap_read -> GET_BYTE_FROM_WORD) 21 | 22 | Artifact filename : baremetal.elf 23 | Driver TEXT : 6134 24 | Driver BSS : 780 25 | Driver DATA : 168 26 | 27 | Artifact filename : cs40l25_cal_fw_img.o 28 | Driver TEXT : 9892 29 | 30 | Artifact filename : cs40l25_fw_img.o 31 | Driver TEXT : 30064 32 | 33 | Compiler flags: 34 | 35 | -------------------------------------------------------------------------------- /cs40l25/bsp/bsp_dut.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file bsp_dut.h 3 | * 4 | * @brief Functions and prototypes exported by the BSP module for the cs40l25 platform. 5 | * 6 | * @copyright 7 | * Copyright (c) Cirrus Logic 2021 All Rights Reserved, http://www.cirrus.com/ 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the License); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | */ 22 | 23 | #ifndef BSP_DUT_H 24 | #define BSP_DUT_H 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /*********************************************************************************************************************** 31 | * INCLUDES 32 | **********************************************************************************************************************/ 33 | #include "bsp_driver_if.h" 34 | #include 35 | 36 | /*********************************************************************************************************************** 37 | * LITERALS & CONSTANTS 38 | **********************************************************************************************************************/ 39 | #define BSP_DUT_I2C_ADDRESS_8BIT (0x80) 40 | 41 | #define BSP_DUT_TRIGGER_HAPTIC_POWER_ON (0xFF) 42 | 43 | /*********************************************************************************************************************** 44 | * MACROS 45 | **********************************************************************************************************************/ 46 | 47 | /*********************************************************************************************************************** 48 | * ENUMS, STRUCTS, UNIONS, TYPEDEFS 49 | **********************************************************************************************************************/ 50 | 51 | /*********************************************************************************************************************** 52 | * GLOBAL VARIABLES 53 | **********************************************************************************************************************/ 54 | 55 | /*********************************************************************************************************************** 56 | * API FUNCTIONS 57 | **********************************************************************************************************************/ 58 | uint32_t bsp_dut_initialize(void); 59 | uint32_t bsp_dut_reset(void); 60 | uint32_t bsp_dut_boot(bool cal_boot); 61 | uint32_t bsp_dut_calibrate(void); 62 | uint32_t bsp_dut_power_up(void); 63 | uint32_t bsp_dut_power_down(void); 64 | uint32_t bsp_dut_hibernate(void); 65 | uint32_t bsp_dut_wake(void); 66 | uint32_t bsp_dut_start_i2s(void); 67 | uint32_t bsp_dut_stop_i2s(void); 68 | uint32_t bsp_dut_trigger_haptic(uint8_t waveform, uint32_t duration_ms); 69 | uint32_t bsp_dut_has_processed(bool *has_processed); 70 | uint32_t bsp_dut_update_haptic_config(uint8_t config_index); 71 | uint32_t bsp_dut_enable_haptic_processing(bool enable); 72 | uint32_t bsp_dut_dynamic_calibrate(void); 73 | uint32_t bsp_dut_process(void); 74 | 75 | uint32_t bsp_dut_enable_vamp(bool is_enabled); 76 | uint32_t bsp_dut_discharge_vamp(void); 77 | uint32_t bsp_dut_trigger_gpio1(uint32_t duration_ms); 78 | 79 | /**********************************************************************************************************************/ 80 | #ifdef __cplusplus 81 | } 82 | #endif 83 | 84 | #endif // BSP_DUT_H 85 | -------------------------------------------------------------------------------- /cs40l25/bsp/vregmap.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file vregmap.h 3 | * 4 | * @brief 5 | * Virtual regmap interface. 6 | * 7 | * @copyright 8 | * Copyright (c) Cirrus Logic 2021 All Rights Reserved, http://www.cirrus.com/ 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the License); you may 11 | * not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 18 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | * 22 | */ 23 | #ifndef VREGMAP_H 24 | #define VREGMAP_H 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /*********************************************************************************************************************** 31 | * INCLUDES 32 | **********************************************************************************************************************/ 33 | #include "regmap.h" 34 | 35 | /*********************************************************************************************************************** 36 | * LITERALS & CONSTANTS 37 | **********************************************************************************************************************/ 38 | #define VREGMAP_LENGTH_REGS (2) 39 | #define VREGMAP_BRIDGE_DEVICE_ID "VREGS" 40 | #define VREGMAP_BRIDGE_DEV_NAME "VREGS-1" 41 | 42 | /*********************************************************************************************************************** 43 | * MACROS 44 | **********************************************************************************************************************/ 45 | 46 | /*********************************************************************************************************************** 47 | * ENUMS, STRUCTS, UNIONS, TYPEDEFS 48 | **********************************************************************************************************************/ 49 | 50 | /*********************************************************************************************************************** 51 | * GLOBAL VARIABLES 52 | **********************************************************************************************************************/ 53 | extern const regmap_cp_config_t vregmap_cp; 54 | extern regmap_virtual_register_t vregmap[VREGMAP_LENGTH_REGS]; 55 | 56 | /*********************************************************************************************************************** 57 | * API FUNCTIONS 58 | **********************************************************************************************************************/ 59 | 60 | /**********************************************************************************************************************/ 61 | #ifdef __cplusplus 62 | } 63 | #endif 64 | 65 | #endif // VREGMAP_H 66 | 67 | -------------------------------------------------------------------------------- /cs40l25/config/cs40l25_cal_sym.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * @file cs40l25_cal_sym.h 4 | * 5 | * @brief Master table of known firmware symbols for the CS40L25_CAL Driver module 6 | * 7 | * @copyright 8 | * Copyright (c) Cirrus Logic 2020 All Rights Reserved, http://www.cirrus.com/ 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the License); you may 11 | * not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 18 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | * 22 | * firmware_converter.py version: 3.0.0 23 | * Command: ..\..\tools\firmware_converter\firmware_converter.py --command fw_img_v1 --part cs40l25 --suffix cal --sym-input ..\cs40l25_cal_sym.h --sym-output ..\cs40l25_cal_sym.h --wmfw prince_haptics_ctrl_ram_remap_calib_0A0101.wmfw 24 | * 25 | * 26 | */ 27 | 28 | #ifndef CS40L25_CAL_SYM_H 29 | #define CS40L25_CAL_SYM_H 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | /*********************************************************************************************************************** 36 | * LITERALS & CONSTANTS 37 | **********************************************************************************************************************/ 38 | 39 | /** 40 | * @defgroup CS40L25_CAL_ALGORITHMS 41 | * @brief Defines indicating presence of HALO Core Algorithms 42 | * 43 | * @{ 44 | */ 45 | #define CS40L25_CAL_ALGORITHM_FIRMWARE_PRINCE_HAPCTRL_RAM_REMAP_CALIB 46 | #define CS40L25_CAL_ALGORITHM_F0_TRACKING 47 | #define CS40L25_CAL_ALGORITHM_Q_ESTIMATION 48 | /** @} */ 49 | 50 | /** 51 | * @defgroup CS40L25_CAL_SYM_ 52 | * @brief Single source of truth for firmware symbols known to the driver. 53 | * 54 | * @{ 55 | */ 56 | // FIRMWARE 57 | #define CS40L25_CAL_SYM_FIRMWARE_HALO_STATE (0x1) 58 | #define CS40L25_CAL_SYM_FIRMWARE_HALO_HEARTBEAT (0x2) 59 | #define CS40L25_CAL_SYM_FIRMWARE_SHUTDOWNREQUEST (0x3) 60 | // F0_TRACKING 61 | #define CS40L25_CAL_SYM_F0_TRACKING_F0 (0x4) 62 | #define CS40L25_CAL_SYM_F0_TRACKING_CLOSED_LOOP (0x5) 63 | #define CS40L25_CAL_SYM_F0_TRACKING_REDC (0x6) 64 | #define CS40L25_CAL_SYM_F0_TRACKING_F0_TRACKING_ENABLE (0x7) 65 | #define CS40L25_CAL_SYM_F0_TRACKING_MAXBACKEMF (0x8) 66 | // Q_ESTIMATION 67 | #define CS40L25_CAL_SYM_Q_ESTIMATION_Q_EST (0x9) 68 | 69 | /** @} */ 70 | 71 | /**********************************************************************************************************************/ 72 | #ifdef __cplusplus 73 | } 74 | #endif 75 | 76 | #endif // CS40L25_CAL_SYM_H 77 | 78 | -------------------------------------------------------------------------------- /cs40l25/config/cs40l25_sym.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * @file cs40l25_sym.h 4 | * 5 | * @brief Master table of known firmware symbols for the CS40L25 Driver module 6 | * 7 | * @copyright 8 | * Copyright (c) Cirrus Logic 2020 All Rights Reserved, http://www.cirrus.com/ 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the License); you may 11 | * not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 18 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | * 22 | * firmware_converter.py version: 3.0.0 23 | * Command: ..\..\tools\firmware_converter\firmware_converter.py --command fw_img_v1 --part cs40l25 --sym-input ..\cs40l25_sym.h --sym-output ..\cs40l25_sym.h --generic-sym --wmfw prince_haptics_ctrl_ram_remap_clab_0A0101.wmfw --wmdr default_wt.bin 24 | * 25 | * 26 | */ 27 | 28 | #ifndef CS40L25_SYM_H 29 | #define CS40L25_SYM_H 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | /*********************************************************************************************************************** 36 | * LITERALS & CONSTANTS 37 | **********************************************************************************************************************/ 38 | 39 | /** 40 | * @defgroup CS40L25_ALGORITHMS 41 | * @brief Defines indicating presence of HALO Core Algorithms 42 | * 43 | * @{ 44 | */ 45 | #define CS40L25_ALGORITHM_FIRMWARE 46 | #define CS40L25_ALGORITHM_VIBEGEN 47 | #define CS40L25_ALGORITHM_CLAB 48 | #define CS40L25_ALGORITHM_DVL 49 | /** @} */ 50 | 51 | /** 52 | * @defgroup CS40L25_SYM_ 53 | * @brief Single source of truth for firmware symbols known to the driver. 54 | * 55 | * @{ 56 | */ 57 | // FIRMWARE 58 | #define CS40L25_SYM_FIRMWARE_HALO_STATE (0x1) 59 | #define CS40L25_SYM_FIRMWARE_HALO_HEARTBEAT (0x2) 60 | #define CS40L25_SYM_FIRMWARE_EVENTCONTROL (0x3) 61 | #define CS40L25_SYM_FIRMWARE_GPIO1EVENT (0x4) 62 | #define CS40L25_SYM_FIRMWARE_GPIO2EVENT (0x5) 63 | #define CS40L25_SYM_FIRMWARE_GPIO3EVENT (0x6) 64 | #define CS40L25_SYM_FIRMWARE_GPIO4EVENT (0x7) 65 | #define CS40L25_SYM_FIRMWARE_GPIOPLAYBACKEVENT (0x8) 66 | #define CS40L25_SYM_FIRMWARE_TRIGGERPLAYBACKEVENT (0x9) 67 | #define CS40L25_SYM_FIRMWARE_RXREADYEVENT (0xa) 68 | #define CS40L25_SYM_FIRMWARE_ACTIVETOSTANDBYEVENT (0xb) 69 | #define CS40L25_SYM_FIRMWARE_HARDWAREEVENT (0xc) 70 | #define CS40L25_SYM_FIRMWARE_INDEXBUTTONPRESS (0xd) 71 | #define CS40L25_SYM_FIRMWARE_INDEXBUTTONRELEASE (0xe) 72 | #define CS40L25_SYM_FIRMWARE_GPIO_BUTTONDETECT (0xf) 73 | #define CS40L25_SYM_FIRMWARE_GAIN_CONTROL (0x10) 74 | #define CS40L25_SYM_FIRMWARE_GPIO_ENABLE (0x11) 75 | #define CS40L25_SYM_FIRMWARE_POWERSTATE (0x12) 76 | #define CS40L25_SYM_FIRMWARE_POWERONSEQUENCE (0x13) 77 | #define CS40L25_SYM_FIRMWARE_USER_CONTROL_IPDATA (0x14) 78 | #define CS40L25_SYM_FIRMWARE_F0_STORED (0x15) 79 | #define CS40L25_SYM_FIRMWARE_REDC_STORED (0x16) 80 | #define CS40L25_SYM_FIRMWARE_IRQMASKSEQUENCE (0x17) 81 | #define CS40L25_SYM_FIRMWARE_IRQMASKSEQUENCE_VALID (0x18) 82 | #define CS40L25_SYM_FIRMWARE_Q_STORED (0x19) 83 | #define CS40L25_SYM_FIRMWARE_FEATURE_BITMAP (0x1a) 84 | #define CS40L25_SYM_FIRMWARE_USE_EXT_BOOST (0x1b) 85 | #define CS40L25_SYM_FIRMWARE_GPI_PLAYBACK_DELAY (0x1c) 86 | // VIBEGEN 87 | #define CS40L25_SYM_VIBEGEN_TIMEOUT_MS (0x1d) 88 | #define CS40L25_SYM_VIBEGEN_COMPENSATION_ENABLE (0x1e) 89 | // CLAB 90 | #define CS40L25_SYM_CLAB_CLAB_ENABLED (0x1f) 91 | #define CS40L25_SYM_CLAB_PEAK_AMPLITUDE_CONTROL (0x20) 92 | // DVL 93 | #define CS40L25_SYM_DVL_EN (0x101) 94 | #define CS40L25_SYM_DVL_GAINLIMITERCOEF (0x102) 95 | #define CS40L25_SYM_DVL_LRAOVERMAX (0x103) 96 | #define CS40L25_SYM_DVL_LRASAT (0x104) 97 | #define CS40L25_SYM_DVL_MAGRELCOEF (0x105) 98 | // DYNAMIC_F0 99 | #define CS40L25_SYM_DYNAMIC_F0_DYNAMIC_F0_ENABLED (0x201) 100 | #define CS40L25_SYM_DYNAMIC_F0_DYN_F0_TABLE (0x202) 101 | #define CS40L25_SYM_DYNAMIC_F0_DYNAMIC_REDC (0x203) 102 | /** @} */ 103 | 104 | /**********************************************************************************************************************/ 105 | #ifdef __cplusplus 106 | } 107 | #endif 108 | 109 | #endif // CS40L25_SYM_H 110 | 111 | -------------------------------------------------------------------------------- /cs40l25/fw/default_clab.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CirrusLogic/mcu-drivers/91ee3d783221971d70a1351a28976a2cb62325b2/cs40l25/fw/default_clab.bin -------------------------------------------------------------------------------- /cs40l25/fw/default_wt.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CirrusLogic/mcu-drivers/91ee3d783221971d70a1351a28976a2cb62325b2/cs40l25/fw/default_wt.bin -------------------------------------------------------------------------------- /cs40l25/fw/dvl.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CirrusLogic/mcu-drivers/91ee3d783221971d70a1351a28976a2cb62325b2/cs40l25/fw/dvl.bin -------------------------------------------------------------------------------- /cs40l25/fw/prince_haptics_ctrl_ram_remap_a2h_0A0603.wmfw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CirrusLogic/mcu-drivers/91ee3d783221971d70a1351a28976a2cb62325b2/cs40l25/fw/prince_haptics_ctrl_ram_remap_a2h_0A0603.wmfw -------------------------------------------------------------------------------- /cs40l25/fw/prince_haptics_ctrl_ram_remap_calib_0A0603.wmfw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CirrusLogic/mcu-drivers/91ee3d783221971d70a1351a28976a2cb62325b2/cs40l25/fw/prince_haptics_ctrl_ram_remap_calib_0A0603.wmfw -------------------------------------------------------------------------------- /cs40l25/fw/prince_haptics_ctrl_ram_remap_clab_0A0402.wmfw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CirrusLogic/mcu-drivers/91ee3d783221971d70a1351a28976a2cb62325b2/cs40l25/fw/prince_haptics_ctrl_ram_remap_clab_0A0402.wmfw -------------------------------------------------------------------------------- /cs40l25/fw/prince_haptics_ctrl_ram_remap_clab_0A0603.wmfw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CirrusLogic/mcu-drivers/91ee3d783221971d70a1351a28976a2cb62325b2/cs40l25/fw/prince_haptics_ctrl_ram_remap_clab_0A0603.wmfw -------------------------------------------------------------------------------- /cs40l25/fw/prince_haptics_ctrl_ram_remap_df0_clab_0A0603.wmfw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CirrusLogic/mcu-drivers/91ee3d783221971d70a1351a28976a2cb62325b2/cs40l25/fw/prince_haptics_ctrl_ram_remap_df0_clab_0A0603.wmfw -------------------------------------------------------------------------------- /cs40l25/fw/prince_haptics_ctrl_ram_remap_ext_boost_0A0603.wmfw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CirrusLogic/mcu-drivers/91ee3d783221971d70a1351a28976a2cb62325b2/cs40l25/fw/prince_haptics_ctrl_ram_remap_ext_boost_0A0603.wmfw -------------------------------------------------------------------------------- /cs40l25/fw/prince_haptics_ctrl_ram_remap_pwle_reg_0A0603.wmfw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CirrusLogic/mcu-drivers/91ee3d783221971d70a1351a28976a2cb62325b2/cs40l25/fw/prince_haptics_ctrl_ram_remap_pwle_reg_0A0603.wmfw -------------------------------------------------------------------------------- /cs40l26/artifact_info.txt: -------------------------------------------------------------------------------- 1 | Artifact Info: 2 | Artifact : CS40L26 Alt-OS Driver: 4.24.2 - 13efce8883b6138d3a0f152fee4fc721c73d7f88 3 | Test Target MCU SDK: STM32Cube_FW_F4: 1.24.1 4 | Target toolchain : GNU Arm Embedded Toolchain: arm-none-eabi-gcc (Arm GNU Toolchain 13.2.rel1 (Build arm-13.7)) 13.2.1 20231009 5 | Build system : make: GNU Make 4.3 6 | OS : Linux: 5.14.0-503.35.1.el9_5.x86_64 7 | Shell : bash: GNU bash, version 5.1.8(1)-release (x86_64-redhat-linux-gnu) 8 | Host toolchain : MinGW GCC: gcc (GCC) 11.5.0 20240719 (Red Hat 11.5.0-5) 9 | Build Job : peart_h_alt_os_nightly: 1153 10 | Git SHA : 13efce8883b6138d3a0f152fee4fc721c73d7f88 11 | 12 | System resources: 13 | 14 | Build Configuration 1: 15 | 16 | Artifact filename : libcs40l26.a 17 | Driver TEXT : 6664 18 | Driver BSS : 12 19 | Driver DATA : 195 20 | Driver Max Stack : 176 (cs40l26_power -> cs40l26_allow_hibernate -> regmap_write_array -> regmap_update_reg -> regmap_read -> GET_BYTE_FROM_WORD) 21 | 22 | Artifact filename : baremetal.elf 23 | Driver TEXT : 5426 24 | Driver BSS : 1060 25 | Driver DATA : 72 26 | 27 | Artifact filename : cs40l26_cal_fw_img.o 28 | Driver TEXT : 19580 29 | 30 | Artifact filename : cs40l26_fw_img.o 31 | Driver TEXT : 22772 32 | 33 | Compiler flags: 34 | 35 | -------------------------------------------------------------------------------- /cs40l26/bsp/bsp_dut.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file bsp_dut.h 3 | * 4 | * @brief Functions and prototypes exported by the BSP module for the cs40l26 platform. 5 | * 6 | * @copyright 7 | * Copyright (c) Cirrus Logic 2021-2023 All Rights Reserved, http://www.cirrus.com/ 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the License); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | */ 22 | 23 | #ifndef BSP_DUT_H 24 | #define BSP_DUT_H 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /*********************************************************************************************************************** 31 | * INCLUDES 32 | **********************************************************************************************************************/ 33 | #include "bsp_driver_if.h" 34 | #include "cs40l26_ext.h" 35 | #include 36 | 37 | /*********************************************************************************************************************** 38 | * LITERALS & CONSTANTS 39 | **********************************************************************************************************************/ 40 | #define BSP_DUT_I2C_ADDRESS_8BIT (0x80) 41 | 42 | #define BSP_DUT_TRIGGER_HAPTIC_POWER_ON (0xFF) 43 | 44 | /*********************************************************************************************************************** 45 | * MACROS 46 | **********************************************************************************************************************/ 47 | 48 | /*********************************************************************************************************************** 49 | * ENUMS, STRUCTS, UNIONS, TYPEDEFS 50 | **********************************************************************************************************************/ 51 | 52 | /*********************************************************************************************************************** 53 | * GLOBAL VARIABLES 54 | **********************************************************************************************************************/ 55 | extern bool bsp_processing_haptic; 56 | extern bool bsp_hibernation; 57 | 58 | /*********************************************************************************************************************** 59 | * API FUNCTIONS 60 | **********************************************************************************************************************/ 61 | uint32_t bsp_dut_initialize(void); 62 | uint32_t bsp_dut_reset(void); 63 | uint32_t bsp_dut_pre_boot(void); 64 | uint32_t bsp_dut_boot(bool cal_boot); 65 | uint32_t bsp_dut_load_wavetable(void); 66 | uint32_t bsp_dut_calibrate(void); 67 | uint32_t bsp_dut_power_up(void); 68 | uint32_t bsp_dut_power_down(void); 69 | uint32_t bsp_dut_hibernate(void); 70 | uint32_t bsp_dut_wake(void); 71 | uint32_t bsp_dut_start_i2s(void); 72 | uint32_t bsp_dut_stop_i2s(void); 73 | uint32_t bsp_dut_trigger_haptic(uint8_t waveform, cs40l26_wavetable_bank_t bank); 74 | uint32_t bsp_dut_buzzgen_set(uint16_t freq, uint16_t level, 75 | uint16_t duration, uint8_t buzzgen_num); 76 | uint32_t bsp_dut_trigger_rth_pwle(bool is_simple, rth_pwle_section_t **pwle_data, uint8_t num_sections, uint8_t repeat); 77 | uint32_t bsp_dut_trigger_rth_pcm(uint8_t *pcm_data, uint32_t num_sections, uint16_t buffer, uint16_t f0, uint16_t redc); 78 | uint32_t bsp_dut_has_processed(bool *has_processed); 79 | uint32_t bsp_dut_enable_haptic_processing(bool enable); 80 | uint32_t bsp_dut_owt_upload_effect(uint32_t *effect, uint8_t size); 81 | uint32_t bsp_dut_owt_reset_table(void); 82 | uint32_t bsp_dut_dynamic_calibrate(uint8_t index); 83 | uint32_t bsp_dut_process(void); 84 | uint32_t bsp_dut_configure_gpi_mute(uint8_t gpi, bool level); 85 | uint32_t bsp_dut_enable_gpi_mute(bool enable); 86 | uint32_t bsp_dut_configure_gpi(uint8_t gpi); 87 | 88 | /**********************************************************************************************************************/ 89 | #ifdef __cplusplus 90 | } 91 | #endif 92 | 93 | #endif // BSP_DUT_H 94 | -------------------------------------------------------------------------------- /cs40l26/bsp/cs40l26_altos_bridge.xml: -------------------------------------------------------------------------------- 1 | 2 | 24 | 25 | 40260100 26 | cs40l26_altos_bridge 27 | cs40l26_altos_bridge 28 | 29 | 30 | CS40L26 31 | CS40L26-1 32 | 33 | 34 | I2C 35 | 0x80 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /cs40l26/config/cs40l26_cal_sym.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * @file cs40l26_sym.h 4 | * 5 | * @brief Master table of known firmware symbols for the CS40L26 Driver module 6 | * 7 | * @copyright 8 | * Copyright (c) Cirrus Logic 2022 All Rights Reserved, http://www.cirrus.com/ 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the License); you may 11 | * not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 18 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | * 22 | * firmware_converter.py SDK version: 4.8.0 - internal 23 | * Command: ../../tools/firmware_converter/firmware_converter.py fw_img_v2 cs40l26 CS40L26_Rev7.2.15.wmfw --generic-sym --wmdr FW_ROM_wavetable.bin 24 | * 25 | * 26 | */ 27 | 28 | #ifndef CS40L26_CAL_SYM_H 29 | #define CS40L26_CAL_SYM_H 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | /*********************************************************************************************************************** 36 | * LITERALS & CONSTANTS 37 | **********************************************************************************************************************/ 38 | 39 | /** 40 | * @defgroup CS40L26_ALGORITHMS 41 | * @brief Defines indicating presence of HALO Core Algorithms 42 | * 43 | * @{ 44 | */ 45 | #define CS40L26_CAL_ALGORITHM_FIRMWARE_CS40L26 46 | #define CS40L26_CAL_ALGORITHM_A2H 47 | #define CS40L26_CAL_ALGORITHM_DYNAMIC_F0 48 | #define CS40L26_CAL_ALGORITHM_BUZZGEN 49 | #define CS40L26_CAL_ALGORITHM_EVENT_HANDLER 50 | #define CS40L26_CAL_ALGORITHM_VIBEGEN 51 | #define CS40L26_CAL_ALGORITHM_SVC 52 | #define CS40L26_CAL_ALGORITHM_GPIO 53 | #define CS40L26_CAL_ALGORITHM_MDSYNC 54 | #define CS40L26_CAL_ALGORITHM_PM 55 | #define CS40L26_CAL_ALGORITHM_MAILBOX 56 | #define CS40L26_CAL_ALGORITHM_FW_RAM_EXT 57 | #define CS40L26_CAL_ALGORITHM_HAPTICS_LOGGER 58 | #define CS40L26_CAL_ALGORITHM_EVENT_LOGGER 59 | /** @} */ 60 | 61 | /** 62 | * @defgroup CS40L26_SYM_ 63 | * @brief Single source of truth for firmware symbols known to the driver. 64 | * 65 | * @{ 66 | */ 67 | // FIRMWARE_CS40L26 68 | #define CS40L26_CAL_SYM_FIRMWARE_CS40L26_HALO_STATE (0x2) 69 | #define CS40L26_CAL_SYM_FIRMWARE_CS40L26_HALO_HEARTBEAT (0x3) 70 | #define CS40L26_CAL_SYM_FIRMWARE_CS40L26_CALL_RAM_INIT (0x12) 71 | // DYNAMIC_F0 72 | #define CS40L26_CAL_SYM_DYNAMIC_F0_DYNAMIC_F0_ENABLED (0x5e) 73 | #define CS40L26_CAL_SYM_DYNAMIC_F0_DYN_F0_TABLE (0x62) 74 | // MAILBOX 75 | #define CS40L26_CAL_SYM_MAILBOX_QUEUE_BASE (0x17e) 76 | #define CS40L26_CAL_SYM_MAILBOX_QUEUE_LEN (0x17f) 77 | #define CS40L26_CAL_SYM_MAILBOX_QUEUE_WT (0x180) 78 | #define CS40L26_CAL_SYM_MAILBOX_QUEUE_RD (0x181) 79 | #define CS40L26_CAL_SYM_MAILBOX_STATUS (0x182) 80 | // PM 81 | #define CS40L26_CAL_SYM_PM_PM_TIMER_TIMEOUT_TICKS (0x276) 82 | #define CS40L26_CAL_SYM_PM_PM_CUR_STATE (0x277) 83 | #define CS40L26_CAL_SYM_PM_POWER_ON_SEQUENCE (0x231) 84 | /** @} */ 85 | 86 | /**********************************************************************************************************************/ 87 | #ifdef __cplusplus 88 | } 89 | #endif 90 | 91 | #endif // CS40L26_CAL_SYM_H 92 | 93 | -------------------------------------------------------------------------------- /cs40l26/config/cs40l26_sym.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * @file cs40l26_sym.h 4 | * 5 | * @brief Master table of known firmware symbols for the CS40L26 Driver module 6 | * 7 | * @copyright 8 | * Copyright (c) Cirrus Logic 2021-2023 All Rights Reserved, http://www.cirrus.com/ 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the License); you may 11 | * not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 18 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | * 22 | * firmware_converter.py SDK version: 4.8.0 - internal 23 | * Command: ../../tools/firmware_converter/firmware_converter.py fw_img_v2 cs40l26 CS40L26_Rev7.2.15.wmfw --generic-sym --wmdr FW_ROM_wavetable.bin 24 | * 25 | * 26 | */ 27 | 28 | #ifndef CS40L26_SYM_H 29 | #define CS40L26_SYM_H 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | /*********************************************************************************************************************** 36 | * LITERALS & CONSTANTS 37 | **********************************************************************************************************************/ 38 | 39 | /** 40 | * @defgroup CS40L26_ALGORITHMS 41 | * @brief Defines indicating presence of HALO Core Algorithms 42 | * 43 | * @{ 44 | */ 45 | #define CS40L26_ALGORITHM_FIRMWARE_CS40L26 46 | #define CS40L26_ALGORITHM_A2H 47 | #define CS40L26_ALGORITHM_DYNAMIC_F0 48 | #define CS40L26_ALGORITHM_BUZZGEN 49 | #define CS40L26_ALGORITHM_EVENT_HANDLER 50 | #define CS40L26_ALGORITHM_VIBEGEN 51 | #define CS40L26_ALGORITHM_SVC 52 | #define CS40L26_ALGORITHM_GPIO 53 | #define CS40L26_ALGORITHM_MDSYNC 54 | #define CS40L26_ALGORITHM_PM 55 | #define CS40L26_ALGORITHM_MAILBOX 56 | #define CS40L26_ALGORITHM_FW_RAM_EXT 57 | #define CS40L26_ALGORITHM_HAPTICS_LOGGER 58 | #define CS40L26_ALGORITHM_EVENT_LOGGER 59 | /** @} */ 60 | 61 | /** 62 | * @defgroup CS40L26_SYM_ 63 | * @brief Single source of truth for firmware symbols known to the driver. 64 | * 65 | * @{ 66 | */ 67 | // FIRMWARE_CS40L26 68 | #define CS40L26_SYM_FIRMWARE_HALO_STATE (0x2) 69 | #define CS40L26_SYM_FIRMWARE_HALO_HEARTBEAT (0x3) 70 | // BUZZGEN 71 | #define CS40L26_SYM_BUZZGEN_BUZZ_EFFECTS1_BUZZ_FREQ (0x1d) 72 | // VIBEGEN 73 | #define CS40L26_SYM_VIBEGEN_NUM_OF_WAVES (0x3e) 74 | #define CS40L26_SYM_VIBEGEN_COMPENSATION_ENABLE (0x44) 75 | #define CS40L26_SYM_VIBEGEN_WAVE_XM_TABLE (0x45) 76 | #define CS40L26_SYM_VIBEGEN_OWT_SIZE_XM (0x47) 77 | #define CS40L26_SYM_VIBEGEN_OWT_NEXT_XM (0x48) 78 | // DYNAMIC_F0 79 | #define CS40L26_SYM_DYNAMIC_F0_DYNAMIC_F0_ENABLED (0x17) 80 | #define CS40L26_SYM_DYNAMIC_F0_IMONRINGPPTHRESHOLD (0x18) 81 | #define CS40L26_SYM_DYNAMIC_F0_FRME_SKIP (0x19) 82 | #define CS40L26_SYM_DYNAMIC_F0_NUM_PEAKS_TOFIND (0x1a) 83 | #define CS40L26_SYM_DYNAMIC_F0_DYN_F0_TABLE (0x1b) 84 | // GPIO 85 | #define CS40L26_SYM_GPIO_GPI_ENABLE_BITMASK (0x161) 86 | #define CS40L26_SYM_GPIO_GPO_ENABLE_BITMASK (0x162) 87 | // PM 88 | #define CS40L26_SYM_PM_PM_TIMER_TIMEOUT_TICKS (0x16f) 89 | #define CS40L26_SYM_PM_PM_CUR_STATE (0x170) 90 | #define CS40L26_SYM_PM_POWER_ON_SEQUENCE (0x173) 91 | // MAILBOX 92 | #define CS40L26_SYM_MAILBOX_QUEUE_WT (0x179) 93 | #define CS40L26_SYM_MAILBOX_QUEUE_RD (0x17a) 94 | // FW_RAM_EXT 95 | #define CS40L26_SYM_FW_RAM_EXT_GPI_PMIC_MUTE_ENABLE (0x18b) 96 | // A2H 97 | #define CS40L26_SYM_A2H_A2HEN (0x1bf) 98 | /** @} */ 99 | 100 | /**********************************************************************************************************************/ 101 | #ifdef __cplusplus 102 | } 103 | #endif 104 | 105 | #endif // CS40L26_SYM_H 106 | 107 | -------------------------------------------------------------------------------- /cs40l26/config/wisce_init.txt: -------------------------------------------------------------------------------- 1 | * ----- ------ -------------------- ------- --------- ------------------------------ 2 | * REG DATA ACCESS READ OR DEVICE 3 | * INDEX VALUE TYPE WRITE ADDRESS COMMENT (for information only) 4 | * ----- ------ -------------------- ------- --------- ------------------------------ 5 | 6 | 0x4808 0x20000000 SMbus_32inx_32dat rmodw 0x80 0xFF000000 * Set ASP_RX_WIDTH to 0x20 (32-bit) 7 | -------------------------------------------------------------------------------- /cs40l26/fw/cs40l26_waveform.h: -------------------------------------------------------------------------------- 1 | /**5 2 | * @file cs40l26_waveform.h 3 | * 4 | * @brief CS40L26 FW IMG Header File 5 | * 6 | * @copyright 7 | * Copyright (c) Cirrus Logic 2023 All Rights Reserved, http://www.cirrus.com/ 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the License); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | */ 22 | 23 | #ifndef CS40L26_WAVEFORM_H 24 | #define CS40L26_WAVEFORM_H 25 | 26 | /*********************************************************************************************************************** 27 | * INCLUDES 28 | **********************************************************************************************************************/ 29 | #include 30 | 31 | /*********************************************************************************************************************** 32 | * WAVEFORM 33 | **********************************************************************************************************************/ 34 | 35 | extern const uint8_t cs40l26_waveform[]; 36 | 37 | /**********************************************************************************************************************/ 38 | 39 | #endif // CS40L26_WAVEFORM_H 40 | 41 | -------------------------------------------------------------------------------- /cs40l26/fw/cs40l26_wt.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CirrusLogic/mcu-drivers/91ee3d783221971d70a1351a28976a2cb62325b2/cs40l26/fw/cs40l26_wt.bin -------------------------------------------------------------------------------- /cs40l26/fw/tuning.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CirrusLogic/mcu-drivers/91ee3d783221971d70a1351a28976a2cb62325b2/cs40l26/fw/tuning.bin -------------------------------------------------------------------------------- /cs40l50/artifact_info.txt: -------------------------------------------------------------------------------- 1 | Artifact Info: 2 | Artifact : CS40L50 Alt-OS Driver: 4.24.2 - 13efce8883b6138d3a0f152fee4fc721c73d7f88 3 | Test Target MCU SDK: STM32Cube_FW_F4: 1.24.1 4 | Target toolchain : GNU Arm Embedded Toolchain: arm-none-eabi-gcc (Arm GNU Toolchain 13.2.rel1 (Build arm-13.7)) 13.2.1 20231009 5 | Build system : make: GNU Make 4.3 6 | OS : Linux: 5.14.0-503.35.1.el9_5.x86_64 7 | Shell : bash: GNU bash, version 5.1.8(1)-release (x86_64-redhat-linux-gnu) 8 | Host toolchain : MinGW GCC: gcc (GCC) 11.5.0 20240719 (Red Hat 11.5.0-5) 9 | Build Job : jamerson_h_alt_os_nightly: 837 10 | Git SHA : 13efce8883b6138d3a0f152fee4fc721c73d7f88 11 | 12 | System resources: 13 | 14 | Build Configuration 1: 15 | 16 | Artifact filename : libcs40l50.a 17 | Driver TEXT : 3124 18 | Driver BSS : 4 19 | Driver DATA : 596 20 | Driver Max Stack : 136 (cs40l50_power -> cs40l50_prevent_hibernate -> cs40l50_pm_state_transition -> regmap_write_acked_reg -> regmap_read -> GET_BYTE_FROM_WORD) 21 | 22 | Artifact filename : baremetal.elf 23 | Driver TEXT : 1592 24 | Driver BSS : 88 25 | Driver DATA : 188 26 | 27 | Artifact filename : cs40l50_firmware.o 28 | Driver TEXT : 8428 29 | 30 | Compiler flags: 31 | 32 | -------------------------------------------------------------------------------- /cs40l50/baremetal/main.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file main.c 3 | * 4 | * @brief The main function for CS40L50 System Test Harness 5 | * 6 | * @copyright 7 | * Copyright (c) Cirrus Logic 2025 All Rights Reserved, http://www.cirrus.com/ 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the License); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | */ 22 | /*********************************************************************************************************************** 23 | * INCLUDES 24 | **********************************************************************************************************************/ 25 | #include "platform_bsp.h" 26 | #include 27 | #include 28 | 29 | /*********************************************************************************************************************** 30 | * LOCAL FUNCTIONS 31 | **********************************************************************************************************************/ 32 | void app_bsp_callback(uint32_t status, void *arg) 33 | { 34 | if (status == BSP_STATUS_FAIL) 35 | { 36 | exit(1); 37 | } 38 | 39 | return; 40 | } 41 | 42 | /*********************************************************************************************************************** 43 | * API FUNCTIONS 44 | **********************************************************************************************************************/ 45 | 46 | /** 47 | * @brief The Main Entry Point from __main 48 | * By this time, the RAM RW-Data section has been initialized by the ARM-provided __main function. 49 | * 50 | * @return N/A (does not return) 51 | */ 52 | int main(void) 53 | { 54 | int ret_val = 0; 55 | 56 | bsp_initialize(app_bsp_callback, NULL); 57 | bsp_dut_initialize(); 58 | bsp_dut_reset(); 59 | 60 | bsp_set_ld2(BSP_LD2_MODE_ON, 0); 61 | bsp_dut_trigger_haptic(0, ROM_BANK); 62 | 63 | while (1) 64 | { 65 | 66 | if (bsp_was_pb_pressed(BSP_PB_ID_USER)) 67 | { 68 | bsp_dut_trigger_haptic(0, ROM_BANK); 69 | } 70 | 71 | bsp_sleep(); 72 | } 73 | 74 | exit(1); 75 | 76 | return ret_val; 77 | } 78 | -------------------------------------------------------------------------------- /cs40l50/bsp/bsp_dut.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file bsp_dut.h 3 | * 4 | * @brief Functions and prototypes exported by the BSP module for the cs35l56 platform. 5 | * 6 | * @copyright 7 | * Copyright (c) Cirrus Logic 2022-2024 All Rights Reserved, http://www.cirrus.com/ 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the License); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | */ 22 | 23 | #ifndef HW_0_BSP_DUT_H 24 | #define HW_0_BSP_DUT_H 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /*********************************************************************************************************************** 31 | * INCLUDES 32 | **********************************************************************************************************************/ 33 | #include "bsp_driver_if.h" 34 | #include "cs40l50.h" 35 | #include 36 | 37 | /*********************************************************************************************************************** 38 | * LITERALS & CONSTANTS 39 | **********************************************************************************************************************/ 40 | #define BSP_DUT_I2C_ADDRESS_8BIT (0x68) 41 | 42 | /*********************************************************************************************************************** 43 | * MACROS 44 | **********************************************************************************************************************/ 45 | 46 | /*********************************************************************************************************************** 47 | * ENUMS, STRUCTS, UNIONS, TYPEDEFS 48 | **********************************************************************************************************************/ 49 | 50 | /*********************************************************************************************************************** 51 | * GLOBAL VARIABLES 52 | **********************************************************************************************************************/ 53 | 54 | /*********************************************************************************************************************** 55 | * API FUNCTIONS 56 | **********************************************************************************************************************/ 57 | uint32_t bsp_dut_initialize(void); 58 | uint32_t bsp_dut_reset(void); 59 | uint32_t bsp_dut_boot(void); 60 | uint32_t bsp_dut_process(void); 61 | uint32_t bsp_dut_calibrate(void); 62 | uint32_t bsp_dut_timeout_ticks_set(uint32_t ms); 63 | uint32_t bsp_dut_hibernate(void); 64 | uint32_t bsp_dut_wake(void); 65 | uint32_t bsp_dut_set_click_compensation(bool f0_enable, bool redc_enable); 66 | uint32_t bsp_dut_set_broadcast_en(bool enable); 67 | uint32_t bsp_dut_configure_gpio_trigger(cs40l50_gpio_bank_t gpio, bool rth, 68 | uint8_t attenuation, bool ram, uint8_t plybck_index); 69 | uint32_t bsp_dut_dynamic_f0_set_enable(bool enable); 70 | uint32_t bsp_dut_trigger_haptic(uint8_t waveform, cs40l50_wavetable_bank_t bank); 71 | uint32_t bsp_dut_trigger_rth_pwle(bool is_simple, rth_pwle_section_t **pwle_data, uint8_t num_sections, uint8_t repeat); 72 | uint32_t bsp_dut_trigger_rth_pcm(uint8_t *pcm_data, uint32_t num_sections, uint16_t buffer, uint16_t f0, uint16_t redc); 73 | uint32_t bsp_dut_dynamic_calibrate(uint8_t index); 74 | 75 | /**********************************************************************************************************************/ 76 | #ifdef __cplusplus 77 | } 78 | #endif 79 | 80 | #endif // HW_0_BSP_DUT_H 81 | -------------------------------------------------------------------------------- /cs40l50/config/cs40l50_sym.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * @file cs40l50_sym.h 4 | * 5 | * @brief Master table of known firmware symbols for the CS40L50 Driver module 6 | * 7 | * @copyright 8 | * Copyright (c) Cirrus Logic 2022 All Rights Reserved, http://www.cirrus.com/ 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the License); you may 11 | * not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 18 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | * 22 | * firmware_converter.py version: 3.0.0 23 | * Command: ..\..\tools\firmware_converter\firmware_converter.py --command fw_img_v1 --part cs40l50 --sym-input ..\cs40l50_sym.h --sym-output ..\cs40l50_sym.h --generic-sym --wmfw prince_haptics_ctrl_ram_remap_clab_0A0101.wmfw --wmdr default_wt.bin 24 | * 25 | * 26 | */ 27 | 28 | #ifndef CS40L50_SYM_H 29 | #define CS40L50_SYM_H 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | /*********************************************************************************************************************** 36 | * LITERALS & CONSTANTS 37 | **********************************************************************************************************************/ 38 | 39 | /** 40 | * @defgroup CS40L50_ALGORITHMS 41 | * @brief Defines indicating presence of HALO Core Algorithms 42 | * 43 | * @{ 44 | */ 45 | /** @} */ 46 | 47 | /** 48 | * @defgroup CS40L50_SYM_ 49 | * @brief Single source of truth for firmware symbols known to the driver. 50 | * 51 | * @{ 52 | */ 53 | /** @} */ 54 | 55 | /**********************************************************************************************************************/ 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | 60 | #endif // CS40L50_SYM_H 61 | 62 | -------------------------------------------------------------------------------- /cs40l50/fw/CS40L50_Rev3.4.8.wmfw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CirrusLogic/mcu-drivers/91ee3d783221971d70a1351a28976a2cb62325b2/cs40l50/fw/CS40L50_Rev3.4.8.wmfw -------------------------------------------------------------------------------- /cs40l50/fw/cs40l50_wt.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CirrusLogic/mcu-drivers/91ee3d783221971d70a1351a28976a2cb62325b2/cs40l50/fw/cs40l50_wt.bin -------------------------------------------------------------------------------- /cs47l15/artifact_info.txt: -------------------------------------------------------------------------------- 1 | Artifact Info: 2 | Artifact : CS47L15 Alt-OS Driver: 4.24.2 - 13efce8883b6138d3a0f152fee4fc721c73d7f88 3 | Test Target MCU SDK: STM32Cube_FW_F4: 1.24.1 4 | Target toolchain : GNU Arm Embedded Toolchain: arm-none-eabi-gcc (Arm GNU Toolchain 13.2.rel1 (Build arm-13.7)) 13.2.1 20231009 5 | Build system : make: GNU Make 4.3 6 | OS : Linux: 5.14.0-503.35.1.el9_5.x86_64 7 | Shell : bash: GNU bash, version 5.1.8(1)-release (x86_64-redhat-linux-gnu) 8 | Host toolchain : MinGW GCC: gcc (GCC) 11.5.0 20240719 (Red Hat 11.5.0-5) 9 | Build Job : gaines_alt_os_nightly: 1380 10 | Git SHA : 13efce8883b6138d3a0f152fee4fc721c73d7f88 11 | 12 | System resources: 13 | 14 | Build Configuration 1: 15 | 16 | Artifact filename : libcs47l15.a 17 | Driver TEXT : 5768 18 | Driver BSS : 0 19 | Driver DATA : 56 20 | Driver Max Stack : 224 (cs47l15_fll_config -> cs47l15_set_fll_refclk -> cs47l15_apply_config_fll -> cs47l15_write_fll -> cs47l15_update_reg -> regmap_update_reg -> regmap_read -> GET_BYTE_FROM_WORD) 21 | 22 | Artifact filename : baremetal.elf 23 | Driver TEXT : 5094 24 | Driver BSS : 228 25 | Driver DATA : 56 26 | 27 | Artifact filename : cs47l15_fw_img.o 28 | Driver TEXT : 50644 29 | 30 | Compiler flags: 31 | 32 | -------------------------------------------------------------------------------- /cs47l15/bsp/bsp_dut.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file bsp_dut.h 3 | * 4 | * @brief Functions and prototypes exported by the BSP module for the cs47l15 platform. 5 | * 6 | * @copyright 7 | * Copyright (c) Cirrus Logic 2021 All Rights Reserved, http://www.cirrus.com/ 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the License); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | */ 22 | 23 | #ifndef BSP_DUT_H 24 | #define BSP_DUT_H 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /*********************************************************************************************************************** 31 | * INCLUDES 32 | **********************************************************************************************************************/ 33 | #include "bsp_driver_if.h" 34 | #include 35 | 36 | /*********************************************************************************************************************** 37 | * LITERALS & CONSTANTS 38 | **********************************************************************************************************************/ 39 | #define BSP_DUT_I2C_ADDRESS_8BIT (0x80) 40 | 41 | #define BSP_DUT_TRIGGER_HAPTIC_POWER_ON (0xFF) 42 | 43 | // data length read from array with padding, should be multiple of 4 44 | #define BSP_DUT_BUFFER_SIZE 24572 45 | /*********************************************************************************************************************** 46 | * MACROS 47 | **********************************************************************************************************************/ 48 | #define BSP_USE_CASE_TG_HP_EN (0x0) 49 | #define BSP_USE_CASE_TG_HP_DIS (0x1) 50 | #define BSP_USE_CASE_MP3_441K_INIT (0x2) 51 | #define BSP_USE_CASE_MP3_48K_INIT (0x3) 52 | #define BSP_USE_CASE_MP3_PROCESS (0x4) 53 | #define BSP_USE_CASE_MP3_DONE (0x5) 54 | 55 | /*********************************************************************************************************************** 56 | * ENUMS, STRUCTS, UNIONS, TYPEDEFS 57 | **********************************************************************************************************************/ 58 | 59 | /*********************************************************************************************************************** 60 | * GLOBAL VARIABLES 61 | **********************************************************************************************************************/ 62 | 63 | /*********************************************************************************************************************** 64 | * API FUNCTIONS 65 | **********************************************************************************************************************/ 66 | uint32_t bsp_dut_initialize(void); 67 | uint32_t bsp_dut_reset(void); 68 | uint32_t bsp_dut_boot(); 69 | uint32_t bsp_dut_use_case(uint32_t use_case); 70 | uint32_t bsp_dut_process(void); 71 | 72 | /**********************************************************************************************************************/ 73 | #ifdef __cplusplus 74 | } 75 | #endif 76 | 77 | #endif // BSP_DUT_H 78 | -------------------------------------------------------------------------------- /cs47l15/config/cs47l15_sym.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * @file cs47l15_sym.h 4 | * 5 | * @brief Master table of known firmware symbols for the CS47L15 Driver module 6 | * 7 | * @copyright 8 | * Copyright (c) Cirrus Logic 2020 All Rights Reserved, http://www.cirrus.com/ 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the License); you may 11 | * not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 18 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | * 22 | */ 23 | 24 | #ifndef CS47L15_SYM_H 25 | #define CS47L15_SYM_H 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | /*********************************************************************************************************************** 32 | * LITERALS & CONSTANTS 33 | **********************************************************************************************************************/ 34 | 35 | /** 36 | * @defgroup CS47L15_ALGORITHMS 37 | * @brief Defines indicating presence of HALO Core Algorithms 38 | * 39 | * @{ 40 | */ 41 | #define CS47L15_ALGORITHM_FIRMWARE 42 | #define CS47L15_ALGORITHM_EG_ALGORITHM 43 | 44 | #define CS47L15_ALGORITHM_MP3_DEC 45 | /** @} */ 46 | 47 | /** 48 | * @defgroup CS47L15_SYM_ 49 | * @brief Single source of truth for firmware symbols known to the driver. 50 | * 51 | * @{ 52 | */ 53 | // FIRMWARE 54 | #define CS47L15_SYM_FIRMWARE_SYSTEM_CONFIG_XM_STRUCT_T (0x1) 55 | #define CS47L15_SYM_FIRMWARE_SYS_ENABLE (0x2) 56 | #define CS47L15_SYM_FIRMWARE_PLUGIN_VISIBLE_FIRMWARE_ID (0x3) 57 | #define CS47L15_SYM_FIRMWARE_PLUGIN_VISIBLE_FIRMWARE_VERSION (0x4) 58 | #define CS47L15_SYM_FIRMWARE_ADSP2_STATE (0x5) 59 | #define CS47L15_SYM_FIRMWARE_ADSP2_WATCHDOG (0x6) 60 | #define CS47L15_SYM_FIRMWARE_DMA_BUFFER_SIZE (0x7) 61 | #define CS47L15_SYM_FIRMWARE_RDMA_CONTROL_TABLE (0x8) 62 | #define CS47L15_SYM_FIRMWARE_WDMA_CONTROL_TABLE (0x9) 63 | #define CS47L15_SYM_FIRMWARE_BUILD_JOB_NAME (0xa) 64 | #define CS47L15_SYM_FIRMWARE_BUILD_JOB_NUMBER (0xb) 65 | #define CS47L15_SYM_FIRMWARE_SYSTEM_CONFIG_ZM_STRUCT_T (0xc) 66 | #define CS47L15_SYM_FIRMWARE_MAX_SYSTEM_GAIN (0xd) 67 | // EG_ALGORITHM 68 | #define CS47L15_SYM_EG_ALGORITHM_EG_ALGORITHM_XM_STRUCT_T (0x1001) 69 | #define CS47L15_SYM_EG_ALGORITHM_EG_ALGORITHM_ENABLE (0x1002) 70 | #define CS47L15_SYM_EG_ALGORITHM_DUMMY_XM_CONFIG (0x1003) 71 | #define CS47L15_SYM_EG_ALGORITHM_EG_ALGORITHM_YM_STRUCT_T (0x1004) 72 | #define CS47L15_SYM_EG_ALGORITHM_DUMMY_YM_CONFIG (0x1005) 73 | #define CS47L15_SYM_EG_ALGORITHM_EG_ALGORITHM_ZM_STRUCT_T (0x1006) 74 | #define CS47L15_SYM_EG_ALGORITHM_EG_ALGORITHM_GAIN (0x1007) 75 | // MP3_DEC 76 | #define CS47L15_SYM_MP3_DEC_MP3_DEC_XM_STRUCT_T (0x2001) 77 | #define CS47L15_SYM_MP3_DEC_RING_BUFF_ADDRESS (0x2002) 78 | #define CS47L15_SYM_MP3_DEC_NO_OF_CHANNELS (0x2003) 79 | #define CS47L15_SYM_MP3_DEC_BITRATE (0x2004) 80 | #define CS47L15_SYM_MP3_DEC_SAMPLE_RATE (0x2005) 81 | #define CS47L15_SYM_MP3_DEC_HIGH_WATERMARK_LEVEL_PERCENTAGE (0x2006) 82 | #define CS47L15_SYM_MP3_DEC_PLAY_CONTROL (0x2007) 83 | #define CS47L15_SYM_MP3_DEC_MP3_DEC_YM_STRUCT_T (0x2008) 84 | #define CS47L15_SYM_MP3_DEC_MP3_DEC_ZM_STRUCT_T (0x2009) 85 | 86 | /** @} */ 87 | 88 | /**********************************************************************************************************************/ 89 | #ifdef __cplusplus 90 | } 91 | #endif 92 | 93 | #endif // CS47L15_SYM_H 94 | 95 | -------------------------------------------------------------------------------- /cs47l15/config/wisce_init.txt: -------------------------------------------------------------------------------- 1 | 0x100 0x0041 4wireSPI_32inx_16dat Write 0x00 * Clock_32k_1(100H): 0041 CLK_32K_ENA=1, CLK_32K_SRC=MCLK2 (direct) 2 | 0x171 0x0002 4wireSPI_32inx_16dat Write 0x00 * FLL1_Control_1(171H): 0000 FLL1_FREERUN=1, FLL1_ENA=0 3 | 0x101 0x0404 4wireSPI_32inx_16dat Write 0x00 * System_Clock_1(101H): 0444 SYSCLK_FRAC=SYSCLK is a multiple of 6.144MHz, SYSCLK_FREQ=98.304MHz (90.3168MHz), SYSCLK_ENA=0, SYSCLK_SRC=FLL1 4 | 0x102 0x0003 4wireSPI_32inx_16dat Write 0x00 * Sample_rate_1(102H): 0003 SAMPLE_RATE_1=48kHz 5 | 0x122 0x24DD 4wireSPI_32inx_16dat Write 0x00 * DSP_Clock_2(122H): 24DD DSP_CLK_FREQ=147.45MHz 6 | 0x218 0x81A4 4wireSPI_32inx_16dat Write 0x00 * Mic_Bias_Ctrl_1(218H): 81A4 MICB1_EXT_CAP=1, MICB1_LVL=2.8V, MICB1_RATE=Fast start-up / shut-down, MICB1_DISCH=MICBIAS1 discharged when disabled, MICB1_BYPASS=0, MICB1_ENA=0 7 | 0x310 0x0C80 4wireSPI_32inx_16dat Write 0x00 * IN1L_Control(310H): 0C80 IN1L_HPF=0, IN1_DMIC_SUP=MICBIAS1, IN1_MODE=Digital input, IN1L_PGA_VOL=0dB 8 | -------------------------------------------------------------------------------- /cs47l15/fw/gaines_mp3_decoder_000001.wmfw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CirrusLogic/mcu-drivers/91ee3d783221971d70a1351a28976a2cb62325b2/cs47l15/fw/gaines_mp3_decoder_000001.wmfw -------------------------------------------------------------------------------- /cs47l15/fw/gaines_passthru_030500.wmfw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CirrusLogic/mcu-drivers/91ee3d783221971d70a1351a28976a2cb62325b2/cs47l15/fw/gaines_passthru_030500.wmfw -------------------------------------------------------------------------------- /cs47l15/mp3_test_01_441.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file mp3_test_01.h 3 | * 4 | * @brief CS47L15 test chirp stereo signal in mp3 format at 44.1kHz sampling header 5 | * 6 | * @copyright 7 | * Copyright (c) Cirrus Logic 2020 All Rights Reserved, http://www.cirrus.com/ 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the License); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | */ 22 | 23 | #ifndef CS47L15_MP3_TEST_CHIRP_441 24 | #define CS47L15_MP3_TEST_CHIRP_441 25 | 26 | /*********************************************************************************************************************** 27 | * INCLUDES 28 | **********************************************************************************************************************/ 29 | #include 30 | 31 | /*********************************************************************************************************************** 32 | * MP3_TEST_CHIRP 33 | **********************************************************************************************************************/ 34 | 35 | extern const uint8_t mp3_test_01_mp3_441[]; 36 | extern const uint32_t mp3_test_01_mp3_441_len; 37 | 38 | /**********************************************************************************************************************/ 39 | 40 | #endif // CS47L15_MP3_TEST_CHIRP -------------------------------------------------------------------------------- /cs47l15/mp3_test_01_48.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file mp3_test_01.h 3 | * 4 | * @brief CS47L15 test chirp stereo signal in mp3 format at 48kHz sampling header 5 | * 6 | * @copyright 7 | * Copyright (c) Cirrus Logic 2020 All Rights Reserved, http://www.cirrus.com/ 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the License); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | */ 22 | 23 | #ifndef CS47L15_MP3_TEST_CHIRP_48 24 | #define CS47L15_MP3_TEST_CHIRP_48 25 | 26 | /*********************************************************************************************************************** 27 | * INCLUDES 28 | **********************************************************************************************************************/ 29 | #include 30 | 31 | /*********************************************************************************************************************** 32 | * MP3_TEST_CHIRP 33 | **********************************************************************************************************************/ 34 | 35 | extern const uint8_t mp3_test_01_mp3_48[]; 36 | extern const uint32_t mp3_test_01_mp3_48_len; 37 | 38 | /**********************************************************************************************************************/ 39 | 40 | #endif // CS47L15_MP3_TEST_CHIRP -------------------------------------------------------------------------------- /cs47l35/artifact_info.txt: -------------------------------------------------------------------------------- 1 | Artifact Info: 2 | Artifact : CS47L35 Alt-OS Driver: 4.24.2 - 13efce8883b6138d3a0f152fee4fc721c73d7f88 3 | Test Target MCU SDK: STM32Cube_FW_F4: 1.24.1 4 | Target toolchain : GNU Arm Embedded Toolchain: arm-none-eabi-gcc (Arm GNU Toolchain 13.2.rel1 (Build arm-13.7)) 13.2.1 20231009 5 | Build system : make: GNU Make 4.3 6 | OS : Linux: 5.14.0-503.35.1.el9_5.x86_64 7 | Shell : bash: GNU bash, version 5.1.8(1)-release (x86_64-redhat-linux-gnu) 8 | Host toolchain : MinGW GCC: gcc (GCC) 11.5.0 20240719 (Red Hat 11.5.0-5) 9 | Build Job : marley_alt_os_nightly: 1270 10 | Git SHA : 13efce8883b6138d3a0f152fee4fc721c73d7f88 11 | 12 | System resources: 13 | 14 | Build Configuration 1: 15 | 16 | Artifact filename : libcs47l35.a 17 | Driver TEXT : 5858 18 | Driver BSS : 0 19 | Driver DATA : 48 20 | Driver Max Stack : 216 (cs47l35_fll_config -> cs47l35_set_fll_refclk -> cs47l35_apply_config_fll -> cs47l35_write_fll -> cs47l35_update_reg -> regmap_update_reg -> regmap_read -> GET_BYTE_FROM_WORD) 21 | 22 | Artifact filename : baremetal.elf 23 | Driver TEXT : 5324 24 | Driver BSS : 136 25 | Driver DATA : 48 26 | 27 | Artifact filename : cs47l35_dsp2_fw_img.o 28 | Driver TEXT : 129500 29 | 30 | Artifact filename : cs47l35_dsp3_fw_img.o 31 | Driver TEXT : 120516 32 | 33 | Compiler flags: 34 | 35 | -------------------------------------------------------------------------------- /cs47l35/bsp/bsp_dut.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file bsp_dut.h 3 | * 4 | * @brief Functions and prototypes exported by the BSP module for the cs47l35 platform. 5 | * 6 | * @copyright 7 | * Copyright (c) Cirrus Logic 2021 All Rights Reserved, http://www.cirrus.com/ 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the License); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | */ 22 | 23 | #ifndef BSP_DUT_H 24 | #define BSP_DUT_H 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /*********************************************************************************************************************** 31 | * INCLUDES 32 | **********************************************************************************************************************/ 33 | #include "bsp_driver_if.h" 34 | #include 35 | 36 | /*********************************************************************************************************************** 37 | * LITERALS & CONSTANTS 38 | **********************************************************************************************************************/ 39 | #define BSP_DUT_I2C_ADDRESS_8BIT (0x80) 40 | 41 | #define BSP_DUT_BUFFER_SIZE 24572 42 | #define BSP_DUT_RECORDING_SIZE 3000 43 | /*********************************************************************************************************************** 44 | * MACROS 45 | **********************************************************************************************************************/ 46 | #define BSP_USE_CASE_TG_HP_EN (0x0) 47 | #define BSP_USE_CASE_TG_HP_DIS (0x1) 48 | #define BSP_USE_CASE_OPUS_RECORD_16K_INIT (0x2) 49 | #define BSP_USE_CASE_OPUS_RECORD (0x3) 50 | #define BSP_USE_CASE_OPUS_RECORD_DONE (0x4) 51 | 52 | /*********************************************************************************************************************** 53 | * ENUMS, STRUCTS, UNIONS, TYPEDEFS 54 | **********************************************************************************************************************/ 55 | 56 | /*********************************************************************************************************************** 57 | * GLOBAL VARIABLES 58 | **********************************************************************************************************************/ 59 | 60 | /*********************************************************************************************************************** 61 | * API FUNCTIONS 62 | **********************************************************************************************************************/ 63 | uint32_t bsp_dut_initialize(void); 64 | uint32_t bsp_dut_reset(void); 65 | uint32_t bsp_dut_boot(); 66 | uint32_t bsp_dut_use_case(uint32_t use_case); 67 | uint32_t bsp_dut_process(void); 68 | 69 | /**********************************************************************************************************************/ 70 | #ifdef __cplusplus 71 | } 72 | #endif 73 | 74 | #endif // BSP_DUT_H 75 | -------------------------------------------------------------------------------- /cs47l35/config/wisce_init.txt: -------------------------------------------------------------------------------- 1 | 0x100 0x0041 4wireSPI_32inx_16dat Write 0x00 * Clock_32k_1(100H): 0041 CLK_32K_ENA=1, CLK_32K_SRC=MCLK2 (direct) 2 | 0x171 0x0002 4wireSPI_32inx_16dat Write 0x00 * FLL1_Control_1(171H): 0000 FLL1_FREERUN=1, FLL1_ENA=0 3 | 0x101 0x0404 4wireSPI_32inx_16dat Write 0x00 * System_Clock_1(101H): 0444 SYSCLK_FRAC=SYSCLK is a multiple of 6.144MHz, SYSCLK_FREQ=98.304MHz (90.3168MHz), SYSCLK_ENA=0, SYSCLK_SRC=FLL1 4 | 0x102 0x0003 4wireSPI_32inx_16dat Write 0x00 * Sample_rate_1(102H): 0003 SAMPLE_RATE_1=48kHz 5 | 0x218 0x81A4 4wireSPI_32inx_16dat Write 0x00 * Mic_Bias_Ctrl_1(218H): 81A4 MICB1_EXT_CAP=1, MICB1_LVL=2.8V, MICB1_RATE=Fast start-up / shut-down, MICB1_DISCH=MICBIAS1 discharged when disabled, MICB1_BYPASS=0, MICB1_ENA=0 6 | 0x310 0x0C80 4wireSPI_32inx_16dat Write 0x00 * IN1L_Control(310H): 0C80 IN1L_HPF=0, IN1_DMIC_SUP=MICBIAS1, IN1_MODE=Digital input, IN1L_PGA_VOL=0dB -------------------------------------------------------------------------------- /cs47l35/opus_test_01_16.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file opus_test_01_16.h 3 | * 4 | * @brief CS47L35 test chirp stereo signal in opus format at 16kHz sampling 5 | * 6 | * @copyright 7 | * Copyright (c) Cirrus Logic 2021 All Rights Reserved, http://www.cirrus.com/ 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the License); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | */ 22 | 23 | #ifndef CS47L35_OPUS_TEST_CHIRP_16 24 | #define CS47L35_OPUS_TEST_CHIRP_16 25 | 26 | /*********************************************************************************************************************** 27 | * INCLUDES 28 | **********************************************************************************************************************/ 29 | #include 30 | 31 | /*********************************************************************************************************************** 32 | * MP3_TEST_CHIRP 33 | **********************************************************************************************************************/ 34 | 35 | extern const uint8_t opus_test_01_16[]; 36 | extern const uint32_t opus_test_01_16_len; 37 | 38 | /**********************************************************************************************************************/ 39 | 40 | #endif // CS47L35_OPUS_TEST_CHIRP_16 41 | -------------------------------------------------------------------------------- /cs47l63/artifact_info.txt: -------------------------------------------------------------------------------- 1 | Artifact Info: 2 | Artifact : CS47L63 Alt-OS Driver: 4.24.2 - 13efce8883b6138d3a0f152fee4fc721c73d7f88 3 | Test Target MCU SDK: STM32Cube_FW_F4: 1.24.1 4 | Target toolchain : GNU Arm Embedded Toolchain: arm-none-eabi-gcc (Arm GNU Toolchain 13.2.rel1 (Build arm-13.7)) 13.2.1 20231009 5 | Build system : make: GNU Make 4.3 6 | OS : Linux: 5.14.0-503.35.1.el9_5.x86_64 7 | Shell : bash: GNU bash, version 5.1.8(1)-release (x86_64-redhat-linux-gnu) 8 | Host toolchain : MinGW GCC: gcc (GCC) 11.5.0 20240719 (Red Hat 11.5.0-5) 9 | Build Job : shelley_alt_os_nightly: 1323 10 | Git SHA : 13efce8883b6138d3a0f152fee4fc721c73d7f88 11 | 12 | System resources: 13 | 14 | Build Configuration 1: 15 | 16 | Artifact filename : libcs47l63.a 17 | Driver TEXT : 7600 18 | Driver BSS : 0 19 | Driver DATA : 136 20 | Driver Max Stack : 448 (cs47l63_reset -> cs47l63_patch -> cs47l63_common_patch -> cs47l63_write_block -> regmap_write_block -> GET_BYTE_FROM_WORD) 21 | 22 | Artifact filename : baremetal.elf 23 | Driver TEXT : 7214 24 | Driver BSS : 244 25 | Driver DATA : 136 26 | 27 | Artifact filename : cs47l63_fw_img.o 28 | Driver TEXT : 144512 29 | 30 | Compiler flags: 31 | 32 | -------------------------------------------------------------------------------- /cs47l63/bsp/bsp_dut.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file bsp_dut.h 3 | * 4 | * @brief Functions and prototypes exported by the BSP module for the cs47l63 platform. 5 | * 6 | * @copyright 7 | * Copyright (c) Cirrus Logic 2021, 2023 All Rights Reserved, http://www.cirrus.com/ 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the License); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | */ 22 | 23 | #ifndef BSP_DUT_H 24 | #define BSP_DUT_H 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /*********************************************************************************************************************** 31 | * INCLUDES 32 | **********************************************************************************************************************/ 33 | #include 34 | 35 | /*********************************************************************************************************************** 36 | * LITERALS & CONSTANTS 37 | **********************************************************************************************************************/ 38 | #define BSP_DUT_I2C_ADDRESS_8BIT (0x80) 39 | 40 | #define BSP_DUT_I2S_HALF_SIZE (4096) 41 | #define BSP_DUT_I2S_SIZE (BSP_DUT_I2S_HALF_SIZE * 2) 42 | #define BSP_DUT_BUFFER_SIZE (BSP_DUT_I2S_SIZE * 2) 43 | #define BSP_DUT_RECORDING_SIZE (BSP_DUT_I2S_SIZE * 3) 44 | 45 | /*********************************************************************************************************************** 46 | * MACROS 47 | **********************************************************************************************************************/ 48 | #define BSP_USE_CASE_TG_HP_EN (0x0) 49 | #define BSP_USE_CASE_TG_HP_DIS (0x1) 50 | #define BSP_USE_CASE_SCC_RECORD_PACKED16 (0x2) 51 | #define BSP_USE_CASE_SCC_RECORD_MSBC (0x3) 52 | #define BSP_USE_CASE_SCC_MANUAL_TRIGGER (0x4) 53 | #define BSP_USE_CASE_SCC_TRIGGERED (0x5) 54 | #define BSP_USE_CASE_SCC_PROCESS_IRQ (0x6) 55 | #define BSP_USE_CASE_SCC_PROCESS_I2S (0x7) 56 | #define BSP_USE_CASE_SCC_STOP_RECORDING (0x8) 57 | 58 | /*********************************************************************************************************************** 59 | * ENUMS, STRUCTS, UNIONS, TYPEDEFS 60 | **********************************************************************************************************************/ 61 | 62 | /*********************************************************************************************************************** 63 | * GLOBAL VARIABLES 64 | **********************************************************************************************************************/ 65 | extern bool bsp_process_irq; 66 | extern volatile bool bsp_process_i2s; 67 | 68 | /*********************************************************************************************************************** 69 | * API FUNCTIONS 70 | **********************************************************************************************************************/ 71 | uint32_t bsp_dut_initialize(void); 72 | uint32_t bsp_dut_reset(void); 73 | uint32_t bsp_dut_boot(void); 74 | uint32_t bsp_dut_use_case(uint32_t use_case); 75 | uint32_t bsp_dut_process(void); 76 | uint32_t bsp_dut_get_driver_handle(void **driver); 77 | 78 | /**********************************************************************************************************************/ 79 | #ifdef __cplusplus 80 | } 81 | #endif 82 | 83 | #endif // BSP_DUT_H 84 | -------------------------------------------------------------------------------- /cs47l63/bsp/cs47l63_altos_bridge.xml: -------------------------------------------------------------------------------- 1 | 2 | 24 | 25 | 47630100 26 | cs47l63_altos_bridge 27 | cs47l63_altos_bridge 28 | 29 | 30 | CS47L63 31 | CS47A63-1 32 | 33 | ../../devices/cs47l63/cs47l63.xml 34 | SPI 35 | 1 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /cs47l63/bsp/cs47l63_altos_bridge_vregs.xml: -------------------------------------------------------------------------------- 1 | 2 | 24 | 25 | 47630101 26 | cs47l63_altos_bridge_vregs 27 | cs47l63_altos_bridge_vregs 28 | 29 | 30 | VREGS 31 | VREGS-1 32 | 33 | ../../devices/bridge_scs_device/bridge_scs_device.xml 34 | SPI 35 | 0 36 | 37 | 38 | CS47L63 39 | CS47A63-2 40 | 41 | ../../devices/cs47l63/cs47l63.xml 42 | SPI 43 | 1 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /cs47l63/bsp/vregmap.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file vregmap.h 3 | * 4 | * @brief 5 | * Virtual regmap interface. 6 | * 7 | * @copyright 8 | * Copyright (c) Cirrus Logic 2021 All Rights Reserved, http://www.cirrus.com/ 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the License); you may 11 | * not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 18 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | * 22 | */ 23 | #ifndef VREGMAP_H 24 | #define VREGMAP_H 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /*********************************************************************************************************************** 31 | * INCLUDES 32 | **********************************************************************************************************************/ 33 | #include "regmap.h" 34 | 35 | /*********************************************************************************************************************** 36 | * LITERALS & CONSTANTS 37 | **********************************************************************************************************************/ 38 | #define VREGMAP_LENGTH_REGS (2) 39 | #define VREGMAP_BRIDGE_DEVICE_ID "VREGS" 40 | #define VREGMAP_BRIDGE_DEV_NAME "VREGS-1" 41 | 42 | /*********************************************************************************************************************** 43 | * MACROS 44 | **********************************************************************************************************************/ 45 | 46 | /*********************************************************************************************************************** 47 | * ENUMS, STRUCTS, UNIONS, TYPEDEFS 48 | **********************************************************************************************************************/ 49 | 50 | /*********************************************************************************************************************** 51 | * GLOBAL VARIABLES 52 | **********************************************************************************************************************/ 53 | extern const regmap_cp_config_t vregmap_cp; 54 | extern regmap_virtual_register_t vregmap[VREGMAP_LENGTH_REGS]; 55 | 56 | /*********************************************************************************************************************** 57 | * API FUNCTIONS 58 | **********************************************************************************************************************/ 59 | 60 | /**********************************************************************************************************************/ 61 | #ifdef __cplusplus 62 | } 63 | #endif 64 | 65 | #endif // VREGMAP_H 66 | 67 | -------------------------------------------------------------------------------- /cs47l63/config/wisce_init.txt: -------------------------------------------------------------------------------- 1 | 0x1400 0x0041 4wireSPI_32inx_32dat_32pad Write 0x00 * CLOCK32K(1400H): 0041 CLK_32K_EN=1, CLK_32K_SRC=MCLK2 (direct) 2 | 0x1C04 0x28601177 4wireSPI_32inx_32dat_32pad Write 0x00 * FLL1_CONTROL2(1C04H): 28600177 FLL1_LOCKDET_THR=0010, FLL1_LOCKDET=1, FLL1_PHASEDET=1, FLL1_REFDET=1, FLL1_REFCLK_DIV=1, FLL1_REFCLK_SRC=MCLK2, FLL1_N=375 3 | 0x1C08 0x10000 4wireSPI_32inx_32dat_32pad Write 0x00 * FLL1_CONTROL3(1C08H): 10000 FLL1_LAMBDA=1, FLL1_THETA=0 4 | 0x1C0C 0x23F05004 4wireSPI_32inx_32dat_32pad Write 0x00 * FLL1_CONTROL4(1C0CH): 23F05004 FLL1_PD_GAIN_FINE=2, FLL1_PD_GAIN_COARSE=3, FLL1_FD_GAIN_FINE=Reserved, FLL1_FD_GAIN_COARSE=1, FLL1_INTEG_DLY_MODE=1, FLL1_HP=Integer Mode, FLL1_FB_DIV=4 5 | 0x1C00 0x0006 4wireSPI_32inx_32dat_32pad Write 0x00 * FLL1_CONTROL1(1C00H): 0006 FLL1_CTRL_UPD=1, FLL1_HOLD=1, FLL1_EN=0 6 | 0x1404 0x030C 4wireSPI_32inx_32dat_32pad Write 0x00 * SYSTEM_CLOCK1(1404H): 0404 SYSCLK_FRAC=CODEC SYSCLK is a multiple of 6.144MHz, SYSCLK_FREQ=49Mhz, SYSCLK_EN=0, SYSCLK_SRC=FLL1(50MHz) 7 | 0x1420 0x0003 4wireSPI_32inx_32dat_32pad Write 0x00 * SAMPLE_RATE1(1420H): 0003 SAMPLE_RATE_1=48kHz 8 | 0x1510 0x2580001F 4wireSPI_32inx_32dat_32pad Write 0x00 * DSP_CLOCK1(1510H): 25800004 DSP_CLK_FREQ=150MHz, DSP_CLK_EN=0, DSP_CLK_SRC=FLL1 50mhz 9 | 10 | *** Set up ASP1 pins as ASP (not GPIO) 11 | 0xC08 0xE1000000 4wireSPI_32inx_32dat_32pad Write 0x00 * GPIO1_CTRL1(C08H): 61000000 GP1_DIR=Input, GP1_PU=1, GP1_PD=1, GP1_DRV_STR=8mA, GP1_DBTIME=0000, GP1_LVL=Low, GP1_OP_CFG=CMOS, GP1_DB=Disabled, GP1_POL=Non-inverted (Active High), GP1_FN=ASP1DOUT 12 | 0xC0C 0xE1000000 4wireSPI_32inx_32dat_32pad Write 0x00 * GPIO2_CTRL1(C0CH): 61000000 GP2_DIR=Input, GP2_PU=1, GP2_PD=1, GP2_DRV_STR=8mA, GP2_DBTIME=0000, GP2_LVL=Low, GP2_OP_CFG=CMOS, GP2_DB=Disabled, GP2_POL=Non-inverted (Active High), GP2_FN=ASP1DIN 13 | 0xC10 0xE1000000 4wireSPI_32inx_32dat_32pad Write 0x00 * GPIO3_CTRL1(C10H): 61000000 GP3_DIR=Input, GP3_PU=1, GP3_PD=1, GP3_DRV_STR=8mA, GP3_DBTIME=0000, GP3_LVL=Low, GP3_OP_CFG=CMOS, GP3_DB=Disabled, GP3_POL=Non-inverted (Active High), GP3_FN=ASP1BCLK 14 | 0xC14 0xE1000000 4wireSPI_32inx_32dat_32pad Write 0x00 * GPIO4_CTRL1(C14H): 61000000 GP4_DIR=Input, GP4_PU=1, GP4_PD=1, GP4_DRV_STR=8mA, GP4_DBTIME=0000, GP4_LVL=Low, GP4_OP_CFG=CMOS, GP4_DB=Disabled, GP4_POL=Non-inverted (Active High), GP4_FN=ASP1FSYNC 15 | 16 | *** ASP1 Config 17 | 0x6000 0x0000 4wireSPI_32inx_32dat_32pad Write 0x00 * ASP1_ENABLES1(6000H): 18 | 0x6004 0x0012 4wireSPI_32inx_32dat_32pad Write 0x00 * ASP1_CONTROL1(6004H): 0033 ASP1_RATE=SAMPLE_RATE_1, ASP1_BCLK_FREQ=12.288 MHz 19 | 0x6008 0x10100200 4wireSPI_32inx_32dat_32pad Write 0x00 * ASP1_CONTROL2(6008H): 20200200 ASP1_RX_WIDTH=32 cycles per slot, ASP1_TX_WIDTH=32 cycles per slot, ASP1_FMT=I2S mode, ASP1_BCLK_INV=ASP1 BCLK not inverted, ASP1_BCLK_FRC=Normal, ASP1_BCLK_MSTR=ASP1 BCLK Slave mode, ASP1_FSYNC_INV=ASP1 FSYNC not inverted, ASP1_FSYNC_FRC=Normal, ASP1_FSYNC_MSTR=ASP1 FSYNC Slave mode 20 | 0x6030 0x00000010 4wireSPI_32inx_32dat_32pad Write 0x00 * ASP1_DATA_CONTROL1(6030H): 0018 ASP1_TX_WL=24 cycles per slot 21 | 0x6040 0x00000010 4wireSPI_32inx_32dat_32pad Write 0x00 * ASP1_DATA_CONTROL5(6040H): 0018 ASP1_RX_WL=24 cycles per slot 22 | -------------------------------------------------------------------------------- /cs47l63/cs47l63_ext.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file cs47l63_ext.c 3 | * 4 | * @brief The CS47L63 Driver Extended API module 5 | * 6 | * @copyright 7 | * Copyright (c) Cirrus Logic 2021, 2023 All Rights Reserved, http://www.cirrus.com/ 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the License); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | */ 22 | /*********************************************************************************************************************** 23 | * INCLUDES 24 | **********************************************************************************************************************/ 25 | #include "cs47l63_ext.h" 26 | 27 | /*********************************************************************************************************************** 28 | * LOCAL LITERAL SUBSTITUTIONS 29 | **********************************************************************************************************************/ 30 | 31 | /*********************************************************************************************************************** 32 | * LOCAL VARIABLES 33 | **********************************************************************************************************************/ 34 | 35 | /*********************************************************************************************************************** 36 | * LOCAL FUNCTIONS 37 | **********************************************************************************************************************/ 38 | 39 | /*********************************************************************************************************************** 40 | * API FUNCTIONS 41 | **********************************************************************************************************************/ 42 | 43 | -------------------------------------------------------------------------------- /cs47l63/cs47l63_ext.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file cs47l63_ext.h 3 | * 4 | * @brief Functions and prototypes exported by the CS47L63 Driver Extended API module 5 | * 6 | * @copyright 7 | * Copyright (c) Cirrus Logic 2021, 2023 All Rights Reserved, http://www.cirrus.com/ 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the License); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | */ 22 | 23 | #ifndef CS47L63_EXT_H 24 | #define CS47L63_EXT_H 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /*********************************************************************************************************************** 31 | * INCLUDES 32 | **********************************************************************************************************************/ 33 | #include 34 | 35 | /*********************************************************************************************************************** 36 | * LITERALS & CONSTANTS 37 | **********************************************************************************************************************/ 38 | /** 39 | * @defgroup CS47L63_DSP_ 40 | * @brief Values for communicating with DSP 41 | * 42 | * @{ 43 | */ 44 | #define CS47L63_DSP_OFFSET_MUL_VALUE 4 45 | #define CS47L63_DSP_UNPACKED24_BYTES_PER_REG 4 46 | #define CS47L63_DSP_IRQ_ACK_VAL 0x1 47 | 48 | /*********************************************************************************************************************** 49 | * MACROS 50 | **********************************************************************************************************************/ 51 | 52 | /*********************************************************************************************************************** 53 | * ENUMS, STRUCTS, UNIONS, TYPEDEFS 54 | **********************************************************************************************************************/ 55 | 56 | /*********************************************************************************************************************** 57 | * GLOBAL VARIABLES 58 | **********************************************************************************************************************/ 59 | 60 | /*********************************************************************************************************************** 61 | * API FUNCTIONS 62 | **********************************************************************************************************************/ 63 | 64 | /**********************************************************************************************************************/ 65 | #ifdef __cplusplus 66 | } 67 | #endif 68 | 69 | #endif // CS47L63_EXT_H 70 | -------------------------------------------------------------------------------- /doc.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CirrusLogic/mcu-drivers/91ee3d783221971d70a1351a28976a2cb62325b2/doc.zip -------------------------------------------------------------------------------- /samples/README.md: -------------------------------------------------------------------------------- 1 | # Zephyr Sample Applications 2 | 3 | Follow the Zephyr Getting Started guide to create a Zephyr workspace: https://docs.zephyrproject.org/latest/develop/getting_started/index.html 4 | 5 | The SDK samples will use the ST Nucleo F401RE board as a target (nucleo_f401re) 6 | 7 | ## Directory structure 8 | 9 | Clone the SDK repo (mcu-drivers) inside the 'zephyrproject' directory, at the same level as the Zephyr kernel 10 | ``` 11 | └── zephyrproject 12 | ├── bootloader 13 | ├── build 14 | ├── mcu-drivers 15 | ├── modules 16 | ├── tools 17 | └── zephyr 18 | ``` 19 | 20 | ## Building 21 | 22 | Use west to build the sample by providing the path to the sample directory inside the SDK 23 | ``` 24 | west build -p always -b nucleo_f401re mcu-drivers/samples/haptics/cs40l50 25 | ``` 26 | 27 | ## Samples 28 | 29 | Hello World: 30 | https://github.com/CirrusLogic/mcu-drivers/blob/7faad294f130f55ace18f95e3f3ed827589601cd/samples/helloworld/cs40l50/ 31 | 32 | 33 | SDK Integration: 34 | https://github.com/CirrusLogic/mcu-drivers/blob/7faad294f130f55ace18f95e3f3ed827589601cd/samples/haptics/cs40l50/ 35 | -------------------------------------------------------------------------------- /samples/haptics/cs40l50/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: Apache-2.0 2 | 3 | cmake_minimum_required(VERSION 3.20.0) 4 | 5 | find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) 6 | project(cs40l50) 7 | 8 | FILE(GLOB app_sources src/*.c ../../cs40l50/*.c ../../common/fw_img.c) 9 | target_sources(app PRIVATE ${app_sources}) 10 | 11 | zephyr_library_add_dependencies(offsets_h) 12 | 13 | zephyr_compile_definitions(CIRRUS_ZEPHYR_SAMPLE) 14 | 15 | add_subdirectory(src) 16 | -------------------------------------------------------------------------------- /samples/haptics/cs40l50/Kconfig: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021 Nordic Semiconductor ASA 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # This Kconfig file is picked by the Zephyr build system because it is defined 5 | # as the module Kconfig entry point (see zephyr/module.yml). You can browse 6 | # module options by going to Zephyr -> Modules in Kconfig. 7 | 8 | source "Kconfig" 9 | rsource "src/drivers/haptics/Kconfig" 10 | -------------------------------------------------------------------------------- /samples/haptics/cs40l50/README.md: -------------------------------------------------------------------------------- 1 | 2 | # CS40L50 Zephyr Sample Application 3 | 4 | ## Introduction 5 | 6 | This sample application illustrates how to integrate the CS40L50 SDK driver on a new microcontroller platform using the Zephyr OS and ST Nucleo F401RE as an example. 7 | 8 | Please refer to https://github.com/CirrusLogic/mcu-drivers/blob/7faad294f130f55ace18f95e3f3ed827589601cd/samples/ for instructions on building the Zephyr samples. 9 | 10 | ## Goals 11 | 12 | * Integrate SDK driver files 13 | * Create a BSP that can use cs40l50.c driver functions 14 | * Create an application that can initialize the amplifier and run config scripts 15 | 16 | # Source Files 17 | 18 | _C files_ 19 | * cs40l50/cs40l50.c 20 | * common/fw_img.c 21 | * cs40l50_bsp.c 22 | * main.c 23 | 24 | 25 | _Includes_ 26 | * cs40l50/cs40l50.h 27 | * cs40l50/cs40l50_spec.h 28 | 29 | _Firmware_ 30 | * cs40l50_firmware.c 31 | * cs40l50_firmware.h 32 | 33 | Firmware is generated using the firmware converter Python tool and a wavetable included in the SDK 34 | ``` 35 | python ../../../../tools/firmware_converter/firmware_converter.py export cs40l50 ../../../../cs40l50/fw/CS40L50_Rev3.4.8.wmfw --wmdr ../../../../cs40l50/fw/cs40l50_wt.bin --preserve-filename 36 | ``` 37 | 38 | _Config_ 39 | * cs40l50_syscfg_regs.c 40 | * cs40l50_syscfg_regs.h 41 | 42 | Config is generated using the WISCE script converter Python tool and the wisce_init.txt included in the SDK 43 | 44 | ``` 45 | python tools/wisce_script_converter/wisce_script_converter.py -c c_array -p cs40l50 -i cs40l50/config/wisce_init.txt -o samples/haptics/cs40l50/src/ 46 | ``` 47 | 48 | # BSP 49 | 50 | BSP Goals 51 | * Link platform operations to driver (Control Port, GPIO) 52 | * Initialize driver structs (cs40l50_t, cs40l50_bsp) 53 | * Load firmware and application-specific data 54 | 55 | ## Control Port 56 | 57 | The BSP driver instance is initialized with a `struct i2c_dt_spec` handle that can be used with Zephyr I2C devicetree operations (`include/zephyr/i2c.h`) 58 | 59 | The BSP links the Zephyr I2C operations to the CS40L50 SDK driver by creating the wrapper functions: 60 | * cs40l50_i2c_read_reg_dt 61 | * cs40l50_i2c_write_reg_dt 62 | * cs40l50_update_reg_dt 63 | * cs40l50_write_array_dt 64 | * cs40l50_poll_reg_dt 65 | * cs40l50_write_acked_reg_dt 66 | 67 | These can then be substituted for the corrsponding operations in the SDK demo board BSP. 68 | https://github.com/CirrusLogic/mcu-drivers/blob/7faad294f130f55ace18f95e3f3ed827589601cd/samples/haptics/cs40l50/src/cs40l50_bsp.h#L28-L35 69 | 70 | ## Timer 71 | 72 | The BSP implements a `set_timer` callback using Zephyr's `k_msleep`. 73 | 74 | https://github.com/CirrusLogic/mcu-drivers/blob/7faad294f130f55ace18f95e3f3ed827589601cd/samples/haptics/cs40l50/src/cs40l50_bsp.c#L148-L152 75 | 76 | ## Instantiation 77 | 78 | Once the BSP is linked to the SDK driver, the driver functions in `cs40l50.c` can be used. 79 | The entry point for the BSP/driver is the `cs40l50_init` function. 80 | 81 | The Zephyr init macros ensure that the BSP is allocated the data it needs (`cs40l50_bsp` and `cs40l50_config` structs), receives information about the I2C bus from devicetree (I2C_DT_SPEC_INST_GET), and starts in the function `cs40l50_init()`. 82 | 83 | https://github.com/CirrusLogic/mcu-drivers/blob/7faad294f130f55ace18f95e3f3ed827589601cd/samples/haptics/cs40l50/src/cs40l50_bsp.c#L275-L292 84 | 85 | ## Firmware Loading 86 | 87 | The BSP is responsible for loading the firmware. This is implemented in the `cs40l50_firmware_load` and `cs40l50_write_fw_blocks` functions. 88 | 89 | Before loading firmware, call `cs40l50_boot` with the `fw_img` param equal to `NULL` to disable the DSP. 90 | After loading the firmware, boot the DSP by calling `cs40l50_boot` with a firmware image parameter, or write to the DSP enable directly. 91 | 92 | # Application 93 | 94 | Application Goals 95 | * Link BSP functions to system events 96 | 97 | ## Init 98 | 99 | Due to the devicetree declaration and the CS40L50_INIT definition, the BSP/driver will be instantiated when the system starts and will enter the cs40l50_init function. 100 | 101 | In main.c the application can check that the devicetree instantiation completed by making sure that DEVICE_DT_GET returned a valid `struct device *` pointer. 102 | 103 | Initialization steps: 104 | * Populate `cs40l50_t` with I2C handle and syscfg registers 105 | * Check I2C bus ready 106 | * cs40l50_reset() 107 | 108 | https://github.com/CirrusLogic/mcu-drivers/blob/7faad294f130f55ace18f95e3f3ed827589601cd/samples/haptics/cs40l50/src/cs40l50_bsp.c#L176-L197 109 | 110 | ## System events 111 | 112 | The system uses a built-in Zephyr Haptic API. 113 | 114 | The BSP implements these callbacks: 115 | * haptics_cs40l50_start_output 116 | * haptics_cs40l50_stop_output 117 | -------------------------------------------------------------------------------- /samples/haptics/cs40l50/boards/nucleo_f401re.overlay: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2024 Cirrus Logic, Inc. 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | #include 8 | 9 | &i2c1 { 10 | status = "okay"; 11 | clock-frequency = ; 12 | pinctrl-0 = <&i2c1_scl_pb6 &i2c1_sda_pb7>; 13 | 14 | haptic1: cs40l50@34 { 15 | compatible = "cirrus,cs40l50"; 16 | reg = <0x34>; 17 | status = "okay"; 18 | 19 | }; 20 | }; 21 | 22 | &usart1 { 23 | status = "disabled"; 24 | }; 25 | -------------------------------------------------------------------------------- /samples/haptics/cs40l50/prj.conf: -------------------------------------------------------------------------------- 1 | CONFIG_LOG=y 2 | CONFIG_HAPTICS=y 3 | CONFIG_HAPTICS_CS40L50=y 4 | CONFIG_HEAP_MEM_POOL_SIZE=8192 5 | -------------------------------------------------------------------------------- /samples/haptics/cs40l50/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | zephyr_include_directories(../../../../cs40l50/) 2 | zephyr_library_sources(../../../../cs40l50/cs40l50.c ../../../../common/fw_img.c) 3 | add_subdirectory(drivers) 4 | -------------------------------------------------------------------------------- /samples/haptics/cs40l50/src/cs40l50_syscfg_regs.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file cs40l50_syscfg_regs.c 3 | * 4 | * @brief Register values to be applied after CS40L50 Driver boot(). 5 | * 6 | * @copyright 7 | * Copyright (c) Cirrus Logic 2024-2025 All Rights Reserved, http://www.cirrus.com/ 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the License); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | */ 22 | /*********************************************************************************************************************** 23 | * INCLUDES 24 | **********************************************************************************************************************/ 25 | #include "cs40l50_syscfg_regs.h" 26 | #include "cs40l50_spec.h" 27 | 28 | /*********************************************************************************************************************** 29 | * GLOBAL VARIABLES 30 | **********************************************************************************************************************/ 31 | 32 | /** 33 | * Application-specific config 34 | * Converted from cs40l50/config/wisce_init.txt 35 | * Please consult Cirrus for config appropriate to your application 36 | */ 37 | uint32_t cs40l50_syscfg_regs[] = 38 | { 39 | 0x0040, 0x0055, 40 | 0x0040, 0x00aa, 41 | 0x3808, 0x40000001, 42 | 0x38ec, 0x0032, 43 | 0x0040, 0x0000, 44 | 0x201c, 0x0010, 45 | 0x3800, 0x026e, 46 | 0x2034, 0x2000000, 47 | 0x280279c, 0x0006, 48 | 0x280285c, 0x0000, 49 | 0x280404c, 0x50020, 50 | 0x2804050, 0x340200, 51 | 0x2804054, 0x40020, 52 | 0x2804058, 0x183201, 53 | 0x280405c, 0x50044, 54 | 0x2804060, 0x40100, 55 | 0x2804064, 0xffffff 56 | }; 57 | 58 | -------------------------------------------------------------------------------- /samples/haptics/cs40l50/src/cs40l50_syscfg_regs.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file cs40l50_syscfg_regs.h 3 | * 4 | * @brief Register values to be applied after CS40L50 Driver boot(). 5 | * 6 | * @copyright 7 | * Copyright (c) Cirrus Logic 2024-2025 All Rights Reserved, http://www.cirrus.com/ 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the License); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | * wisce_to_syscfg_reg_converter.py SDK version: 4.21.0 - internal 22 | * Command: ../../tools/wisce_script_converter/wisce_script_converter.py -c c_array -p cs40l50 -i /Users/drhodes/Documents/code/cross-compile/nfs-share/altos/driver/cs40l50/config/wisce_init.txt -o . 23 | * 24 | */ 25 | 26 | #ifndef CS40L50_SYSCFG_REGS_H 27 | #define CS40L50_SYSCFG_REGS_H 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | /*********************************************************************************************************************** 34 | * INCLUDES 35 | **********************************************************************************************************************/ 36 | #include "stdint.h" 37 | //#include "regmap.h" 38 | 39 | /*********************************************************************************************************************** 40 | * LITERALS & CONSTANTS 41 | **********************************************************************************************************************/ 42 | #define CS40L50_SYSCFG_REGS_TOTAL (34) 43 | 44 | /*********************************************************************************************************************** 45 | * ENUMS, STRUCTS, UNIONS, TYPEDEFS 46 | **********************************************************************************************************************/ 47 | 48 | /*********************************************************************************************************************** 49 | * GLOBAL VARIABLES 50 | **********************************************************************************************************************/ 51 | extern uint32_t cs40l50_syscfg_regs[]; 52 | 53 | #ifdef __cplusplus 54 | } 55 | #endif 56 | 57 | #endif // CS40L50_SYSCFG_REGS_H 58 | 59 | -------------------------------------------------------------------------------- /samples/haptics/cs40l50/src/drivers/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory_ifdef(CONFIG_HAPTICS haptics) 2 | -------------------------------------------------------------------------------- /samples/haptics/cs40l50/src/drivers/haptics/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: Apache-2.0 2 | 3 | zephyr_library() 4 | zephyr_syscall_header(${ZEPHYR_BASE}/include/zephyr/drivers/haptics.h) 5 | zephyr_library_add_dependencies(offsets_h) 6 | zephyr_library_sources_ifdef(CONFIG_HAPTICS_CS40L50 ../../../../../../cs40l50/cs40l50.c ../../cs40l50_bsp.c ../../../../../../common/fw_img.c) 7 | zephyr_include_directories(../../../../../../cs40l50/ ../../../../../../common ../../../../../../ ../../) 8 | -------------------------------------------------------------------------------- /samples/haptics/cs40l50/src/drivers/haptics/Kconfig: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Cirrus Logic, Inc. 2 | # 3 | # SPDX-License-Identifier: Apache-2.0 4 | 5 | menuconfig HAPTICS 6 | bool "Haptic feedback drivers" 7 | help 8 | Enable haptics driver configuration. 9 | 10 | if HAPTICS 11 | 12 | module = HAPTICS 13 | module-str = haptics 14 | source "subsys/logging/Kconfig.template.log_config" 15 | 16 | config HAPTICS_INIT_PRIORITY 17 | int "Haptic driver init priority" 18 | default 90 19 | help 20 | Haptic driver initialization priority. 21 | 22 | rsource "Kconfig.cs40l50" 23 | 24 | endif # HAPTICS 25 | -------------------------------------------------------------------------------- /samples/haptics/cs40l50/src/drivers/haptics/Kconfig.cs40l50: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Cirrus Logic, Inc. 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | config HAPTICS_CS40L50 5 | bool "CS40L50 Haptics Driver" 6 | default y 7 | select I2C 8 | help 9 | Enable I2C-based driver for the Cirrus CS40L50 Haptics Driver. 10 | -------------------------------------------------------------------------------- /samples/haptics/cs40l50/src/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2024 Cirrus Logic, Inc. 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | #include 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | //#include "drivers/haptics/cs40l50.h" 16 | #include 17 | #include 18 | #include 19 | 20 | #define LOG_LEVEL 4 21 | 22 | #include "cs40l50_bsp.h" 23 | 24 | LOG_MODULE_REGISTER(main); 25 | 26 | int main(void) 27 | { 28 | int ret; 29 | char in_char; 30 | const struct device *dev1 = DEVICE_DT_GET(DT_NODELABEL(haptic1)); 31 | const struct device *uart = DEVICE_DT_GET(DT_NODELABEL(usart2)); 32 | struct cs40l50_haptic_source_config hap_cfg = { 33 | .index = 23, 34 | .bank = 0, //ROM 35 | }; 36 | 37 | if (!dev1) { 38 | LOG_ERR("CS40L50 device not found"); 39 | return -ENODEV; 40 | } else if (!device_is_ready(dev1)) { 41 | LOG_ERR("CS40L50 device %s is not ready", dev1->name); 42 | //return -EIO; 43 | } else { 44 | LOG_INF("Found CS40L50 device %s", dev1->name); 45 | } 46 | 47 | while (1) { 48 | 49 | ret = uart_poll_in(uart, &in_char); 50 | 51 | if (ret == 0) { 52 | ret = haptics_start_output(dev1); 53 | if (ret < 0) { 54 | LOG_ERR("Failed to start output: %d", ret); 55 | return ret; 56 | } 57 | } 58 | k_msleep(1); 59 | } 60 | 61 | return 0; 62 | } 63 | -------------------------------------------------------------------------------- /samples/haptics/cs40l50/zephyr/module.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021 Nordic Semiconductor ASA 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | build: 5 | # Path to the Kconfig file that will be sourced into Zephyr Kconfig tree under 6 | # Zephyr > Modules > example-application. Path is relative from root of this 7 | # repository. 8 | kconfig: Kconfig 9 | # Path to the folder that contains the CMakeLists.txt file to be included by 10 | # Zephyr build system. The `.` is the root of this repository. 11 | cmake: . 12 | settings: 13 | # Additional roots for boards and DTS files. Zephyr will use the 14 | # `/boards` for additional boards. The `.` is the root of this 15 | # repository. 16 | board_root: . 17 | # Zephyr will use the `/dts` for additional dts files and 18 | # `/dts/bindings` for additional dts binding files. The `.` is 19 | # the root of this repository. 20 | dts_root: . 21 | -------------------------------------------------------------------------------- /samples/helloworld/cs40l50/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: Apache-2.0 2 | 3 | cmake_minimum_required(VERSION 3.20.0) 4 | 5 | find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) 6 | project(cs40l50) 7 | 8 | FILE(GLOB app_sources src/*.c) 9 | target_sources(app PRIVATE ${app_sources}) 10 | 11 | zephyr_library_add_dependencies(offsets_h) 12 | -------------------------------------------------------------------------------- /samples/helloworld/cs40l50/Kconfig: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021 Nordic Semiconductor ASA 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | # This Kconfig file is picked by the Zephyr build system because it is defined 5 | # as the module Kconfig entry point (see zephyr/module.yml). You can browse 6 | # module options by going to Zephyr -> Modules in Kconfig. 7 | 8 | source "Kconfig" 9 | -------------------------------------------------------------------------------- /samples/helloworld/cs40l50/README.md: -------------------------------------------------------------------------------- 1 | 2 | # CS40L50 Zephyr Sample Application 3 | 4 | ## Introduction 5 | 6 | This is a simple application for bringup and hardware verification. 7 | It does not depend on any SDK source. 8 | 9 | Please refer to https://github.com/CirrusLogic/mcu-drivers/blob/7faad294f130f55ace18f95e3f3ed827589601cd/samples/README.md for instructions on building the Zephyr samples. 10 | 11 | ## Goals 12 | 13 | * Verify control port access 14 | * Intitialize the device based on a predefined script 15 | 16 | # Source Files 17 | 18 | C files to build 19 | * main.c 20 | 21 | # Syscfg regs 22 | 23 | A set of register writes to initialize the part is created with the WISCE script converter tool and the wisce_init.txt included in the SDK 24 | 25 | ``` 26 | python tools/wisce_script_converter/wisce_script_converter.py -c c_array -p cs40l50 -i cs40l50/config/wisce_init.txt -o samples/haptics/cs40l50/src/ 27 | ``` 28 | 29 | The array `cs40l50_syscfg_regs` and the array size `CS40L50_SYSCFG_REGS_TOTAL` are copied from the output files 30 | https://github.com/CirrusLogic/mcu-drivers/blob/7faad294f130f55ace18f95e3f3ed827589601cd/samples/helloworld/cs40l50/src/main.c#L22-L48 31 | 32 | # Hardware 33 | 34 | A CS40L50 device is connected to the STM32 F401RE I2C bus labelled "i2c1" in devicetree. 35 | The I2C bus is enabled in the devicetree overlay and the USART that shares the pins is disabled. 36 | https://github.com/CirrusLogic/mcu-drivers/blob/7faad294f130f55ace18f95e3f3ed827589601cd/samples/helloworld/cs40l50/boards/nucleo_f401re.overlay#L1-L17 37 | 38 | # Application 39 | 40 | The application has three steps: 41 | * Check that the I2C bus is ready 42 | * Check that the device ID can be read from address 0 43 | * Load syscfg registers 44 | 45 | https://github.com/CirrusLogic/mcu-drivers/blob/7faad294f130f55ace18f95e3f3ed827589601cd/samples/helloworld/cs40l50/src/main.c#L57-L88 46 | -------------------------------------------------------------------------------- /samples/helloworld/cs40l50/boards/nucleo_f401re.overlay: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2024 Cirrus Logic, Inc. 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | #include 8 | 9 | &i2c1 { 10 | status = "okay"; 11 | clock-frequency = ; 12 | pinctrl-0 = <&i2c1_scl_pb6 &i2c1_sda_pb7>; 13 | }; 14 | 15 | &usart1 { 16 | status = "disabled"; 17 | }; 18 | -------------------------------------------------------------------------------- /samples/helloworld/cs40l50/prj.conf: -------------------------------------------------------------------------------- 1 | CONFIG_LOG=y 2 | CONFIG_I2C=y -------------------------------------------------------------------------------- /samples/helloworld/cs40l50/src/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2024 Cirrus Logic, Inc. 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | #define LOG_LEVEL 4 18 | LOG_MODULE_REGISTER(main); 19 | 20 | #define CS40L50_ADDR 0x34 21 | #define CS40L50_DEVICE_ID 0x40A50 22 | #define CS40L50_SYSCFG_REGS_TOTAL (44) 23 | 24 | uint32_t cs40l50_syscfg_regs[] = 25 | { /* ADDR VALUE */ 26 | 0x0040, 0x0055, 27 | 0x0040, 0x00aa, 28 | 0x3808, 0x40000001, 29 | 0x38ec, 0x0032, 30 | 0x0040, 0x0000, 31 | 0x201c, 0x0010, 32 | 0x3800, 0x026e, 33 | 0x2034, 0x2000000, 34 | 0x280279c, 0x0006, 35 | 0x280285c, 0x0000, 36 | 0x280404c, 0x40020, 37 | 0x2804050, 0x1c0010, 38 | 0x2804054, 0x40038, 39 | 0x2804058, 0x02fa, 40 | 0x280405c, 0xffffff, 41 | 0x280404c, 0x50020, 42 | 0x2804050, 0x340200, 43 | 0x2804054, 0x40020, 44 | 0x2804058, 0x183201, 45 | 0x280405c, 0x50044, 46 | 0x2804060, 0x40100, 47 | 0x2804064, 0xffffff 48 | }; 49 | 50 | int main(void) 51 | { 52 | int ret, i; 53 | uint32_t val; 54 | uint8_t msg_buf[8], *addr_buf, *reg_buf; 55 | const struct device *i2c = DEVICE_DT_GET(DT_NODELABEL(i2c1)); 56 | 57 | /* Check that I2C bus is ready */ 58 | if (!i2c) { 59 | LOG_ERR("I2C bus not found"); 60 | return -ENODEV; 61 | } 62 | 63 | addr_buf = msg_buf; 64 | reg_buf = msg_buf + 4; 65 | 66 | /* Read from CS40L50 device at register address 0 (device ID)*/ 67 | sys_put_be32(0, addr_buf); 68 | ret = i2c_write_read(i2c, CS40L50_ADDR, addr_buf, 4, reg_buf, 4); 69 | val = sys_get_be32(reg_buf); 70 | 71 | if (ret != 0) { 72 | LOG_ERR("I2C Error (%d)", ret); 73 | return ret; 74 | } else if (val != CS40L50_DEVICE_ID) { 75 | LOG_ERR("CS40L50 device not found (%x)", val); 76 | return -ENODEV; 77 | } 78 | 79 | /* Apply syscfg registers */ 80 | for (i = 0; i < CS40L50_SYSCFG_REGS_TOTAL; i++) { 81 | sys_put_be32(cs40l50_syscfg_regs[i++], addr_buf); 82 | sys_put_be32(cs40l50_syscfg_regs[i], reg_buf); 83 | ret = i2c_write(i2c, msg_buf, 8, CS40L50_ADDR); 84 | 85 | if (ret != 0) { 86 | LOG_ERR("I2C Error (%d)", ret); 87 | return ret; 88 | } 89 | } 90 | 91 | return 0; 92 | } 93 | -------------------------------------------------------------------------------- /samples/helloworld/cs40l50/zephyr/module.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021 Nordic Semiconductor ASA 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | build: 5 | # Path to the Kconfig file that will be sourced into Zephyr Kconfig tree under 6 | # Zephyr > Modules > example-application. Path is relative from root of this 7 | # repository. 8 | kconfig: Kconfig 9 | # Path to the folder that contains the CMakeLists.txt file to be included by 10 | # Zephyr build system. The `.` is the root of this repository. 11 | cmake: . 12 | settings: 13 | # Additional roots for boards and DTS files. Zephyr will use the 14 | # `/boards` for additional boards. The `.` is the root of this 15 | # repository. 16 | board_root: . 17 | # Zephyr will use the `/dts` for additional dts files and 18 | # `/dts/bindings` for additional dts binding files. The `.` is 19 | # the root of this repository. 20 | dts_root: . 21 | -------------------------------------------------------------------------------- /sdk_version.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file sdk_version.h 3 | * 4 | * @brief Alt-OS SDK version literals 5 | * 6 | * @copyright 7 | * Copyright (c) Cirrus Logic 2025 All Rights Reserved, http://www.cirrus.com/ 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the License); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | */ 22 | 23 | #ifndef SDK_VERSION_H 24 | #define SDK_VERSION_H 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /*********************************************************************************************************************** 31 | * INCLUDES 32 | **********************************************************************************************************************/ 33 | 34 | /*********************************************************************************************************************** 35 | * LITERALS & CONSTANTS 36 | **********************************************************************************************************************/ 37 | 38 | /** 39 | * @defgroup SDK_VERSION_ 40 | * @brief Defines for the release version of the SDK 41 | * 42 | * @details 43 | * Versions for the SDK are defined as: 44 | * - Major - The interface of the firmware or module has changed in a way that breaks backwards compatibility. This 45 | * means that the module will not work as before if the old interface is used. 46 | * - Minor - The interface of the firmware or module has changed, but not in a way that breaks backwards compatibility. 47 | * This means that the module will work as before if the old interface is used. 48 | * - Update - The function has changed without changing the interface, for instance for a bug fix. 49 | * 50 | * @{ 51 | */ 52 | #define SDK_VERSION_MAJOR (4) ///< Release Major version 53 | #define SDK_VERSION_MINOR (24) ///< Release Minor version 54 | #define SDK_VERSION_UPDATE (2) ///< Release Update version 55 | #define SDK_GIT_SHA ("13efce8883b6138d3a0f152fee4fc721c73d7f88") ///< Release Git SHA 56 | /** @} */ 57 | 58 | 59 | /*********************************************************************************************************************** 60 | * MACROS 61 | **********************************************************************************************************************/ 62 | 63 | /*********************************************************************************************************************** 64 | * ENUMS, STRUCTS, UNIONS, TYPEDEFS 65 | **********************************************************************************************************************/ 66 | 67 | /*********************************************************************************************************************** 68 | * GLOBAL VARIABLES 69 | **********************************************************************************************************************/ 70 | 71 | /*********************************************************************************************************************** 72 | * API FUNCTIONS 73 | **********************************************************************************************************************/ 74 | 75 | /**********************************************************************************************************************/ 76 | #ifdef __cplusplus 77 | } 78 | #endif 79 | 80 | #endif // SDK_VERSION_H 81 | -------------------------------------------------------------------------------- /third_party/sbc.mk: -------------------------------------------------------------------------------- 1 | ############################################################################## 2 | # 3 | # Makefile for Bluetooth SBC Library 4 | # 5 | ############################################################################## 6 | # Licensed under the Apache License, Version 2.0 (the License); you may 7 | # not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an AS IS BASIS, WITHOUT 14 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | # Variable Assignments 21 | ############################################################################## 22 | 23 | # Includes 24 | 25 | # Assign paths 26 | ifeq ($(origin SBC_PATH), undefined) 27 | $(eval SBC_PATH = $(REPO_PATH)/third_party/sbc/sbc) 28 | endif 29 | SBC_BUILD_PATH = $(BUILD_DIR)/third_party/sbc/sbc 30 | 31 | # Assign flags 32 | CFLAGS += -DUSE_SBC 33 | 34 | # Assign sources 35 | SBC_C_SRCS = 36 | SBC_C_SRCS += $(SBC_PATH)/sbc.c 37 | SBC_C_SRCS += $(SBC_PATH)/sbc_primitives.c 38 | SBC_C_SRCS += $(SBC_PATH)/sbc_primitives_armv6.c 39 | SBC_C_SRCS += $(SBC_PATH)/sbc_primitives_iwmmxt.c 40 | SBC_C_SRCS += $(SBC_PATH)/sbc_primitives_mmx.c 41 | SBC_C_SRCS += $(SBC_PATH)/sbc_primitives_neon.c 42 | SBC_C_SRCS += $(SBC_PATH)/sbc_primitives_sse.c 43 | 44 | # Assign includes 45 | INCLUDES += -I$(SBC_PATH) -------------------------------------------------------------------------------- /tools/create_ide_projects/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | {repo_folder_name} 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 10 | clean,full,incremental, 11 | 12 | 13 | 14 | 15 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 16 | full,incremental, 17 | 18 | 19 | 20 | 21 | 22 | com.st.stm32cube.ide.mcu.MCUProjectNature 23 | org.eclipse.cdt.core.cnature 24 | com.st.stm32cube.ide.mcu.MCUCubeIdeServicesRevAev2ProjectNature 25 | com.st.stm32cube.ide.mcu.MCUManagedMakefileProjectNature 26 | com.st.stm32cube.ide.mcu.MCUSingleCpuProjectNature 27 | com.st.stm32cube.ide.mcu.MCURootProjectNature 28 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 29 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 30 | 31 | 32 | -------------------------------------------------------------------------------- /tools/firmware_converter/firmware_exporter.py: -------------------------------------------------------------------------------- 1 | #========================================================================== 2 | # (c) 2020, 2022, 2024 Cirrus Logic, Inc. 3 | #-------------------------------------------------------------------------- 4 | # Project : Abstract Base Class for exporters for firmware_converter 5 | # File : firmware_exporter.py 6 | #-------------------------------------------------------------------------- 7 | # Licensed under the Apache License, Version 2.0 (the License); you may 8 | # not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an AS IS BASIS, WITHOUT 15 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | #-------------------------------------------------------------------------- 19 | # 20 | # Environment Requirements: None 21 | # 22 | #========================================================================== 23 | 24 | #========================================================================== 25 | # IMPORTS 26 | #========================================================================== 27 | from abc import ABC, abstractmethod 28 | 29 | #========================================================================== 30 | # CONSTANTS/GLOBALS 31 | #========================================================================== 32 | 33 | #========================================================================== 34 | # CLASSES 35 | #========================================================================== 36 | class firmware_exporter(ABC): 37 | def __init__(self, attributes): 38 | self.attributes = attributes 39 | 40 | super().__init__() 41 | return 42 | 43 | @abstractmethod 44 | def update_block_info(self, fw_block_total, coeff_block_totals, coeff_filenames): pass 45 | 46 | @abstractmethod 47 | def add_control(self, algorithm_name, algorithm_id, control_name, address, length): pass 48 | 49 | @abstractmethod 50 | def add_metadata_text_line(self, line): pass 51 | 52 | @abstractmethod 53 | def add_fw_block(self, address, data_bytes): pass 54 | 55 | @abstractmethod 56 | def add_coeff_block(self, index, address, data_bytes, filename): pass 57 | 58 | @abstractmethod 59 | def add_bin_block(self, index, address, data_bytes): pass 60 | 61 | @abstractmethod 62 | def to_file(self): pass 63 | 64 | @abstractmethod 65 | def __str__(self): pass 66 | 67 | #========================================================================== 68 | # HELPER FUNCTIONS 69 | #========================================================================== 70 | 71 | #========================================================================== 72 | # MAIN PROGRAM 73 | #========================================================================== 74 | 75 | -------------------------------------------------------------------------------- /tools/wisce_script_converter/wisce_script_exporter.py: -------------------------------------------------------------------------------- 1 | #========================================================================== 2 | # (c) 2020 Cirrus Logic, Inc. 3 | #-------------------------------------------------------------------------- 4 | # Project : Abstract Base Class for exporters for wisce_scripts 5 | # File : wisce_script_exporter.py 6 | #-------------------------------------------------------------------------- 7 | # Licensed under the Apache License, Version 2.0 (the License); you may 8 | # not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an AS IS BASIS, WITHOUT 15 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | #-------------------------------------------------------------------------- 19 | # 20 | # Environment Requirements: None 21 | # 22 | #========================================================================== 23 | 24 | #========================================================================== 25 | # IMPORTS 26 | #========================================================================== 27 | from abc import ABC, abstractmethod 28 | 29 | #========================================================================== 30 | # CONSTANTS/GLOBALS 31 | #========================================================================== 32 | 33 | #========================================================================== 34 | # CLASSES 35 | #========================================================================== 36 | class wisce_script_exporter(ABC): 37 | def __init__(self, attributes): 38 | self.attributes = attributes 39 | 40 | super().__init__() 41 | return 42 | 43 | @abstractmethod 44 | def add_transaction(self, transaction): pass 45 | 46 | @abstractmethod 47 | def add_metadata_text_line(self, line): pass 48 | 49 | @abstractmethod 50 | def to_file(self): pass 51 | 52 | @abstractmethod 53 | def __str__(self): pass 54 | 55 | #========================================================================== 56 | # HELPER FUNCTIONS 57 | #========================================================================== 58 | 59 | #========================================================================== 60 | # MAIN PROGRAM 61 | #========================================================================== 62 | 63 | -------------------------------------------------------------------------------- /tools/wisce_script_converter/wisce_script_exporter_factory.py: -------------------------------------------------------------------------------- 1 | #========================================================================== 2 | # (c) 2020 Cirrus Logic, Inc. 3 | #-------------------------------------------------------------------------- 4 | # Project : WISCE Script Exporter Factory class 5 | # File : wisce_script_exporter_factory.py 6 | #-------------------------------------------------------------------------- 7 | # Licensed under the Apache License, Version 2.0 (the License); you may 8 | # not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an AS IS BASIS, WITHOUT 15 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | #-------------------------------------------------------------------------- 19 | # 20 | # Environment Requirements: None 21 | # 22 | #========================================================================== 23 | 24 | #========================================================================== 25 | # IMPORTS 26 | #========================================================================== 27 | from wisce_script_exporter import wisce_script_exporter 28 | from c_array_exporter import c_array_exporter 29 | from c_function_exporter import c_function_exporter 30 | 31 | #========================================================================== 32 | # CONSTANTS/GLOBALS 33 | #========================================================================== 34 | exporter_types = ['c_array', 'c_functions'] 35 | 36 | #========================================================================== 37 | # CLASSES 38 | #========================================================================== 39 | class wisce_script_exporter_factory(wisce_script_exporter): 40 | 41 | def __init__(self, attributes): 42 | wisce_script_exporter.__init__(self, attributes) 43 | self.exporters = [] 44 | self.attributes = attributes 45 | return 46 | 47 | def add_exporter(self, type): 48 | if (type not in exporter_types): 49 | exit(1) 50 | 51 | if (type == 'c_array'): 52 | e = c_array_exporter(self.attributes) 53 | self.exporters.append(e) 54 | elif (type == 'c_functions'): 55 | e = c_function_exporter(self.attributes) 56 | self.exporters.append(e) 57 | else: 58 | print('Unknown firmware exporter type!') 59 | exit(1) 60 | 61 | return 62 | 63 | def add_transaction(self, transaction): 64 | for e in self.exporters: 65 | e.add_transaction(transaction) 66 | 67 | return 68 | 69 | def add_metadata_text_line(self, line): 70 | for e in self.exporters: 71 | e.add_metadata_text_line(line) 72 | 73 | return 74 | 75 | def __str__(self): 76 | output_str = '' 77 | 78 | for e in self.exporters: 79 | output_str = output_str + str(e) 80 | 81 | return output_str 82 | 83 | def to_file(self): 84 | results_str = '' 85 | for e in self.exporters: 86 | results_str = results_str + e.to_file() 87 | 88 | return results_str 89 | 90 | #========================================================================== 91 | # HELPER FUNCTIONS 92 | #========================================================================== 93 | 94 | #========================================================================== 95 | # MAIN PROGRAM 96 | #========================================================================== 97 | 98 | -------------------------------------------------------------------------------- /tools/wisce_script_converter/wisce_script_function.py: -------------------------------------------------------------------------------- 1 | #========================================================================== 2 | # (c) 2021 Cirrus Logic, Inc. 3 | #-------------------------------------------------------------------------- 4 | # Project : WISCE Script Control Port Transaction class 5 | # File : wisce_script_function.py 6 | #-------------------------------------------------------------------------- 7 | # Licensed under the Apache License, Version 2.0 (the License); you may 8 | # not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an AS IS BASIS, WITHOUT 15 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | #-------------------------------------------------------------------------- 19 | # 20 | # Environment Requirements: None 21 | # 22 | #========================================================================== 23 | 24 | #========================================================================== 25 | # IMPORTS 26 | #========================================================================== 27 | 28 | #========================================================================== 29 | # CONSTANTS/GLOBALS 30 | #========================================================================== 31 | 32 | #========================================================================== 33 | # CLASSES 34 | #========================================================================== 35 | class wisce_script_function: 36 | def __init__(self, cmd, params, comment=None, length=None): 37 | self.__set_cmd(cmd) 38 | self.__set_params(params) 39 | self.__set_comment(comment) 40 | self.__set_length(length) 41 | return 42 | 43 | def __get_cmd(self): 44 | return self.__cmd 45 | 46 | def __set_cmd(self, cmd): 47 | self.__cmd = cmd 48 | 49 | cmd = property(__get_cmd, __set_cmd) 50 | 51 | def __get_params(self): 52 | return self.__params 53 | 54 | def __set_params(self, params): 55 | self.__params = params 56 | 57 | params = property(__get_params, __set_params) 58 | 59 | def __get_comment(self): 60 | return self.__comment 61 | 62 | def __set_comment(self, comment): 63 | self.__comment = comment 64 | 65 | comment = property(__get_comment, __set_comment) 66 | 67 | def __get_length(self): 68 | return self.__length 69 | 70 | def __set_length(self, length): 71 | self.__length = length 72 | 73 | length = property(__get_length, __set_length) 74 | 75 | #========================================================================== 76 | # HELPER FUNCTIONS 77 | #========================================================================== 78 | 79 | #========================================================================== 80 | # MAIN PROGRAM 81 | #========================================================================== 82 | 83 | --------------------------------------------------------------------------------