dtmf 2.1.0.0
|
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. | |
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.
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.
[in] | ctx | : Click context object. See dtmf_t object definition for detailed explanation. |
0
- Flag is not set, 1
- Flag is set. void dtmf_cfg_setup | ( | dtmf_cfg_t * | cfg | ) |
DTMF configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See dtmf_cfg_t object definition for detailed explanation. |
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.
[in] | ctx | : Click context object. See dtmf_t object definition for detailed explanation. |
0
- Success, -1
- Error, -2
- Timeout. 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.
[in] | ctx | : Click context object. See dtmf_t object definition for detailed explanation. |
[in] | dial_num | : Dial number string [up to 16 digits]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See dtmf_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t dtmf_get_irq_pin | ( | dtmf_t * | ctx | ) |
DTMF get irq pin function.
This function returns the interrupt request (IRQ) pin logic state.
[in] | ctx | : Click context object. See dtmf_t object definition for detailed explanation. |
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.
[in] | ctx | : Click context object. See dtmf_t object definition for detailed explanation. |
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.
[in] | ctx | : Click context object. See dtmf_t object definition for detailed explanation. |
[out] | data_out | : 16-bit status register. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See dtmf_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void dtmf_hook_off | ( | dtmf_t * | ctx | ) |
DTMF hook off function.
This function sets hookswitch to OFF state which closes the line interface.
[in] | ctx | : Click context object. See dtmf_t object definition for detailed explanation. |
void dtmf_hook_on | ( | dtmf_t * | ctx | ) |
DTMF hook on function.
This function sets hookswitch to ON state which opens the line interface.
[in] | ctx | : Click context object. See dtmf_t object definition for detailed explanation. |
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.
[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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See dtmf_t object definition for detailed explanation. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t dtmf_rx_ready | ( | dtmf_t * | ctx | ) |
DTMF rx ready function.
This function reads the status register and returns the rx ready flag.
[in] | ctx | : Click context object. See dtmf_t object definition for detailed explanation. |
0
- Not ready, 1
- Ready. 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.
[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. |
0
- Success, -1
- Error, -2
- Timeout. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See dtmf_t object definition for detailed explanation. |
[in] | data_in | : Control register data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See dtmf_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
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.
[in] | ctx | : Click context object. See dtmf_t object definition for detailed explanation. |
[in] | data_in | : Programming register data to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See dtmf_t object definition for detailed explanation. |
[in] | data_in | : Receive mode register data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See dtmf_t object definition for detailed explanation. |
[in] | data_in | : Transmit mode register data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See dtmf_t object definition for detailed explanation. |
[in] | data_in | : Data to be transmitted. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t dtmf_tx_ready | ( | dtmf_t * | ctx | ) |
DTMF tx ready function.
This function reads the status register and returns the tx ready flag.
[in] | ctx | : Click context object. See dtmf_t object definition for detailed explanation. |
0
- Not ready, 1
- Ready. 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.
[in] | ctx | : Click context object. See dtmf_t object definition for detailed explanation. |
0
- Flag is not set, 1
- Flag is set.