Skip to content

Support for GPIO TX inhibit line #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 11 commits into from
Next Next commit
Config changes for TXINH
  • Loading branch information
ab0tj committed Nov 12, 2015
commit dd2d740787e4e37bc105c0b9707f8648103f5470
6 changes: 6 additions & 0 deletions audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,12 @@ struct audio_s {

} octrl[NUM_OCTYPES];

struct {
int enabled;
int gpio;
int invert;
} txinh;

/* Transmit timing. */

int dwait; /* First wait extra time for receiver squelch. */
Expand Down
24 changes: 24 additions & 0 deletions config.c
Original file line number Diff line number Diff line change
Expand Up @@ -1450,6 +1450,30 @@ void config_init (char *fname, struct audio_s *p_audio_config,

} /* end of PTT */

/*
* TXINH - Input for TX inhibit signal
*/

else if (strcasecmp(t, "TXINH") == 0) {
t = strtok (NULL, " ,\t\n\r");
if (t == NULL) {
text_color_set(DW_COLOR_ERROR);
dw_printf ("Config file line %d: Missing GPIO number for TXINH.\n",
line);
continue;
}

p_audio_config->achan[channel].txinh.enabled = 1;

if (*t == '-') {
p_audio_config->achan[channel].txinh.gpio = atoi(t+1);
p_audio_config->achan[channel].txinh.invert = 1;
}
else {
p_audio_config->achan[channel].txinh.gpio = atoi(t);
p_audio_config->achan[channel].txinh.invert = 0;
}
} /* end of TXINH */

/*
* DWAIT - Extra delay for receiver squelch.
Expand Down