eposmodule
2.1.0.0
|
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... | |
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.
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.
[in] | ctx | : Click context object. See eposmodule_t object definition for detailed explanation. |
0
- Flag is not set, 1
- Flag is set. void eposmodule_cfg_setup | ( | eposmodule_cfg_t * | cfg | ) |
EPOS Module configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See eposmodule_cfg_t object definition for detailed explanation. |
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.
[in] | ctx | : Click context object. See eposmodule_t object definition for detailed explanation. |
0
- Success, -1
- Error, -2
- Timeout. 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.
[in] | ctx | : Click context object. See eposmodule_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 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.
[in] | ctx | : Click context object. See eposmodule_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See eposmodule_t object definition for detailed explanation. |
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.
[in] | ctx | : Click context object. See eposmodule_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 eposmodule_handshake_init | ( | eposmodule_t * | ctx | ) |
EPOS Module handshake init function.
This function performs a handshake init which resets the device settings to default.
[in] | ctx | : Click context object. See eposmodule_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See eposmodule_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See eposmodule_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[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). |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See eposmodule_t object definition for detailed explanation. |
0
- Not ready, 1
- 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.
[in] | ctx | : Click context object. See eposmodule_t object definition for detailed explanation. |
0
- Not ready, 1
- Ready. 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.
[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. |
0
- Success, -1
- Error, -2
- Timeout. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See eposmodule_t object definition for detailed explanation. |
[in] | data_in | : Control register data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See eposmodule_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 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.
[in] | ctx | : Click context object. See eposmodule_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 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.
[in] | ctx | : Click context object. See eposmodule_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 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.
[in] | ctx | : Click context object. See eposmodule_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 eposmodule_tx_ready | ( | eposmodule_t * | ctx | ) |
EPOS Module tx ready function.
This function reads the status register and returns the tx ready flag.
[in] | ctx | : Click context object. See eposmodule_t object definition for detailed explanation. |
0
- Not ready, 1
- Ready. 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.
[in] | ctx | : Click context object. See eposmodule_t object definition for detailed explanation. |
0
- Flag is not set, 1
- Flag is set.