Go to the documentation of this file.
39 #ifdef PREINIT_SUPPORTED
43 #ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49 #include "drv_digital_out.h"
50 #include "drv_digital_in.h"
73 #define SPEAKUP3_START_BYTE 0x5A
74 #define SPEAKUP3_INS_ENTER_WAKE_UP 0x00 // Voice CMD: hey pudding / hello pudding
75 #define SPEAKUP3_INS_EXIT_WAKE_UP 0x01 // Voice CMD: goodbye / see you
76 #define SPEAKUP3_INS_LEARN_MATCH_AC 0x02 // Voice CMD: match the air conditioner
77 #define SPEAKUP3_INS_AC_TURN_ON 0x03 // Voice CMD: turn on the air conditioner
78 #define SPEAKUP3_INS_AC_TURN_OFF 0x04 // Voice CMD: turn off the air conditioner
79 #define SPEAKUP3_INS_AC_MODE_AUTO 0x05 // Voice CMD: automatic mode
80 #define SPEAKUP3_INS_AC_MODE_COLD 0x06 // Voice CMD: cold mode
81 #define SPEAKUP3_INS_AC_MODE_HEAT 0x07 // Voice CMD: heat mode
82 #define SPEAKUP3_INS_AC_MODE_DRY 0x08 // Voice CMD: dry mode
83 #define SPEAKUP3_INS_AC_MODE_FAN 0x09 // Voice CMD: fan mode
84 #define SPEAKUP3_INS_AC_MODE_SLEEP 0x0A // Voice CMD: sleeping mode
85 #define SPEAKUP3_INS_AC_WIND_AUTO 0x0B // Voice CMD: automatic fan
86 #define SPEAKUP3_INS_AC_WIND_LOW 0x0C // Voice CMD: low fan
87 #define SPEAKUP3_INS_AC_WIND_MID 0x0D // Voice CMD: medium fan
88 #define SPEAKUP3_INS_AC_WIND_HIGH 0x0E // Voice CMD: high fan
89 #define SPEAKUP3_INS_AC_WIND_INC 0x0F // Voice CMD: higher the fan
90 #define SPEAKUP3_INS_AC_WIND_DEC 0x10 // Voice CMD: lower the fan
91 #define SPEAKUP3_INS_AC_TMP_16 0x11 // Voice CMD: sixteen centigrade
92 #define SPEAKUP3_INS_AC_TMP_17 0x12 // Voice CMD: seventeen centigrade
93 #define SPEAKUP3_INS_AC_TMP_18 0x13 // Voice CMD: eighteen centigrade
94 #define SPEAKUP3_INS_AC_TMP_19 0x14 // Voice CMD: nineteen centigrade
95 #define SPEAKUP3_INS_AC_TMP_20 0x15 // Voice CMD: twenty centigrade
96 #define SPEAKUP3_INS_AC_TMP_21 0x16 // Voice CMD: twenty one centigrade
97 #define SPEAKUP3_INS_AC_TMP_22 0x17 // Voice CMD: twenty two centigrade
98 #define SPEAKUP3_INS_AC_TMP_23 0x18 // Voice CMD: twenty three centigrade
99 #define SPEAKUP3_INS_AC_TMP_24 0x19 // Voice CMD: twenty four centigrade
100 #define SPEAKUP3_INS_AC_TMP_25 0x1A // Voice CMD: twenty five centigrade
101 #define SPEAKUP3_INS_AC_TMP_26 0x1B // Voice CMD: twenty six centigrade
102 #define SPEAKUP3_INS_AC_TMP_27 0x1C // Voice CMD: twenty seven centigrade
103 #define SPEAKUP3_INS_AC_TMP_28 0x1D // Voice CMD: twenty eight centigrade
104 #define SPEAKUP3_INS_AC_TMP_29 0x1E // Voice CMD: twenty nine centigrade
105 #define SPEAKUP3_INS_AC_TMP_30 0x1F // Voice CMD: thirty centigrade
106 #define SPEAKUP3_INS_AC_TMP_INC 0x20 // Voice CMD: warmer
107 #define SPEAKUP3_INS_AC_TMP_DEC 0x21 // Voice CMD: cooler
108 #define SPEAKUP3_INS_AC_SWEPT_ON 0x22 // Voice CMD: start to fan
109 #define SPEAKUP3_INS_AC_SWEPT_OFF 0x23 // Voice CMD: stop to fan
110 #define SPEAKUP3_INS_AC_SWEPT_VERT 0x24 // Voice CMD: air swing up and down
111 #define SPEAKUP3_INS_AC_SWEPT_CROSS 0x25 // Voice CMD: air swing left and right
112 #define SPEAKUP3_INS_SET_RESTORE 0x26 // Voice CMD: air conditioner reset
113 #define SPEAKUP3_RESERVED_BYTE_1 0x00
114 #define SPEAKUP3_RESERVED_BYTE_2 0x00
121 #define TX_DRV_BUFFER_SIZE 100
122 #define RX_DRV_BUFFER_SIZE 200
140 #define SPEAKUP3_MAP_MIKROBUS( cfg, mikrobus ) \
141 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
142 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX );
@ SPEAKUP3_OK
Definition: speakup3.h:187
SpeakUp 3 Click context object.
Definition: speakup3.h:152
@ SPEAKUP3_ERROR
Definition: speakup3.h:188
err_t speakup3_wait_for_reply(speakup3_t *ctx, uint8_t *reply_ins, uint32_t wait_ms)
SpeakUp 3 wait for reply function.
uart_parity_t parity_bit
Definition: speakup3.h:176
pin_name_t rx_pin
Definition: speakup3.h:169
void speakup3_cfg_setup(speakup3_cfg_t *cfg)
SpeakUp 3 configuration object setup function.
bool uart_blocking
Definition: speakup3.h:174
err_t speakup3_generic_read(speakup3_t *ctx, char *data_out, uint16_t len)
SpeakUp 3 data reading function.
speakup3_return_value_t
SpeakUp 3 Click return value data.
Definition: speakup3.h:186
uint32_t baud_rate
Definition: speakup3.h:173
uart_stop_bits_t stop_bit
Definition: speakup3.h:177
#define RX_DRV_BUFFER_SIZE
Definition: speakup3.h:122
pin_name_t tx_pin
Definition: speakup3.h:170
err_t speakup3_init(speakup3_t *ctx, speakup3_cfg_t *cfg)
SpeakUp 3 initialization function.
uart_t uart
Definition: speakup3.h:154
err_t speakup3_generic_write(speakup3_t *ctx, char *data_in, uint16_t len)
SpeakUp 3 data writing function.
uart_data_bits_t data_bit
Definition: speakup3.h:175
#define TX_DRV_BUFFER_SIZE
SpeakUp 3 driver buffer size.
Definition: speakup3.h:121
SpeakUp 3 Click configuration object.
Definition: speakup3.h:167