42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_digital_in.h"
66#define DMX_MAP_MIKROBUS( cfg, mikrobus ) \
67 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
68 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
69 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
70 cfg.abr = MIKROBUS( mikrobus, MIKROBUS_CS ); \
71 cfg.run = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
72 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
81#define DMX_ERROR_TIMEOUT -2
88#define DMX_RSP_OK "OK"
89#define DMX_RSP_ERROR "ERR"
96#define DMX_CMD_SADR "@SADR,001\0"
97#define DMX_CMD_BLEN "@BLEN,006\0"
98#define DMX_CMD_ITMR "@ITMR,001\0"
99#define DMX_CMD_FTMR "@FTMR,001\0"
100#define DMX_CMD_FLEN_MASTER "@FLEN,010\0"
101#define DMX_CMD_FLEN_SLAVE "@FLEN,006\0"
102#define DMX_CMD_SCOD "@SCOD,000\0"
103#define DMX_CMD_PURGEBFR "!PURGEBFR\0"
104#define DMX_CMD_STORECFG "!STORECFG\0"
105#define DMX_CMD_CLEARCFG "!CLEARCFG\0"
106#define DMX_CMD_DISPLCFG "!DISPLCFG\0"
115#define DMX_CONFIG_MODE 0
116#define DMX_RUN_MODE 1
117#define DMX_INT_INACTIVE 0
118#define DMX_INT_ACTIVE 1
125#define DMX_DRV_RX_BUFFER_SIZE 300
126#define DMX_DRV_TX_BUFFER_SIZE 100
#define DMX_DRV_TX_BUFFER_SIZE
Definition dmx.h:126
#define DMX_DRV_RX_BUFFER_SIZE
Definition dmx.h:125
err_t dmx_generic_read(dmx_t *ctx, uint8_t *data_buf, uint16_t max_len)
Generic read function.
err_t dmx_init(dmx_t *ctx, dmx_cfg_t *cfg)
Initialization function.
void dmx_cfg_setup(dmx_cfg_t *cfg)
Config Object Initialization function.
uint8_t dmx_check_int(dmx_t *ctx)
Interrupt Check function.
void dmx_set_reset(dmx_t *ctx, uint8_t state)
Reset Setting function.
void dmx_reset(dmx_t *ctx, uint8_t dev_mode)
Reset function.
void dmx_run(dmx_t *ctx, uint8_t run_mode)
Mode Setting function.
void dmx_send_cmd(dmx_t *ctx, uint8_t *cmd)
Send command function.
void dmx_generic_write(dmx_t *ctx, uint8_t *data_buf, uint16_t len)
Generic write function.
void dmx_set_auto_baud_rate(dmx_t *ctx, uint8_t state)
Auto Baud Rate Setting function.
Click configuration structure definition.
Definition dmx.h:160
pin_name_t run
Definition dmx.h:168
uint32_t baud_rate
Definition dmx.h:172
pin_name_t abr
Definition dmx.h:167
bool uart_blocking
Definition dmx.h:173
uart_data_bits_t data_bit
Definition dmx.h:174
pin_name_t tx_pin
Definition dmx.h:163
pin_name_t rx_pin
Definition dmx.h:162
uart_stop_bits_t stop_bit
Definition dmx.h:176
pin_name_t int_pin
Definition dmx.h:169
uart_parity_t parity_bit
Definition dmx.h:175
pin_name_t rst
Definition dmx.h:166
Click ctx object definition.
Definition dmx.h:139
uart_t uart
Definition dmx.h:149
digital_in_t int_pin
Definition dmx.h:146
digital_out_t run
Definition dmx.h:143
digital_out_t abr
Definition dmx.h:142
digital_out_t rst
Definition dmx.h:141