25 const char cmd_acou_help[] =
"acou test: call acou no args for more help";
27 void acou_print_help(){
28 puts(
"\nacou on|off: switch on/off the module "
29 "\nacou sampling <n> (<n> from 0 to 255): set the sampling rate"
30 "\nacou resolution <n>: set the audio resolution (0=12 bit, 1=16 bit, 2=24 bit)"
31 "\nacou channel <n>: set the audio channel (0=both, 1=ch 1, 2=ch 2)");
35 bool cmd_acou_exec(
int argc,
const char *args[])
43 if ((argc == 1) && (strcmp(args[0],
"off") == 0))
47 else if ((argc == 1) && (strcmp(args[0],
"on") == 0))
51 else if ((argc == 2) && (strcmp(args[0],
"sampling") == 0))
55 puts(
"\nFailed to read sampling number\n");
60 else if ((argc == 2) && (strcmp(args[0],
"resolution") == 0))
65 puts(
"\nFailed to read resolution number\n");
70 puts(
"\nIncorrect resolution choice\n");
75 else if ((argc == 2) && (strcmp(args[0],
"channel") == 0))
80 puts(
"\nFailed to read channel number\n");
85 puts(
"\nIncorrect channel choice\n");
AcouRes
enum for bit resolution
void acouOn()
Turns the hydrophone on.
int cnvParseU(const char *input, uint32_t *output, CnvParams params)
Parse an unsigned integer.
#define CNV_DEFAULT
Default conversion/formatting parameters (base 10).
void acouSetSampling(uint8_t val)
Set the sampling interval.
void acouOff()
Truns the hydrohpone off.
This structure provides information about formatting and parsing.
void acouSetResolution(AcouRes val)
Set the bit resolution.
void acouSetChannel(AcouCh val)
Set the channel configuration.
This module implements parsing and formating of strings and integers.