|
Zephyr Project API 4.4.99
A Scalable Open Source RTOS
|
Go to the source code of this file.
Macros | |
| #define | EM32F967_GPIO 0 /* 000: GPIO function */ |
| GPIO mux function selector (mux field value 0). | |
| #define | EM32F967_AF1 1 /* 001: Alternate function 1 (SPI1, etc.) */ |
| #define | EM32F967_AF2 2 /* 010: Alternate function 2 (UART, etc.) */ |
| #define | EM32F967_AF3 3 /* 011: Alternate function 3 (Timer, 7816, etc.) */ |
| #define | EM32F967_AF4 4 /* 100: Alternate function 4 (I2C, etc.) */ |
| #define | EM32F967_AF5 5 /* 101: Alternate function 5 (I2C, WKUP, etc.) */ |
| #define | EM32F967_AF6 6 /* 110: Alternate function 6 (SSP2, etc.) */ |
| #define | EM32F967_AF7 7 /* 111: Alternate function 7 (PWM, etc.) */ |
| #define | EM32F967_MUX_SHIFT 0U |
| Pin configuration bit field encoding (EM32-style). | |
| #define | EM32F967_MUX_MASK 0x7U |
| #define | EM32F967_PIN_SHIFT 3U |
| #define | EM32F967_PIN_MASK 0xFU |
| #define | EM32F967_PORT_SHIFT 7U |
| #define | EM32F967_PORT_MASK 0x1U |
| #define | EM32F967_PINMUX(port, pin, mux) |
| EM32F967 Pin Multiplexing Macro (EM32-style). | |
| #define | EM32F967_DT_PINMUX_PORT(pinmux) |
| #define | EM32F967_DT_PINMUX_PIN(pinmux) |
| #define | EM32F967_DT_PINMUX_MUX(pinmux) |
| #define | EM32F967_PULL_NONE_5V 0 /* 00: Floating */ |
| #define | EM32F967_PULL_UP0_5V 1 /* 01: PU0 (66KΩ@5V, 101KΩ@3.3V, 238KΩ@1.8V) */ |
| #define | EM32F967_PULL_UP1_5V 2 /* 10: PU1 (4.7KΩ@5V, 6.41KΩ@3.3V, 12.7KΩ@1.8V) */ |
| #define | EM32F967_PULL_DOWN_5V 3 /* 11: PD (15KΩ@5V, 21.8KΩ@3.3V, 49.6KΩ@1.8V) */ |
| #define | EM32F967_PULL_NONE_3V 0 /* 00: Floating */ |
| #define | EM32F967_PULL_UP0_3V 1 /* 01: PU0 (66KΩ@3.3V, 140KΩ@1.8V) */ |
| #define | EM32F967_PULL_UP1_3V 2 /* 10: PU1 (4.7KΩ@3.3V, 8.53KΩ@1.8V) */ |
| #define | EM32F967_PULL_DOWN_3V 3 /* 11: PD (15KΩ@3.3V, 25.2KΩ@1.8V) */ |
| #define | EM32F967_DRIVE_NORMAL 0 /* Normal drive strength */ |
| #define | EM32F967_DRIVE_HIGH 1 /* High drive strength (Load=30pF) */ |
| #define | EM32F967_IO_NONE 0U |
| Embedded IP_SHARE operations carried inside the pinmux cell. | |
| #define | EM32F967_IO1(shift, width, val) |
| Build the first (slot 1) embedded IP_SHARE operation. | |
| #define | EM32F967_IO2(shift, width, val) |
| Build the second (slot 2) embedded IP_SHARE operation. | |
| #define | EM32F967_IO_SET_BIT(pos) |
| Slot 1 helper: set a single IP_SHARE bit. | |
| #define | EM32F967_IO_CLR_BIT(pos) |
| Slot 1 helper: clear a single IP_SHARE bit. | |
| #define | EM32F967_IO_SET_2BIT(pos, val) |
| Slot 1 helper: write a 2-bit IP_SHARE field. | |
| #define | EM32F967_IO_CLR_2BIT(pos) |
| Slot 1 helper: clear a 2-bit IP_SHARE field. | |
| #define | EM32F967_PINMUX_IO(port, pin, mux, ioshare) |
| EM32F967 pinmux macro with embedded IP_SHARE operation(s). | |
| #define EM32F967_AF1 1 /* 001: Alternate function 1 (SPI1, etc.) */ |
| #define EM32F967_AF2 2 /* 010: Alternate function 2 (UART, etc.) */ |
| #define EM32F967_AF3 3 /* 011: Alternate function 3 (Timer, 7816, etc.) */ |
| #define EM32F967_AF4 4 /* 100: Alternate function 4 (I2C, etc.) */ |
| #define EM32F967_AF5 5 /* 101: Alternate function 5 (I2C, WKUP, etc.) */ |
| #define EM32F967_AF6 6 /* 110: Alternate function 6 (SSP2, etc.) */ |
| #define EM32F967_AF7 7 /* 111: Alternate function 7 (PWM, etc.) */ |
| #define EM32F967_DRIVE_HIGH 1 /* High drive strength (Load=30pF) */ |
| #define EM32F967_DRIVE_NORMAL 0 /* Normal drive strength */ |
| #define EM32F967_DT_PINMUX_MUX | ( | pinmux | ) |
| #define EM32F967_DT_PINMUX_PIN | ( | pinmux | ) |
| #define EM32F967_DT_PINMUX_PORT | ( | pinmux | ) |
| #define EM32F967_GPIO 0 /* 000: GPIO function */ |
GPIO mux function selector (mux field value 0).
Selects the plain GPIO function (no alternate function) for a pin when used as the mux argument of EM32F967_PINMUX / EM32F967_PINMUX_IO.
| #define EM32F967_IO1 | ( | shift, | |
| width, | |||
| val ) |
Build the first (slot 1) embedded IP_SHARE operation.
Encodes a single IP_SHARE read-modify-write operation into pinmux bits [19:8] (valid flag, shift, width-1 and value). Combine with EM32F967_IO2 via bitwise OR to encode a second operation.
| shift | Bit position (0-31) of the field within the IP_SHARE register. |
| width | Field width in bits (1-4). |
| val | Value to write into the field. |
| #define EM32F967_IO2 | ( | shift, | |
| width, | |||
| val ) |
Build the second (slot 2) embedded IP_SHARE operation.
Encodes a single IP_SHARE read-modify-write operation into pinmux bits [31:20] (valid flag, shift, width-1 and value). Combine with EM32F967_IO1 (or its convenience helpers) via bitwise OR to encode a second operation in the same pinmux cell.
| shift | Bit position (0-31) of the field within the IP_SHARE register. |
| width | Field width in bits (1-4). |
| val | Value to write into the field. |
| #define EM32F967_IO_CLR_2BIT | ( | pos | ) |
Slot 1 helper: clear a 2-bit IP_SHARE field.
Equivalent to EM32F967_IO1 with a 2-bit field whose value is 0.
| pos | Bit position (0-31) of the 2-bit field in the IP_SHARE register. |
| #define EM32F967_IO_CLR_BIT | ( | pos | ) |
Slot 1 helper: clear a single IP_SHARE bit.
Equivalent to EM32F967_IO1 with a 1-bit field whose value is 0.
| pos | Bit position (0-31) to clear in the IP_SHARE register. |
| #define EM32F967_IO_NONE 0U |
Embedded IP_SHARE operations carried inside the pinmux cell.
The high 24 bits of the pinmux value (bits [31:8]) may encode up to two IP_SHARE read-modify-write operations. The pinctrl driver (drivers/pinctrl/pinctrl_em32.c, em32_apply_ioshare_from_pinmux()) decodes and applies them when present, instead of falling back to the built-in em32_ioshare_table[] lookup.
Bit layout (must stay in sync with the PINMUX_IO* defines in the driver):
bit [ 8] io1_valid (1 = first IP_SHARE op present) bits [13:9] io1_shift (bit position 0-31 in IP_SHARE) bits [15:14] io1_width_m1 (field width minus 1: 0 = 1 bit) bits [19:16] io1_value (value written at io1_shift) bit [20] io2_valid (1 = second IP_SHARE op present) bits [25:21] io2_shift bits [27:26] io2_width_m1 bits [31:28] io2_value
| #define EM32F967_IO_SET_2BIT | ( | pos, | |
| val ) |
Slot 1 helper: write a 2-bit IP_SHARE field.
Equivalent to EM32F967_IO1 with a 2-bit field.
| pos | Bit position (0-31) of the 2-bit field in the IP_SHARE register. |
| val | Value (0-3) to write into the field. |
| #define EM32F967_IO_SET_BIT | ( | pos | ) |
Slot 1 helper: set a single IP_SHARE bit.
Equivalent to EM32F967_IO1 with a 1-bit field whose value is 1.
| pos | Bit position (0-31) to set in the IP_SHARE register. |
| #define EM32F967_MUX_MASK 0x7U |
| #define EM32F967_MUX_SHIFT 0U |
Pin configuration bit field encoding (EM32-style).
Fields:
This encoding allows up to 2 ports, 16 pins per port, and 8 mux functions
| #define EM32F967_PIN_MASK 0xFU |
| #define EM32F967_PIN_SHIFT 3U |
| #define EM32F967_PINMUX | ( | port, | |
| pin, | |||
| mux ) |
EM32F967 Pin Multiplexing Macro (EM32-style).
| port | Port identifier ('A' or 'B') |
| pin | Pin number (0-15) |
| mux | Multiplexing function (GPIO, AF1-AF7) |
| #define EM32F967_PINMUX_IO | ( | port, | |
| pin, | |||
| mux, | |||
| ioshare ) |
EM32F967 pinmux macro with embedded IP_SHARE operation(s).
| port | Port identifier ('A' or 'B') |
| pin | Pin number (0-15) |
| mux | Multiplexing function (GPIO, AF1-AF7) |
| ioshare | One or two IP_SHARE ops built with EM32F967_IO_* / EM32F967_IO1 / EM32F967_IO2, or EM32F967_IO_NONE. |
| #define EM32F967_PORT_MASK 0x1U |
| #define EM32F967_PORT_SHIFT 7U |
| #define EM32F967_PULL_DOWN_3V 3 /* 11: PD (15KΩ@3.3V, 25.2KΩ@1.8V) */ |
| #define EM32F967_PULL_DOWN_5V 3 /* 11: PD (15KΩ@5V, 21.8KΩ@3.3V, 49.6KΩ@1.8V) */ |
| #define EM32F967_PULL_NONE_3V 0 /* 00: Floating */ |
| #define EM32F967_PULL_NONE_5V 0 /* 00: Floating */ |
| #define EM32F967_PULL_UP0_3V 1 /* 01: PU0 (66KΩ@3.3V, 140KΩ@1.8V) */ |
| #define EM32F967_PULL_UP0_5V 1 /* 01: PU0 (66KΩ@5V, 101KΩ@3.3V, 238KΩ@1.8V) */ |
| #define EM32F967_PULL_UP1_3V 2 /* 10: PU1 (4.7KΩ@3.3V, 8.53KΩ@1.8V) */ |
| #define EM32F967_PULL_UP1_5V 2 /* 10: PU1 (4.7KΩ@5V, 6.41KΩ@3.3V, 12.7KΩ@1.8V) */ |