eposmodule  2.1.0.0
eposmodule.h
Go to the documentation of this file.
1 /****************************************************************************
2 ** Copyright (C) 2020 MikroElektronika d.o.o.
3 ** Contact: https://www.mikroe.com/contact
4 **
5 ** Permission is hereby granted, free of charge, to any person obtaining a copy
6 ** of this software and associated documentation files (the "Software"), to deal
7 ** in the Software without restriction, including without limitation the rights
8 ** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 ** copies of the Software, and to permit persons to whom the Software is
10 ** furnished to do so, subject to the following conditions:
11 ** The above copyright notice and this permission notice shall be
12 ** included in all copies or substantial portions of the Software.
13 **
14 ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
16 ** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 ** DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
19 ** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 ** USE OR OTHER DEALINGS IN THE SOFTWARE.
21 ****************************************************************************/
22 
28 #ifndef EPOSMODULE_H
29 #define EPOSMODULE_H
30 
31 #ifdef __cplusplus
32 extern "C"{
33 #endif
34 
39 #ifdef PREINIT_SUPPORTED
40 #include "preinit.h"
41 #endif
42 
43 #ifdef MikroCCoreVersion
44  #if MikroCCoreVersion >= 1
45  #include "delays.h"
46  #endif
47 #endif
48 
49 #include "drv_digital_out.h"
50 #include "drv_digital_in.h"
51 #include "drv_spi_master.h"
52 #include "spi_specifics.h"
53 
74 #define EPOSMODULE_CMD_GENERAL_RESET 0x01
75 #define EPOSMODULE_CMD_GENERAL_CONTROL 0xE0
76 #define EPOSMODULE_CMD_TRANSMIT_MODE 0xE1
77 #define EPOSMODULE_CMD_RECEIVE_MODE 0xE2
78 #define EPOSMODULE_CMD_TRANSMIT_DATA 0xE3
79 #define EPOSMODULE_CMD_ALT_TRANSMIT_DATA 0xE4
80 #define EPOSMODULE_CMD_RECEIVE_DATA 0xE5
81 #define EPOSMODULE_CMD_STATUS 0xE6
82 #define EPOSMODULE_CMD_PROGRAMMING 0xE8
83 #define EPOSMODULE_CMD_QAM_MODEM_CMD 0xEA
84 #define EPOSMODULE_CMD_QAM_MODEM_STATUS 0xEB
85  // eposmodule_reg
87 
102 #define EPOSMODULE_CONTROL_EQU 0x8000
103 #define EPOSMODULE_CONTROL_HI_GAIN 0x4000
104 #define EPOSMODULE_CONTROL_PAT_DET 0x2000
105 #define EPOSMODULE_CONTROL_LB 0x0800
106 #define EPOSMODULE_CONTROL_2C 0x0400
107 #define EPOSMODULE_CONTROL_RLY_DRV 0x0200
108 #define EPOSMODULE_CONTROL_PWR 0x0100
109 #define EPOSMODULE_CONTROL_RST 0x0080
110 #define EPOSMODULE_CONTROL_IRQN_EN 0x0040
111 #define EPOSMODULE_CONTROL_IRQ_RING 0x0020
112 #define EPOSMODULE_CONTROL_IRQ_PROG_FLAG 0x0010
113 #define EPOSMODULE_CONTROL_IRQ_TX_RDY_UNF 0x0008
114 #define EPOSMODULE_CONTROL_IRQ_ENERGY_RX_CP 0x0004
115 #define EPOSMODULE_CONTROL_IRQ_CONT_10 0x0002
116 #define EPOSMODULE_CONTROL_IRQ_RX_RDY_OVF 0x0001
117 #define EPOSMODULE_CONTROL_IRQ_MASK 0x001F
118 
123 #define EPOSMODULE_TX_MODE_QAM 0xF000
124 #define EPOSMODULE_TX_MODE_V22_BIS_2400_HIGH 0xD000
125 #define EPOSMODULE_TX_MODE_V22_BIS_2400_LOW 0xC000
126 #define EPOSMODULE_TX_MODE_V22_1200_HIGH 0xB000
127 #define EPOSMODULE_TX_MODE_V22_1200_LOW 0xA000
128 #define EPOSMODULE_TX_MODE_V21_FSK_HIGH 0x9000
129 #define EPOSMODULE_TX_MODE_V21_FSK_LOW 0x8000
130 #define EPOSMODULE_TX_MODE_BELL_103_FSK_HIGH 0x7000
131 #define EPOSMODULE_TX_MODE_BELL_103_FSK_LOW 0x6000
132 #define EPOSMODULE_TX_MODE_V23_FSK_1200 0x5000
133 #define EPOSMODULE_TX_MODE_V23_FSK_75 0x4000
134 #define EPOSMODULE_TX_MODE_BELL_202_FSK_1200 0x3000
135 #define EPOSMODULE_TX_MODE_BELL_202_FSK_150 0x2000
136 #define EPOSMODULE_TX_MODE_DTMF_TONES 0x1000
137 #define EPOSMODULE_TX_MODE_DISABLED 0x0000
138 #define EPOSMODULE_TX_MODE_MASK 0xF000
139 #define EPOSMODULE_TX_LEVEL_0_DB 0x0E00
140 #define EPOSMODULE_TX_LEVEL_MIN_1_5_DB 0x0C00
141 #define EPOSMODULE_TX_LEVEL_MIN_3_DB 0x0A00
142 #define EPOSMODULE_TX_LEVEL_MIN_4_5_DB 0x0800
143 #define EPOSMODULE_TX_LEVEL_MIN_6_DB 0x0600
144 #define EPOSMODULE_TX_LEVEL_MIN_7_5_DB 0x0400
145 #define EPOSMODULE_TX_LEVEL_MIN_9_DB 0x0200
146 #define EPOSMODULE_TX_LEVEL_MIN_10_5_DB 0x0000
147 #define EPOSMODULE_TX_LEVEL_MASK 0x0E00
148 #define EPOSMODULE_TX_GUARD_TONE_550 0x0180
149 #define EPOSMODULE_TX_GUARD_TONE_1800 0x0100
150 #define EPOSMODULE_TX_GUARD_TONE_DIS 0x0000
151 #define EPOSMODULE_TX_GUARD_TONE_MASK 0x0180
152 #define EPOSMODULE_TX_SCRAMBLER_EN_64_EN 0x0060
153 #define EPOSMODULE_TX_SCRAMBLER_EN_64_DIS 0x0040
154 #define EPOSMODULE_TX_SCRAMBLER_DIS 0x0000
155 #define EPOSMODULE_TX_SCRAMBLER_MASK 0x0060
156 #define EPOSMODULE_TX_DTMF_TWIST_2_DB 0x0000
157 #define EPOSMODULE_TX_DTMF_TWIST_1_DB 0x0020
158 #define EPOSMODULE_TX_DTMF_TWIST_1_5_DB 0x0040
159 #define EPOSMODULE_TX_DTMF_TWIST_2_5_DB 0x0060
160 #define EPOSMODULE_TX_DTMF_TWIST_3_DB 0x0080
161 #define EPOSMODULE_TX_DTMF_TWIST_3_5_DB 0x00A0
162 #define EPOSMODULE_TX_DTMF_TWIST_4_DB 0x00C0
163 #define EPOSMODULE_TX_DTMF_TWIST_4_5_DB 0x00E0
164 #define EPOSMODULE_TX_DTMF_TWIST_MASK 0x00E0
165 #define EPOSMODULE_TX_DATA_FORMAT_SPECIAL 0x0018
166 #define EPOSMODULE_TX_DATA_FORMAT_SS_NO_PAR 0x0010
167 #define EPOSMODULE_TX_DATA_FORMAT_SS_EVEN_PAR 0x0008
168 #define EPOSMODULE_TX_DATA_FORMAT_SS_ODD_PAR 0x0000
169 #define EPOSMODULE_TX_DATA_FORMAT_MASK 0x0018
170 #define EPOSMODULE_TX_DATA_STOP_8_2 0x0007
171 #define EPOSMODULE_TX_DATA_STOP_8_1 0x0006
172 #define EPOSMODULE_TX_DATA_STOP_7_2 0x0005
173 #define EPOSMODULE_TX_DATA_STOP_7_1 0x0004
174 #define EPOSMODULE_TX_DATA_STOP_6_2 0x0003
175 #define EPOSMODULE_TX_DATA_STOP_6_1 0x0002
176 #define EPOSMODULE_TX_DATA_STOP_5_2 0x0001
177 #define EPOSMODULE_TX_DATA_STOP_5_1 0x0000
178 #define EPOSMODULE_TX_DATA_STOP_MASK 0x0007
179 #define EPOSMODULE_TX_DATA_SOURCE_TX_BUF 0x0007
180 #define EPOSMODULE_TX_DATA_SOURCE_HDLC_MODE 0x0006
181 #define EPOSMODULE_TX_DATA_SOURCE_HDLC_ABORT 0x0005
182 #define EPOSMODULE_TX_DATA_SOURCE_CONT_1S 0x0003
183 #define EPOSMODULE_TX_DATA_SOURCE_CONT_0S 0x0002
184 #define EPOSMODULE_TX_DATA_SOURCE_CONT_ALT 0x0001
185 #define EPOSMODULE_TX_DATA_SOURCE_MASK 0x0007
186 #define EPOSMODULE_TX_TONE_FIXED_NO_TONE 0x0000
187 #define EPOSMODULE_TX_TONE_FIXED_PAIR_697 0x0001
188 #define EPOSMODULE_TX_TONE_FIXED_PAIR_770 0x0002
189 #define EPOSMODULE_TX_TONE_FIXED_PAIR_852 0x0003
190 #define EPOSMODULE_TX_TONE_FIXED_PAIR_941 0x0004
191 #define EPOSMODULE_TX_TONE_FIXED_PAIR_1209 0x0005
192 #define EPOSMODULE_TX_TONE_FIXED_PAIR_1336 0x0006
193 #define EPOSMODULE_TX_TONE_FIXED_PAIR_1477 0x0007
194 #define EPOSMODULE_TX_TONE_FIXED_PAIR_1633 0x0008
195 #define EPOSMODULE_TX_TONE_FIXED_PAIR_1300 0x0009
196 #define EPOSMODULE_TX_TONE_FIXED_PAIR_2100 0x000A
197 #define EPOSMODULE_TX_TONE_FIXED_PAIR_2225 0x000B
198 #define EPOSMODULE_TX_TONE_FIXED_PAIR_TA 0x000C
199 #define EPOSMODULE_TX_TONE_FIXED_PAIR_TB 0x000D
200 #define EPOSMODULE_TX_TONE_FIXED_PAIR_TC 0x000E
201 #define EPOSMODULE_TX_TONE_FIXED_PAIR_TD 0x000F
202 #define EPOSMODULE_TX_DTMF_TONE_D 0x0010
203 #define EPOSMODULE_TX_DTMF_TONE_1 0x0011
204 #define EPOSMODULE_TX_DTMF_TONE_2 0x0012
205 #define EPOSMODULE_TX_DTMF_TONE_3 0x0013
206 #define EPOSMODULE_TX_DTMF_TONE_4 0x0014
207 #define EPOSMODULE_TX_DTMF_TONE_5 0x0015
208 #define EPOSMODULE_TX_DTMF_TONE_6 0x0016
209 #define EPOSMODULE_TX_DTMF_TONE_7 0x0017
210 #define EPOSMODULE_TX_DTMF_TONE_8 0x0018
211 #define EPOSMODULE_TX_DTMF_TONE_9 0x0019
212 #define EPOSMODULE_TX_DTMF_TONE_0 0x001A
213 #define EPOSMODULE_TX_DTMF_TONE_STAR 0x001B
214 #define EPOSMODULE_TX_DTMF_TONE_HASH 0x001C
215 #define EPOSMODULE_TX_DTMF_TONE_A 0x001D
216 #define EPOSMODULE_TX_DTMF_TONE_B 0x001E
217 #define EPOSMODULE_TX_DTMF_TONE_C 0x001F
218 #define EPOSMODULE_TX_DTMF_TONE_MASK 0x001F
219 
224 #define EPOSMODULE_RX_MODE_QAM 0xF000
225 #define EPOSMODULE_RX_MODE_V22_BIS_2400_HIGH 0xD000
226 #define EPOSMODULE_RX_MODE_V22_BIS_2400_LOW 0xC000
227 #define EPOSMODULE_RX_MODE_V22_1200_HIGH 0xB000
228 #define EPOSMODULE_RX_MODE_V22_1200_LOW 0xA000
229 #define EPOSMODULE_RX_MODE_V21_FSK_HIGH 0x9000
230 #define EPOSMODULE_RX_MODE_V21_FSK_LOW 0x8000
231 #define EPOSMODULE_RX_MODE_BELL_103_FSK_HIGH 0x7000
232 #define EPOSMODULE_RX_MODE_BELL_103_FSK_LOW 0x6000
233 #define EPOSMODULE_RX_MODE_V23_FSK_1200 0x5000
234 #define EPOSMODULE_RX_MODE_V23_FSK_75 0x4000
235 #define EPOSMODULE_RX_MODE_BELL_202_FSK_1200 0x3000
236 #define EPOSMODULE_RX_MODE_BELL_202_FSK_150 0x2000
237 #define EPOSMODULE_RX_MODE_DTMF_TONES 0x1000
238 #define EPOSMODULE_RX_MODE_DISABLED 0x0000
239 #define EPOSMODULE_RX_MODE_MASK 0xF000
240 #define EPOSMODULE_RX_LEVEL_0_DB 0x0E00
241 #define EPOSMODULE_RX_LEVEL_MIN_1_5_DB 0x0C00
242 #define EPOSMODULE_RX_LEVEL_MIN_3_DB 0x0A00
243 #define EPOSMODULE_RX_LEVEL_MIN_4_5_DB 0x0800
244 #define EPOSMODULE_RX_LEVEL_MIN_6_DB 0x0600
245 #define EPOSMODULE_RX_LEVEL_MIN_7_5_DB 0x0400
246 #define EPOSMODULE_RX_LEVEL_MIN_9_DB 0x0200
247 #define EPOSMODULE_RX_LEVEL_MIN_10_5_DB 0x0000
248 #define EPOSMODULE_RX_LEVEL_MASK 0x0E00
249 #define EPOSMODULE_RX_AUTO_EQU_EN 0x0100
250 #define EPOSMODULE_RX_AUTO_EQU_MASK 0x0100
251 #define EPOSMODULE_RX_DESCRAMBLER_EN_64_EN 0x0060
252 #define EPOSMODULE_RX_DESCRAMBLER_EN_64_DIS 0x0040
253 #define EPOSMODULE_RX_DESCRAMBLER_DIS 0x0000
254 #define EPOSMODULE_RX_DESCRAMBLER_MASK 0x0060
255 #define EPOSMODULE_RX_DATA_FORMAT_SPECIAL 0x0038
256 #define EPOSMODULE_RX_DATA_FORMAT_SS_NO_OVS 0x0030
257 #define EPOSMODULE_RX_DATA_FORMAT_SS_1PCT_OVS 0x0028
258 #define EPOSMODULE_RX_DATA_FORMAT_SS_2_3PCT_OVS 0x0020
259 #define EPOSMODULE_RX_DATA_FORMAT_USART_DIS 0x0000
260 #define EPOSMODULE_RX_DATA_FORMAT_MASK 0x0038
261 #define EPOSMODULE_RX_DATA_PARITY_8_PAR 0x0007
262 #define EPOSMODULE_RX_DATA_PARITY_8_NO_PAR 0x0006
263 #define EPOSMODULE_RX_DATA_PARITY_7_PAR 0x0005
264 #define EPOSMODULE_RX_DATA_PARITY_7_NO_PAR 0x0004
265 #define EPOSMODULE_RX_DATA_PARITY_6_PAR 0x0003
266 #define EPOSMODULE_RX_DATA_PARITY_6_NO_PAR 0x0002
267 #define EPOSMODULE_RX_DATA_PARITY_5_PAR 0x0001
268 #define EPOSMODULE_RX_DATA_PARITY_5_NO_PAR 0x0000
269 #define EPOSMODULE_RX_DATA_PARITY_MASK 0x0007
270 #define EPOSMODULE_RX_DATA_SOURCE_SYNC 0x0007
271 #define EPOSMODULE_RX_DATA_SOURCE_HDLC_MODE 0x0006
272 #define EPOSMODULE_RX_DATA_SOURCE_MASK 0x0007
273 #define EPOSMODULE_RX_TONE_DETECT_PROG_PAIR 0x0004
274 #define EPOSMODULE_RX_TONE_DETECT_CALL_PROG 0x0003
275 #define EPOSMODULE_RX_TONE_DETECT_ANSWER 0x0002
276 #define EPOSMODULE_RX_TONE_DETECT_DTMF 0x0001
277 #define EPOSMODULE_RX_TONE_DETECT_DISABLE 0x0000
278 #define EPOSMODULE_RX_TONE_DETECT_MASK 0x0007
279 
284 #define EPOSMODULE_STATUS_IRQ 0x8000
285 #define EPOSMODULE_STATUS_RING 0x4000
286 #define EPOSMODULE_STATUS_PROG_FLAG 0x2000
287 #define EPOSMODULE_STATUS_TX_READY 0x1000
288 #define EPOSMODULE_STATUS_TX_UNDERFLOW 0x0800
289 #define EPOSMODULE_STATUS_ENERGY_RX_CP 0x0400
290 #define EPOSMODULE_STATUS_1010_PATTERN 0x0200
291 #define EPOSMODULE_STATUS_CONT_0S 0x0100
292 #define EPOSMODULE_STATUS_CONT_1S 0x0080
293 #define EPOSMODULE_STATUS_RX_READY 0x0040
294 #define EPOSMODULE_STATUS_RX_OVERFLOW 0x0020
295 #define EPOSMODULE_STATUS_RX_FRAMING_ERROR 0x0010
296 #define EPOSMODULE_STATUS_RX_EVEN_PARITY 0x0008
297 #define EPOSMODULE_STATUS_HLDC_ABORT 0x0004
298 #define EPOSMODULE_STATUS_RX_2C_MODE 0x0002
299 #define EPOSMODULE_STATUS_FSK_OUT 0x0001
300 #define EPOSMODULE_STATUS_TONE_D 0x0000
301 #define EPOSMODULE_STATUS_TONE_1 0x0001
302 #define EPOSMODULE_STATUS_TONE_2 0x0002
303 #define EPOSMODULE_STATUS_TONE_3 0x0003
304 #define EPOSMODULE_STATUS_TONE_4 0x0004
305 #define EPOSMODULE_STATUS_TONE_5 0x0005
306 #define EPOSMODULE_STATUS_TONE_6 0x0006
307 #define EPOSMODULE_STATUS_TONE_7 0x0007
308 #define EPOSMODULE_STATUS_TONE_8 0x0008
309 #define EPOSMODULE_STATUS_TONE_9 0x0009
310 #define EPOSMODULE_STATUS_TONE_0 0x000A
311 #define EPOSMODULE_STATUS_TONE_STAR 0x000B
312 #define EPOSMODULE_STATUS_TONE_HASH 0x000C
313 #define EPOSMODULE_STATUS_TONE_A 0x000D
314 #define EPOSMODULE_STATUS_TONE_B 0x000E
315 #define EPOSMODULE_STATUS_TONE_C 0x000F
316 #define EPOSMODULE_STATUS_TONE_MASK 0x000F
317 
322 #define EPOSMODULE_QAM_CMD_STOP_MODEM 0x0000
323 #define EPOSMODULE_QAM_CMD_INIT_RETRAIN 0x0008
324 #define EPOSMODULE_QAM_CMD_START_CALLING 0x0010
325 #define EPOSMODULE_QAM_CMD_START_ANSWER 0x0018
326 #define EPOSMODULE_QAM_CMD_INIT_RATE_RENEG 0x0020
327 #define EPOSMODULE_QAM_CMD_FAST_TRAIN_MASK 0x0020
328 #define EPOSMODULE_QAM_CMD_MAX_BITRATE_14400 0x0007
329 #define EPOSMODULE_QAM_CMD_MAX_BITRATE_12000 0x0006
330 #define EPOSMODULE_QAM_CMD_MAX_BITRATE_9600_TR 0x0005
331 #define EPOSMODULE_QAM_CMD_MAX_BITRATE_9600 0x0004
332 #define EPOSMODULE_QAM_CMD_MAX_BITRATE_7200 0x0003
333 #define EPOSMODULE_QAM_CMD_MAX_BITRATE_4800 0x0002
334 #define EPOSMODULE_QAM_CMD_MAX_BITRATE_2400 0x0001
335 #define EPOSMODULE_QAM_CMD_MAX_BITRATE_1200 0x0000
336 #define EPOSMODULE_QAM_CMD_MAX_BITRATE_MASK 0x0007
337 
342 #define EPOSMODULE_QAM_STATUS_MSG_MASK 0xFC00
343 #define EPOSMODULE_QAM_STATUS_SNR_MASK 0x0070
344 #define EPOSMODULE_QAM_STATUS_MODE_MASK 0x000F
345 
350 #define EPOSMODULE_TIMEOUT_CLEAR_IRQ 2000
351 #define EPOSMODULE_TIMEOUT_TX_READY 2000
352 #define EPOSMODULE_TIMEOUT_CALL_PROGRESS 60000
353 #define EPOSMODULE_TIMING_BUSY 50
354 #define EPOSMODULE_TIMING_DISCONNECTED 250
355 #define EPOSMODULE_TIMING_RINGING 2000
356 #define EPOSMODULE_TIMING_CALL_PROGRESS 6000
357 #define EPOSMODULE_TIMING_SEND_MESSAGE 2000
358 #define EPOSMODULE_TIMING_RX_READY 10
359 #define EPOSMODULE_TIMING_WAIT_FOR_MESSAGE 10000
360 
365 #define EPOSMODULE_STATE_IDLE 0
366 #define EPOSMODULE_STATE_IRQ_SET 1
367 #define EPOSMODULE_STATE_RINGING 2
368 #define EPOSMODULE_STATE_CALL_IN_PROGRESS 3
369 #define EPOSMODULE_STATE_CALL_IN_PROGRESS 3
370 
375 #define EPOSMODULE_DIAL_NUMBER_MAX_LEN 16
376 
385 #define EPOSMODULE_SET_DATA_SAMPLE_EDGE SET_SPI_DATA_SAMPLE_EDGE
386 #define EPOSMODULE_SET_DATA_SAMPLE_MIDDLE SET_SPI_DATA_SAMPLE_MIDDLE
387  // eposmodule_set
389 
404 #define EPOSMODULE_MAP_MIKROBUS( cfg, mikrobus ) \
405  cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
406  cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
407  cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
408  cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
409  cfg.irq = MIKROBUS( mikrobus, MIKROBUS_INT )
410  // eposmodule_map // eposmodule
413 
418 typedef struct
419 {
420  // Input pins
421  digital_in_t irq;
423  // Modules
424  spi_master_t spi;
426  pin_name_t chip_select;
428  uint16_t control;
429  uint16_t tx_mode;
430  uint16_t rx_mode;
431  uint16_t status;
433 } eposmodule_t;
434 
439 typedef struct
440 {
441  // Communication gpio pins
442  pin_name_t miso;
443  pin_name_t mosi;
444  pin_name_t sck;
445  pin_name_t cs;
447  // Additional gpio pins
448  pin_name_t irq;
450  // static variable
451  uint32_t spi_speed;
452  spi_master_mode_t spi_mode;
453  spi_master_chip_select_polarity_t cs_polarity;
456 
461 typedef enum
462 {
465  EPOSMODULE_TIMEOUT = -2
466 
468 
485 
500 
513 
527 err_t eposmodule_set_control ( eposmodule_t *ctx, uint16_t data_in );
528 
540 err_t eposmodule_set_transmit_mode ( eposmodule_t *ctx, uint16_t data_in );
541 
553 err_t eposmodule_set_receive_mode ( eposmodule_t *ctx, uint16_t data_in );
554 
571 err_t eposmodule_transmit_data ( eposmodule_t *ctx, uint16_t data_in );
572 
588 err_t eposmodule_receive_data ( eposmodule_t *ctx, uint8_t *data_out );
589 
601 err_t eposmodule_get_status ( eposmodule_t *ctx, uint16_t *data_out );
602 
615 err_t eposmodule_set_programming ( eposmodule_t *ctx, uint16_t data_in );
616 
628 
640 
650 
661 
672 
683 
694 
706 
718 
730 
742 err_t eposmodule_dial ( eposmodule_t *ctx, uint8_t *dial_num );
743 
757 err_t eposmodule_send_message ( eposmodule_t *ctx, uint8_t *data_in, uint8_t len );
758 
759 #ifdef __cplusplus
760 }
761 #endif
762 #endif // EPOSMODULE_H
763  // eposmodule
765 
766 // ------------------------------------------------------------------------ END
eposmodule_rx_ready
uint8_t eposmodule_rx_ready(eposmodule_t *ctx)
EPOS Module rx ready function.
eposmodule_cfg_t::mosi
pin_name_t mosi
Definition: eposmodule.h:443
eposmodule_cfg_t::irq
pin_name_t irq
Definition: eposmodule.h:448
eposmodule_t
EPOS Module Click context object.
Definition: eposmodule.h:419
eposmodule_cfg_t::miso
pin_name_t miso
Definition: eposmodule.h:442
eposmodule_cfg_t::spi_mode
spi_master_mode_t spi_mode
Definition: eposmodule.h:452
eposmodule_send_message
err_t eposmodule_send_message(eposmodule_t *ctx, uint8_t *data_in, uint8_t len)
EPOS Module send message function.
eposmodule_hook_on
err_t eposmodule_hook_on(eposmodule_t *ctx)
EPOS Module hook on function.
spi_specifics.h
This file contains SPI specific macros, functions, etc.
eposmodule_return_value_t
eposmodule_return_value_t
EPOS Module Click return value data.
Definition: eposmodule.h:462
eposmodule_call_progress
uint8_t eposmodule_call_progress(eposmodule_t *ctx)
EPOS Module call progress function.
eposmodule_get_irq_pin
uint8_t eposmodule_get_irq_pin(eposmodule_t *ctx)
EPOS Module get irq pin function.
eposmodule_cfg_t::cs_polarity
spi_master_chip_select_polarity_t cs_polarity
Definition: eposmodule.h:453
eposmodule_init
err_t eposmodule_init(eposmodule_t *ctx, eposmodule_cfg_t *cfg)
EPOS Module initialization function.
eposmodule_set_transmit_mode
err_t eposmodule_set_transmit_mode(eposmodule_t *ctx, uint16_t data_in)
EPOS Module set transmit mode function.
EPOSMODULE_OK
@ EPOSMODULE_OK
Definition: eposmodule.h:463
eposmodule_set_receive_mode
err_t eposmodule_set_receive_mode(eposmodule_t *ctx, uint16_t data_in)
EPOS Module set receive mode function.
eposmodule_dial
err_t eposmodule_dial(eposmodule_t *ctx, uint8_t *dial_num)
EPOS Module dial function.
eposmodule_t::control
uint16_t control
Definition: eposmodule.h:428
eposmodule_unscram_1s_det
uint8_t eposmodule_unscram_1s_det(eposmodule_t *ctx)
EPOS Module unscram 1s det function.
eposmodule_t::spi
spi_master_t spi
Definition: eposmodule.h:424
eposmodule_set_control
err_t eposmodule_set_control(eposmodule_t *ctx, uint16_t data_in)
EPOS Module set control function.
eposmodule_cfg_t::spi_speed
uint32_t spi_speed
Definition: eposmodule.h:451
eposmodule_t::status
uint16_t status
Definition: eposmodule.h:431
eposmodule_receive_data
err_t eposmodule_receive_data(eposmodule_t *ctx, uint8_t *data_out)
EPOS Module receive data function.
eposmodule_tx_ready
uint8_t eposmodule_tx_ready(eposmodule_t *ctx)
EPOS Module tx ready function.
eposmodule_t::rx_mode
uint16_t rx_mode
Definition: eposmodule.h:430
eposmodule_cfg_setup
void eposmodule_cfg_setup(eposmodule_cfg_t *cfg)
EPOS Module configuration object setup function.
eposmodule_hook_off
err_t eposmodule_hook_off(eposmodule_t *ctx)
EPOS Module hook off function.
eposmodule_t::tx_mode
uint16_t tx_mode
Definition: eposmodule.h:429
eposmodule_general_reset
err_t eposmodule_general_reset(eposmodule_t *ctx)
EPOS Module general reset function.
eposmodule_t::irq
digital_in_t irq
Definition: eposmodule.h:421
eposmodule_cfg_t::sck
pin_name_t sck
Definition: eposmodule.h:444
EPOSMODULE_ERROR
@ EPOSMODULE_ERROR
Definition: eposmodule.h:464
eposmodule_set_programming
err_t eposmodule_set_programming(eposmodule_t *ctx, uint16_t data_in)
EPOS Module set programming function.
eposmodule_t::chip_select
pin_name_t chip_select
Definition: eposmodule.h:426
eposmodule_clear_interrupts
err_t eposmodule_clear_interrupts(eposmodule_t *ctx)
EPOS Module clear interrupts function.
eposmodule_handshake_init
err_t eposmodule_handshake_init(eposmodule_t *ctx)
EPOS Module handshake init function.
EPOSMODULE_TIMEOUT
@ EPOSMODULE_TIMEOUT
Definition: eposmodule.h:465
eposmodule_cfg_t
EPOS Module Click configuration object.
Definition: eposmodule.h:440
eposmodule_get_status
err_t eposmodule_get_status(eposmodule_t *ctx, uint16_t *data_out)
EPOS Module get status function.
eposmodule_cfg_t::cs
pin_name_t cs
Definition: eposmodule.h:445
eposmodule_ring_detect
uint8_t eposmodule_ring_detect(eposmodule_t *ctx)
EPOS Module ring detect function.
eposmodule_transmit_data
err_t eposmodule_transmit_data(eposmodule_t *ctx, uint16_t data_in)
EPOS Module transmit data function.