risc-v/esp32c3: Move files shared between boards into a common folder

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
This commit is contained in:
Gustavo Henrique Nihei 2022-12-07 17:55:30 -03:00 committed by Xiang Xiao
parent 9af5dca7dc
commit 1ced1e9f35
73 changed files with 1167 additions and 690 deletions

View File

@ -3790,6 +3790,9 @@ endif
if ARCH_CHIP_ESP32S3
source "boards/xtensa/esp32s3/common/Kconfig"
endif
if ARCH_CHIP_ESP32C3
source "boards/risc-v/esp32c3/common/Kconfig"
endif
if ARCH_CHIP_SAMV7
source "boards/arm/samv7/common/Kconfig"
endif

View File

@ -11,3 +11,64 @@ config ESP32C3_MERGE_BINS
device.
This is only useful when the path to binary files (e.g. bootloader)
is provided via the ESPTOOL_BINDIR variable.
choice ESP32C3_SPIFLASH_FS
prompt "Mount SPI Flash MTD on bring-up"
default ESP32C3_SPIFLASH_SMARTFS
depends on ESP32C3_MTD
optional
---help---
Mount the SPI Flash MTD with the selected File System format on board
bring-up.
If not selected, the MTD will be registered as a device node on /dev.
config ESP32C3_SPIFLASH_SMARTFS
bool "SmartFS"
select FS_SMARTFS
select MTD_SMART
depends on !ESP32C3_SECURE_FLASH_ENC_ENABLED
comment "SmartFS not supported with Flash Encryption"
depends on ESP32C3_SECURE_FLASH_ENC_ENABLED
config ESP32C3_SPIFLASH_NXFFS
bool "NXFFS"
select FS_NXFFS
depends on !ESP32C3_SECURE_FLASH_ENC_ENABLED
comment "NXFFS not supported with Flash Encryption"
depends on ESP32C3_SECURE_FLASH_ENC_ENABLED
config ESP32C3_SPIFLASH_SPIFFS
bool "SPIFFS"
select FS_SPIFFS
depends on !ESP32C3_SECURE_FLASH_ENC_ENABLED
comment "SPIFFS not supported with Flash Encryption"
depends on ESP32C3_SECURE_FLASH_ENC_ENABLED
config ESP32C3_SPIFLASH_LITTLEFS
bool "LittleFS"
select FS_LITTLEFS
config ESP32C3_SPIFLASH_MTD_CONFIG
bool "Non-volatile storage"
endchoice
config ESP32C3_SPIFLASH_FS_MOUNT_PT
string "File-system Mount Point"
depends on ESP32C3_SPIFLASH_LITTLEFS
default "/data"
if LCD_ST7735 || LCD_ST7789 || LCD_GC9A01
config ESP32C3_LCD_RSTPIN
int "LCD reset pin"
default 9
config ESP32C3_LCD_BLPIN
int "LCD backlight pin"
default 18
endif # LCD_ST7735 || LCD_ST7789 || LCD_GC9A01

View File

@ -0,0 +1,74 @@
/****************************************************************************
* boards/risc-v/esp32c3/common/include/esp32c3_board_adc.h
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
#ifndef __BOARDS_RISCV_ESP32C3_COMMON_INCLUDE_ESP32C3_BOARD_ADC_H
#define __BOARDS_RISCV_ESP32C3_COMMON_INCLUDE_ESP32C3_BOARD_ADC_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#ifndef __ASSEMBLY__
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
/****************************************************************************
* Name: board_adc_init
*
* Description:
* Configure the ADC driver.
*
* Input Parameters:
* None.
*
* Returned Value:
* Zero (OK) is returned on success; A negated errno value is returned
* to indicate the nature of any failure.
*
****************************************************************************/
#ifdef CONFIG_ADC
int board_adc_init(void);
#endif
#undef EXTERN
#if defined(__cplusplus)
}
#endif
#endif /* __ASSEMBLY__ */
#endif /* __BOARDS_RISCV_ESP32C3_COMMON_INCLUDE_ESP32C3_BOARD_ADC_H */

View File

@ -1,5 +1,5 @@
/****************************************************************************
* boards/risc-v/esp32c3/esp32c3-devkit-rust-1/src/esp32c3_board_spi.c
* boards/risc-v/esp32c3/common/include/esp32c3_board_apds9960.h
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -18,66 +18,57 @@
*
****************************************************************************/
#ifndef __BOARDS_RISCV_ESP32C3_COMMON_INCLUDE_ESP32C3_BOARD_APDS9960_H
#define __BOARDS_RISCV_ESP32C3_COMMON_INCLUDE_ESP32C3_BOARD_APDS9960_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <stdint.h>
#include <stdbool.h>
#include <debug.h>
#include <nuttx/spi/spi.h>
#include "esp32c3_gpio.h"
/****************************************************************************
* Private Functions
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
#ifndef __ASSEMBLY__
/****************************************************************************
* Name: esp32c3_spi2_status
****************************************************************************/
#ifdef CONFIG_ESP32C3_SPI2
uint8_t esp32c3_spi2_status(struct spi_dev_s *dev, uint32_t devid)
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C"
{
uint8_t status = 0;
return status;
}
#else
#define EXTERN extern
#endif
/****************************************************************************
* Name: esp32c3_spi2_cmddata
* Public Function Prototypes
****************************************************************************/
#if defined(CONFIG_ESP32C3_SPI2) && defined(CONFIG_SPI_CMDDATA)
int esp32c3_spi2_cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
{
if (devid == SPIDEV_DISPLAY(0))
{
/* This is the Data/Command control pad which determines whether the
* data bits are data or a command.
*/
esp32c3_gpiowrite(CONFIG_ESP32C3_SPI2_MISOPIN, !cmd);
return OK;
}
spiinfo("devid: %" PRIu32 " CMD: %s\n", devid, cmd ? "command" :
"data");
return -ENODEV;
}
/****************************************************************************
* Name: board_apds9960_initialize
*
* Description:
* Initialize and register the APDS9960 gesture sensor.
*
* Input Parameters:
* devno - The device number, used to build the device path as /dev/gestN
* busno - The I2C bus number
*
* Returned Value:
* Zero (OK) on success; a negated errno value on failure.
*
****************************************************************************/
#ifdef CONFIG_SENSORS_APDS9960
int board_apds9960_initialize(int devno, int busno);
#endif
#undef EXTERN
#if defined(__cplusplus)
}
#endif
#endif /* __ASSEMBLY__ */
#endif /* __BOARDS_RISCV_ESP32C3_COMMON_INCLUDE_ESP32C3_BOARD_APDS9960_H */

View File

@ -0,0 +1,74 @@
/****************************************************************************
* boards/risc-v/esp32c3/common/include/esp32c3_board_bmp180.h
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
#ifndef __BOARDS_RISCV_ESP32C3_COMMON_INCLUDE_ESP32C3_BOARD_BMP180_H
#define __BOARDS_RISCV_ESP32C3_COMMON_INCLUDE_ESP32C3_BOARD_BMP180_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#ifndef __ASSEMBLY__
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
/****************************************************************************
* Name: board_bmp180_initialize
*
* Description:
* Initialize and register the BMP180 Pressure Sensor driver.
*
* Input Parameters:
* devno - The device number, used to build the device path as /dev/pressN
* busno - The I2C bus number
*
* Returned Value:
* Zero (OK) on success; a negated errno value on failure.
*
****************************************************************************/
#ifdef CONFIG_SENSORS_BMP180
int board_bmp180_initialize(int devno, int busno);
#endif
#undef EXTERN
#if defined(__cplusplus)
}
#endif
#endif /* __ASSEMBLY__ */
#endif /* __BOARDS_RISCV_ESP32C3_COMMON_INCLUDE_ESP32C3_BOARD_BMP180_H */

View File

@ -0,0 +1,74 @@
/****************************************************************************
* boards/risc-v/esp32c3/common/include/esp32c3_board_i2c.h
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
#ifndef __BOARDS_RISCV_ESP32C3_COMMON_INCLUDE_ESP32C3_BOARD_I2C_H
#define __BOARDS_RISCV_ESP32C3_COMMON_INCLUDE_ESP32C3_BOARD_I2C_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#ifndef __ASSEMBLY__
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
/****************************************************************************
* Name: board_i2c_init
*
* Description:
* Configure the I2C driver.
*
* Input Parameters:
* None.
*
* Returned Value:
* Zero (OK) is returned on success; A negated errno value is returned
* to indicate the nature of any failure.
*
****************************************************************************/
#ifdef CONFIG_I2C_DRIVER
int board_i2c_init(void);
#endif
#undef EXTERN
#if defined(__cplusplus)
}
#endif
#endif /* __ASSEMBLY__ */
#endif /* __BOARDS_RISCV_ESP32C3_COMMON_INCLUDE_ESP32C3_BOARD_I2C_H */

View File

@ -0,0 +1,74 @@
/****************************************************************************
* boards/risc-v/esp32c3/common/include/esp32c3_board_ledc.h
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
#ifndef __BOARDS_RISCV_ESP32C3_COMMON_INCLUDE_ESP32C3_BOARD_LEDC_H
#define __BOARDS_RISCV_ESP32C3_COMMON_INCLUDE_ESP32C3_BOARD_LEDC_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#ifndef __ASSEMBLY__
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
/****************************************************************************
* Name: board_ledc_setup
*
* Description:
* Initialize LEDC PWM and register the PWM device.
*
* Input Parameters:
* None.
*
* Returned Value:
* Zero (OK) is returned on success; A negated errno value is returned
* to indicate the nature of any failure.
*
****************************************************************************/
#ifdef CONFIG_ESP32C3_LEDC
int board_ledc_setup(void);
#endif
#undef EXTERN
#if defined(__cplusplus)
}
#endif
#endif /* __ASSEMBLY__ */
#endif /* __BOARDS_RISCV_ESP32C3_COMMON_INCLUDE_ESP32C3_BOARD_LEDC_H */

View File

@ -0,0 +1,75 @@
/****************************************************************************
* boards/risc-v/esp32c3/common/include/esp32c3_board_oneshot.h
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
#ifndef __BOARDS_RISCV_ESP32C3_COMMON_INCLUDE_ESP32C3_BOARD_ONESHOT_H
#define __BOARDS_RISCV_ESP32C3_COMMON_INCLUDE_ESP32C3_BOARD_ONESHOT_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#ifndef __ASSEMBLY__
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
/****************************************************************************
* Name: board_oneshot_init
*
* Description:
* Configure the oneshot timer driver.
*
* Input Parameters:
* timer - Timer instance to be used as oneshot timer.
* resolution - Oneshot timer resolution.
*
* Returned Value:
* Zero (OK) is returned on success; A negated errno value is returned
* to indicate the nature of any failure.
*
****************************************************************************/
#ifdef CONFIG_ONESHOT
int board_oneshot_init(int timer, uint16_t resolution);
#endif
#undef EXTERN
#if defined(__cplusplus)
}
#endif
#endif /* __ASSEMBLY__ */
#endif /* __BOARDS_RISCV_ESP32C3_COMMON_INCLUDE_ESP32C3_BOARD_ONESHOT_H */

View File

@ -0,0 +1,74 @@
/****************************************************************************
* boards/risc-v/esp32c3/common/include/esp32c3_board_spidev.h
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
#ifndef __BOARDS_RISCV_ESP32C3_COMMON_INCLUDE_ESP32C3_BOARD_SPIDEV_H
#define __BOARDS_RISCV_ESP32C3_COMMON_INCLUDE_ESP32C3_BOARD_SPIDEV_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#ifndef __ASSEMBLY__
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
/****************************************************************************
* Name: board_spidev_initialize
*
* Description:
* Initialize SPI driver and register the /dev/spi device.
*
* Input Parameters:
* bus - The SPI bus number, used to build the device path as /dev/spiN
*
* Returned Value:
* Zero (OK) is returned on success; A negated errno value is returned
* to indicate the nature of any failure.
*
****************************************************************************/
#ifdef CONFIG_SPI_DRIVER
int board_spidev_initialize(int bus);
#endif
#undef EXTERN
#if defined(__cplusplus)
}
#endif
#endif /* __ASSEMBLY__ */
#endif /* __BOARDS_RISCV_ESP32C3_COMMON_INCLUDE_ESP32C3_BOARD_SPIDEV_H */

View File

@ -0,0 +1,74 @@
/****************************************************************************
* boards/risc-v/esp32c3/common/include/esp32c3_board_spiflash.h
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
#ifndef __BOARDS_RISCV_ESP32C3_COMMON_INCLUDE_ESP32C3_BOARD_SPIFLASH_H
#define __BOARDS_RISCV_ESP32C3_COMMON_INCLUDE_ESP32C3_BOARD_SPIFLASH_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#ifndef __ASSEMBLY__
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
/****************************************************************************
* Name: board_spiflash_init
*
* Description:
* Initialize the SPIFLASH and register the MTD device.
*
* Input Parameters:
* None.
*
* Returned Value:
* Zero (OK) is returned on success; A negated errno value is returned
* to indicate the nature of any failure.
*
****************************************************************************/
#ifdef CONFIG_ESP32C3_SPIFLASH
int board_spiflash_init(void);
#endif
#undef EXTERN
#if defined(__cplusplus)
}
#endif
#endif /* __ASSEMBLY__ */
#endif /* __BOARDS_RISCV_ESP32C3_COMMON_INCLUDE_ESP32C3_BOARD_SPIFLASH_H */

View File

@ -0,0 +1,74 @@
/****************************************************************************
* boards/risc-v/esp32c3/common/include/esp32c3_board_spislavedev.h
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
#ifndef __BOARDS_RISCV_ESP32C3_COMMON_INCLUDE_ESP32C3_BOARD_SPISLAVEDEV_H
#define __BOARDS_RISCV_ESP32C3_COMMON_INCLUDE_ESP32C3_BOARD_SPISLAVEDEV_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#ifndef __ASSEMBLY__
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
/****************************************************************************
* Name: board_spislavedev_initialize
*
* Description:
* Initialize SPI Slave driver and register the /dev/spislv device.
*
* Input Parameters:
* bus - The SPI bus number, used to build the device path as /dev/spislvN
*
* Returned Value:
* Zero (OK) is returned on success; A negated errno value is returned
* to indicate the nature of any failure.
*
****************************************************************************/
#ifdef CONFIG_SPI_SLAVE
int board_spislavedev_initialize(int bus);
#endif
#undef EXTERN
#if defined(__cplusplus)
}
#endif
#endif /* __ASSEMBLY__ */
#endif /* __BOARDS_RISCV_ESP32C3_COMMON_INCLUDE_ESP32C3_BOARD_SPISLAVEDEV_H */

View File

@ -0,0 +1,74 @@
/****************************************************************************
* boards/risc-v/esp32c3/common/include/esp32c3_board_twai.h
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
#ifndef __BOARDS_RISCV_ESP32C3_COMMON_INCLUDE_ESP32C3_BOARD_TWAI_H
#define __BOARDS_RISCV_ESP32C3_COMMON_INCLUDE_ESP32C3_BOARD_TWAI_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#ifndef __ASSEMBLY__
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
/****************************************************************************
* Name: board_twai_setup
*
* Description:
* Configure the TWAI driver.
*
* Input Parameters:
* None.
*
* Returned Value:
* Zero (OK) is returned on success; A negated errno value is returned
* to indicate the nature of any failure.
*
****************************************************************************/
#ifdef CONFIG_CAN
int board_twai_setup(void);
#endif
#undef EXTERN
#if defined(__cplusplus)
}
#endif
#endif /* __ASSEMBLY__ */
#endif /* __BOARDS_RISCV_ESP32C3_COMMON_INCLUDE_ESP32C3_BOARD_TWAI_H */

View File

@ -0,0 +1,74 @@
/****************************************************************************
* boards/risc-v/esp32c3/common/include/esp32c3_board_wdt.h
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
#ifndef __BOARDS_RISCV_ESP32C3_COMMON_INCLUDE_ESP32C3_BOARD_WDT_H
#define __BOARDS_RISCV_ESP32C3_COMMON_INCLUDE_ESP32C3_BOARD_WDT_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#ifndef __ASSEMBLY__
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
/****************************************************************************
* Name: board_wdt_init
*
* Description:
* Configure the Watchdog Timer driver.
*
* Input Parameters:
* None.
*
* Returned Value:
* Zero (OK) is returned on success; A negated errno value is returned
* to indicate the nature of any failure.
*
****************************************************************************/
#ifdef CONFIG_WATCHDOG
int board_wdt_init(void);
#endif
#undef EXTERN
#if defined(__cplusplus)
}
#endif
#endif /* __ASSEMBLY__ */
#endif /* __BOARDS_RISCV_ESP32C3_COMMON_INCLUDE_ESP32C3_BOARD_WDT_H */

View File

@ -0,0 +1,74 @@
/****************************************************************************
* boards/risc-v/esp32c3/common/include/esp32c3_board_wlan.h
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
#ifndef __BOARDS_RISCV_ESP32C3_COMMON_INCLUDE_ESP32C3_BOARD_WLAN_H
#define __BOARDS_RISCV_ESP32C3_COMMON_INCLUDE_ESP32C3_BOARD_WLAN_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#ifndef __ASSEMBLY__
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
/****************************************************************************
* Name: board_wlan_init
*
* Description:
* Configure the wireless subsystem.
*
* Input Parameters:
* None.
*
* Returned Value:
* Zero (OK) is returned on success; A negated errno value is returned
* to indicate the nature of any failure.
*
****************************************************************************/
#ifdef CONFIG_ESP32C3_WIRELESS
int board_wlan_init(void);
#endif
#undef EXTERN
#if defined(__cplusplus)
}
#endif
#endif /* __ASSEMBLY__ */
#endif /* __BOARDS_RISCV_ESP32C3_COMMON_INCLUDE_ESP32C3_BOARD_WLAN_H */

View File

@ -29,13 +29,13 @@ ENTRYPT = $(patsubst "%",%,$(CONFIG_INIT_ENTRYPOINT))
# is appropriate for the host OS
USER_LIBPATHS = $(addprefix -L,$(call CONVERT_PATH,$(addprefix $(TOPDIR)$(DELIM),$(dir $(USERLIBS)))))
USER_LDSCRIPT = -T $(call CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32c3_out.ld)
USER_LDSCRIPT += -T $(call CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)user-space.ld)
USER_LDSCRIPT += -T $(call CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32c3_rom.ld)
USER_LDSCRIPT = $(call CONVERT_PATH,$(BOARD_COMMON_DIR)$(DELIM)scripts$(DELIM)protected_memory.ld)
USER_LDSCRIPT += $(call CONVERT_PATH,$(BOARD_COMMON_DIR)$(DELIM)scripts$(DELIM)user-space.ld)
USER_LDSCRIPT += $(call CONVERT_PATH,$(BOARD_COMMON_DIR)$(DELIM)scripts$(DELIM)esp32c3_rom.ld)
USER_HEXFILE += $(call CONVERT_PATH,$(TOPDIR)$(DELIM)nuttx_user.hex)
USER_BINFILE += $(call CONVERT_PATH,$(TOPDIR)$(DELIM)nuttx_user.bin)
USER_LDFLAGS = --undefined=$(ENTRYPT) --entry=$(ENTRYPT) $(USER_LDSCRIPT) -melf32lriscv
USER_LDFLAGS = --undefined=$(ENTRYPT) --entry=$(ENTRYPT) $(addprefix -T,$(addsuffix .tmp,$(USER_LDSCRIPT))) -melf32lriscv
ifeq ($(CONFIG_DEBUG_LINK_MAP),y)
USER_LDFLAGS += --cref -Map="$(TOPDIR)$(DELIM)User.map"
@ -68,9 +68,12 @@ all: $(TOPDIR)$(DELIM)nuttx_user.elf
$(COBJS): %$(OBJEXT): %.c
$(call COMPILE, $<, $@)
$(addsuffix .tmp,$(USER_LDSCRIPT)): $(USER_LDSCRIPT)
$(call PREPROCESS,$(patsubst %.tmp,%,$@),$@)
# Create the nuttx_user.elf file containing all of the user-mode code
nuttx_user.elf: $(OBJS)
nuttx_user.elf: $(OBJS) $(addsuffix .tmp,$(USER_LDSCRIPT))
$(Q) $(LD) -o $@ $(USER_LDFLAGS) $(USER_LIBPATHS) $(OBJS) $(LDSTARTGROUP) $(USER_LDLIBS) $(LDENDGROUP) $(USER_LIBGCC)
$(TOPDIR)$(DELIM)nuttx_user.elf: nuttx_user.elf
@ -84,6 +87,7 @@ ifeq ($(CONFIG_RAW_BINARY),y)
$(Q) echo "CP: nuttx_user.bin"
$(Q) $(OBJCOPY) $(OBJCOPYARGS) -O binary nuttx_user.elf $(USER_BINFILE)
endif
$(Q) $(call DELFILE,$(addsuffix .tmp,$(USER_LDSCRIPT)))
.depend:

View File

@ -1,5 +1,5 @@
#############################################################################
# boards/risc-v/esp32c3/esp32c3-devkit/src/Makefile
# boards/risc-v/esp32c3/common/src/Make.defs
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
@ -18,99 +18,78 @@
#
#############################################################################
include $(TOPDIR)/Make.defs
SCRIPTDIR = $(BOARD_DIR)$(DELIM)scripts
CONFIGFILE = $(TOPDIR)$(DELIM)include$(DELIM)nuttx$(DELIM)config.h
CSRCS = esp32c3_boot.c esp32c3_bringup.c
ifeq ($(CONFIG_BOARDCTL),y)
CSRCS += esp32c3_appinit.c
ifeq ($(CONFIG_BOARDCTL_RESET),y)
CSRCS += esp32c3_reset.c
endif
endif
ifeq ($(CONFIG_ESP32C3_SPIFLASH),y)
CSRCS += esp32c3_spiflash.c
endif
ifeq ($(CONFIG_ESP32C3_WIRELESS),y)
CSRCS += esp32c3_board_wlan.c
endif
ifeq ($(CONFIG_DEV_GPIO),y)
CSRCS += esp32c3_gpio.c
endif
ifeq ($(CONFIG_ARCH_BOARD_COMMON),y)
ifeq ($(CONFIG_ESP32C3_SPI),y)
CSRCS += esp32c3_board_spi.c
CSRCS += esp32c3_board_spi.c
endif
ifeq ($(CONFIG_SPI_DRIVER),y)
CSRCS += esp32c3_board_spidev.c
CSRCS += esp32c3_board_spidev.c
endif
ifeq ($(CONFIG_SPI_SLAVE_DRIVER),y)
CSRCS += esp32c3_board_spislavedev.c
CSRCS += esp32c3_board_spislavedev.c
endif
ifeq ($(CONFIG_ESP32C3_SPIFLASH),y)
CSRCS += esp32c3_board_spiflash.c
endif
ifeq ($(CONFIG_I2C_DRIVER),y)
CSRCS += esp32c3_i2c.c
CSRCS += esp32c3_board_i2c.c
endif
ifeq ($(CONFIG_ESP32C3_WIRELESS),y)
CSRCS += esp32c3_board_wlan.c
endif
ifeq ($(CONFIG_CAN),y)
CSRCS += esp32c3_twai.c
endif
ifeq ($(CONFIG_SENSORS_BMP180),y)
CSRCS += esp32c3_bmp180.c
CSRCS += esp32c3_board_twai.c
endif
ifeq ($(CONFIG_WATCHDOG),y)
CSRCS += esp32c3_wdt.c
CSRCS += esp32c3_board_wdt.c
endif
ifeq ($(CONFIG_ONESHOT),y)
CSRCS += esp32c3_oneshot.c
CSRCS += esp32c3_board_oneshot.c
endif
ifeq ($(CONFIG_PWM),y)
CSRCS += esp32c3_ledc.c
CSRCS += esp32c3_board_ledc.c
endif
ifeq ($(CONFIG_ADC),y)
CSRCS += esp32c3_adc.c
CSRCS += esp32c3_board_adc.c
endif
ifeq ($(CONFIG_SENSORS_BMP180),y)
CSRCS += esp32c3_board_bmp180.c
endif
ifeq ($(CONFIG_LCD_ST7735),y)
CSRCS += esp32c3_st7735.c
CSRCS += esp32c3_board_st7735.c
endif
ifeq ($(CONFIG_LCD_ST7789),y)
CSRCS += esp32c3_st7789.c
CSRCS += esp32c3_board_st7789.c
endif
ifeq ($(CONFIG_LCD_GC9A01),y)
CSRCS += esp32c3_gc9a01.c
CSRCS += esp32c3_board_gc9a01.c
endif
ifeq ($(CONFIG_BOARDCTL_IOCTL),y)
CSRCS += esp32c3_ioctl.c
ifeq ($(CONFIG_SENSORS_APDS9960),y)
CSRCS += esp32c3_board_apds9960.c
endif
ifeq ($(CONFIG_BOARDCTL_UNIQUEID),y)
CSRCS += esp32c3_uid.c
ifeq ($(CONFIG_LCD_APA102),y)
CSRCS += esp32c3_board_apa102.c
endif
ifeq ($(CONFIG_NSH_ROMFSETC),y)
ifneq ($(CONFIG_NSH_CUSTOMROMFS),y)
RCSRCS = etc/init.d/rc.sysinit etc/init.d/rcS
RCRAWS = etc/group etc/passwd
endif
endif
DEPPATH += --dep-path src
VPATH += :src
CFLAGS += $(shell $(INCDIR) "$(CC)" $(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board$(DELIM)src)
include $(TOPDIR)/boards/Board.mk
endif

View File

@ -1,5 +1,5 @@
/****************************************************************************
* boards/risc-v/esp32c3/esp32c3-devkit/src/esp32c3_adc.c
* boards/risc-v/esp32c3/common/src/esp32c3_board_adc.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -29,7 +29,7 @@
#include "esp32c3_adc.h"
#include "esp32c3-devkit.h"
#include "esp32c3_board_adc.h"
/****************************************************************************
* Pre-processor Definitions
@ -45,6 +45,9 @@
* Description:
* Configure the ADC driver.
*
* Input Parameters:
* None.
*
* Returned Value:
* Zero (OK) is returned on success; A negated errno value is returned
* to indicate the nature of any failure.

View File

@ -1,5 +1,5 @@
/****************************************************************************
* boards/risc-v/esp32c3/esp32c3-devkit-rust-1/src/esp32c3_apa102.c
* boards/risc-v/esp32c3/common/src/esp32c3_board_apa102.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -37,7 +37,6 @@
#include "esp32c3_gpio.h"
#include "esp32c3_spi.h"
#include "esp32c3-devkit-rust-1.h"
/****************************************************************************
* Pre-processor Definitions

View File

@ -1,5 +1,5 @@
/****************************************************************************
* boards/risc-v/esp32c3/esp32c3-devkit-rust-1/src/esp32c3_apds9960.c
* boards/risc-v/esp32c3/common/src/esp32c3_board_apds9960.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -36,6 +36,8 @@
#include "esp32c3_i2c.h"
#include "esp32c3_gpio.h"
#include "esp32c3_board_apds9960.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
@ -136,7 +138,7 @@ static int apds9960_irq_attach(struct apds9960_config_s *state,
****************************************************************************/
/****************************************************************************
* Name: apds9960_initialize
* Name: board_apds9960_initialize
*
* Description:
* Initialize and register the APDS9960 gesture sensor.
@ -150,7 +152,7 @@ static int apds9960_irq_attach(struct apds9960_config_s *state,
*
****************************************************************************/
int apds9960_initialize(int devno, int busno)
int board_apds9960_initialize(int devno, int busno)
{
struct i2c_master_s *i2c;
char devpath[12];

View File

@ -1,5 +1,5 @@
/****************************************************************************
* boards/risc-v/esp32c3/esp32c3-devkit/src/esp32c3_bmp180.c
* boards/risc-v/esp32c3/common/src/esp32c3_board_bmp180.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -32,31 +32,8 @@
#include <nuttx/i2c/i2c_master.h>
#include "esp32c3_i2c.h"
#include "esp32c3-devkit.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Private Types
****************************************************************************/
/****************************************************************************
* Private Function Prototypes
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Public Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
#include "esp32c3_board_bmp180.h"
/****************************************************************************
* Public Functions

View File

@ -1,5 +1,5 @@
/****************************************************************************
* boards/risc-v/esp32c3/esp32c3-devkit/src/esp32c3_gc9a01.c
* boards/risc-v/esp32c3/common/src/esp32c3_board_gc9a01.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with

View File

@ -1,5 +1,5 @@
/****************************************************************************
* boards/risc-v/esp32c3/esp32c3-devkit/src/esp32c3_i2c.c
* boards/risc-v/esp32c3/common/src/esp32c3_board_i2c.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -30,7 +30,8 @@
#include <nuttx/i2c/i2c_master.h>
#include "esp32c3_i2c.h"
#include "esp32c3-devkit.h"
#include "esp32c3_board_i2c.h"
/****************************************************************************
* Public Functions
@ -42,6 +43,9 @@
* Description:
* Configure the I2C driver.
*
* Input Parameters:
* None.
*
* Returned Value:
* Zero (OK) is returned on success; A negated errno value is returned
* to indicate the nature of any failure.

View File

@ -1,5 +1,5 @@
/****************************************************************************
* boards/risc-v/esp32c3/esp32c3-devkit/src/esp32c3_ledc.c
* boards/risc-v/esp32c3/common/src/esp32c3_board_ledc.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -36,6 +36,8 @@
#include "chip.h"
#include "esp32c3_ledc.h"
#include "esp32c3_board_ledc.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
@ -45,14 +47,21 @@
****************************************************************************/
/****************************************************************************
* Name: esp32c3_pwm_setup
* Name: board_ledc_setup
*
* Description:
* Initialize LEDC PWM and register the PWM device.
*
* Input Parameters:
* None.
*
* Returned Value:
* Zero (OK) is returned on success; A negated errno value is returned
* to indicate the nature of any failure.
*
****************************************************************************/
int esp32c3_pwm_setup(void)
int board_ledc_setup(void)
{
int ret;
struct pwm_lowerhalf_s *pwm;

View File

@ -1,5 +1,5 @@
/****************************************************************************
* boards/risc-v/esp32c3/esp32c3-devkit/src/esp32c3_oneshot.c
* boards/risc-v/esp32c3/common/src/esp32c3_board_oneshot.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -26,10 +26,12 @@
#include <debug.h>
#include <sys/types.h>
#include <nuttx/timers/timer.h>
#include <nuttx/clock.h>
#include <nuttx/timers/oneshot.h>
#include "esp32c3-devkit.h"
#include "esp32c3_board_oneshot.h"
/****************************************************************************
* Pre-processor Definitions
@ -45,6 +47,10 @@
* Description:
* Configure the oneshot timer driver.
*
* Input Parameters:
* timer - Timer instance to be used as oneshot timer.
* resolution - Oneshot timer resolution.
*
* Returned Value:
* Zero (OK) is returned on success; A negated errno value is returned
* to indicate the nature of any failure.

View File

@ -1,5 +1,5 @@
/****************************************************************************
* boards/risc-v/esp32c3/esp32c3-devkit/src/esp32c3_board_spi.c
* boards/risc-v/esp32c3/common/src/esp32c3_board_spi.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with

View File

@ -1,5 +1,5 @@
/****************************************************************************
* boards/risc-v/esp32c3/esp32c3-devkit/src/esp32c3_board_spidev.c
* boards/risc-v/esp32c3/common/src/esp32c3_board_spidev.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -32,6 +32,8 @@
#include "esp32c3_spi.h"
#include "esp32c3_board_spidev.h"
/****************************************************************************
* Public Functions
****************************************************************************/
@ -40,7 +42,14 @@
* Name: board_spidev_initialize
*
* Description:
* Initialize and register SPI driver for the specified SPI port.
* Initialize SPI driver and register the /dev/spi device.
*
* Input Parameters:
* bus - The SPI bus number, used to build the device path as /dev/spiN
*
* Returned Value:
* Zero (OK) is returned on success; A negated errno value is returned
* to indicate the nature of any failure.
*
****************************************************************************/

View File

@ -1,5 +1,5 @@
/****************************************************************************
* boards/risc-v/esp32c3/esp32c3-devkit/src/esp32c3_spiflash.c
* boards/risc-v/esp32c3/common/src/esp32c3_board_spiflash.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -45,7 +45,8 @@
#include "esp32c3_spiflash.h"
#include "esp32c3_spiflash_mtd.h"
#include "esp32c3-devkit.h"
#include "esp32c3_board_spiflash.h"
/****************************************************************************
* Pre-processor Definitions
@ -553,7 +554,15 @@ static int init_storage_partition(void)
* Name: board_spiflash_init
*
* Description:
* Initialize the SPIFLASH and register the MTD device.
* Initialize the SPI Flash and register the MTD device.
*
* Input Parameters:
* None.
*
* Returned Value:
* Zero (OK) is returned on success; A negated errno value is returned
* to indicate the nature of any failure.
*
****************************************************************************/
int board_spiflash_init(void)

View File

@ -1,5 +1,5 @@
/****************************************************************************
* boards/risc-v/esp32c3/esp32c3-devkit/src/esp32c3_board_spislavedev.c
* boards/risc-v/esp32c3/common/src/esp32c3_board_spislavedev.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -32,6 +32,8 @@
#include "esp32c3_spi.h"
#include "esp32c3_board_spislavedev.h"
/****************************************************************************
* Public Functions
****************************************************************************/

View File

@ -1,5 +1,5 @@
/****************************************************************************
* boards/risc-v/esp32c3/esp32c3-devkit/src/esp32c3_st7735.c
* boards/risc-v/esp32c3/common/src/esp32c3_board_st7735.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with

View File

@ -1,5 +1,5 @@
/****************************************************************************
* boards/risc-v/esp32c3/esp32c3-devkit/src/esp32c3_st7789.c
* boards/risc-v/esp32c3/common/src/esp32c3_board_st7789.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with

View File

@ -1,5 +1,5 @@
/****************************************************************************
* boards/risc-v/esp32c3/esp32c3-devkit/src/esp32c3_twai.c
* boards/risc-v/esp32c3/common/src/esp32c3_board_twai.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -34,7 +34,8 @@
/* #include "arm_arch.h" */
#include "esp32c3_twai.h"
#include "esp32c3-devkit.h"
#include "esp32c3_board_twai.h"
#ifdef CONFIG_CAN
@ -51,14 +52,21 @@
****************************************************************************/
/****************************************************************************
* Name: esp32c3_twai_setup
* Name: board_twai_setup
*
* Description:
* Initialize TWAI and register the TWAI device
* Configure the TWAI driver.
*
* Input Parameters:
* None.
*
* Returned Value:
* Zero (OK) is returned on success; A negated errno value is returned
* to indicate the nature of any failure.
*
****************************************************************************/
int esp32c3_twai_setup(void)
int board_twai_setup(void)
{
#ifdef CONFIG_ESP32C3_TWAI0
struct can_dev_s *twai;

View File

@ -1,5 +1,5 @@
/****************************************************************************
* boards/risc-v/esp32c3/esp32c3-devkit/src/esp32c3_wdt.c
* boards/risc-v/esp32c3/common/src/esp32c3_board_wdt.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -30,7 +30,7 @@
#include "esp32c3_wdt_lowerhalf.h"
#include "esp32c3_wdt.h"
#include "esp32c3-devkit.h"
#include "esp32c3_board_wdt.h"
/****************************************************************************
* Pre-processor Definitions
@ -44,7 +44,10 @@
* Name: board_wdt_init
*
* Description:
* Configure the watchdog timer driver.
* Configure the Watchdog Timer driver.
*
* Input Parameters:
* None.
*
* Returned Value:
* Zero (OK) is returned on success; A negated errno value is returned

View File

@ -1,5 +1,5 @@
/****************************************************************************
* boards/risc-v/esp32c3/esp32c3-devkit/src/esp32c3_board_wlan.c
* boards/risc-v/esp32c3/common/src/esp32c3_board_wlan.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -36,6 +36,8 @@
#include "esp32c3_spiflash.h"
#include "esp32c3_wlan.h"
#include "esp32c3_board_wlan.h"
/****************************************************************************
* Public Functions
****************************************************************************/
@ -46,6 +48,9 @@
* Description:
* Configure the wireless subsystem.
*
* Input Parameters:
* None.
*
* Returned Value:
* Zero (OK) is returned on success; A negated errno value is returned
* to indicate the nature of any failure.

View File

@ -11,6 +11,7 @@
# CONFIG_NSH_CMDPARMS is not set
CONFIG_ARCH="risc-v"
CONFIG_ARCH_BOARD="esp32c3-devkit-rust-1"
CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_ESP32C3_DEVKIT_RUST1=y
CONFIG_ARCH_CHIP="esp32c3"
CONFIG_ARCH_CHIP_ESP32C3=y

View File

@ -20,37 +20,24 @@
include $(TOPDIR)/Make.defs
SCRIPTDIR = $(BOARD_DIR)$(DELIM)scripts
CONFIGFILE = $(TOPDIR)$(DELIM)include$(DELIM)nuttx$(DELIM)config.h
CSRCS = esp32c3_boot.c esp32c3_bringup.c
ifeq ($(CONFIG_BOARDCTL),y)
CSRCS += esp32c3_appinit.c
ifeq ($(CONFIG_BOARDCTL_RESET),y)
CSRCS += esp32c3_reset.c
endif
CSRCS += esp32c3_appinit.c
ifeq ($(CONFIG_BOARDCTL_RESET),y)
CSRCS += esp32c3_reset.c
endif
endif
ifeq ($(CONFIG_ARCH_LEDS),y)
CSRCS += esp32c3_autoleds.c
CSRCS += esp32c3_autoleds.c
endif
ifeq ($(CONFIG_BOARDCTL_IOCTL),y)
CSRCS += esp32c3_ioctl.c
CSRCS += esp32c3_ioctl.c
endif
ifeq ($(CONFIG_ESP32C3_SPI),y)
CSRCS += esp32c3_board_spi.c
endif
ifeq ($(CONFIG_SENSORS_APDS9960),y)
CSRCS += esp32c3_apds9960.c
endif
ifeq ($(CONFIG_LCD_APA102),y)
CSRCS += esp32c3_apa102.c
endif
include $(TOPDIR)/boards/Board.mk
DEPPATH += --dep-path board
VPATH += :board
CFLAGS += $(shell $(INCDIR) "$(CC)" $(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board$(DELIM)board)

View File

@ -75,233 +75,5 @@
int esp32c3_bringup(void);
/****************************************************************************
* Name: esp32c3_gpio_init
****************************************************************************/
#ifdef CONFIG_DEV_GPIO
int esp32c3_gpio_init(void);
#endif
/****************************************************************************
* Name: board_wdt_init
*
* Description:
* Configure the timer driver.
*
* Returned Value:
* Zero (OK) is returned on success; A negated errno value is returned
* to indicate the nature of any failure.
*
****************************************************************************/
#ifdef CONFIG_WATCHDOG
int board_wdt_init(void);
#endif
/****************************************************************************
* Name: board_spidev_initialize
*
* Description:
* Initialize SPI driver and register the /dev/spi device.
*
* Input Parameters:
* bus - The SPI bus number, used to build the device path as /dev/spiN
*
* Returned Value:
* Zero (OK) is returned on success; A negated errno value is returned
* to indicate the nature of any failure.
*
****************************************************************************/
#ifdef CONFIG_SPI_DRIVER
int board_spidev_initialize(int bus);
#endif
/****************************************************************************
* Name: board_spislavedev_initialize
*
* Description:
* Initialize SPI Slave driver and register the /dev/spislv device.
*
* Input Parameters:
* bus - The SPI bus number, used to build the device path as /dev/spislvN
*
* Returned Value:
* Zero (OK) is returned on success; A negated errno value is returned
* to indicate the nature of any failure.
*
****************************************************************************/
#ifdef CONFIG_SPI_SLAVE
int board_spislavedev_initialize(int bus);
#endif
/****************************************************************************
* Name: board_i2c_init
*
* Description:
* Configure the I2C driver.
*
* Returned Value:
* Zero (OK) is returned on success; A negated errno value is returned
* to indicate the nature of any failure.
*
****************************************************************************/
#ifdef CONFIG_I2C_DRIVER
int board_i2c_init(void);
#endif
/****************************************************************************
* Name: board_twai_setup
*
* Description:
* Configure the TWAI driver.
*
* Returned Value:
* Zero (OK) is returned on success; A negated errno value is returned
* to indicate the nature of any failure.
*
****************************************************************************/
#ifdef CONFIG_CAN
int esp32c3_twai_setup(void);
#endif
/****************************************************************************
* Name: board_oneshot_init
*
* Description:
* Configure the oneshot timer driver.
*
* Input Parameters:
* timer - Timer instance to be used as oneshot timer.
* resolution - Oneshot timer resolution.
*
* Returned Value:
* Zero (OK) is returned on success; A negated errno value is returned
* to indicate the nature of any failure.
*
****************************************************************************/
#ifdef CONFIG_ONESHOT
int board_oneshot_init(int timer, uint16_t resolution);
#endif
/****************************************************************************
* Name: board_bmp180_initialize
*
* Description:
* Initialize and register the BMP180 Pressure Sensor driver.
*
* Input Parameters:
* devno - The device number, used to build the device path as /dev/pressN
* busno - The I2C bus number
*
* Returned Value:
* Zero (OK) on success; a negated errno value on failure.
*
****************************************************************************/
#ifdef CONFIG_SENSORS_BMP180
int board_bmp180_initialize(int devno, int busno);
#endif
/****************************************************************************
* Name: board_wlan_init
*
* Description:
* Configure the wireless subsystem.
*
* Returned Value:
* Zero (OK) is returned on success; A negated errno value is returned
* to indicate the nature of any failure.
*
****************************************************************************/
#ifdef CONFIG_ESP32C3_WIRELESS
int board_wlan_init(void);
#endif
/****************************************************************************
* Name: board_spiflash_init
*
* Description:
* Initialize the SPIFLASH and register the MTD device.
*
****************************************************************************/
#ifdef CONFIG_ESP32C3_SPIFLASH
int board_spiflash_init(void);
#endif
/****************************************************************************
* Name: esp32c3_spiflash_encrypt_test
*
* Description:
* Test ESP32-C3 SPI Flash driver read/write with encryption.
*
* Input Parameters:
* None
*
* Returned Value:
* None.
*
****************************************************************************/
#ifdef CONFIG_ESP32C3_SPIFLASH_ENCRYPTION_TEST
void esp32c3_spiflash_encrypt_test(void);
#endif
/****************************************************************************
* Name: esp32c3_ledc_setup
*
* Description:
* Initialize LEDC PWM and register the PWM device.
*
****************************************************************************/
#ifdef CONFIG_ESP32C3_LEDC
int esp32c3_pwm_setup(void);
#endif
/****************************************************************************
* Name: board_adc_init
*
* Description:
* Configure the ADC driver.
*
* Returned Value:
* Zero (OK) is returned on success; A negated errno value is returned
* to indicate the nature of any failure.
*
****************************************************************************/
#ifdef CONFIG_ADC
int board_adc_init(void);
#endif
/****************************************************************************
* Name: apds9960_initialize
*
* Description:
*
* Initialize and register the APDS9960 gesture sensor.
*
* Input Parameters:
* devno - The device number, used to build the device path as /dev/gestN
* busno - The I2C bus number
*
* Returned Value:
* Zero (OK) on success; a negated errno value on failure.
* Initialize the APDS-9960 sensor
*
****************************************************************************/
#ifdef CONFIG_SENSORS_APDS9960
int apds9960_initialize(int devno, int busno);
#endif
#endif /* __ASSEMBLY__ */
#endif /* __BOARDS_RISCV_ESP32C3_ESP32C3_DEVKIT_RUST1_SRC_ESP32C3_DEVKIT_RUST1_H */

View File

@ -147,7 +147,7 @@ int esp32c3_bringup(void)
#ifdef CONFIG_SENSORS_APDS9960
/* Register the APDS-9960 gesture sensor */
ret = apds9960_initialize(0, 0);
ret = board_apds9960_initialize(0, 0);
if (ret < 0)
{
syslog(LOG_ERR, "ERROR: board_apds9960_initialize() failed: %d\n",

View File

@ -41,15 +41,6 @@ config ESP32C3_DEVKIT_RUN_IRAM
bool "Run from IRAM"
default n
config ESP32C3_MERGE_BINS
bool "Merge raw binary files into a single file"
default n
---help---
Merge the raw binary files into a single file for flashing to the
device.
This is only useful when the path to binary files (e.g. bootloader)
is provided via the ESPTOOL_BINDIR variable.
config ESP32C3_STORAGE_MTD_ENCRYPT
bool "Encrypt Storage MTD partition"
default y
@ -70,65 +61,4 @@ config ESP32C3_STORAGE_MTD_SIZE
---help---
MTD size in SPI Flash.
choice ESP32C3_SPIFLASH_FS
prompt "Mount SPI Flash MTD on bring-up"
default ESP32C3_SPIFLASH_SMARTFS
depends on ESP32C3_MTD
optional
---help---
Mount the SPI Flash MTD with the selected File System format on board
bring-up.
If not selected, the MTD will be registered as a device node on /dev.
config ESP32C3_SPIFLASH_SMARTFS
bool "SmartFS"
select FS_SMARTFS
select MTD_SMART
depends on !ESP32C3_SECURE_FLASH_ENC_ENABLED
comment "SmartFS not supported with Flash Encryption"
depends on ESP32C3_SECURE_FLASH_ENC_ENABLED
config ESP32C3_SPIFLASH_NXFFS
bool "NXFFS"
select FS_NXFFS
depends on !ESP32C3_SECURE_FLASH_ENC_ENABLED
comment "NXFFS not supported with Flash Encryption"
depends on ESP32C3_SECURE_FLASH_ENC_ENABLED
config ESP32C3_SPIFLASH_SPIFFS
bool "SPIFFS"
select FS_SPIFFS
depends on !ESP32C3_SECURE_FLASH_ENC_ENABLED
comment "SPIFFS not supported with Flash Encryption"
depends on ESP32C3_SECURE_FLASH_ENC_ENABLED
config ESP32C3_SPIFLASH_LITTLEFS
bool "LittleFS"
select FS_LITTLEFS
config ESP32C3_SPIFLASH_MTD_CONFIG
bool "Non-volatile storage"
endchoice
config ESP32C3_SPIFLASH_FS_MOUNT_PT
string "File-system Mount Point"
depends on ESP32C3_SPIFLASH_LITTLEFS
default "/data"
if LCD_ST7735 || LCD_ST7789 || LCD_GC9A01
config ESP32C3_LCD_RSTPIN
int "LCD reset pin"
default 9
config ESP32C3_LCD_BLPIN
int "LCD backlight pin"
default 18
endif # LCD_ST7735 || LCD_ST7789 || LCD_GC9A01
endif # ARCH_BOARD_ESP32C3_DEVKIT

View File

@ -10,6 +10,7 @@
# CONFIG_NSH_CMDPARMS is not set
CONFIG_ARCH="risc-v"
CONFIG_ARCH_BOARD="esp32c3-devkit"
CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_ESP32C3_DEVKIT=y
CONFIG_ARCH_CHIP="esp32c3"
CONFIG_ARCH_CHIP_ESP32C3=y

View File

@ -10,6 +10,7 @@
# CONFIG_NSH_CMDPARMS is not set
CONFIG_ARCH="risc-v"
CONFIG_ARCH_BOARD="esp32c3-devkit"
CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_ESP32C3_DEVKIT=y
CONFIG_ARCH_CHIP="esp32c3"
CONFIG_ARCH_CHIP_ESP32C3=y

View File

@ -8,6 +8,7 @@
CONFIG_ALLOW_BSD_COMPONENTS=y
CONFIG_ARCH="risc-v"
CONFIG_ARCH_BOARD="esp32c3-devkit"
CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_ESP32C3_DEVKIT=y
CONFIG_ARCH_CHIP="esp32c3"
CONFIG_ARCH_CHIP_ESP32C3=y

View File

@ -10,6 +10,7 @@
# CONFIG_NSH_CMDPARMS is not set
CONFIG_ARCH="risc-v"
CONFIG_ARCH_BOARD="esp32c3-devkit"
CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_ESP32C3_DEVKIT=y
CONFIG_ARCH_CHIP="esp32c3"
CONFIG_ARCH_CHIP_ESP32C3=y

View File

@ -10,6 +10,7 @@
# CONFIG_NSH_CMDPARMS is not set
CONFIG_ARCH="risc-v"
CONFIG_ARCH_BOARD="esp32c3-devkit"
CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_ESP32C3_DEVKIT=y
CONFIG_ARCH_CHIP="esp32c3"
CONFIG_ARCH_CHIP_ESP32C3=y

View File

@ -13,6 +13,7 @@
# CONFIG_NSH_DISABLE_MW is not set
CONFIG_ARCH="risc-v"
CONFIG_ARCH_BOARD="esp32c3-devkit"
CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_ESP32C3_DEVKIT=y
CONFIG_ARCH_CHIP="esp32c3"
CONFIG_ARCH_CHIP_ESP32C3=y

View File

@ -8,6 +8,7 @@
# CONFIG_NSH_DISABLE_LOSMART is not set
CONFIG_ARCH="risc-v"
CONFIG_ARCH_BOARD="esp32c3-devkit"
CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_ESP32C3_DEVKIT=y
CONFIG_ARCH_CHIP="esp32c3"
CONFIG_ARCH_CHIP_ESP32C3=y

View File

@ -10,6 +10,7 @@
# CONFIG_NSH_CMDPARMS is not set
CONFIG_ARCH="risc-v"
CONFIG_ARCH_BOARD="esp32c3-devkit"
CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_ESP32C3_DEVKIT=y
CONFIG_ARCH_CHIP="esp32c3"
CONFIG_ARCH_CHIP_ESP32C3=y

View File

@ -11,6 +11,7 @@
# CONFIG_NSH_CMDPARMS is not set
CONFIG_ARCH="risc-v"
CONFIG_ARCH_BOARD="esp32c3-devkit"
CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_ESP32C3_DEVKIT=y
CONFIG_ARCH_CHIP="esp32c3"
CONFIG_ARCH_CHIP_ESP32C3=y
@ -43,7 +44,7 @@ CONFIG_NSH_FILEIOSIZE=512
CONFIG_NSH_READLINE=y
CONFIG_NSH_STRERROR=y
CONFIG_NUTTX_USERSPACE=0x3c080018
CONFIG_PASS1_BUILDIR="boards/risc-v/esp32c3/esp32c3-devkit/kernel"
CONFIG_PASS1_BUILDIR="boards/risc-v/esp32c3/common/kernel"
CONFIG_PREALLOC_TIMERS=0
CONFIG_RAW_BINARY=y
CONFIG_RR_INTERVAL=200

View File

@ -10,6 +10,7 @@
# CONFIG_NSH_CMDPARMS is not set
CONFIG_ARCH="risc-v"
CONFIG_ARCH_BOARD="esp32c3-devkit"
CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_ESP32C3_DEVKIT=y
CONFIG_ARCH_CHIP="esp32c3"
CONFIG_ARCH_CHIP_ESP32C3=y

View File

@ -10,6 +10,7 @@
# CONFIG_NSH_CMDPARMS is not set
CONFIG_ARCH="risc-v"
CONFIG_ARCH_BOARD="esp32c3-devkit"
CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_ESP32C3_DEVKIT=y
CONFIG_ARCH_CHIP="esp32c3"
CONFIG_ARCH_CHIP_ESP32C3=y

View File

@ -10,6 +10,7 @@
# CONFIG_NSH_CMDPARMS is not set
CONFIG_ARCH="risc-v"
CONFIG_ARCH_BOARD="esp32c3-devkit"
CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_ESP32C3_DEVKIT=y
CONFIG_ARCH_CHIP="esp32c3"
CONFIG_ARCH_CHIP_ESP32C3=y

View File

@ -10,6 +10,7 @@
# CONFIG_NSH_CMDPARMS is not set
CONFIG_ARCH="risc-v"
CONFIG_ARCH_BOARD="esp32c3-devkit"
CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_ESP32C3_DEVKIT=y
CONFIG_ARCH_CHIP="esp32c3"
CONFIG_ARCH_CHIP_ESP32C3=y

View File

@ -10,6 +10,7 @@
# CONFIG_NSH_CMDPARMS is not set
CONFIG_ARCH="risc-v"
CONFIG_ARCH_BOARD="esp32c3-devkit"
CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_ESP32C3_DEVKIT=y
CONFIG_ARCH_CHIP="esp32c3"
CONFIG_ARCH_CHIP_ESP32C3=y

View File

@ -10,6 +10,7 @@
# CONFIG_NSH_CMDPARMS is not set
CONFIG_ARCH="risc-v"
CONFIG_ARCH_BOARD="esp32c3-devkit"
CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_ESP32C3_DEVKIT=y
CONFIG_ARCH_CHIP="esp32c3"
CONFIG_ARCH_CHIP_ESP32C3=y

View File

@ -10,6 +10,7 @@
# CONFIG_NSH_CMDPARMS is not set
CONFIG_ARCH="risc-v"
CONFIG_ARCH_BOARD="esp32c3-devkit"
CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_ESP32C3_DEVKIT=y
CONFIG_ARCH_CHIP="esp32c3"
CONFIG_ARCH_CHIP_ESP32C3=y

View File

@ -10,6 +10,7 @@
# CONFIG_NSH_CMDPARMS is not set
CONFIG_ARCH="risc-v"
CONFIG_ARCH_BOARD="esp32c3-devkit"
CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_ESP32C3_DEVKIT=y
CONFIG_ARCH_CHIP="esp32c3"
CONFIG_ARCH_CHIP_ESP32C3=y

View File

@ -10,6 +10,7 @@
# CONFIG_NSH_CMDPARMS is not set
CONFIG_ARCH="risc-v"
CONFIG_ARCH_BOARD="esp32c3-devkit"
CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_ESP32C3_DEVKIT=y
CONFIG_ARCH_CHIP="esp32c3"
CONFIG_ARCH_CHIP_ESP32C3=y

View File

@ -10,6 +10,7 @@
# CONFIG_NSH_CMDPARMS is not set
CONFIG_ARCH="risc-v"
CONFIG_ARCH_BOARD="esp32c3-devkit"
CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_ESP32C3_DEVKIT=y
CONFIG_ARCH_CHIP="esp32c3"
CONFIG_ARCH_CHIP_ESP32C3=y

View File

@ -10,6 +10,7 @@
# CONFIG_NSH_CMDPARMS is not set
CONFIG_ARCH="risc-v"
CONFIG_ARCH_BOARD="esp32c3-devkit"
CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_ESP32C3_DEVKIT=y
CONFIG_ARCH_CHIP="esp32c3"
CONFIG_ARCH_CHIP_ESP32C3=y

View File

@ -10,6 +10,7 @@
# CONFIG_NSH_CMDPARMS is not set
CONFIG_ARCH="risc-v"
CONFIG_ARCH_BOARD="esp32c3-devkit"
CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_ESP32C3_DEVKIT=y
CONFIG_ARCH_CHIP="esp32c3"
CONFIG_ARCH_CHIP_ESP32C3=y

View File

@ -10,6 +10,7 @@
# CONFIG_NSH_CMDPARMS is not set
CONFIG_ARCH="risc-v"
CONFIG_ARCH_BOARD="esp32c3-devkit"
CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_ESP32C3_DEVKIT=y
CONFIG_ARCH_CHIP="esp32c3"
CONFIG_ARCH_CHIP_ESP32C3=y

View File

@ -11,6 +11,7 @@
CONFIG_ALLOW_BSD_COMPONENTS=y
CONFIG_ARCH="risc-v"
CONFIG_ARCH_BOARD="esp32c3-devkit"
CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_ESP32C3_DEVKIT=y
CONFIG_ARCH_CHIP="esp32c3"
CONFIG_ARCH_CHIP_ESP32C3=y

View File

@ -10,6 +10,7 @@
# CONFIG_NSH_CMDPARMS is not set
CONFIG_ARCH="risc-v"
CONFIG_ARCH_BOARD="esp32c3-devkit"
CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_ESP32C3_DEVKIT=y
CONFIG_ARCH_CHIP="esp32c3"
CONFIG_ARCH_CHIP_ESP32C3=y

View File

@ -10,6 +10,7 @@
# CONFIG_NSH_CMDPARMS is not set
CONFIG_ARCH="risc-v"
CONFIG_ARCH_BOARD="esp32c3-devkit"
CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_ESP32C3_DEVKIT=y
CONFIG_ARCH_CHIP="esp32c3"
CONFIG_ARCH_CHIP_ESP32C3=y

View File

@ -10,6 +10,7 @@
# CONFIG_NSH_CMDPARMS is not set
CONFIG_ARCH="risc-v"
CONFIG_ARCH_BOARD="esp32c3-devkit"
CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_ESP32C3_DEVKIT=y
CONFIG_ARCH_CHIP="esp32c3"
CONFIG_ARCH_CHIP_ESP32C3=y

View File

@ -10,6 +10,7 @@
# CONFIG_NSH_CMDPARMS is not set
CONFIG_ARCH="risc-v"
CONFIG_ARCH_BOARD="esp32c3-devkit"
CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_ESP32C3_DEVKIT=y
CONFIG_ARCH_CHIP="esp32c3"
CONFIG_ARCH_CHIP_ESP32C3=y

View File

@ -11,6 +11,7 @@
# CONFIG_NSH_CMDPARMS is not set
CONFIG_ARCH="risc-v"
CONFIG_ARCH_BOARD="esp32c3-devkit"
CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_ESP32C3_DEVKIT=y
CONFIG_ARCH_CHIP="esp32c3"
CONFIG_ARCH_CHIP_ESP32C3=y

View File

@ -10,6 +10,7 @@
# CONFIG_NSH_CMDPARMS is not set
CONFIG_ARCH="risc-v"
CONFIG_ARCH_BOARD="esp32c3-devkit"
CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_ESP32C3_DEVKIT=y
CONFIG_ARCH_CHIP="esp32c3"
CONFIG_ARCH_CHIP_ESP32C3=y

View File

@ -10,6 +10,7 @@
# CONFIG_NSH_CMDPARMS is not set
CONFIG_ARCH="risc-v"
CONFIG_ARCH_BOARD="esp32c3-devkit"
CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_ESP32C3_DEVKIT=y
CONFIG_ARCH_CHIP="esp32c3"
CONFIG_ARCH_CHIP_ESP32C3=y

View File

@ -10,6 +10,7 @@
# CONFIG_NSH_CMDPARMS is not set
CONFIG_ARCH="risc-v"
CONFIG_ARCH_BOARD="esp32c3-devkit"
CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_ESP32C3_DEVKIT=y
CONFIG_ARCH_CHIP="esp32c3"
CONFIG_ARCH_CHIP_ESP32C3=y

View File

@ -0,0 +1,54 @@
#############################################################################
# boards/risc-v/esp32c3/esp32c3-devkit/src/Makefile
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
#############################################################################
include $(TOPDIR)/Make.defs
CSRCS = esp32c3_boot.c esp32c3_bringup.c
ifeq ($(CONFIG_BOARDCTL),y)
CSRCS += esp32c3_appinit.c
ifeq ($(CONFIG_BOARDCTL_RESET),y)
CSRCS += esp32c3_reset.c
endif
endif
ifeq ($(CONFIG_DEV_GPIO),y)
CSRCS += esp32c3_gpio.c
endif
ifeq ($(CONFIG_BOARDCTL_IOCTL),y)
CSRCS += esp32c3_ioctl.c
endif
ifeq ($(CONFIG_BOARDCTL_UNIQUEID),y)
CSRCS += esp32c3_uid.c
endif
ifeq ($(CONFIG_NSH_ROMFSETC),y)
ifneq ($(CONFIG_NSH_CUSTOMROMFS),y)
RCSRCS = etc/init.d/rc.sysinit etc/init.d/rcS
RCRAWS = etc/group etc/passwd
endif
endif
DEPPATH += --dep-path board
VPATH += :board
CFLAGS += $(shell $(INCDIR) "$(CC)" $(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board$(DELIM)board)

View File

@ -79,204 +79,5 @@ int esp32c3_bringup(void);
int esp32c3_gpio_init(void);
#endif
/****************************************************************************
* Name: board_wdt_init
*
* Description:
* Configure the timer driver.
*
* Returned Value:
* Zero (OK) is returned on success; A negated errno value is returned
* to indicate the nature of any failure.
*
****************************************************************************/
#ifdef CONFIG_WATCHDOG
int board_wdt_init(void);
#endif
/****************************************************************************
* Name: board_spidev_initialize
*
* Description:
* Initialize SPI driver and register the /dev/spi device.
*
* Input Parameters:
* bus - The SPI bus number, used to build the device path as /dev/spiN
*
* Returned Value:
* Zero (OK) is returned on success; A negated errno value is returned
* to indicate the nature of any failure.
*
****************************************************************************/
#ifdef CONFIG_SPI_DRIVER
int board_spidev_initialize(int bus);
#endif
/****************************************************************************
* Name: board_spislavedev_initialize
*
* Description:
* Initialize SPI Slave driver and register the /dev/spislv device.
*
* Input Parameters:
* bus - The SPI bus number, used to build the device path as /dev/spislvN
*
* Returned Value:
* Zero (OK) is returned on success; A negated errno value is returned
* to indicate the nature of any failure.
*
****************************************************************************/
#ifdef CONFIG_SPI_SLAVE
int board_spislavedev_initialize(int bus);
#endif
/****************************************************************************
* Name: board_i2c_init
*
* Description:
* Configure the I2C driver.
*
* Returned Value:
* Zero (OK) is returned on success; A negated errno value is returned
* to indicate the nature of any failure.
*
****************************************************************************/
#ifdef CONFIG_I2C_DRIVER
int board_i2c_init(void);
#endif
/****************************************************************************
* Name: board_twai_setup
*
* Description:
* Configure the TWAI driver.
*
* Returned Value:
* Zero (OK) is returned on success; A negated errno value is returned
* to indicate the nature of any failure.
*
****************************************************************************/
#ifdef CONFIG_CAN
int esp32c3_twai_setup(void);
#endif
/****************************************************************************
* Name: board_oneshot_init
*
* Description:
* Configure the oneshot timer driver.
*
* Input Parameters:
* timer - Timer instance to be used as oneshot timer.
* resolution - Oneshot timer resolution.
*
* Returned Value:
* Zero (OK) is returned on success; A negated errno value is returned
* to indicate the nature of any failure.
*
****************************************************************************/
#ifdef CONFIG_ONESHOT
int board_oneshot_init(int timer, uint16_t resolution);
#endif
/****************************************************************************
* Name: board_bmp180_initialize
*
* Description:
* Initialize and register the BMP180 Pressure Sensor driver.
*
* Input Parameters:
* devno - The device number, used to build the device path as /dev/pressN
* busno - The I2C bus number
*
* Returned Value:
* Zero (OK) on success; a negated errno value on failure.
*
****************************************************************************/
#ifdef CONFIG_SENSORS_BMP180
int board_bmp180_initialize(int devno, int busno);
#endif
/****************************************************************************
* Name: board_wlan_init
*
* Description:
* Configure the wireless subsystem.
*
* Returned Value:
* Zero (OK) is returned on success; A negated errno value is returned
* to indicate the nature of any failure.
*
****************************************************************************/
#ifdef CONFIG_ESP32C3_WIRELESS
int board_wlan_init(void);
#endif
/****************************************************************************
* Name: board_spiflash_init
*
* Description:
* Initialize the SPIFLASH and register the MTD device.
*
****************************************************************************/
#ifdef CONFIG_ESP32C3_SPIFLASH
int board_spiflash_init(void);
#endif
/****************************************************************************
* Name: esp32c3_spiflash_encrypt_test
*
* Description:
* Test ESP32-C3 SPI Flash driver read/write with encryption.
*
* Input Parameters:
* None
*
* Returned Value:
* None.
*
****************************************************************************/
#ifdef CONFIG_ESP32C3_SPIFLASH_ENCRYPTION_TEST
void esp32c3_spiflash_encrypt_test(void);
#endif
/****************************************************************************
* Name: esp32c3_ledc_setup
*
* Description:
* Initialize LEDC PWM and register the PWM device.
*
****************************************************************************/
#ifdef CONFIG_ESP32C3_LEDC
int esp32c3_pwm_setup(void);
#endif
/****************************************************************************
* Name: board_adc_init
*
* Description:
* Configure the ADC driver.
*
* Returned Value:
* Zero (OK) is returned on success; A negated errno value is returned
* to indicate the nature of any failure.
*
****************************************************************************/
#ifdef CONFIG_ADC
int board_adc_init(void);
#endif
#endif /* __ASSEMBLY__ */
#endif /* __BOARDS_RISCV_ESP32C3_ESP32C3_DEVKIT_SRC_ESP32C3_DEVKIT_H */

View File

@ -40,7 +40,19 @@
#include "esp32c3_wlan.h"
#include "esp32c3_spiflash.h"
#include "esp32c3_partition.h"
#include "esp32c3-devkit.h"
#include "esp32c3_board_adc.h"
#include "esp32c3_board_bmp180.h"
#include "esp32c3_board_i2c.h"
#include "esp32c3_board_ledc.h"
#include "esp32c3_board_oneshot.h"
#include "esp32c3_board_spiflash.h"
#include "esp32c3_board_spidev.h"
#include "esp32c3_board_spislavedev.h"
#include "esp32c3_board_twai.h"
#include "esp32c3_board_wdt.h"
#include "esp32c3_board_wlan.h"
#ifdef CONFIG_SPI
# include "esp32c3_spi.h"
@ -224,10 +236,10 @@ int esp32c3_bringup(void)
/* Initialize TWAI and register the TWAI driver. */
ret = esp32c3_twai_setup();
ret = board_twai_setup();
if (ret < 0)
{
syslog(LOG_ERR, "ERROR: esp32c3_twai_setup failed: %d\n", ret);
syslog(LOG_ERR, "ERROR: board_twai_setup failed: %d\n", ret);
}
#endif
@ -334,10 +346,10 @@ int esp32c3_bringup(void)
#endif /* CONFIG_ESP32C3_WIRELESS */
#ifdef CONFIG_ESP32C3_LEDC
ret = esp32c3_pwm_setup();
ret = board_ledc_setup();
if (ret < 0)
{
syslog(LOG_ERR, "ERROR: esp32c3_pwm_setup() failed: %d\n", ret);
syslog(LOG_ERR, "ERROR: board_ledc_setup() failed: %d\n", ret);
}
#endif /* CONFIG_ESP32C3_LEDC */