From 92960a1c5dad3ed41308a37a9cf29709baac923f Mon Sep 17 00:00:00 2001 From: wgzAIIT <820906721@qq.com> Date: Thu, 30 Jun 2022 16:43:02 +0800 Subject: [PATCH] k210 support gpio on nuttx --- .../nuttx/arch/risc-v/src/k210/Make.defs | 2 +- .../risc-v/src/k210/hardware/k210_memorymap.h | 53 ++++++++ .../nuttx/arch/risc-v/src/k210/k210_fpioa.c | 76 +++++------ .../nuttx/arch/risc-v/src/k210/k210_fpioa.h | 9 ++ .../nuttx/arch/risc-v/src/k210/k210_gpio.c | 121 ++++++++++++++++++ .../nuttx/arch/risc-v/src/k210/k210_gpio.h | 89 +++++++++++++ .../arch/risc-v/src/k210/k210_gpio_common.h | 66 ++++++++++ .../nuttx/arch/risc-v/src/k210/k210_gpiohs.c | 44 +++---- .../nuttx/arch/risc-v/src/k210/k210_gpiohs.h | 9 +- .../arch/risc-v/src/k210/k210_systemreset.c | 4 +- 10 files changed, 402 insertions(+), 71 deletions(-) create mode 100644 Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/arch/risc-v/src/k210/hardware/k210_memorymap.h create mode 100644 Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/arch/risc-v/src/k210/k210_gpio.c create mode 100644 Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/arch/risc-v/src/k210/k210_gpio.h create mode 100644 Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/arch/risc-v/src/k210/k210_gpio_common.h diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/arch/risc-v/src/k210/Make.defs b/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/arch/risc-v/src/k210/Make.defs index 791b456c7..221af4901 100644 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/arch/risc-v/src/k210/Make.defs +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/arch/risc-v/src/k210/Make.defs @@ -56,7 +56,7 @@ endif CHIP_CSRCS = k210_allocateheap.c k210_clockconfig.c CHIP_CSRCS += k210_irq.c k210_irq_dispatch.c k210_systemreset.c CHIP_CSRCS += k210_lowputc.c k210_serial.c k210_fpioa.c -CHIP_CSRCS += k210_start.c k210_timerisr.c k210_gpiohs.c +CHIP_CSRCS += k210_start.c k210_timerisr.c k210_gpiohs.c k210_gpio.c ifeq ($(CONFIG_BUILD_PROTECTED),y) CMN_CSRCS += riscv_task_start.c riscv_pthread_start.c diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/arch/risc-v/src/k210/hardware/k210_memorymap.h b/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/arch/risc-v/src/k210/hardware/k210_memorymap.h new file mode 100644 index 000000000..13da9e3b6 --- /dev/null +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/arch/risc-v/src/k210/hardware/k210_memorymap.h @@ -0,0 +1,53 @@ +/**************************************************************************** + * arch/risc-v/src/k210/hardware/k210_memorymap.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. + * + ****************************************************************************/ + +/** +* @file k210_memorymap.h +* @brief nuttx source code +* https://github.com/apache/incubator-nuttx.git +* @version 10.3.0 +* @author AIIT XUOS Lab +* @date 2022-06-30 +*/ + +#ifndef __ARCH_RISCV_SRC_K210_HARDWARE_K210_MEMORYMAP_H +#define __ARCH_RISCV_SRC_K210_HARDWARE_K210_MEMORYMAP_H + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* Register Base Address ****************************************************/ + +#define K210_CLINT_BASE 0x02000000 +#define K210_PLIC_BASE 0x0c000000 + +#ifdef CONFIG_K210_WITH_QEMU +#define K210_UART0_BASE 0x10010000 +#else +#define K210_UART0_BASE 0x38000000 +#endif +#define K210_GPIOHS_BASE 0x38001000 +#define K210_GPIO_BASE 0x50200000 +#define K210_FPIOA_BASE 0x502B0000 + +#define K210_SYSCTL_BASE 0x50440000 + +#endif /* __ARCH_RISCV_SRC_K210_HARDWARE_K210_MEMORYMAP_H */ diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/arch/risc-v/src/k210/k210_fpioa.c b/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/arch/risc-v/src/k210/k210_fpioa.c index 4633ba0d0..267011ec3 100644 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/arch/risc-v/src/k210/k210_fpioa.c +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/arch/risc-v/src/k210/k210_fpioa.c @@ -45,52 +45,52 @@ ****************************************************************************/ int k210_fpioa_get_io_by_function(uint8_t function) { - int index = 0; - uint32_t RegValue = 0x0000; - uint32_t *fpioa = (uint32_t *)K210_FPIOA_BASE; + int index = 0; + uint32_t RegValue = 0x0000; + uint32_t *fpioa = (uint32_t *)K210_FPIOA_BASE; - for (index = 0; index < K210_IO_NUMBER; index++) - { - RegValue = getreg32(&fpioa[index]); - if ((RegValue & 0xFF) == function) - return index; - } - return -1; + for (index = 0; index < K210_IO_NUMBER; index++) + { + RegValue = getreg32(&fpioa[index]); + if ((RegValue & 0xFF) == function) + return index; + } + return -1; } int fpioa_set_io_pull(int number, fpioa_pull_t pull) { - /* Check parameters */ - if (number < 0 || number >= K210_IO_NUMBER || pull >= FPIOA_PULL_MAX) - return -1; + /* Check parameters */ + if (number < 0 || number >= K210_IO_NUMBER || pull >= FPIOA_PULL_MAX) + return -1; - /* read register */ - uint32_t *fpioa = (uint32_t *)K210_FPIOA_BASE; - fpioa_io_config_t cfg = *(fpioa_io_config_t *)(&fpioa[number]); - uint32_t ioflags = 0x0000; + /* read register */ + uint32_t *fpioa = (uint32_t *)K210_FPIOA_BASE; + fpioa_io_config_t cfg = *(fpioa_io_config_t *)(&fpioa[number]); + uint32_t ioflags = 0x0000; - switch (pull) - { - case FPIOA_PULL_NONE: - cfg.pu = 0; - cfg.pd = 0; - break; - case FPIOA_PULL_DOWN: - cfg.pu = 0; - cfg.pd = 1; - break; - case FPIOA_PULL_UP: - cfg.pu = 1; - cfg.pd = 0; - break; - default: - break; - } + switch (pull) + { + case FPIOA_PULL_NONE: + cfg.pu = 0; + cfg.pd = 0; + break; + case FPIOA_PULL_DOWN: + cfg.pu = 0; + cfg.pd = 1; + break; + case FPIOA_PULL_UP: + cfg.pu = 1; + cfg.pd = 0; + break; + default: + break; + } - /* write register */ - ioflags = *(uint32_t*)(&cfg); - putreg32(ioflags, &fpioa[number]); - return 0; + /* write register */ + ioflags = *(uint32_t*)(&cfg); + putreg32(ioflags, &fpioa[number]); + return 0; } void k210_fpioa_config(uint32_t io, uint32_t ioflags) diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/arch/risc-v/src/k210/k210_fpioa.h b/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/arch/risc-v/src/k210/k210_fpioa.h index d92572b02..cc122c3b8 100644 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/arch/risc-v/src/k210/k210_fpioa.h +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/arch/risc-v/src/k210/k210_fpioa.h @@ -42,6 +42,7 @@ #define K210_IO_NUMBER 48 #define K210_GPIOHS_MAX_PINNO 32 +#define K210_GPIO_MAX_PINNO 8 #define K210_IO_FUNC_UARTHS_RX 18 /* UART High speed Receiver */ #define K210_IO_FUNC_UARTHS_TX 19 /* UART High speed Transmitter */ @@ -77,6 +78,14 @@ #define K210_IO_FUNC_GPIOHS29 53 /* GPIO High speed 29 */ #define K210_IO_FUNC_GPIOHS30 54 /* GPIO High speed 30 */ #define K210_IO_FUNC_GPIOHS31 55 /* GPIO High speed 31 */ +#define K210_IO_FUNC_GPIO0 56 /* GPIO pin 0 */ +#define K210_IO_FUNC_GPIO1 57 /* GPIO pin 1 */ +#define K210_IO_FUNC_GPIO2 58 /* GPIO pin 2 */ +#define K210_IO_FUNC_GPIO3 59 /* GPIO pin 3 */ +#define K210_IO_FUNC_GPIO4 60 /* GPIO pin 4 */ +#define K210_IO_FUNC_GPIO5 61 /* GPIO pin 5 */ +#define K210_IO_FUNC_GPIO6 62 /* GPIO pin 6 */ +#define K210_IO_FUNC_GPIO7 63 /* GPIO pin 7 */ #define K210_IO_DS(x) (x << 8) /* Driving Selector */ diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/arch/risc-v/src/k210/k210_gpio.c b/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/arch/risc-v/src/k210/k210_gpio.c new file mode 100644 index 000000000..919589a0a --- /dev/null +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/arch/risc-v/src/k210/k210_gpio.c @@ -0,0 +1,121 @@ +/**************************************************************************** + * arch/risc-v/src/k210/k210_gpio.c + * + * 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. + * + ****************************************************************************/ + +/** +* @file k210_gpio.c +* @brief nuttx source code +* https://github.com/apache/incubator-nuttx.git +* @version 10.3.0 +* @author AIIT XUOS Lab +* @date 2022-06-30 +*/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#include + +#include "riscv_internal.h" +#include "k210_memorymap.h" +#include "k210_gpio.h" +#include "k210_fpioa.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#define GPIO_INPUT_VAL_OFFSET 0x00 +#define GPIO_INPUT_EN_OFFSET 0x04 +#define GPIO_OUTPUT_EN_OFFSET 0x08 +#define GPIO_OUTPUT_VAL_OFFSET 0x0c +#define GPIO_PULLUP_EN_OFFSET 0x10 +#define GPIO_DRIVE_OFFSET 0x14 + +#define GPIO_INPUT (K210_GPIO_BASE + GPIO_INPUT_VAL_OFFSET) +#define GPIO_INPUT_EN (K210_GPIO_BASE + GPIO_INPUT_EN_OFFSET) +#define GPIO_OUTPUT (K210_GPIO_BASE + GPIO_OUTPUT_VAL_OFFSET) +#define GPIO_OUTPUT_EN (K210_GPIO_BASE + GPIO_OUTPUT_EN_OFFSET) + +/**************************************************************************** + * Public Functions + ****************************************************************************/ +void k210_gpio_set_direction(uint32_t io, gpio_drive_mode_t mode) +{ + DEBUGASSERT(io < K210_GPIO_MAX_PINNO); + int io_number = fpioa_get_io_by_function(K210_IO_FUNC_GPIO0 + io); + DEBUGASSERT(io_number >= 0); + + fpioa_pull_t pull = FPIOA_PULL_NONE; + uint32_t dir = 0; + + switch (mode) + { + case GPIO_DM_INPUT: + pull = FPIOA_PULL_NONE; + dir = 0; + break; + case GPIO_DM_INPUT_PULL_DOWN: + pull = FPIOA_PULL_DOWN; + dir = 0; + break; + case GPIO_DM_INPUT_PULL_UP: + pull = FPIOA_PULL_UP; + dir = 0; + break; + case GPIO_DM_OUTPUT: + pull = FPIOA_PULL_DOWN; + dir = 1; + break; + default: + DEBUGASSERT(!"GPIO drive mode is not supported."); + break; + } + + fpioa_set_io_pull(io_number, pull); + uint32_t outbit = dir << io; + uint32_t inbit = (!dir) << io; + modifyreg32(GPIO_OUTPUT_EN, inbit, outbit); + modifyreg32(GPIO_INPUT_EN, outbit, inbit); +} + +void k210_gpio_set_value(uint32_t io, bool val) +{ + uint32_t setbit = val << io; + uint32_t clrbit = (!val) << io; + modifyreg32(GPIO_OUTPUT, clrbit, setbit); +} + +bool k210_gpio_get_value(uint32_t io) +{ + uint32_t reg = getreg32(GPIO_INPUT); + + if (reg & (1 << io)) + { + return true; + } + else + { + return false; + } +} + diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/arch/risc-v/src/k210/k210_gpio.h b/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/arch/risc-v/src/k210/k210_gpio.h new file mode 100644 index 000000000..13d98e04d --- /dev/null +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/arch/risc-v/src/k210/k210_gpio.h @@ -0,0 +1,89 @@ +/**************************************************************************** + * arch/risc-v/src/k210/k210_gpio.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. + * + ****************************************************************************/ + +/** +* @file k210_gpio.h +* @brief nuttx source code +* https://github.com/apache/incubator-nuttx.git +* @version 10.3.0 +* @author AIIT XUOS Lab +* @date 2022-06-30 +*/ + +#ifndef __ARCH_RISCV_SRC_K210_K210_GPIO_H +#define __ARCH_RISCV_SRC_K210_K210_GPIO_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#include "k210_gpio_common.h" + +/**************************************************************************** + * Public Functions Prototypes + ****************************************************************************/ + +/**************************************************************************** + * Name: k210_gpio_set_direction + * + * Description: + * Set gpiohs direction + * + * Input Parameters: + * io - IO number + * dir - true for output, false for input + * + ****************************************************************************/ + +void k210_gpio_set_direction(uint32_t io, gpio_drive_mode_t mode); + +/**************************************************************************** + * Name: k210_gpio_set_value + * + * Description: + * Set gpiohs direction + * + * Input Parameters: + * io - IO number + * dir - true for high level, false for low level + * + ****************************************************************************/ + +void k210_gpio_set_value(uint32_t io, bool val); + +/**************************************************************************** + * Name: k210_gpio_get_value + * + * Description: + * Get gpiohs level + * + * Input Parameters: + * io - IO number + * + * Returned Value: + * true for high level, false for low level + * + ****************************************************************************/ + +bool k210_gpio_get_value(uint32_t io); + +#endif /* __ARCH_RISCV_SRC_K210_K210_GPIO_H */ diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/arch/risc-v/src/k210/k210_gpio_common.h b/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/arch/risc-v/src/k210/k210_gpio_common.h new file mode 100644 index 000000000..c55284348 --- /dev/null +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/arch/risc-v/src/k210/k210_gpio_common.h @@ -0,0 +1,66 @@ +/**************************************************************************** + * arch/risc-v/src/k210/k210_gpio_common + * + * 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. + * + ****************************************************************************/ + +/** +* @file k210_gpio_common.h +* @brief nuttx source code +* https://github.com/apache/incubator-nuttx.git +* @version 10.3.0 +* @author AIIT XUOS Lab +* @date 2022-06-30 +*/ + +#ifndef __ARCH_RISCV_SRC_K210_GPIO_COMMON_H +#define __ARCH_RISCV_SRC_K210_GPIO_COMMON_H + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum _gpio_drive_mode +{ + GPIO_DM_INPUT, + GPIO_DM_INPUT_PULL_DOWN, + GPIO_DM_INPUT_PULL_UP, + GPIO_DM_OUTPUT, +} gpio_drive_mode_t; + +typedef enum _gpio_pin_edge +{ + GPIO_PE_NONE, + GPIO_PE_FALLING, + GPIO_PE_RISING, + GPIO_PE_BOTH, + GPIO_PE_LOW, + GPIO_PE_HIGH = 8, +} gpio_pin_edge_t; + +typedef enum _gpio_pin_value +{ + GPIO_PV_LOW, + GPIO_PV_HIGH +} gpio_pin_value_t; + +#ifdef __cplusplus +} +#endif + +#endif /* __ARCH_RISCV_SRC_K210_GPIO_COMMON_H */ + diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/arch/risc-v/src/k210/k210_gpiohs.c b/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/arch/risc-v/src/k210/k210_gpiohs.c index 097a2c09f..df386bf04 100644 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/arch/risc-v/src/k210/k210_gpiohs.c +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/arch/risc-v/src/k210/k210_gpiohs.c @@ -68,28 +68,28 @@ void k210_gpiohs_set_direction(uint32_t io, gpio_drive_mode_t mode) fpioa_pull_t pull = FPIOA_PULL_NONE; uint32_t dir = 0; - switch (mode) - { - case GPIO_DM_INPUT: - pull = FPIOA_PULL_NONE; - dir = 0; - break; - case GPIO_DM_INPUT_PULL_DOWN: - pull = FPIOA_PULL_DOWN; - dir = 0; - break; - case GPIO_DM_INPUT_PULL_UP: - pull = FPIOA_PULL_UP; - dir = 0; - break; - case GPIO_DM_OUTPUT: - pull = FPIOA_PULL_DOWN; - dir = 1; - break; - default: - DEBUGASSERT(!"GPIO drive mode is not supported."); - break; - } + switch (mode) + { + case GPIO_DM_INPUT: + pull = FPIOA_PULL_NONE; + dir = 0; + break; + case GPIO_DM_INPUT_PULL_DOWN: + pull = FPIOA_PULL_DOWN; + dir = 0; + break; + case GPIO_DM_INPUT_PULL_UP: + pull = FPIOA_PULL_UP; + dir = 0; + break; + case GPIO_DM_OUTPUT: + pull = FPIOA_PULL_DOWN; + dir = 1; + break; + default: + DEBUGASSERT(!"GPIO drive mode is not supported."); + break; + } fpioa_set_io_pull(io_number, pull); uint32_t outbit = dir << io; diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/arch/risc-v/src/k210/k210_gpiohs.h b/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/arch/risc-v/src/k210/k210_gpiohs.h index 3d993e2ff..43bd7eb60 100644 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/arch/risc-v/src/k210/k210_gpiohs.h +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/arch/risc-v/src/k210/k210_gpiohs.h @@ -36,14 +36,7 @@ #include #include - -typedef enum _gpio_drive_mode -{ - GPIO_DM_INPUT, - GPIO_DM_INPUT_PULL_DOWN, - GPIO_DM_INPUT_PULL_UP, - GPIO_DM_OUTPUT, -} gpio_drive_mode_t; +#include "k210_gpio_common.h" /**************************************************************************** * Public Functions Prototypes diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/arch/risc-v/src/k210/k210_systemreset.c b/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/arch/risc-v/src/k210/k210_systemreset.c index c33a4313e..4cc5137b6 100644 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/arch/risc-v/src/k210/k210_systemreset.c +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/arch/risc-v/src/k210/k210_systemreset.c @@ -35,8 +35,8 @@ typedef struct _k210_soft_reset { - uint32_t soft_reset : 1; - uint32_t reserved : 31; + uint32_t soft_reset : 1; + uint32_t reserved : 31; } __attribute__((packed, aligned(4))) k210_soft_reset_t; volatile k210_soft_reset_t *const reset = (volatile k210_soft_reset_t *)(K210_SYSCTL_BASE + 0x30);