54typedef enum : uint32_t {
59typedef enum : uint64_t {
81typedef enum : uint32_t {
90typedef enum : uint32_t {
111typedef enum : uint32_t {
127typedef enum : uint16_t {
144typedef enum : uint32_t {
162typedef enum : uint32_t {
172typedef enum : uint16_t {
191typedef enum : uint16_t {
221 return (uint32_t)(off >> 2U);
409 uint32_t converted = 0U;
410 uint16_t last_code = 0U;
436 if (converted != 0U) {
440 "ADC grp=%u %uch code=%u",
443 (
unsigned)last_code);
465 const uint64_t off = addr - (uint64_t)
k_adc_base;
493 const uint64_t off = addr - (uint64_t)
k_adc_base;
499 if ((off >= str_lo) && (off < str_hi) && ((value & (uint64_t)
k_adc_adst_mask) != 0U)) {
500 const uint32_t group = (uint32_t)((off - str_lo) / (uint64_t)
k_adc_str_stride);
Multi-channel console log store backing the board view's tabbed console.
void board_console_push(board_console_ch_t ch, const char *line)
Append one completed line to a channel ring and the ALL ring.
@ k_board_console_ch_adc
ADC_B conversion summaries.
static RA8_INTERNAL uint16_t internal_adc_midscale_for_adprc(uint32_t adprc)
Resolution-appropriate mid-scale result code for an ADPRC format.
adc_elc_event_t
ADC_B scan-complete (ADI) ELC event the model raises on a scan start.
@ k_event_adc0_scan_end
ADC0 ADI scan-complete event.
adc_map_t
ADC_B block geometry (ra8_adc_b_regs.h, FSP R_ADC_B0_Type).
@ k_adc_sgdcr_stride
ADSGDCRn is 4 bytes per slot.
@ k_adc_str_stride
ADSTR[n] is 4 bytes per slot.
@ k_adc_chcr_stride
ADCHCRn occupies 16 bytes per slot.
@ k_adc_span
Full FSP R_ADC_B0_Type window size.
@ k_adc_off_adsger
ADSGER scan-group enable.
@ k_adc_off_adexdr0
ADEXDR[0] extended-analog results.
@ k_adc_off_addopcrc0
ADDOPCRC[0] per-channel ADPRC format.
@ k_adc_off_adsgdcr0
ADSGDCR[0] scan-group self-diag ctrl.
@ k_adc_off_adstr0
ADSTR[0] per-group SW start.
@ k_adc_off_adsr
ADSR conversion status (RO).
@ k_adc_off_adchcr0
ADCHCR[0] per-channel config.
@ k_adc_off_adstopr
ADSTOPR force-stop.
@ k_adc_off_adtrgenr
ADTRGENR per-group HW-trigger enable.
@ k_adc_exdr_stride
ADEXDRn is 4 bytes per slot.
@ k_adc_off_adintcr
ADINTCR per-group scan-end IE.
@ k_adc_base
ADC_B register-window base.
@ k_adc_off_addr0
ADDR[0] conversion results.
@ k_adc_addr_stride
ADDR[n] is 4 bytes per slot.
static RA8_INTERNAL uint32_t internal_adc_diagval(uint32_t group)
Read ADSGDCR[group].DIAGVAL[2:0] (self-diagnosis mode) from the store.
static RA8_INTERNAL void internal_adc_reset(void)
Clear all ADC_B register state and observability counters.
static RA8_INTERNAL uint64_t internal_adc_read(uc_engine *uc, uint64_t addr, unsigned size)
MMIO read: ADSR holds ADACT0 idle; everything else reads back.
static uint16_t s_adc_last_code
Last result code written to an ADDR.
adc_ext_chan_t
Extended-analog (internal) channel CNVCS codes (ra8_adc_b_regs.h).
@ k_adc_chan_selfdiag
Self-diagnosis A/D unit 0.
@ k_adc_chan_temp
On-chip temperature sensor.
@ k_adc_chan_int_vref
Internal reference voltage.
@ k_adc_ext_chan_base
ADEXDR index origin (n = CNVCS - base).
static RA8_INTERNAL void internal_adc_write(uc_engine *uc, uint64_t addr, unsigned size, uint64_t value)
MMIO write: ADSTR kicks a scan; other registers latch the value.
static RA8_INTERNAL void internal_adc_convert_group(uint32_t group)
Populate result registers for every channel enrolled in group.
static RA8_INTERNAL uint32_t internal_adc_chcr(uint32_t ch)
Read an ADCHCRn slot's raw config word from the backing store.
adc_field_t
ADC_B field shifts / masks the model consults.
@ k_adc_chcr_cnvcs_s
ADCHCRn.CNVCS shift.
@ k_adc_sgdcr_diagval
ADSGDCRn.DIAGVAL[2:0] mode.
@ k_adc_opcrc_adprc_s
ADDOPCRCn.ADPRC shift.
@ k_adc_adst_mask
ADSTR[n].ADST start bit.
@ k_adc_addr_data
ADDR[n] DATA[15:0] field.
@ k_adc_adact0_mask
ADSR.ADACT0 unit-0 busy flag.
@ k_adc_opcrc_adprc_m
ADDOPCRCn.ADPRC[17:16] format.
@ k_adc_chcr_cnvcs_m
ADCHCRn.CNVCS[14:8] phys channel.
@ k_adc_chcr_sgsel
ADCHCRn.SGSEL[4:0] scan group.
adc_console_t
Console-tap line buffer capacity for an ADC conversion summary.
@ k_adc_console_line_cap
Max chars in an "ADC grp=.. .." line.
static RA8_INTERNAL uint32_t internal_adc_word(uint64_t off)
Word index into the backing store for an in-window offset.
static RA8_INTERNAL uint16_t internal_adc_selfdiag_ideal(uint32_t diagval)
Ideal 16-bit self-diagnosis code for the armed DIAGVAL mode.
static RA8_INTERNAL void internal_adc_report(void)
Print the ADC_B scan count + last reported result code.
static RA8_INTERNAL void internal_board_periph_adc_register(void)
Self-register the ADC_B block before main runs (decentralized).
static const board_periph_block_t s_k_adc_block
This block's descriptor (static lifetime; the core keeps the pointer).
adc_midscale_t
Resolution-appropriate mid-scale (half-full-scale) result codes.
@ k_adc_mid_16bit
16-bit half-scale.
@ k_adc_mid_12bit
12-bit half-scale.
@ k_adc_mid_14bit
14-bit half-scale.
@ k_adc_mid_10bit
10-bit half-scale.
static RA8_INTERNAL uint32_t internal_adc_adprc(uint32_t slot)
Read ADDOPCRC[slot].ADPRC[1:0] data-format code from the store.
adc_adprc_t
ADDOPCRCn.ADPRC[1:0] data-format codes (HUM Ch 53.2.3.4 p 3339).
@ k_adc_adprc_10bit
ADPRC 0b11: 10-bit result.
@ k_adc_adprc_16bit
ADPRC 0b00: 16-bit result.
@ k_adc_adprc_14bit
ADPRC 0b01: 14-bit result.
@ k_adc_adprc_12bit
ADPRC 0b10: 12-bit result.
static RA8_INTERNAL void internal_adc_set_ext_result(uint32_t idx, uint16_t code)
Store an extended-analog result into ADEXDR[idx] (DATA[15:0], ERR clear).
adc_selfdiag_t
ADSGDCRn.DIAGVAL self-diagnosis mode codes + ideal 16-bit results.
@ k_adc_diagval_mode1
DIAGVAL mode 1: zero.
@ k_adc_selfdiag_posfs
Mode-3 ideal 0x7FFF (+32767).
@ k_adc_selfdiag_negfs
Mode-2 ideal 0x8000 (-32768).
@ k_adc_diagval_mode3
DIAGVAL mode 3: positive full-scale.
@ k_adc_selfdiag_zero
Mode-1 ideal 0x0000.
@ k_adc_diagval_mode2
DIAGVAL mode 2: negative full-scale.
adc_sample_t
Plausible conversion result reported on every scan.
@ k_adc_temp_code
12-bit temperature-sensor code (~26 degC).
@ k_adc_sample_code
12-bit half-scale (~VREFH/2) mid-scale.
static uint32_t s_adc_reg[k_adc_reg_words]
Backing store for the whole ADC_B window (word-addressed).
static RA8_INTERNAL uint16_t internal_adc_ext_value(uint32_t phys, uint32_t group)
Synthetic ADEXDR code for an extended-analog channel (phys >= base).
static RA8_INTERNAL void internal_adc_set_result(uint32_t ch, uint16_t code)
Store a freshly converted code into ADDR[ch] (DATA[15:0], ERR clear).
static uint32_t s_adc_scans
Conversions kicked via ADSTR.
adc_dim_t
ADC_B array dimensions (mirror ra8_adc_b_limits_t).
@ k_adc_reg_words
Backing-store word count.
@ k_adc_max_channels
ADCHCR0..23 virtual-channel config slots.
@ k_adc_ext_regs
ADEXDR[0..22] extended-analog slots.
@ k_adc_result_regs
ADDR[0..22] result slots.
@ k_adc_scan_groups
ADSGER / ADTRGENR / ADSTR width [8:0].
Decentralized peripheral-block registry for the board emulator core.
void board_periph_icu_raise_event(uc_engine *uc, uint16_t event)
Raise a peripheral ELC event through the core's ICU -> NVIC path.
void board_periph_register_block(const board_periph_block_t *block)
Register a peripheral block's descriptor with the core registry.
@ k_block_order_i2c
I3C/I2C + GT911 (no tick today).
bool board_periph_trace(void)
Whether –trace is active (blocks log transitions when true).
Bounded raw-descriptor I/O seam for the RA8 emulator.
emu_io_result_t priv_emu_io_errf(const char *format,...)
Format bounded text and write it to the injected error descriptor.
#define RA8_INTERNAL
Marker that a function is intended to be static (file-local).
A modelled peripheral block's self-description for the core registry.