[bsp][nxp][rsoc] Fix compilation issues with bsp of nxp/lxp series

This commit is contained in:
hydevcode authored and GitHub committed 2024-09-29 20:47:39 -04:00
1 parent e7e44ec7e8
commit 66d54ea8c0
17 files changed
+1336 -1234

No files matched your search

+2 -2
View File
@@ -209,8 +209,8 @@ jobs:
- "nxp/lpc/lpc1114"
- "nxp/lpc/lpc2148"
- "nxp/lpc/lpc2478"
# - "nxp/lpc/lpc5410x"
# - "nxp/lpc/lpc54114-lite"
- "nxp/lpc/lpc5410x"
- "nxp/lpc/lpc54114-lite"
- "nxp/lpc/lpc176x"
#- "nxp/lpc/lpc43xx/M4"
- "nxp/imx/imx6sx/cortex-a9"
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -63,27 +63,27 @@ extern "C" {
* @brief High level ROM API structure
*/
typedef struct {
const uint32_t reserved_usb; /*!< Reserved */
const uint32_t reserved_clib; /*!< Reserved */
const uint32_t reserved_can; /*!< Reserved */
const PWRD_API_T *pPWRD; /*!< Power API function table base address */
const uint32_t reserved_div; /*!< Reserved */
const uint32_t reserved_i2cd; /*!< Reserved */
const uint32_t reserved_dmad; /*!< Reserved */
const uint32_t reserved_spid; /*!< Reserved */
const uint32_t reserved_adcd; /*!< Reserved */
const uint32_t reserved_uartd; /*!< Reserved */
const uint32_t reserved_vfifo; /*!< Reserved */
const uint32_t reserved_usart; /*!< Reserved */
/* v2 drivers - only present in some LPC5410x devices */
const ROM_I2CMD_API_T *pI2CMD; /*!< v2 I2C master only driver API function table base address */
const ROM_I2CSD_API_T *pI2CSD; /*!< v2 I2C slave only driver API function table base address */
const ROM_I2CMOND_API_T *pI2CMOND; /*!< v2 I2C bus monitor driver API function table base address */
const ROM_SPIMD_API_T *pSPIMD; /*!< v2 SPI master only driver API function table base address */
const ROM_SPISD_API_T *pSPISD; /*!< v2 SPI slave only driver API function table base address */
const ROM_DMAALTD_API_T *pDMAALT; /*!< v2 abstract DMA driver API function table base address */
const ROM_ADC_API_T *pADCALT; /*!< v2 ADC driver API function table base address */
const ROM_UART_API_T *pUARTALT; /*!< v2 UART driver API function table base address */
const uint32_t reserved_usb; /*!< Reserved */
const uint32_t reserved_clib; /*!< Reserved */
const uint32_t reserved_can; /*!< Reserved */
const PWRD_API_T *pPWRD; /*!< Power API function table base address */
const uint32_t reserved_div; /*!< Reserved */
const uint32_t reserved_i2cd; /*!< Reserved */
const uint32_t reserved_dmad; /*!< Reserved */
const uint32_t reserved_spid; /*!< Reserved */
const uint32_t reserved_adcd; /*!< Reserved */
const uint32_t reserved_uartd; /*!< Reserved */
const uint32_t reserved_vfifo; /*!< Reserved */
const uint32_t reserved_usart; /*!< Reserved */
/* v2 drivers - only present in some LPC5410x devices */
const ROM_I2CMD_API_T *pI2CMD; /*!< v2 I2C master only driver API function table base address */
const ROM_I2CSD_API_T *pI2CSD; /*!< v2 I2C slave only driver API function table base address */
const ROM_I2CMOND_API_T *pI2CMOND; /*!< v2 I2C bus monitor driver API function table base address */
const ROM_SPIMD_API_T *pSPIMD; /*!< v2 SPI master only driver API function table base address */
const ROM_SPISD_API_T *pSPISD; /*!< v2 SPI slave only driver API function table base address */
const ROM_DMAALTD_API_T *pDMAALT; /*!< v2 abstract DMA driver API function table base address */
const ROM_ADC_API_T *pADCALT; /*!< v2 ADC driver API function table base address */
const ROM_UART_API_T *pUARTALT; /*!< v2 UART driver API function table base address */
} LPC_ROM_API_T;
/* Pointer to ROM API function address */
@@ -123,9 +123,9 @@ typedef struct {
/**
* @brief LPC5410x IAP_ENTRY API function type
*/
static INLINE void iap_entry(unsigned int cmd_param[5], unsigned int status_result[4])
static INLINE void iap_entry(uint32_t cmd_param[5], uint32_t status_result[4])
{
((IAP_ENTRY_T) IAP_ENTRY_LOCATION)(cmd_param, status_result);
((IAP_ENTRY_T) IAP_ENTRY_LOCATION)(cmd_param, status_result);
}
/**
@@ -78,7 +78,7 @@ extern "C" {
#define IAP_CRP_ENABLED 19 /*!< Code read protection enabled */
/* IAP_ENTRY API function type */
typedef void (*IAP_ENTRY_T)(unsigned int[5], unsigned int[4]);
typedef void (*IAP_ENTRY_T)(uint32_t[5], uint32_t[4]);
/**
* @brief Prepare sector for write operation
-11
View File
@@ -25,21 +25,10 @@
#endif
// <RDTConfigurator URL="http://www.rt-thread.com/eclipse">
// <integer name="LPC_EXT_SDRAM" description="Begin Address of External SDRAM" default="0xA0000000" />
#define LPC_EXT_SDRAM_BEGIN 0xA0000000
// <integer name="LPC_EXT_SDRAM_END" description="End Address of External SDRAM" default="0xA2000000" />
#define LPC_EXT_SDRAM_END 0xA2000000
// <bool name="RT_USING_UART0" description="Using UART0" default="true" />
#define RT_USING_UART0
// <bool name="RT_USING_UART1" description="Using UART1" default="true" />
//#define RT_USING_UART1
// <bool name="RT_USING_UART2" description="Using UART2" default="true" />
#define RT_USING_UART2
// <string name="RT_CONSOLE_DEVICE_NAME" description="The name of console device" default="" />
#define RT_CONSOLE_DEVICE_NAME "uart0"
// </RDTConfigurator>
#ifdef __CC_ARM
+1
View File
@@ -157,6 +157,7 @@ void UART0_IRQHandler(void)
break;
default :
tmp = LPC_USART0->INTSTAT;
RT_UNUSED(tmp);
break;
}
/* leave interrupt */
+1 -1
View File
@@ -128,7 +128,7 @@ static rt_err_t configure(struct rt_spi_device *device, struct rt_spi_configurat
return ret;
}
static rt_uint32_t spixfer(struct rt_spi_device *device, struct rt_spi_message *message)
static rt_ssize_t spixfer(struct rt_spi_device *device, struct rt_spi_message *message)
{
spi_transfer_t transfer = {0};
+15 -15
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2023, RT-Thread Development Team
* Copyright (c) 2006-2024 RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -22,39 +22,39 @@
*
* <b>Example</b>
* @code {.c}
* #define ADC_DEV_NAME "adc1"
* #define ADC_DEV_CHANNEL 5
* #define REFER_VOLTAGE 330
* #define CONVERT_BITS (1 << 12)
*
* #define ADC_DEV_NAME "adc1"
* #define ADC_DEV_CHANNEL 5
* #define REFER_VOLTAGE 330
* #define CONVERT_BITS (1 << 12)
*
* static int adc_vol_sample(int argc, char *argv[])
* {
* rt_adc_device_t adc_dev;
* rt_uint32_t value, vol;
*
*
* rt_err_t ret = RT_EOK;
*
*
* adc_dev = (rt_adc_device_t)rt_device_find(ADC_DEV_NAME);
* if (adc_dev == RT_NULL)
* {
* rt_kprintf("adc sample run failed! can't find %s device!\n", ADC_DEV_NAME);
* return RT_ERROR;
* return -RT_ERROR;
* }
*
*
* ret = rt_adc_enable(adc_dev, ADC_DEV_CHANNEL);
*
*
* value = rt_adc_read(adc_dev, ADC_DEV_CHANNEL);
* rt_kprintf("the value is :%d \n", value);
*
*
* vol = value * REFER_VOLTAGE / CONVERT_BITS;
* rt_kprintf("the voltage is :%d.%02d \n", vol / 100, vol % 100);
*
*
* ret = rt_adc_disable(adc_dev, ADC_DEV_CHANNEL);
*
*
* return ret;
* }
* MSH_CMD_EXPORT(adc_vol_sample, adc voltage convert sample);
*
*
* @endcode
*
* @ingroup Drivers
+18 -18
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2023, RT-Thread Development Team
* Copyright (c) 2006-2024 RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -19,47 +19,47 @@
*
* <b>Example</b>
* @code {.c}
*
*
* #include <rtthread.h>
* #include <rtdevice.h>
* #include <stdlib.h>
* #define DAC_DEV_NAME "dac1"
* #define DAC_DEV_CHANNEL 1
* #define REFER_VOLTAGE 330
* #define CONVERT_BITS (1 << 12)
*
* #define DAC_DEV_NAME "dac1"
* #define DAC_DEV_CHANNEL 1
* #define REFER_VOLTAGE 330
* #define CONVERT_BITS (1 << 12)
*
* static int dac_vol_sample(int argc, char *argv[])
* {
* rt_dac_device_t dac_dev;
* rt_uint32_t value, vol;
* rt_err_t ret = RT_EOK;
*
*
* dac_dev = (rt_dac_device_t)rt_device_find(DAC_DEV_NAME);
* if (dac_dev == RT_NULL)
* {
* rt_kprintf("dac sample run failed! can't find %s device!\n", DAC_DEV_NAME);
* return RT_ERROR;
* return -RT_ERROR;
* }
*
*
* ret = rt_dac_enable(dac_dev, DAC_DEV_CHANNEL);
*
*
* value = atoi(argv[1]);
* rt_dac_write(dac_dev, DAC_DEV_NAME, DAC_DEV_CHANNEL, value);
* rt_kprintf("the value is :%d \n", value);
*
*
* vol = value * REFER_VOLTAGE / CONVERT_BITS;
* rt_kprintf("the voltage is :%d.%02d \n", vol / 100, vol % 100);
*
*
* rt_thread_mdelay(500);
*
*
* ret = rt_dac_disable(dac_dev, DAC_DEV_CHANNEL);
*
*
* return ret;
* }
* MSH_CMD_EXPORT(dac_vol_sample, dac voltage convert sample);
*
*
* @endcode
*
*
* @ingroup Drivers
*/
@@ -80,7 +80,7 @@ struct rt_dac_ops
};
/**
* @brief DAC device structure
*
*
*/
struct rt_dac_device
{