ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_power_profile_config_t Struct Reference

Initialisation configuration. More...

#include <ra8_power_profile.h>

Data Fields

ra8_power_profile_gpio_pulse_fn_t pulse
 GPIO edge hook (may be nullptr).
ra8_power_profile_now_us_fn_t now_us
 Clock hook, us (may be nullptr).
void * user_ctx_gpio
 Opaque pointer passed to pulse.
void * user_ctx_time
 Opaque pointer passed to now_us.

Detailed Description

Initialisation configuration.

Wires the profiler to the application's GPIO and time-base hooks. Either hook may be nullptr – a null GPIO hook turns the helper into a pure software accumulator (useful in unit tests); a null time-base hook disables total_time_us accumulation while still counting entries.

Invariant
user_ctx_gpio and user_ctx_time are passed through verbatim to the hooks; the profiler never inspects them.
static void board_pulse(void* c, ra8_power_profile_region_id_t r, bool e) {
(void)c; (void)r;
}
static uint64_t board_now_us(void* c) { (void)c; return ra8_rtc_now_us(); }
ra8_power_profile_config_t cfg = {
.pulse = board_pulse,
.now_us = board_now_us,
};
@ k_ra8_port_4
RA8 port 4.
@ k_ra8_level_high
Drive or read 1.
@ k_ra8_level_low
Drive or read 0.
ra8_err_t ra8_gpio_write(ra8_port_pin_t pin, ra8_level_t level)
Drive a previously-configured output to the given level.
Definition gpio.c:154
ra8_power_profile_region_id_t
Default named region IDs.
ra8_err_t ra8_power_profile_init(const ra8_power_profile_config_t *cfg)
Initialise the power profiler.
See also
ra8_power_profile_init
Since
0.1.0

Definition at line 203 of file ra8_power_profile.h.

Field Documentation

◆ now_us

ra8_power_profile_now_us_fn_t ra8_power_profile_config_t::now_us

Clock hook, us (may be nullptr).

Definition at line 205 of file ra8_power_profile.h.

◆ pulse

ra8_power_profile_gpio_pulse_fn_t ra8_power_profile_config_t::pulse

GPIO edge hook (may be nullptr).

Definition at line 204 of file ra8_power_profile.h.

◆ user_ctx_gpio

void* ra8_power_profile_config_t::user_ctx_gpio

Opaque pointer passed to pulse.

Definition at line 206 of file ra8_power_profile.h.

◆ user_ctx_time

void* ra8_power_profile_config_t::user_ctx_time

Opaque pointer passed to now_us.

Definition at line 207 of file ra8_power_profile.h.


The documentation for this struct was generated from the following file: