|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
I2C Bus Interface (IIC) register layout for the Renesas RA8D2. More...
Go to the source code of this file.
Data Structures | |
| struct | r_i2c_regs_t |
| Memory-mapped register block for one IIC channel. More... | |
Functions | |
| static volatile r_i2c_regs_t * | ra8_i2c_regs (uint8_t channel) |
| Get a pointer to the IIC channel channel register block. | |
I2C Bus Interface (IIC) register layout for the Renesas RA8D2.
Three RIIC channels (IIC0/IIC1/IIC2) at base 0x4025_E000 + 0x0100 * n – this is the classic Renesas RIIC register block (ICCR1, ICCR2, ICMR1..3, ICFER, ICSER, ICIER, ICSR1/2, SARLy/SARUy, ICBRL/ICBRH, ICDRT, ICDRR). It is the peripheral the RA8D2 HUM calls "I2C Bus Interface (IIC)" and that FSP drives with r_iic_master – distinct from the I3C unified IP (ra8_i3c / ra8_i3c_i2c) at 0x4035_F000.
This header is hand-derived from the RA8D2 Hardware User's Manual Chapter 39 "I2C Bus Interface (IIC)" register descriptions (HUM Ch 39.2, p 2369-2394). Every RIIC register is a single byte; the registers are laid out contiguously from offset 0x00.
Definition in file ra8_i2c_regs.h.
| enum ra8_i2c_addr_t : uintptr_t |
Hardware base addresses for the IIC channels.
Per HUM Ch 39.2.1 "ICCR1 : I2C Bus Control Register 1" p 2369 the channel base is IICn = 0x4025_E000 + 0x0100 * n (n = 0..2). The HAL only ever programmes the S/non-aliased view; the NS alias lives at 0x5025_E000 + 0x0100 * n.
| Enumerator | |
|---|---|
| k_ra8_i2c0_base_addr | HUM Ch 39.2.1, p 2369. |
| k_ra8_i2c_channel_stride | HUM Ch 39.2.1, p 2369. |
Definition at line 51 of file ra8_i2c_regs.h.
| enum ra8_i2c_iccr1_t : uint8_t |
ICCR1 (Bus Control 1) field positions (HUM Ch 39.2.1, p 2369).
Definition at line 117 of file ra8_i2c_regs.h.
| enum ra8_i2c_iccr2_t : uint8_t |
ICCR2 (Bus Control 2) field positions (HUM Ch 39.2.2, p 2371).
Definition at line 132 of file ra8_i2c_regs.h.
| enum ra8_i2c_icfer_t : uint8_t |
ICFER (Bus Function Enable) field positions (HUM Ch 39.2.6, p 2378).
Definition at line 167 of file ra8_i2c_regs.h.
| enum ra8_i2c_icier_t : uint8_t |
ICIER (Bus Interrupt Enable) field positions (HUM Ch 39.2.8, p 2381).
Definition at line 182 of file ra8_i2c_regs.h.
| enum ra8_i2c_icmr1_t : uint8_t |
ICMR1 (Bus Mode 1) field positions (HUM Ch 39.2.3, p 2374).
| Enumerator | |
|---|---|
| k_ra8_i2c_icmr1_cks_pos | Internal reference clock select [6:4]. |
| k_ra8_i2c_icmr1_mtwp_pos | MST/TRS write protect. |
Definition at line 145 of file ra8_i2c_regs.h.
| enum ra8_i2c_icmr3_t : uint8_t |
ICMR3 (Bus Mode 3) field positions (HUM Ch 39.2.5, p 2376).
Definition at line 154 of file ra8_i2c_regs.h.
| enum ra8_i2c_icser_t : uint8_t |
ICSER (Bus Status Enable) field positions (HUM Ch 39.2.7, p 2380).
Own-address-match enables used by the target (peripheral) role. Each SARyE bit arms the matching SARLy / SARUy own-address slot, and GCAE arms the I2C general-call address (0000 000b + 0[W]). Bits 4 and 6 are reserved. Each SARyE bit is this driver's inclusive "own-address slot y" match-enable.
Definition at line 219 of file ra8_i2c_regs.h.
| enum ra8_i2c_icsr1_t : uint8_t |
ICSR1 (Bus Status 1) field positions (HUM Ch 39.2.9, p 2382).
Own-address detection flags. After a controller issues a START and an address that matches an enabled own-address slot, the hardware raises the matching AASy flag (or GCA for the general-call address) on the rising edge of the ninth SCL clock. These flags are cleared automatically when the bus STOP condition is detected.
Definition at line 239 of file ra8_i2c_regs.h.
| enum ra8_i2c_icsr2_t : uint8_t |
ICSR2 (Bus Status 2) field positions (HUM Ch 39.2.10, p 2384).
Definition at line 197 of file ra8_i2c_regs.h.
| enum ra8_i2c_limits_t : uint16_t |
Channel-count limits.
| Enumerator | |
|---|---|
| k_ra8_i2c_channel_count | HUM Ch 39.1, p 2367 (3 channels). |
| k_ra8_i2c_regs_block_bytes | sizeof(r_i2c_regs_t): 0x00..0x15. |
Definition at line 60 of file ra8_i2c_regs.h.
| enum ra8_i2c_mask_t : uint8_t |
Composite bit masks used by the polling driver (HUM Ch 39.2).
Definition at line 286 of file ra8_i2c_regs.h.
| enum ra8_i2c_peripheral_mask_t : uint8_t |
Composite masks for the target (peripheral) role (HUM Ch 39.2).
Own-address enable bits (ICSER), own-address detection flags (ICSR1) and the union of all match flags used to decide that the controller addressed this device. Kept separate from ra8_i2c_mask_t so the controller-only transfer plane is unaffected.
Definition at line 324 of file ra8_i2c_regs.h.
| enum ra8_i2c_sarl_t : uint8_t |
SARLy (own-address lower) field positions (HUM Ch 39.2.13, p 2390).
In 7-bit format (SARUy.FS = 0) the SVA[6:0] field at bit 1 holds the whole 7-bit own address, so a 7-bit address is written left-shifted by one. SVA0 at bit 0 is the 10-bit LSB and is ignored in 7-bit format.
| Enumerator | |
|---|---|
| k_ra8_i2c_sarl_sva0_pos | 10-bit own-address LSB (SVA0). |
| k_ra8_i2c_sarl_sva_pos | 7-bit own address / 10-bit low SVA[6:0]. |
Definition at line 257 of file ra8_i2c_regs.h.
| enum ra8_i2c_saru_t : uint8_t |
SARUy (own-address upper) field positions (HUM Ch 39.2.14, p 2391).
FS selects 7-bit (0) or 10-bit (1) own-address format; SVA[1:0] at bit 1 holds the two upper bits of a 10-bit own address. This polling-mode target driver only programmes the 7-bit format, so SARUy is written as 0.
| Enumerator | |
|---|---|
| k_ra8_i2c_saru_fs_pos | 7-bit (0) / 10-bit (1) format select. |
| k_ra8_i2c_saru_sva_pos | 10-bit own-address upper SVA[1:0]. |
Definition at line 271 of file ra8_i2c_regs.h.
|
inlinestatic |
Get a pointer to the IIC channel channel register block.
| [in] | channel | Channel index. 0, 1 or 2 on the RA8D2. |
Definition at line 356 of file ra8_i2c_regs.h.
References k_ra8_i2c0_base_addr, k_ra8_i2c_channel_count, and k_ra8_i2c_channel_stride.
Referenced by ra8_i2c_clear_errors(), ra8_i2c_deinit(), ra8_i2c_get_errors(), ra8_i2c_init(), ra8_i2c_peripheral_deinit(), ra8_i2c_peripheral_dispatch(), ra8_i2c_peripheral_init(), ra8_i2c_peripheral_poll(), ra8_i2c_peripheral_receive(), ra8_i2c_peripheral_transmit(), ra8_i2c_read(), ra8_i2c_scan(), ra8_i2c_set_clock(), ra8_i2c_transfer(), and ra8_i2c_write().