Engineer’s Work Log: Implementing Button-Triggered Pairing for TWS Paired Speakers on Jieli AC696N
Issue
A customer is developing TWS paired speakers using the Jieli AC696N development board. They need to implement a “button-triggered pairing” function, but are unsure which IO pin to connect the button to and how to configure it in the code.
Analysis & Reproduction
When reviewing the Jieli AC696N TWS paired speaker example project, we found that pairing is typically triggered by an AD key or a regular GPIO key. The example project reserves the pairing button logic, but does not explicitly state the hardware connection or software configuration mapping. The correct setup requires cross-referencing the schematic diagram and the key scan module in the code.
Solution
Open the TWS paired speaker example project and locate the key configuration section:
Hardware connection: It is recommended to connect the pairing button to PB4 (which is defined as an AD key channel in the Jieli AC696N factory firmware). Different buttons are distinguished by their AD sampling values.
Code configuration: In
adkey_table.c(or the user key configuration table), find the macroKEY_TWS_SEARCH_REMOVE_PAIR(pairing function). Bind this macro to the specific AD key value.
Modification example: In the key mapping array, set the trigger event of the corresponding AD key to
KEY_TWS_SEARCH_REMOVE_PAIR, and ensure the button press duration meets the default pairing trigger condition (e.g., long press for 3 seconds).
After completing the configuration, compile and burn the firmware. The button will then trigger TWS pairing.
Summary
The customer reported “OK” after half an hour following the guidance. The AC696N TWS example project already contains a complete pairing flow. Developers only need to correctly bind the button event to the hardware IO. It is recommended to refer to the key configuration section and comments in the AC6966B TWS paired speaker example project, and to use AD keys to save IO pins. This is a common sticking point in TWS paired speaker development – recorded here for fellow engineers.


评论
发表评论