Skip to content

Commit ceb6cfe

Browse files
Hazel Zhangeasonxiang
authored andcommitted
pinmux and gpio code implement
implement pinmux and gpio code, implement aon_glb_reg code. Signed-off-by: Hazel Zhang <hazel.zhang@unisoc.com>
1 parent c4757e5 commit ceb6cfe

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ if(CONFIG_HAS_UWP)
1111
zephyr_sources_ifdef(CONFIG_USE_UWP_HAL_GNSS soc/gnss.c)
1212
zephyr_sources_ifdef(CONFIG_USE_UWP_HAL_FW soc/load_fw.c)
1313

14-
zephyr_sources_ifdef(CONFIG_SOC_UWP5661&&CONFIG_PINMUX_UWP drivers/src/hal_pinmux_uwp5661.c)
15-
zephyr_sources_ifdef(CONFIG_SOC_UWP5662&&CONFIG_PINMUX_UWP drivers/src/hal_pinmux_uwp5662.c)
14+
zephyr_sources_ifdef(CONFIG_SOC_UWP5661 drivers/src/hal_pinmux_uwp5661.c)
15+
zephyr_sources_ifdef(CONFIG_SOC_UWP5662 drivers/src/hal_pinmux_uwp5662.c)
1616
endif()

drivers/include/hal_aon_glb.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ extern "C" {
4242
#define REG_AON_CHIP_ID (BASE_AON_GLB + 0x208)
4343
#define REG_AON_GPIO_MODE1 (BASE_AON_GLB + 0x20C)
4444
#define REG_AON_GPIO_MODE2 (BASE_AON_GLB + 0x210)
45+
#define REG_AON_CM4_SLEEP_HOLD (BASE_AON_GLB + 0x238)
4546

4647
enum {
4748
AON_EB_SYST = 0,

drivers/include/hal_gpio.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ extern "C" {
1212
#endif
1313

1414
#include "uwp_hal.h"
15-
16-
#define GPIO_DIR_OUTPUT 1
17-
#define GPIO_DIR_INPUT 0
15+
#include <gpio.h>
1816

1917
#define GPIO_INT_DETECT_LEVEL 1
2018
#define GPIO_INT_DETECT_EDGE 0
@@ -97,7 +95,7 @@ extern "C" {
9795
{
9896
volatile struct uwp_gpio *gpio = UWP_GPIO(base);
9997

100-
if(dir == GPIO_DIR_OUTPUT)
98+
if (dir == GPIO_DIR_OUT)
10199
gpio->dir |= pin_map;
102100
else
103101
gpio->dir &= (~pin_map);

drivers/include/hal_pin_reg_uwp5662.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7-
#ifndef _HAL_PIN_REG_H
8-
#define _HAL_PIN_REG_H
7+
#ifndef _HAL_PIN_REG_UWP5662_H
8+
#define _HAL_PIN_REG_UWP5662_H
99

1010
#ifdef __cpluscplus
1111
extern "C"

0 commit comments

Comments
 (0)