11 static const struct mcp4552_t mcp4552[] =
26 struct manageable_psu_t
28 const struct mcp4552_t *potentiometer;
29 const struct gpio_t *enable_not;
32 static const struct manageable_psu_t psu[] =
35 .potentiometer = &mcp4552[0],
36 .enable_not = &gpio_enable_not0,
39 .potentiometer = &mcp4552[1],
40 .enable_not = &gpio_enable_not1,
44 static status_e psu_set(
const struct manageable_psu_t *psu, uint32_t mv)
83 value = min(value, (uint32_t)256);
87 mcp4552_set(psu->potentiometer, value);
94 return psu_set(&psu[0], mv);
99 return psu_set(&psu[1], mv);
BSP - Board Support Package.
Manageable PSU with an enable and a digital potentiometer.
static void gpio_set(const struct gpio_t *gpio, uint32_t value)
Set a gpio.
#define DEF_GPIOG(__PIN, __MODE)
same as DEF_GPIOA for port G
Driver for mcp4552 digital potentiometer.
const struct heivs_bus_t bus_i2c[BSP_I2C_BUS_COUNT]
All i2c busses.
status_e gpio_setup(const struct gpio_t *gpio)
Setup a gpio.