Zephyr Project API
3.3.0
A Scalable Open Source RTOS
gecko-pinctrl.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2022 Silicon Labs
3
* SPDX-License-Identifier: Apache-2.0
4
*/
5
6
#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_PINCTRL_GECKO_PINCTRL_H_
7
#define ZEPHYR_INCLUDE_DT_BINDINGS_PINCTRL_GECKO_PINCTRL_H_
8
9
/*
10
* The whole GECKO_pin configuration information is encoded in a 32-bit bitfield
11
* organized as follows:
12
*
13
* - 31..24: Pin function.
14
* - 23..16: Reserved.
15
* - 15..8: Port for UART_RX/UART_TX functions.
16
* - 7..0: Pin number for UART_RX/UART_TX functions.
17
* - 15..8: Reserved for UART_LOC function.
18
* - 7..0: Loc for UART_LOC function.
19
*/
20
27
#define GECKO_FUN_POS 24U
29
#define GECKO_FUN_MSK 0xFFFU
30
32
#define GECKO_PIN_POS 0U
34
#define GECKO_PIN_MSK 0xFFU
35
37
#define GECKO_PORT_POS 8U
39
#define GECKO_PORT_MSK 0xFFU
40
42
#define GECKO_LOC_POS 0U
44
#define GECKO_LOC_MSK 0xFFU
45
54
#define GECKO_FUN_UART_TX 0U
56
#define GECKO_FUN_UART_RX 1U
58
#define GECKO_FUN_UART_RTS 2U
60
#define GECKO_FUN_UART_CTS 3U
62
#define GECKO_FUN_UART_LOC 4U
63
64
#define GECKO_FUN_SPI_MISO 5U
65
#define GECKO_FUN_SPI_MOSI 6U
66
#define GECKO_FUN_SPI_CSN 7U
67
#define GECKO_FUN_SPI_SCK 8U
68
78
#define GECKO_PSEL(fun, port, pin) \
79
(((GECKO_PORT_##port & GECKO_PORT_MSK) << GECKO_PORT_POS) | \
80
((GECKO_PIN(##pin##) & GECKO_PIN_MSK) << GECKO_PIN_POS) | \
81
((GECKO_FUN_##fun & GECKO_FUN_MSK) << GECKO_FUN_POS))
82
89
#define GECKO_LOC(fun, loc) \
90
(((GECKO_LOCATION(##loc##) & GECKO_LOC_MSK) << GECKO_LOC_POS) | \
91
((GECKO_FUN_##fun##_LOC & GECKO_FUN_MSK) << GECKO_FUN_POS))
92
93
#endif
/* ZEPHYR_INCLUDE_DT_BINDINGS_PINCTRL_GECKO_PINCTRL_H_ */
include
zephyr
dt-bindings
pinctrl
gecko-pinctrl.h
Generated on Fri Jun 9 2023 14:55:11 for Zephyr Project API by
1.9.2