Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Luiz Fernando Lavado Villa
Core
Commits
e8b3e8c7
Commit
e8b3e8c7
authored
Jul 09, 2021
by
Clément Foucher
Browse files
Add a VREFBUF Driver Module to control the reference voltage.
parent
dc309e52
Changes
5
Hide whitespace changes
Inline
Side-by-side
zephyr/modules/owntech_vrefbuf_driver/zephyr/CMakeLists.txt
0 → 100644
View file @
e8b3e8c7
if
(
CONFIG_OWNTECH_VREFBUF_DRIVER
)
# Define the current folder as a Zephyr library
zephyr_library
()
# Select source files to be compiled
zephyr_library_sources
(
./src/vrefbuf_driver.c
)
endif
()
zephyr/modules/owntech_vrefbuf_driver/zephyr/Kconfig
0 → 100644
View file @
e8b3e8c7
config OWNTECH_VREFBUF_DRIVER
bool "Enable OwnTech VREFBUF driver for STM32"
default y
zephyr/modules/owntech_vrefbuf_driver/zephyr/module.yml
0 → 100644
View file @
e8b3e8c7
name
:
owntech_vrefbuf_driver
build
:
cmake
:
zephyr
kconfig
:
zephyr/Kconfig
zephyr/modules/owntech_vrefbuf_driver/zephyr/src/vrefbuf_driver.c
0 → 100644
View file @
e8b3e8c7
/*
* Copyright (c) 2021 LAAS-CNRS
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: LGLPV2.1
*/
/**
* @author Clément Foucher <clement.foucher@laas.fr>
*/
// Zephyr
#include
<zephyr.h>
#include
<device.h>
// STM32 LL
#include
"stm32_ll_bus.h"
#include
"stm32_ll_system.h"
static
int
vrefbuf_init
(
const
struct
device
*
dev
)
{
LL_APB2_GRP1_EnableClock
(
LL_APB2_GRP1_PERIPH_SYSCFG
);
LL_VREFBUF_SetVoltageScaling
(
LL_VREFBUF_VOLTAGE_SCALE0
);
LL_VREFBUF_DisableHIZ
();
LL_VREFBUF_Enable
();
return
0
;
}
DEVICE_DEFINE
(
vrefbuf_driver
,
"vrefbuf_driver"
,
vrefbuf_init
,
device_pm_control_nop
,
NULL
,
NULL
,
PRE_KERNEL_1
,
CONFIG_KERNEL_INIT_PRIORITY_DEVICE
,
NULL
);
zephyr/prj.conf
View file @
e8b3e8c7
...
...
@@ -45,3 +45,4 @@ CONFIG_ASSERT=y
#CONFIG_OWNTECH_LEG_DRIVER=n
#CONFIG_OWNTECH_NGND_DRIVER=n
#CONFIG_OWNTECH_DATA_ACQUISITION=n
#CONFIG_OWNTECH_VREFBUF_DRIVER=n
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment