PF1550 Driver 0.1.0
API reference
Loading...
Searching...
No Matches
Classes | Functions | Variables
Interrupt map

Source locations, masks and fault classification. More...

Classes

struct  pf1550::IrqLocation
 Where one interrupt source lives. More...
 

Functions

constexpr uint8_t pf1550::CategoryBitsOf (IrqGroup group) noexcept
 
constexpr IrqLocation pf1550::LocationOf (IrqSource source) noexcept
 
constexpr bool pf1550::Has (const InterruptEvents &events, IrqSource source) noexcept
 
constexpr bool pf1550::IsFaultSource (IrqSource source) noexcept
 
constexpr bool pf1550::HasFault (const std::array< uint8_t, kIrqGroups > &status) noexcept
 
constexpr uint8_t pf1550::MaskByteFor (const IrqMask &mask, IrqGroup group) noexcept
 
template<std::size_t N>
constexpr IrqMask pf1550::UnmaskOnly (const std::array< IrqSource, N > &sources) noexcept
 

Variables

constexpr std::array< IrqLocation, kIrqSourceCount > pf1550::kIrqLocations
 The location of every source, indexed by IrqSource (Tables 90 to 110 and 150).
 
constexpr std::array< uint8_t, kIrqGroups > pf1550::kIrqStatRegs
 The status register of each group, indexed by IrqGroup.
 
constexpr std::array< uint8_t, kIrqGroups > pf1550::kIrqMaskRegs
 The mask register of each group.
 
constexpr std::array< uint8_t, kIrqGroups > pf1550::kIrqSenseRegs
 The sense register of each group (the charger's is CHG_INT_OK).
 
constexpr std::array< uint8_t, kIrqGroups > pf1550::kIrqDefinedBits
 The bits that carry a source in each group; the others are reserved and preserved.
 
constexpr uint8_t pf1550::kCategoryCharger = 1U << 0
 INT_CATEGORY bit of a group's summary (the three SW groups share bits 1 to 3 by rail).
 
constexpr uint8_t pf1550::kCategorySw = 0x0E
 SW1_INT, SW2_INT and SW3_INT.
 
constexpr uint8_t pf1550::kCategoryLdo = 1U << 4
 LDO_INT.
 
constexpr uint8_t pf1550::kCategoryOnkey = 1U << 5
 ONKEY_INT.
 
constexpr uint8_t pf1550::kCategoryTemp = 1U << 6
 TEMP_INT.
 
constexpr uint8_t pf1550::kCategoryMisc = 1U << 7
 MISC_INT.
 

Detailed Description

Source locations, masks and fault classification.

Function Documentation

◆ CategoryBitsOf()

constexpr uint8_t pf1550::CategoryBitsOf ( IrqGroup  group)
constexprnoexcept

The INT_CATEGORY bits that summarise a group.

Parameters
groupThe group.
Returns
The summary bits; 0 for a value that is not an enumerator.

◆ Has()

constexpr bool pf1550::Has ( const InterruptEvents &  events,
IrqSource  source 
)
constexprnoexcept

Whether a source is set in the events (the status bytes as read, before the clear).

Parameters
eventsWhat ServiceInterrupts() returned.
sourceThe source.
Returns
true when set.

◆ HasFault()

constexpr bool pf1550::HasFault ( const std::array< uint8_t, kIrqGroups > &  status)
constexprnoexcept

Whether any fault-class source is set.

Parameters
statusOne status byte per group.
Returns
true when one is set.

◆ IsFaultSource()

constexpr bool pf1550::IsFaultSource ( IrqSource  source)
constexprnoexcept

Whether a source reports a fault of a rail or of the die: a current limit, an LDO fault, 125 C or a system overvoltage.

Parameters
sourceThe source.
Returns
true for a fault-class source.

◆ LocationOf()

constexpr IrqLocation pf1550::LocationOf ( IrqSource  source)
constexprnoexcept

The location of a source.

Parameters
sourceThe source.
Returns
Its group and bit; group Charger, bit 0 for a value that is not an enumerator.

◆ MaskByteFor()

constexpr uint8_t pf1550::MaskByteFor ( const IrqMask &  mask,
IrqGroup  group 
)
constexprnoexcept

The mask byte of a group.

Parameters
maskThe mask.
groupThe group.
Returns
The byte as stored in mask.

◆ UnmaskOnly()

template<std::size_t N>
constexpr IrqMask pf1550::UnmaskOnly ( const std::array< IrqSource, N > &  sources)
constexprnoexcept

A mask that unmasks exactly the sources in the list and masks every other.

Parameters
sourcesThe sources to unmask.
Returns
The mask.

Variable Documentation

◆ kIrqDefinedBits

constexpr std::array<uint8_t, kIrqGroups> pf1550::kIrqDefinedBits
inlineconstexpr
Initial value:
= {0xEF, 0x07, 0x07, 0x03,
0x07, 0x05, 0x3F, 0x1F}

The bits that carry a source in each group; the others are reserved and preserved.

◆ kIrqLocations

constexpr std::array<IrqLocation, kIrqSourceCount> pf1550::kIrqLocations
inlineconstexpr
Initial value:
= {{
{.group = IrqGroup::Charger, .bit = 0}, {.group = IrqGroup::Charger, .bit = 1},
{.group = IrqGroup::Charger, .bit = 2}, {.group = IrqGroup::Charger, .bit = 3},
{.group = IrqGroup::Charger, .bit = 5}, {.group = IrqGroup::Charger, .bit = 6},
{.group = IrqGroup::Charger, .bit = 7}, {.group = IrqGroup::SwLowSide, .bit = 0},
{.group = IrqGroup::SwLowSide, .bit = 1}, {.group = IrqGroup::SwLowSide, .bit = 2},
{.group = IrqGroup::SwHighSide, .bit = 0}, {.group = IrqGroup::SwHighSide, .bit = 1},
{.group = IrqGroup::SwHighSide, .bit = 2}, {.group = IrqGroup::SwDvs, .bit = 0},
{.group = IrqGroup::SwDvs, .bit = 1}, {.group = IrqGroup::Ldo, .bit = 0},
{.group = IrqGroup::Ldo, .bit = 1}, {.group = IrqGroup::Ldo, .bit = 2},
{.group = IrqGroup::Temp, .bit = 0}, {.group = IrqGroup::Temp, .bit = 2},
{.group = IrqGroup::Onkey, .bit = 0}, {.group = IrqGroup::Onkey, .bit = 1},
{.group = IrqGroup::Onkey, .bit = 2}, {.group = IrqGroup::Onkey, .bit = 3},
{.group = IrqGroup::Onkey, .bit = 4}, {.group = IrqGroup::Onkey, .bit = 5},
{.group = IrqGroup::Misc, .bit = 0}, {.group = IrqGroup::Misc, .bit = 1},
{.group = IrqGroup::Misc, .bit = 2}, {.group = IrqGroup::Misc, .bit = 3},
{.group = IrqGroup::Misc, .bit = 4},
}}

The location of every source, indexed by IrqSource (Tables 90 to 110 and 150).

◆ kIrqMaskRegs

constexpr std::array<uint8_t, kIrqGroups> pf1550::kIrqMaskRegs
inlineconstexpr
Initial value:
= {
reg::kChgIntMask, reg::kSwIntMask0, reg::kSwIntMask1, reg::kSwIntMask2,
reg::kLdoIntMask0, reg::kTempIntMask0, reg::kOnkeyIntMask0, reg::kMiscIntMask0}

The mask register of each group.

◆ kIrqSenseRegs

constexpr std::array<uint8_t, kIrqGroups> pf1550::kIrqSenseRegs
inlineconstexpr
Initial value:
= {
reg::kChgIntOk, reg::kSwIntSense0, reg::kSwIntSense1, reg::kSwIntSense2,
reg::kLdoIntSense0, reg::kTempIntSense0, reg::kOnkeyIntSense0, reg::kMiscIntSense0}

The sense register of each group (the charger's is CHG_INT_OK).

◆ kIrqStatRegs

constexpr std::array<uint8_t, kIrqGroups> pf1550::kIrqStatRegs
inlineconstexpr
Initial value:
= {
reg::kChgInt, reg::kSwIntStat0, reg::kSwIntStat1, reg::kSwIntStat2,
reg::kLdoIntStat0, reg::kTempIntStat0, reg::kOnkeyIntStat0, reg::kMiscIntStat0}

The status register of each group, indexed by IrqGroup.