Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WB32 MCU] Added RTC hal. #399

Merged
merged 49 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
04578f5
Fixed usb remote wakeup, i2c Added more rate configurations
itarze Dec 7, 2023
a5cd80d
Merge branch 'ChibiOS:chibios-21.11.x' into chibios-21.11.x-wb
itarze Dec 12, 2023
3e83712
Added RTC configuration in hal_lld.h
itarze Dec 14, 2023
37beb23
初步测试通过 实现RTC功能
Dec 18, 2023
43ae522
update
Dec 19, 2023
f6501d3
update rtc_lld
Dec 19, 2023
fcf5cbc
UPDATE
Dec 19, 2023
a3301f9
update
Dec 20, 2023
a3afbe5
update 正式版本2
Dec 20, 2023
79949fb
update 正式版
Dec 20, 2023
b99e576
update 正式发布
Dec 21, 2023
a69a5ea
update 正式发布
Dec 21, 2023
f8154d2
update 3G71
Dec 21, 2023
c579784
update
Dec 21, 2023
8644894
update
Dec 22, 2023
2931666
update
Dec 22, 2023
740a81d
update
Dec 22, 2023
b6bf6b2
update
Dec 22, 2023
302e53b
update
Dec 22, 2023
c389668
update
Dec 22, 2023
97e67ed
update
Dec 22, 2023
ce01fe3
update
Dec 22, 2023
9611021
Revert "Update keil project"
Dec 22, 2023
6a28596
update 修改格式
Dec 22, 2023
3b5cb28
Update demos/WB32/RT-WB32F3G71-RTC/debug.h
yelishang Dec 22, 2023
f46c2f3
Update demos/WB32/RT-WB32F3G71-RTC/main.c
yelishang Dec 22, 2023
07223ed
Update demos/WB32/RT-WB32F3G71-RTC/main.c
yelishang Dec 22, 2023
7d9d75e
Update demos/WB32/RT-WB32F3G71-RTC/main.c
yelishang Dec 22, 2023
f9e4aba
Revert "Update keil project"
Dec 22, 2023
95140e1
Merge branch 'lbk' of github.com:yelishang/ChibiOS-Contrib into lbk
Dec 22, 2023
da2e995
update
Dec 22, 2023
889c11e
update
Dec 22, 2023
4f9c7ea
update
Dec 22, 2023
e236e2b
update
Dec 22, 2023
6d58f4e
Update os/hal/ports/WB32/LLD/RTCv1/hal_rtc_lld.c
yelishang Dec 22, 2023
26cc201
Update os/hal/ports/WB32/LLD/RTCv1/hal_rtc_lld.c
yelishang Dec 22, 2023
c3ebbfc
Update os/hal/ports/WB32/LLD/RTCv1/hal_rtc_lld.c
yelishang Dec 22, 2023
5ec9127
Update os/hal/ports/WB32/LLD/RTCv1/hal_rtc_lld.c
yelishang Dec 22, 2023
2b69d7a
Update os/hal/ports/WB32/LLD/RTCv1/hal_rtc_lld.c
yelishang Dec 22, 2023
58914b4
UPDATE
Dec 22, 2023
a6d4345
update
Dec 22, 2023
7df19a2
update
Dec 22, 2023
621c08c
update
Dec 22, 2023
9276a97
update
Dec 22, 2023
edeea92
update
Dec 22, 2023
5b09b27
Merge pull request #2 from yelishang/lbk
itarze Dec 22, 2023
60f2d3b
Update hal_usb_lld.c
Apr 3, 2024
d7d4bab
Merge branch 'chibios-21.11.x' of https://github.com/ChibiOS/ChibiOS-…
Apr 3, 2024
08ee280
Update
Apr 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
204 changes: 204 additions & 0 deletions demos/WB32/RT-WB32F3G71-RTC/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
##############################################################################
# Build global options
# NOTE: Can be overridden externally.
#

# Compiler options here.
ifeq ($(USE_OPT),)
USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16
endif

# C specific options here (added to USE_OPT).
ifeq ($(USE_COPT),)
USE_COPT =
endif

# C++ specific options here (added to USE_OPT).
ifeq ($(USE_CPPOPT),)
USE_CPPOPT = -fno-rtti
endif

# Enable this if you want the linker to remove unused code and data.
ifeq ($(USE_LINK_GC),)
USE_LINK_GC = yes
endif

# Linker extra options here.
ifeq ($(USE_LDOPT),)
USE_LDOPT =
endif

# Enable this if you want link time optimizations (LTO).
ifeq ($(USE_LTO),)
USE_LTO = yes
endif

# Enable this if you want to see the full log while compiling.
ifeq ($(USE_VERBOSE_COMPILE),)
USE_VERBOSE_COMPILE = yes
endif

# If enabled, this option makes the build process faster by not compiling
# modules not used in the current configuration.
ifeq ($(USE_SMART_BUILD),)
USE_SMART_BUILD = yes
endif

#
# Build global options
##############################################################################

##############################################################################
# Architecture or project specific options
#

# Stack size to be allocated to the Cortex-M process stack. This stack is
# the stack used by the main() thread.
ifeq ($(USE_PROCESS_STACKSIZE),)
USE_PROCESS_STACKSIZE = 0x400
endif

# Stack size to the allocated to the Cortex-M main/exceptions stack. This
# stack is used for processing interrupts and exceptions.
ifeq ($(USE_EXCEPTIONS_STACKSIZE),)
USE_EXCEPTIONS_STACKSIZE = 0x400
endif

# Enables the use of FPU (no, softfp, hard).
ifeq ($(USE_FPU),)
USE_FPU = no
endif

# FPU-related options.
ifeq ($(USE_FPU_OPT),)
USE_FPU_OPT = -mfloat-abi=$(USE_FPU) -mfpu=fpv4-sp-d16
endif

#
# Architecture or project specific options
##############################################################################

##############################################################################
# Project, target, sources and paths
#

# Define project name here
PROJECT = ch

# Target settings.
MCU = cortex-m3

# Imported source files and paths.
CHIBIOS := ../../../../ChibiOS
CHIBIOS_CONTRIB = $(CHIBIOS)/../ChibiOS-Contrib
CONFDIR := ./cfg
BUILDDIR := ./build
DEPDIR := ./.dep
BOARDDIR := ./board

# Licensing files.
include $(CHIBIOS)/os/license/license.mk
# Startup files.
include $(CHIBIOS_CONTRIB)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_wb32f3g71xx.mk
# HAL-OSAL files (optional).
include $(CHIBIOS)/os/hal/hal.mk
include $(CHIBIOS_CONTRIB)/os/hal/ports/WB32/WB32F3G71xx/platform.mk
include $(BOARDDIR)/board.mk
include $(CHIBIOS)/os/hal/osal/rt-nil/osal.mk
# RTOS files (optional).
include $(CHIBIOS)/os/rt/rt.mk
include $(CHIBIOS)/os/common/ports/ARMv7-M/compilers/GCC/mk/port.mk
# Auto-build files in ./source recursively.
include $(CHIBIOS)/tools/mk/autobuild.mk
# Other files (optional).
# include $(CHIBIOS)/test/lib/test.mk
# include $(CHIBIOS)/test/rt/rt_test.mk
# include $(CHIBIOS)/test/oslib/oslib_test.mk
# include $(CHIBIOS)/os/hal/lib/streams/streams.mk
# include $(CHIBIOS)/os/various/shell/shell.mk

# Define linker script file here
LDSCRIPT= $(STARTUPLD_CONTRIB)/WB32F3G71xC.ld


# C sources that can be compiled in ARM or THUMB mode depending on the global
# setting.
CSRC = $(ALLCSRC) \
$(TESTSRC) \
$(CHIBIOS)/os/various/syscalls.c \
$(CHIBIOS)/os/hal/lib/streams/chprintf.c \
debug.c \
main.c

ALLINC += ./ \
$(CHIBIOS)/os/common/lib/include \
$(CHIBIOS)/os/common/oop/include \
$(CHIBIOS)/os/hal/lib/streams



# C++ sources that can be compiled in ARM or THUMB mode depending on the global
# setting.
CPPSRC = $(ALLCPPSRC)

# List ASM source files here.
ASMSRC = $(ALLASMSRC)

# List ASM with preprocessor source files here.
ASMXSRC = $(ALLXASMSRC)

# Inclusion directories.
INCDIR = $(CONFDIR) $(ALLINC) $(TESTINC)

# Define C warning options here.
CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes

# Define C++ warning options here.
CPPWARN = -Wall -Wextra -Wundef

#
# Project, target, sources and paths
##############################################################################

##############################################################################
# Start of user section
#

# List all user C define here, like -D_DEBUG=1
UDEFS =

# Define ASM defines here
UADEFS =

# List all user directories here
UINCDIR =

# List the user directory to look for the libraries here
ULIBDIR =

# List all user libraries here
ULIBS =

#
# End of user section
##############################################################################

##############################################################################
# Common rules
#

RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk
include $(RULESPATH)/arm-none-eabi.mk
include $(RULESPATH)/rules.mk

#
# Common rules
##############################################################################

##############################################################################
# Custom rules
#

#
# Custom rules
##############################################################################
82 changes: 82 additions & 0 deletions demos/WB32/RT-WB32F3G71-RTC/board/board.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/*
Copyright (C) 2023 Westberry Technology Corp., Ltd

Licensed 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.
*/

/*
* This file has been automatically generated using ChibiStudio board
* generator plugin. Do not edit manually.
*/

#include "hal.h"

/*===========================================================================*/
/* Driver local definitions. */
/*===========================================================================*/

/*===========================================================================*/
/* Driver exported variables. */
/*===========================================================================*/

/*===========================================================================*/
/* Driver local variables and types. */
/*===========================================================================*/

/*===========================================================================*/
/* Driver local functions. */
/*===========================================================================*/

static void wb32_gpio_init(void) {

#if WB32_HAS_GPIOA
rccEnableAPB1(RCC_APB1ENR_GPIOAEN);
#endif

#if WB32_HAS_GPIOB
rccEnableAPB1(RCC_APB1ENR_GPIOBEN);
#endif

#if WB32_HAS_GPIOC
rccEnableAPB1(RCC_APB1ENR_GPIOCEN);
#endif

#if WB32_HAS_GPIOD
rccEnableAPB1(RCC_APB1ENR_GPIODEN);
#endif
}

/*===========================================================================*/
/* Driver interrupt handlers. */
/*===========================================================================*/

/*===========================================================================*/
/* Driver exported functions. */
/*===========================================================================*/
/*
* Early initialization code.
* This initialization must be performed just after stack setup and before
* any other initialization.
*/
void __early_init(void) {

wb32_clock_init();
wb32_gpio_init();
}
/**
* @brief Board-specific initialization code.
* @note You can add your board-specific code here.
*/
void boardInit(void) {

}
56 changes: 56 additions & 0 deletions demos/WB32/RT-WB32F3G71-RTC/board/board.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#pragma once
/*
Copyright (C) 2023 Westberry Technology Corp., Ltd

Licensed 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.
*/

/*
* This file has been automatically generated using ChibiStudio board
* generator plugin. Do not edit manually.
*/

#ifndef BOARD_H
#define BOARD_H

/*===========================================================================*/
/* Driver constants. */
/*===========================================================================*/

/*
* Setup board.
*/

/*
* Board identifier.
*/
#define WB32FQ95xC
#if !defined(WB32F3G71xx)
#define WB32F3G71xx
#endif

/*===========================================================================*/
/* External declarations. */
/*===========================================================================*/

#if !defined(_FROM_ASM_)
#ifdef __cplusplus
extern "C" {
#endif
void boardInit(void);
#ifdef __cplusplus
}
#endif
#endif /* _FROM_ASM_ */

#endif /* BOARD_H */
9 changes: 9 additions & 0 deletions demos/WB32/RT-WB32F3G71-RTC/board/board.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# List of all the board related files.
BOARDSRC = $(BOARDDIR)/board.c

# Required include directories
BOARDINC = $(BOARDDIR)

# Shared variables
ALLCSRC += $(BOARDSRC)
ALLINC += $(BOARDINC)
Loading
Loading