refactor DAC handling

This commit is contained in:
Philippe G
2020-08-01 19:31:58 -07:00
parent 77e8c29936
commit 9fd792cf98
12 changed files with 183 additions and 187 deletions

View File

@@ -15,7 +15,8 @@
typedef enum { ADAC_ON = 0, ADAC_STANDBY, ADAC_OFF } adac_power_e;
struct adac_s {
bool (*init)(int i2c_port_num, int i2s_num, i2s_config_t *config);
char *model;
bool (*init)(char *config, int i2c_port_num);
void (*deinit)(void);
void (*power)(adac_power_e mode);
void (*speaker)(bool active);
@@ -23,6 +24,6 @@ struct adac_s {
void (*volume)(unsigned left, unsigned right);
};
extern struct adac_s dac_tas57xx;
extern struct adac_s dac_a1s;
extern struct adac_s dac_external;
extern const struct adac_s dac_tas57xx;
extern const struct adac_s dac_ac101;
extern const struct adac_s dac_external;