ChibiOS/HAL 9.0.0
hal_lld.h
Go to the documentation of this file.
1/*
2 ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17/**
18 * @file hal_lld.h
19 * @brief PLATFORM HAL subsystem low level driver header.
20 *
21 * @addtogroup HAL
22 * @{
23 */
24
25#ifndef HAL_LLD_H
26#define HAL_LLD_H
27
28/*===========================================================================*/
29/* Driver constants. */
30/*===========================================================================*/
31
32/**
33 * @brief Requires use of SPIv2 driver model.
34 */
35#define HAL_LLD_SELECT_SPI_V2 TRUE
36
37/**
38 * @brief Specifies implementation of dynamic clock management.
39 */
40#define HAL_LLD_USE_CLOCK_MANAGEMENT
41
42/**
43 * @name Platform identification macros
44 * @{
45 */
46#define PLATFORM_NAME "templates"
47/** @} */
48
49/*===========================================================================*/
50/* Driver pre-compile time settings. */
51/*===========================================================================*/
52
53/**
54 * @name PLATFORM configuration options
55 * @{
56 */
57/** @} */
58
59/*===========================================================================*/
60/* Derived constants and error checks. */
61/*===========================================================================*/
62
63/*
64 * Configuration-related checks.
65 */
66#if !defined(PLATFORM_MCUCONF)
67#error "Using a wrong mcuconf.h file, PLATFORM_MCUCONF not defined"
68#endif
69
70/*===========================================================================*/
71/* Driver data structures and types. */
72/*===========================================================================*/
73
74#if defined(HAL_LLD_USE_CLOCK_MANAGEMENT) || defined(__DOXYGEN__)
75/**
76 * @brief Type of a clock configuration structure.
77 */
78typedef struct {
79 uint32_t dummy;
81#endif /* defined(HAL_LLD_USE_CLOCK_MANAGEMENT) */
82
83/*===========================================================================*/
84/* Driver macros. */
85/*===========================================================================*/
86
87/*===========================================================================*/
88/* External declarations. */
89/*===========================================================================*/
90
91#if defined(HAL_LLD_USE_CLOCK_MANAGEMENT) && !defined(__DOXYGEN__)
92extern const halclkcfg_t hal_clkcfg_reset;
93extern const halclkcfg_t hal_clkcfg_default;
94#endif
95
96#ifdef __cplusplus
97extern "C" {
98#endif
99 void hal_lld_init(void);
100#if defined(HAL_LLD_USE_CLOCK_MANAGEMENT) || defined(__DOXYGEN__)
101 bool hal_lld_clock_switch_mode(const halclkcfg_t *ccp);
103#endif /* defined(HAL_LLD_USE_CLOCK_MANAGEMENT) */
104#ifdef __cplusplus
105}
106#endif
107
108#endif /* HAL_LLD_H */
109
110/** @} */
unsigned halclkpt_t
Type of a clock point identifier.
Definition hal.h:239
void hal_lld_init(void)
Low level HAL driver initialization.
Definition hal_lld.c:72
halfreq_t hal_lld_get_clock_point(halclkpt_t clkpt)
Returns the frequency of a clock point in Hz.
Definition hal_lld.c:103
uint32_t halfreq_t
Type of a clock point frequency in Hz.
Definition hal.h:244
bool hal_lld_clock_switch_mode(const halclkcfg_t *ccp)
Switches to a different clock configuration.
Definition hal_lld.c:87
Type of a clock configuration structure.
Definition hal_lld.h:78
uint32_t dummy
Definition hal_lld.h:79