Current Sampling
Introduction
API
- group spinner_drivers_currsmp
Typedefs
-
typedef void (*currsmp_regulation_cb_t)(void *ctx)
Current sampling regulation callback.
Functions
-
static inline void currsmp_configure(const struct device *dev, currsmp_regulation_cb_t regulation_cb, void *ctx)
Configure current sampling device.
Note
This function needs to be called before calling currsmp_start().
- Parameters:
dev – [in] Current sampling device.
regulation_cb – [in] Callback called on each regulation cycle.
ctx – [in] Callback context.
-
static inline void currsmp_get_currents(const struct device *dev, struct currsmp_curr *curr)
Get phase currents.
- Parameters:
dev – [in] Current sampling device.
curr – [out] Pointer where phase currents will be stored.
-
static inline void currsmp_set_sector(const struct device *dev, uint8_t sector)
Set SV-PWM sector.
- Parameters:
dev – [in] Current sampling device.
sector – [in] SV-PWM sector.
-
static inline uint32_t currsmp_get_smp_time(const struct device *dev)
Obtain currents sampling time in nanoseconds.
- Parameters:
dev – [in] Current sampling device.
- Returns:
Sampling time in nanoseconds (zero indicates error).
-
static inline void currsmp_start(const struct device *dev)
Start sampling currents.
See also
- Parameters:
dev – [in] Current sampling device.
-
static inline void currsmp_stop(const struct device *dev)
Stop sampling currents.
- Parameters:
dev – [in] Current sampling device.
-
struct currsmp_curr
- #include <currsmp.h>
Current sampling currents.
-
typedef void (*currsmp_regulation_cb_t)(void *ctx)