mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-30 19:19:21 +00:00
change(lp-core): Update LP I2C and LP UART drivers to use raw interrupt status
This commit updates the LP I2C and LP UART drivers to use the raw interrupt status without enabling the interrupts.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "test_shared.h"
|
||||
#include "ulp_lp_core_utils.h"
|
||||
#include "ulp_lp_core_i2c.h"
|
||||
#include "ulp_lp_core_interrupts.h"
|
||||
|
||||
#define LP_I2C_TRANS_WAIT_FOREVER -1
|
||||
|
||||
@@ -19,6 +20,13 @@ uint8_t data_wr[DATA_LENGTH] = {};
|
||||
|
||||
int main(void)
|
||||
{
|
||||
/* Enable interrupts.
|
||||
* This does not affect how the LP I2C functions
|
||||
* but it will add extra test coverage to make sure
|
||||
* the interrupt handler does not cause any issues.
|
||||
*/
|
||||
ulp_lp_core_intr_enable();
|
||||
|
||||
lp_core_i2c_master_read_from_device(LP_I2C_NUM_0, I2C_SLAVE_ADDRESS, data_rd, RW_TEST_LENGTH, LP_I2C_TRANS_WAIT_FOREVER);
|
||||
read_test_reply = LP_CORE_COMMAND_OK;
|
||||
|
||||
|
@@ -11,6 +11,7 @@
|
||||
#include "ulp_lp_core_uart.h"
|
||||
#include "ulp_lp_core_print.h"
|
||||
#include "soc/soc_caps.h"
|
||||
#include "ulp_lp_core_interrupts.h"
|
||||
|
||||
#define LP_UART_PORT_NUM LP_UART_NUM_0
|
||||
#define LP_UART_BUFFER_LEN UART_BUF_SIZE
|
||||
@@ -37,6 +38,13 @@ volatile char test_character;
|
||||
|
||||
int main(void)
|
||||
{
|
||||
/* Enable interrupts.
|
||||
* This does not affect how the LP UART functions
|
||||
* but it will add extra test coverage to make sure
|
||||
* the interrupt handler does not cause any issues.
|
||||
*/
|
||||
ulp_lp_core_intr_enable();
|
||||
|
||||
while (1) {
|
||||
/* Wait for the HP core to start the test */
|
||||
while (test_cmd == LP_CORE_NO_COMMAND) {
|
||||
|
Reference in New Issue
Block a user