EPOS Module Click
EPOS Module Click is a compact add-on board that provides a low-power modem solution for use in EPOS terminals and telephone-based systems. It is based on the CMX869B, a multi-standard v.32 bis modem from CML Micro, which supports multiple communication protocols. The CMX869B has built-in functions such as DTMF encoding/decoding and a Powersave mode to optimize energy consumption. It also includes a fully isolated telephone interface via the P1200 transformer for reliable communication.
Click Product page
Click library
- Author : Stefan Filipovic
- Date : Jan 2024.
- Type : SPI type
Software Support
We provide a library for the EPOS Module Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Library Description
This library contains API for EPOS Module Click driver.
Standard key functions :
eposmodule_cfg_setup
Config Object Initialization function.
eposmodule_init
Initialization function.
Example key functions :
eposmodule_handshake_init
This function performs a handshake init which resets the device settings to default.
eposmodule_dial
This function dials the selected number by alternating between DTMF and No-tone.
eposmodule_send_message
This function sends an array of bytes via V.23 FSK 1200bps modem in start-stop 8.1 mode.
Example Description
This example demonstrates the use of EPOS Module 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.
{
log_cfg_t log_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
#if ( DEMO_APP == APP_DIALING )
log_printf( &logger, " Application Mode: Dialing\r\n" );
#elif ( DEMO_APP == APP_ANSWERING )
log_printf( &logger, " Application Mode: Answering\r\n" );
#else
#error "Selected application mode is not supported!"
#endif
log_info( &logger, " Application Task " );
}
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.
{
uint32_t time_cnt = 0;
uint8_t msg_cnt = 0;
#if ( DEMO_APP == APP_DIALING )
log_printf( &logger, "\r\n Hook OFF\r\n" );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
log_printf( &logger,
" Dial: %s\r\n", (
char * )
DIAL_NUMBER );
for ( ; ; )
{
Delay_ms ( 1 );
{
time_cnt = 0;
}
{
{
log_printf( &logger, " Busy\r\n" );
break;
}
{
log_printf( &logger, " Disconnected\r\n" );
break;
}
{
log_printf( &logger, " Ringing\r\n" );
}
}
{
log_printf( &logger, " Call in progress\r\n" );
time_cnt = 0;
}
{
log_printf( &logger, " Send message %u\r\n", ( uint16_t ) msg_cnt++ );
}
{
log_printf( &logger, " Timeout\r\n" );
break;
}
}
log_printf( &logger, " Hook ON\r\n" );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
#elif ( DEMO_APP == APP_ANSWERING )
uint8_t rx_data = 0;
uint8_t msg_end_buff[ 2 ] = { 0 };
log_printf( &logger, "\r\n Waiting for a call...\r\n" );
Delay_ms ( 1000 );
log_printf( &logger, " Hook OFF\r\n" );
Delay_ms ( 1000 );
log_printf( &logger,
" Waiting for %u messages...\r\n", ( uint16_t )
NUM_MESSAGES );
for ( ; ; )
{
Delay_ms ( 1 );
{
{
log_printf( &logger, "\r\n Disconnected\r\n" );
break;
}
log_printf( &logger, " Message %u: ", ( uint16_t ) msg_cnt );
time_cnt = 0;
}
{
{
if ( ( ( ' ' <= rx_data ) && ( '~' >= rx_data ) ) ||
( '\r' == rx_data ) || ( '\n' == rx_data ) )
{
log_printf( &logger, "%c", ( char ) rx_data );
}
if ( '\r' == rx_data )
{
msg_end_buff[ 0 ] = rx_data;
}
else if ( '\n' == rx_data )
{
msg_end_buff[ 1 ] = rx_data;
}
else
{
msg_end_buff[ 0 ] = 0;
msg_end_buff[ 1 ] = 0;
}
}
if ( ( '\r' == msg_end_buff[ 0 ] ) && ( '\n' == msg_end_buff[ 1 ] ) )
{
msg_end_buff[ 0 ] = 0;
msg_end_buff[ 1 ] = 0;
{
Delay_ms ( 100 );
log_printf( &logger, " Terminate call\r\n" );
Delay_ms ( 100 );
break;
}
}
}
{
log_printf( &logger, "\r\n Timeout\r\n" );
break;
}
}
log_printf( &logger, " Hook ON\r\n" );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
#endif
}
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).
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Other Mikroe Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.EPOSModule
Additional notes and informations
Depending on the development board you are using, you may need USB UART Click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. UART terminal is available in all MikroElektronika compilers.