eposmodule  2.1.0.0
Modules | Functions
EPOS Module Click Driver

API for configuring and manipulating EPOS Module Click driver. More...

Modules

 EPOS Module Registers List
 List of registers of EPOS Module Click driver.
 
 EPOS Module Registers Settings
 Settings for registers of EPOS Module Click driver.
 
 EPOS Module MikroBUS Map
 MikroBUS pin mapping of EPOS Module Click driver.
 

Functions

void eposmodule_cfg_setup (eposmodule_cfg_t *cfg)
 EPOS Module configuration object setup function. More...
 
err_t eposmodule_init (eposmodule_t *ctx, eposmodule_cfg_t *cfg)
 EPOS Module initialization function. More...
 
err_t eposmodule_general_reset (eposmodule_t *ctx)
 EPOS Module general reset function. More...
 
err_t eposmodule_set_control (eposmodule_t *ctx, uint16_t data_in)
 EPOS Module set control function. More...
 
err_t eposmodule_set_transmit_mode (eposmodule_t *ctx, uint16_t data_in)
 EPOS Module set transmit mode function. More...
 
err_t eposmodule_set_receive_mode (eposmodule_t *ctx, uint16_t data_in)
 EPOS Module set receive mode function. More...
 
err_t eposmodule_transmit_data (eposmodule_t *ctx, uint16_t data_in)
 EPOS Module transmit data function. More...
 
err_t eposmodule_receive_data (eposmodule_t *ctx, uint8_t *data_out)
 EPOS Module receive data function. More...
 
err_t eposmodule_get_status (eposmodule_t *ctx, uint16_t *data_out)
 EPOS Module get status function. More...
 
err_t eposmodule_set_programming (eposmodule_t *ctx, uint16_t data_in)
 EPOS Module set programming function. More...
 
err_t eposmodule_hook_off (eposmodule_t *ctx)
 EPOS Module hook off function. More...
 
err_t eposmodule_hook_on (eposmodule_t *ctx)
 EPOS Module hook on function. More...
 
uint8_t eposmodule_get_irq_pin (eposmodule_t *ctx)
 EPOS Module get irq pin function. More...
 
uint8_t eposmodule_ring_detect (eposmodule_t *ctx)
 EPOS Module ring detect function. More...
 
uint8_t eposmodule_tx_ready (eposmodule_t *ctx)
 EPOS Module tx ready function. More...
 
uint8_t eposmodule_rx_ready (eposmodule_t *ctx)
 EPOS Module rx ready function. More...
 
uint8_t eposmodule_call_progress (eposmodule_t *ctx)
 EPOS Module call progress function. More...
 
uint8_t eposmodule_unscram_1s_det (eposmodule_t *ctx)
 EPOS Module unscram 1s det function. More...
 
err_t eposmodule_clear_interrupts (eposmodule_t *ctx)
 EPOS Module clear interrupts function. More...
 
err_t eposmodule_handshake_init (eposmodule_t *ctx)
 EPOS Module handshake init function. More...
 
err_t eposmodule_dial (eposmodule_t *ctx, uint8_t *dial_num)
 EPOS Module dial function. More...
 
err_t eposmodule_send_message (eposmodule_t *ctx, uint8_t *data_in, uint8_t len)
 EPOS Module send message function. More...
 

Detailed Description

API for configuring and manipulating EPOS Module Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ eposmodule_call_progress()

uint8_t eposmodule_call_progress ( eposmodule_t ctx)

EPOS Module call progress function.

This function reads the status register and returns the rx energy or call progress flag.

Parameters
[in]ctx: Click context object. See eposmodule_t object definition for detailed explanation.
Returns
  • 0 - Flag is not set,
  • 1 - Flag is set.
Note
None.

◆ eposmodule_cfg_setup()

void eposmodule_cfg_setup ( eposmodule_cfg_t cfg)

EPOS Module configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See eposmodule_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ eposmodule_clear_interrupts()

err_t eposmodule_clear_interrupts ( eposmodule_t ctx)

EPOS Module clear interrupts function.

This function reads the status register in a loop until the IRQ flag is cleared.

Parameters
[in]ctx: Click context object. See eposmodule_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error,
  • -2 - Timeout.
Note
None.

◆ eposmodule_dial()

err_t eposmodule_dial ( eposmodule_t ctx,
uint8_t *  dial_num 
)

EPOS Module dial function.

This function dials the selected number by alternating between DTMF and No-tone.

Parameters
[in]ctx: Click context object. See eposmodule_t object definition for detailed explanation.
[in]dial_num: Dial number string [up to 16 digits].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ eposmodule_general_reset()

err_t eposmodule_general_reset ( eposmodule_t ctx)

EPOS Module general reset function.

This function resets the device and clears all bits of the General Control, Transmit Mode and Receive Mode Registers and b15 and b13-0 of the Status Register.

Parameters
[in]ctx: Click context object. See eposmodule_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ eposmodule_get_irq_pin()

uint8_t eposmodule_get_irq_pin ( eposmodule_t ctx)

EPOS Module get irq pin function.

This function returns the interrupt request (IRQ) pin logic state.

Parameters
[in]ctx: Click context object. See eposmodule_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ eposmodule_get_status()

err_t eposmodule_get_status ( eposmodule_t ctx,
uint16_t *  data_out 
)

EPOS Module get status function.

This function reads the 16-bit status register data.

Parameters
[in]ctx: Click context object. See eposmodule_t object definition for detailed explanation.
[out]data_out: 16-bit status register.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ eposmodule_handshake_init()

err_t eposmodule_handshake_init ( eposmodule_t ctx)

EPOS Module handshake init function.

This function performs a handshake init which resets the device settings to default.

Parameters
[in]ctx: Click context object. See eposmodule_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ eposmodule_hook_off()

err_t eposmodule_hook_off ( eposmodule_t ctx)

EPOS Module hook off function.

This function sets hookswitch to OFF state which closes the line interface.

Parameters
[in]ctx: Click context object. See eposmodule_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ eposmodule_hook_on()

err_t eposmodule_hook_on ( eposmodule_t ctx)

EPOS Module hook on function.

This function sets hookswitch to ON state which opens the line interface.

Parameters
[in]ctx: Click context object. See eposmodule_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ eposmodule_init()

err_t eposmodule_init ( eposmodule_t ctx,
eposmodule_cfg_t cfg 
)

EPOS Module initialization function.

This function initializes all necessary pins and peripherals used for this click board.

Parameters
[out]ctx: Click context object. See eposmodule_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See eposmodule_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ eposmodule_receive_data()

err_t eposmodule_receive_data ( eposmodule_t ctx,
uint8_t *  data_out 
)

EPOS Module receive data function.

In Synchronous and HDLC Rx data modes each byte contains 8 received data bits, b0 of the byte holding the earliest received bit, b7 the latest. In Start-Stop modes each byte contains the specified number of data bits from a received character, b0 of the byte holding the first received bit. Unused bits are set to 0. In HDLC mode, the FCS will be output in this register: it follows the last received data character.

Parameters
[in]ctx: Click context object. See eposmodule_t object definition for detailed explanation.
[out]data_out: Output read data (two bytes in 16-bit mode).
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function may be set to operate in 8- or 16-bit mode by b10 of the General Control Register. This setting is only actioned following a reset or power-on.

◆ eposmodule_ring_detect()

uint8_t eposmodule_ring_detect ( eposmodule_t ctx)

EPOS Module ring detect function.

This function reads the status register and returns the ring detect flag.

Parameters
[in]ctx: Click context object. See eposmodule_t object definition for detailed explanation.
Returns
  • 0 - Not ready,
  • 1 - Ready.
Note
None.

◆ eposmodule_rx_ready()

uint8_t eposmodule_rx_ready ( eposmodule_t ctx)

EPOS Module rx ready function.

This function reads the status register and returns the rx ready flag.

Parameters
[in]ctx: Click context object. See eposmodule_t object definition for detailed explanation.
Returns
  • 0 - Not ready,
  • 1 - Ready.
Note
None.

◆ eposmodule_send_message()

err_t eposmodule_send_message ( eposmodule_t ctx,
uint8_t *  data_in,
uint8_t  len 
)

EPOS Module send message function.

This function sends an array of bytes via V.23 FSK 1200bps modem in start-stop 8.1 mode.

Parameters
[in]ctx: Click context object. See eposmodule_t object definition for detailed explanation.
[in]data_in: Array of bytes.
[in]len: Number of bytes to be sent.
Returns
  • 0 - Success,
  • -1 - Error,
  • -2 - Timeout. See #err_t definition for detailed explanation.
Note
None.

◆ eposmodule_set_control()

err_t eposmodule_set_control ( eposmodule_t ctx,
uint16_t  data_in 
)

EPOS Module set control function.

This function controls general features of the CMX869B such as the Powersave, Loopback mode and the IRQ mask bits. It also allows the fixed compromise equalisers in the Tx and Rx signal paths to be disabled if desired.

Parameters
[in]ctx: Click context object. See eposmodule_t object definition for detailed explanation.
[in]data_in: Control register data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ eposmodule_set_programming()

err_t eposmodule_set_programming ( eposmodule_t ctx,
uint16_t  data_in 
)

EPOS Module set programming function.

This function is used to program the transmit and receive programmed tone pairs by writing appropriate values to RAM locations within the CMX869B.

Parameters
[in]ctx: Click context object. See eposmodule_t object definition for detailed explanation.
[in]data_in: Programming register data to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ eposmodule_set_receive_mode()

err_t eposmodule_set_receive_mode ( eposmodule_t ctx,
uint16_t  data_in 
)

EPOS Module set receive mode function.

This function controls the CMX869B receive signal type and level.

Parameters
[in]ctx: Click context object. See eposmodule_t object definition for detailed explanation.
[in]data_in: Receive mode register data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ eposmodule_set_transmit_mode()

err_t eposmodule_set_transmit_mode ( eposmodule_t ctx,
uint16_t  data_in 
)

EPOS Module set transmit mode function.

This function controls the CMX869B transmit signal type and level.

Parameters
[in]ctx: Click context object. See eposmodule_t object definition for detailed explanation.
[in]data_in: Transmit mode register data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ eposmodule_transmit_data()

err_t eposmodule_transmit_data ( eposmodule_t ctx,
uint16_t  data_in 
)

EPOS Module transmit data function.

In Synchronous and HDLC Tx data modes all 8 bits of a byte are transmitted, bit 0 of each byte being transmitted first b0 is transmitted first. In Tx Start-Stop mode, the specified number of data bits will be taken from the byte in the Tx Data Register (b0 of the byte first). A Start bit, a Parity bit (if required and Stop bit(s) will be added automatically. This function should only be called when the Tx Data Ready bit of the Status Register is set.

Parameters
[in]ctx: Click context object. See eposmodule_t object definition for detailed explanation.
[in]data_in: Data to be transmitted.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function may be set to operate in 8- or 16-bit mode by b10 of the General Control Register. This setting should not be changed once data transmission has started.

◆ eposmodule_tx_ready()

uint8_t eposmodule_tx_ready ( eposmodule_t ctx)

EPOS Module tx ready function.

This function reads the status register and returns the tx ready flag.

Parameters
[in]ctx: Click context object. See eposmodule_t object definition for detailed explanation.
Returns
  • 0 - Not ready,
  • 1 - Ready.
Note
None.

◆ eposmodule_unscram_1s_det()

uint8_t eposmodule_unscram_1s_det ( eposmodule_t ctx)

EPOS Module unscram 1s det function.

This function reads the status register and sets the return flag if continuous ones and rx energy flags are detected.

Parameters
[in]ctx: Click context object. See eposmodule_t object definition for detailed explanation.
Returns
  • 0 - Flag is not set,
  • 1 - Flag is set.
Note
None.