dtmf 2.1.0.0
main.c File Reference

DTMF Click example. More...

#include "board.h"
#include "log.h"
#include "dtmf.h"

Macros

#define APP_DIALING   0
 
#define APP_ANSWERING   1
 
#define DEMO_APP   APP_DIALING
 
#define DIAL_NUMBER   "1000"
 
#define TEXT_TO_SEND   "MIKROE - DTMF click\r\n"
 
#define NUM_MESSAGES   5u
 

Functions

void application_init (void)
 
void application_task (void)
 
int main (void)
 

Detailed Description

DTMF Click example.

Description

This example demonstrates the use of DTMF click board by showing the communication between the two click boards connected to PBX system.

The demo application is composed of two sections :

Application Init

Initializes the driver and logger, and displays the selected application mode.

Application Task

Dialing application mode:

  • Resets the device settings and dials the selected number. If a call is answered it starts sending desired messages every couple of seconds with constantly checking if a call is still in progress or it's terminated from the other side. Answering application mode:
  • Resets the device settings and waits for an incoming call indication, answers the call, and waits for a desired number of messages. The call is terminated after all messages are received successfully.
Note
We have used a Yeastar S20 VoIP PBX system for the test, where the click boards are connected to ports 1 and 2 configured as FXS extension with numbers 1000 and 1001 (dialer).
Author
Stefan Filipovic

Macro Definition Documentation

◆ APP_ANSWERING

#define APP_ANSWERING   1

◆ APP_DIALING

#define APP_DIALING   0

◆ DEMO_APP

#define DEMO_APP   APP_DIALING

◆ DIAL_NUMBER

#define DIAL_NUMBER   "1000"

◆ NUM_MESSAGES

#define NUM_MESSAGES   5u

◆ TEXT_TO_SEND

#define TEXT_TO_SEND   "MIKROE - DTMF click\r\n"

Function Documentation

◆ application_init()

void application_init ( void )

< Logger config object.

< Click config object.

Logger initialization. Default baud rate: 115200 Default log level: LOG_LEVEL_DEBUG

Note
If USB_UART_RX and USB_UART_TX are defined as HAL_PIN_NC, you will need to define them manually for log to work. See LOG_MAP_USB_UART macro definition for detailed explanation.

◆ application_task()

void application_task ( void )

◆ main()

int main ( void )