blob: 79e8b60937f4967ba802c23cfde86770eab1fc2e [file] [log] [blame]
Harald Weltec3f170d2019-02-24 09:06:59 +01001#pragma once
2#include <stdbool.h>
3
4enum ncn8025_sim_voltage {
5 SIM_VOLT_3V0 = 0,
6 SIM_VOLT_5V0 = 2,
7 SIM_VOLT_1V8 = 3
8};
9
10enum ncn8025_sim_clkdiv {
11 SIM_CLKDIV_1 = 1,
12 SIM_CLKDIV_2 = 3,
13 SIM_CLKDIV_4 = 2,
14 SIM_CLKDIV_8 = 0,
15};
16
17struct ncn8025_settings {
18 bool rstin; /* high: active */
19 bool cmdvcc; /* high: active */
20 bool simpres; /* high: active */
21 bool led; /* high: active */
22 enum ncn8025_sim_clkdiv clkdiv; /* raw 2bit value */
23 enum ncn8025_sim_voltage vsel; /* raw 2bit value */
24};
25
26int ncn8025_set(uint8_t slot, const struct ncn8025_settings *set);
27int ncn8025_get(uint8_t slot, struct ncn8025_settings *set);
28int ncn8025_init(unsigned int slot);
Harald Welte1b9a5b82019-02-24 23:04:45 +010029void ncn8025_dump(const struct ncn8025_settings *set);