dtmf 2.1.0.0
DTMF Click Driver

API for configuring and manipulating DTMF Click driver. More...

Topics

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

Functions

void dtmf_cfg_setup (dtmf_cfg_t *cfg)
 DTMF configuration object setup function.
 
err_t dtmf_init (dtmf_t *ctx, dtmf_cfg_t *cfg)
 DTMF initialization function.
 
err_t dtmf_general_reset (dtmf_t *ctx)
 DTMF general reset function.
 
err_t dtmf_set_control (dtmf_t *ctx, uint16_t data_in)
 DTMF set control function.
 
err_t dtmf_set_transmit_mode (dtmf_t *ctx, uint16_t data_in)
 DTMF set transmit mode function.
 
err_t dtmf_set_receive_mode (dtmf_t *ctx, uint16_t data_in)
 DTMF set receive mode function.
 
err_t dtmf_transmit_data (dtmf_t *ctx, uint8_t data_in)
 DTMF transmit data function.
 
err_t dtmf_receive_data (dtmf_t *ctx, uint8_t *data_out)
 DTMF receive data function.
 
err_t dtmf_get_status (dtmf_t *ctx, uint16_t *data_out)
 DTMF get status function.
 
err_t dtmf_set_programming (dtmf_t *ctx, uint16_t data_in)
 DTMF set programming function.
 
void dtmf_set_hsw_pin (dtmf_t *ctx, uint8_t state)
 DTMF set hsw pin function.
 
void dtmf_hook_off (dtmf_t *ctx)
 DTMF hook off function.
 
void dtmf_hook_on (dtmf_t *ctx)
 DTMF hook on function.
 
uint8_t dtmf_get_rdn_pin (dtmf_t *ctx)
 DTMF get rdn pin function.
 
uint8_t dtmf_get_irq_pin (dtmf_t *ctx)
 DTMF get irq pin function.
 
uint8_t dtmf_tx_ready (dtmf_t *ctx)
 DTMF tx ready function.
 
uint8_t dtmf_rx_ready (dtmf_t *ctx)
 DTMF rx ready function.
 
uint8_t dtmf_call_progress (dtmf_t *ctx)
 DTMF call progress function.
 
uint8_t dtmf_unscram_1s_det (dtmf_t *ctx)
 DTMF unscram 1s det function.
 
err_t dtmf_clear_interrupts (dtmf_t *ctx)
 DTMF clear interrupts function.
 
err_t dtmf_handshake_init (dtmf_t *ctx)
 DTMF handshake init function.
 
err_t dtmf_dial (dtmf_t *ctx, uint8_t *dial_num)
 DTMF dial function.
 
err_t dtmf_send_message (dtmf_t *ctx, uint8_t *data_in, uint8_t len)
 DTMF send message function.
 

Detailed Description

API for configuring and manipulating DTMF 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

◆ dtmf_call_progress()

uint8_t dtmf_call_progress ( dtmf_t * ctx)

DTMF 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 dtmf_t object definition for detailed explanation.
Returns
  • 0 - Flag is not set,
  • 1 - Flag is set.
Note
None.

◆ dtmf_cfg_setup()

void dtmf_cfg_setup ( dtmf_cfg_t * cfg)

DTMF configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ dtmf_clear_interrupts()

err_t dtmf_clear_interrupts ( dtmf_t * ctx)

DTMF 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 dtmf_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error,
  • -2 - Timeout.
Note
None.

◆ dtmf_dial()

err_t dtmf_dial ( dtmf_t * ctx,
uint8_t * dial_num )

DTMF dial function.

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

Parameters
[in]ctx: Click context object. See dtmf_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.

◆ dtmf_general_reset()

err_t dtmf_general_reset ( dtmf_t * ctx)

DTMF 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 dtmf_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ dtmf_get_irq_pin()

uint8_t dtmf_get_irq_pin ( dtmf_t * ctx)

DTMF get irq pin function.

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

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

◆ dtmf_get_rdn_pin()

uint8_t dtmf_get_rdn_pin ( dtmf_t * ctx)

DTMF get rdn pin function.

This function returns the ring detection notification (RDN) pin logic state.

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

◆ dtmf_get_status()

err_t dtmf_get_status ( dtmf_t * ctx,
uint16_t * data_out )

DTMF get status function.

This function reads the 16-bit status register data.

Parameters
[in]ctx: Click context object. See dtmf_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.

◆ dtmf_handshake_init()

err_t dtmf_handshake_init ( dtmf_t * ctx)

DTMF handshake init function.

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

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

◆ dtmf_hook_off()

void dtmf_hook_off ( dtmf_t * ctx)

DTMF hook off function.

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

Parameters
[in]ctx: Click context object. See dtmf_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ dtmf_hook_on()

void dtmf_hook_on ( dtmf_t * ctx)

DTMF hook on function.

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

Parameters
[in]ctx: Click context object. See dtmf_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ dtmf_init()

err_t dtmf_init ( dtmf_t * ctx,
dtmf_cfg_t * cfg )

DTMF initialization function.

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

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

◆ dtmf_receive_data()

err_t dtmf_receive_data ( dtmf_t * ctx,
uint8_t * data_out )

DTMF receive data function.

In Rx synchronous mode, this function reads 8 received data bits, b0 of the register holding the earliest received bit, b7 the latest. In Rx Start-Stop mode, this function reads the specified number of data bits from a received character, b0 holding the first received bit. Unused bits are set to 0.

Parameters
[in]ctx: Click context object. See dtmf_t object definition for detailed explanation.
[out]data_out: Output read data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ dtmf_rx_ready()

uint8_t dtmf_rx_ready ( dtmf_t * ctx)

DTMF rx ready function.

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

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

◆ dtmf_send_message()

err_t dtmf_send_message ( dtmf_t * ctx,
uint8_t * data_in,
uint8_t len )

DTMF 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 dtmf_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.

◆ dtmf_set_control()

err_t dtmf_set_control ( dtmf_t * ctx,
uint16_t data_in )

DTMF set control function.

This function controls general features of the CMX865A 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 dtmf_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.

◆ dtmf_set_hsw_pin()

void dtmf_set_hsw_pin ( dtmf_t * ctx,
uint8_t state )

DTMF set hsw pin function.

This function sets the hookswitch (HSW) pin logic state.

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

◆ dtmf_set_programming()

err_t dtmf_set_programming ( dtmf_t * ctx,
uint16_t data_in )

DTMF 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 CMX865A.

Parameters
[in]ctx: Click context object. See dtmf_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.

◆ dtmf_set_receive_mode()

err_t dtmf_set_receive_mode ( dtmf_t * ctx,
uint16_t data_in )

DTMF set receive mode function.

This function controls the CMX865A receive signal type and level.

Parameters
[in]ctx: Click context object. See dtmf_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.

◆ dtmf_set_transmit_mode()

err_t dtmf_set_transmit_mode ( dtmf_t * ctx,
uint16_t data_in )

DTMF set transmit mode function.

This function controls the CMX865A transmit signal type and level.

Parameters
[in]ctx: Click context object. See dtmf_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.

◆ dtmf_transmit_data()

err_t dtmf_transmit_data ( dtmf_t * ctx,
uint8_t data_in )

DTMF transmit data function.

In Tx Synchronous mode, this function sets the next 8 data bits to be transmitted. b0 is transmitted first. In Tx Start-Stop mode, the specified number of data bits will be transmitted (b0 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 dtmf_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
None.

◆ dtmf_tx_ready()

uint8_t dtmf_tx_ready ( dtmf_t * ctx)

DTMF tx ready function.

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

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

◆ dtmf_unscram_1s_det()

uint8_t dtmf_unscram_1s_det ( dtmf_t * ctx)

DTMF 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 dtmf_t object definition for detailed explanation.
Returns
  • 0 - Flag is not set,
  • 1 - Flag is set.
Note
None.