The HPM Power solution summarizes the requirements of the power MCU, integrates them into a universal software solution, and provides various Application Programming Interface.
HPM Power Driver API is a power driver API interface based on the HPM Software Development Kit (HPM SDK).
The Power API abstracts a pair of PWM, PWM, and ADC channels on the hardware into custom ID numbers, allowing upper-layer applications to focus solely on the abstracted ID numbers.
The Power API supports generating various paired PWM waveforms, such as complementary, center aligned waveforms, and edge aligned waveforms. It also includes features like deadzone insertion, fault protection, and forced outputs.
The Power API also supports a single PWM waveform, and a single PWM waveform also supports functions such as fault protection and forced output.
The Power API supports binding a pair of PWM or single PWM to a multi-channel ADC. It supports configuring the PWM to trigger ADC sampling at any duty cycle, and automatically trigger a callback function after the ADC sampling.
The Power API supports the configuration of a pair of PWM or single PWM to trigger a DMA request at any PWM duty cycle, allowing sequential ADC values (adjustable) to be sampled by DMA transport.
The Power API DMA supports chain mode and dual-buffer mode, enabling the automatic periodic sampling of ADC values (adjustable) in PING/PONG modes without CPU intervention. After each group of samples is acquired, it automatically triggers a callback funciton and initiates the sampling of the next group.
The Power API supports configuring PWM frequency, duty cycle, trigger time, etc.
The Power API supports the creation of high-precision timers (unit: microseconds).
Notes:
This solution does not include power loop algorithm content.
For the same PWM controller, modifying the PWM frequency of any channel will influence the frequency of all channels on the current controller.