|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Programmable Voltage Detection (PVD / LVD) HAL types. More...
Go to the source code of this file.
Data Structures | |
| struct | ra8_lvd_cfg_t |
| Configuration descriptor for ra8_lvd_channel_init. More... | |
| struct | ra8_lvd_status_t |
| Decoded PVDmSR snapshot. More... | |
Typedefs | |
| typedef void(* | ra8_lvd_event_fn_t) (void *ctx, ra8_lvd_channel_t channel) |
| PVD threshold-crossing callback. | |
Programmable Voltage Detection (PVD / LVD) HAL types.
Typed enums, configuration / status structs, and the callback typedef for the RA8D2 PVD HAL driver. Split out of ra8_lvd.h so the public umbrella header stays under the per-file line budget; the umbrella ra8_lvd.h re-includes this header, so consumers are unaffected.
See ra8_lvd.h for the driver overview and HUM Ch 8 "Programmable Voltage Detection (PVD)", p 300-316 (R01UH1065EJ rev 1.30).
Definition in file ra8_lvd_types.h.
| typedef void(* ra8_lvd_event_fn_t) (void *ctx, ra8_lvd_channel_t channel) |
PVD threshold-crossing callback.
| [in] | ctx | Caller context registered via ra8_lvd_attach_handler. |
| [in] | channel | Channel that fired (one of k_ra8_lvd_chN). |
Definition at line 241 of file ra8_lvd_types.h.
| enum ra8_lvd_channel_t : uint8_t |
Voltage-monitor channel selector.
The RA8D2 PVD block defines four monitor channels: PVD1 / PVD2 are the "m" series (NMI-capable, full feature set), PVD4 / PVD5 are the "n" series (reset-only, no IRQ). Channels 0 and 3 are not exposed on this part. See HUM Ch 8.1 Table 8.1 p 300.
| Enumerator | |
|---|---|
| k_ra8_lvd_ch1 | PVD1 (m series, NMI-capable). |
| k_ra8_lvd_ch2 | PVD2 (m series, NMI-capable). |
| k_ra8_lvd_ch4 | PVD4 (n series, reset-only). |
| k_ra8_lvd_ch5 | PVD5 (n series, reset-only). |
Definition at line 192 of file ra8_lvd_types.h.
| enum ra8_lvd_edge_t : uint8_t |
PVDmCR1.IDTSEL[1:0] edge selector for monitor m channels.
From HUM 8.2.6 p 307:
| Enumerator | |
|---|---|
| k_ra8_lvd_edge_rise | Detect VCC >= Vdetm rising crossings. |
| k_ra8_lvd_edge_fall | Detect VCC < Vdetm falling crossings. |
| k_ra8_lvd_edge_both | Detect either crossing. |
Definition at line 41 of file ra8_lvd_types.h.
| enum ra8_lvd_hysteresis_t : uint8_t |
PVDmFCR.RHSEL / PVDnFCR.RHSEL value.
From HUM 8.2.8 p 308 and HUM 8.2.9 p 309 (identical semantics):
| Enumerator | |
|---|---|
| k_ra8_lvd_hysteresis_lvd | RHSEL = 0 (fall detect). |
| k_ra8_lvd_hysteresis_hvd | RHSEL = 1 (rise detect). |
Definition at line 115 of file ra8_lvd_types.h.
| enum ra8_lvd_irq_type_t : uint8_t |
PVDmCR1.IRQSEL value – NMI vs maskable interrupt.
| Enumerator | |
|---|---|
| k_ra8_lvd_irq_nmi | Non-maskable interrupt (default). |
| k_ra8_lvd_irq_maskable | Maskable interrupt via ICU. |
Definition at line 51 of file ra8_lvd_types.h.
| enum ra8_lvd_loco_div_t : uint8_t |
PVDmCR0.FSAMP[1:0] / PVDnCR0.FSAMP[1:0] sampling-clock divider.
Selects the LOCO divider feeding the digital filter. HUM Ch 8.2.4 p 305 "FSAMP[1:0] bits" documents 0..3 as the only legal range. The encoding matches FSP lvd_sample_clock_t:
The "2s + 3 LOCO cycles" stabilisation delay computed by ra8_lvd_filter_delay_us uses s = 2^(div+1) – so div=0 implies s=2 (LOCO/2), div=3 implies s=16 (LOCO/16).
Definition at line 172 of file ra8_lvd_types.h.
| enum ra8_lvd_negate_t : uint8_t |
PVDmCR0.RN value – reset deassertion timing.
From HUM 8.2.4 p 305 "RN bit":
The driver uses k_ra8_lvd_negate_after_voltage as the safe default because that is the only value compatible with Software Standby and Deep Software Standby (HUM 8.2.4 p 306 "RN bit").
| Enumerator | |
|---|---|
| k_ra8_lvd_negate_after_voltage | Negate after VCC clears Vdetm. |
| k_ra8_lvd_negate_after_assert | Negate after reset asserts. |
Definition at line 99 of file ra8_lvd_types.h.
| enum ra8_lvd_pvdlvl_t : uint8_t |
PVDLVL[4:0] threshold encoding for PVDmCMPCR / PVDnCMPCR.
The legal range is 0x03..0x0F per HUM Ch 8.2.2 p 303 (Table 8.2). Encodings 0x00..0x02 and 0x10..0x1F are reserved / prohibited; the driver rejects any value outside k_ra8_lvd_pvdlvl_min..k_ra8_lvd_pvdlvl_max. Each named entry maps to a nominal Vdetm voltage; values verified against FSP lvd_threshold_t for RA8D2 in bsp/mcu/ra8d2/bsp_override.h.
Definition at line 134 of file ra8_lvd_types.h.
| enum ra8_lvd_response_t : uint8_t |
Detection response selector for ra8_lvd_cfg_t::response.
Determines which downstream signal the comparator drives:
Definition at line 76 of file ra8_lvd_types.h.