LibDriver SYN6288E
Loading...
Searching...
No Matches
driver_syn6288e.h
Go to the documentation of this file.
1
36
37#ifndef DRIVER_SYN6288E_H
38#define DRIVER_SYN6288E_H
39
40#include <stdio.h>
41#include <stdint.h>
42#include <string.h>
43
44#ifdef __cplusplus
45extern "C"{
46#endif
47
53
58
90
105
127
138
147
151
156
179
180
190
194
199
203typedef struct syn6288e_handle_s
204{
205 uint8_t (*uart_init)(void);
206 uint8_t (*uart_deinit)(void);
207 uint16_t (*uart_read)(uint8_t *buf, uint16_t len);
208 uint8_t (*uart_flush)(void);
209 uint8_t (*uart_write)(uint8_t *buf, uint16_t len);
210 void (*delay_ms)(uint32_t ms);
211 void (*debug_print)(const char *const fmt, ...);
212 uint8_t type;
213 uint8_t mode;
214 uint8_t rate;
215 uint8_t volume;
217 uint8_t speed;
218 uint8_t inited;
219 uint8_t buf[256];
221
237
241
248
255#define DRIVER_SYN6288E_LINK_INIT(HANDLE, STRUCTURE) memset(HANDLE, 0, sizeof(STRUCTURE))
256
263#define DRIVER_SYN6288E_LINK_UART_INIT(HANDLE, FUC) (HANDLE)->uart_init = FUC
264
271#define DRIVER_SYN6288E_LINK_UART_DEINIT(HANDLE, FUC) (HANDLE)->uart_deinit = FUC
272
279#define DRIVER_SYN6288E_LINK_UART_READ(HANDLE, FUC) (HANDLE)->uart_read = FUC
280
287#define DRIVER_SYN6288E_LINK_UART_WRITE(HANDLE, FUC) (HANDLE)->uart_write = FUC
288
295#define DRIVER_SYN6288E_LINK_UART_FLUSH(HANDLE, FUC) (HANDLE)->uart_flush = FUC
296
303#define DRIVER_SYN6288E_LINK_DELAY_MS(HANDLE, FUC) (HANDLE)->delay_ms = FUC
304
311#define DRIVER_SYN6288E_LINK_DEBUG_PRINT(HANDLE, FUC) (HANDLE)->debug_print = FUC
312
316
323
332uint8_t syn6288e_info(syn6288e_info_t *info);
333
344uint8_t syn6288e_init(syn6288e_handle_t *handle);
345
356uint8_t syn6288e_deinit(syn6288e_handle_t *handle);
357
369uint8_t syn6288e_synthesis_text(syn6288e_handle_t *handle, char *text);
370
383
396
409
422
433uint8_t syn6288e_stop(syn6288e_handle_t *handle);
434
445uint8_t syn6288e_pause(syn6288e_handle_t *handle);
446
457uint8_t syn6288e_resume(syn6288e_handle_t *handle);
458
470
482
494
498
505
518
530
542
554
566uint8_t syn6288e_set_synthesis_volume(syn6288e_handle_t *handle, uint8_t volume);
567
578uint8_t syn6288e_get_synthesis_volume(syn6288e_handle_t *handle, uint8_t *volume);
579
591uint8_t syn6288e_set_background_volume(syn6288e_handle_t *handle, uint8_t volume);
592
603uint8_t syn6288e_get_background_volume(syn6288e_handle_t *handle, uint8_t *volume);
604
616uint8_t syn6288e_set_synthesis_speed(syn6288e_handle_t *handle, uint8_t speed);
617
628uint8_t syn6288e_get_synthesis_speed(syn6288e_handle_t *handle, uint8_t *speed);
629
633
640
652uint8_t syn6288e_set_command(syn6288e_handle_t *handle, char *command);
653
657
661
662#ifdef __cplusplus
663}
664#endif
665
666#endif
uint8_t syn6288e_set_background_volume(syn6288e_handle_t *handle, uint8_t volume)
set the synthesis background volume
syn6288e_baud_rate_t
syn6288e baud rate enumeration definition
uint8_t syn6288e_set_baud_rate(syn6288e_handle_t *handle, syn6288e_baud_rate_t rate)
set the baud rate
uint8_t syn6288e_get_synthesis_speed(syn6288e_handle_t *handle, uint8_t *speed)
get the synthesis speed
uint8_t syn6288e_get_baud_rate(syn6288e_handle_t *handle, syn6288e_baud_rate_t *rate)
get the baud rate
uint8_t syn6288e_get_synthesis_volume(syn6288e_handle_t *handle, uint8_t *volume)
get the chip synthesis volume
uint8_t syn6288e_set_synthesis_speed(syn6288e_handle_t *handle, uint8_t speed)
set the synthesis speed
syn6288e_mode_t
syn6288e mode enumeration definition
uint8_t syn6288e_set_synthesis_volume(syn6288e_handle_t *handle, uint8_t volume)
set the chip synthesis volume
uint8_t syn6288e_get_background_volume(syn6288e_handle_t *handle, uint8_t *volume)
get the chip synthesis background volume
uint8_t syn6288e_get_mode(syn6288e_handle_t *handle, syn6288e_mode_t *mode)
get the chip mode
uint8_t syn6288e_set_mode(syn6288e_handle_t *handle, syn6288e_mode_t mode)
set the chip mode
@ SYN6288E_BAUD_RATE_9600_BPS
@ SYN6288E_BAUD_RATE_19200_BPS
@ SYN6288E_BAUD_RATE_38400_BPS
@ SYN6288E_MODE_BACKGROUND_8
@ SYN6288E_MODE_BACKGROUND_15
@ SYN6288E_MODE_BACKGROUND_5
@ SYN6288E_MODE_BACKGROUND_13
@ SYN6288E_MODE_BACKGROUND_7
@ SYN6288E_MODE_BACKGROUND_4
@ SYN6288E_MODE_COMMON
@ SYN6288E_MODE_BACKGROUND_10
@ SYN6288E_MODE_BACKGROUND_1
@ SYN6288E_MODE_BACKGROUND_3
@ SYN6288E_MODE_BACKGROUND_6
@ SYN6288E_MODE_BACKGROUND_12
@ SYN6288E_MODE_BACKGROUND_14
@ SYN6288E_MODE_BACKGROUND_11
@ SYN6288E_MODE_BACKGROUND_9
@ SYN6288E_MODE_BACKGROUND_2
syn6288e_type_t
syn6288e type enumeration definition
uint8_t syn6288e_synthesis_text(syn6288e_handle_t *handle, char *text)
synthesis the test
uint8_t syn6288e_synthesis_sound(syn6288e_handle_t *handle, syn6288e_sound_t sound)
synthesis the sound
syn6288e_message_t
syn6288e message enumeration definition
syn6288e_ring_t
syn6288e ring enumeration definition
uint8_t syn6288e_init(syn6288e_handle_t *handle)
initialize the chip
uint8_t syn6288e_synthesis_ring(syn6288e_handle_t *handle, syn6288e_ring_t ring)
synthesis the ring
uint8_t syn6288e_deinit(syn6288e_handle_t *handle)
close the chip
uint8_t syn6288e_info(syn6288e_info_t *info)
get chip's information
uint8_t syn6288e_set_text_type(syn6288e_handle_t *handle, syn6288e_type_t type)
set the chip text type
struct syn6288e_handle_s syn6288e_handle_t
syn6288e handle structure definition
uint8_t syn6288e_get_text_type(syn6288e_handle_t *handle, syn6288e_type_t *type)
get the chip text type
struct syn6288e_info_s syn6288e_info_t
syn6288e information structure definition
uint8_t syn6288e_get_status(syn6288e_handle_t *handle, syn6288e_status_t *status)
get the current status
uint8_t syn6288e_stop(syn6288e_handle_t *handle)
stop the chip
uint8_t syn6288e_power_down(syn6288e_handle_t *handle)
power down the chip
uint8_t syn6288e_synthesis_message(syn6288e_handle_t *handle, syn6288e_message_t message)
synthesis the message
uint8_t syn6288e_pause(syn6288e_handle_t *handle)
pause the chip
syn6288e_status_t
syn6288e status enumeration definition
uint8_t syn6288e_resume(syn6288e_handle_t *handle)
resume the chip
syn6288e_sound_t
syn6288e sound enumeration definition
@ SYN6288E_TYPE_GBK
@ SYN6288E_TYPE_BIG5
@ SYN6288E_TYPE_UNICODE
@ SYN6288E_TYPE_GB2312
@ SYN6288E_MESSAGE_B
@ SYN6288E_MESSAGE_H
@ SYN6288E_MESSAGE_F
@ SYN6288E_MESSAGE_A
@ SYN6288E_MESSAGE_G
@ SYN6288E_MESSAGE_C
@ SYN6288E_MESSAGE_E
@ SYN6288E_MESSAGE_D
@ SYN6288E_RING_N
@ SYN6288E_RING_G
@ SYN6288E_RING_F
@ SYN6288E_RING_B
@ SYN6288E_RING_H
@ SYN6288E_RING_M
@ SYN6288E_RING_J
@ SYN6288E_RING_D
@ SYN6288E_RING_K
@ SYN6288E_RING_I
@ SYN6288E_RING_C
@ SYN6288E_RING_L
@ SYN6288E_RING_E
@ SYN6288E_RING_A
@ SYN6288E_RING_O
@ SYN6288E_STATUS_OK
@ SYN6288E_STATUS_BUSY
@ SYN6288E_SOUND_B
@ SYN6288E_SOUND_E
@ SYN6288E_SOUND_Q
@ SYN6288E_SOUND_M
@ SYN6288E_SOUND_G
@ SYN6288E_SOUND_S
@ SYN6288E_SOUND_P
@ SYN6288E_SOUND_U
@ SYN6288E_SOUND_J
@ SYN6288E_SOUND_T
@ SYN6288E_SOUND_K
@ SYN6288E_SOUND_O
@ SYN6288E_SOUND_W
@ SYN6288E_SOUND_I
@ SYN6288E_SOUND_D
@ SYN6288E_SOUND_F
@ SYN6288E_SOUND_X
@ SYN6288E_SOUND_N
@ SYN6288E_SOUND_C
@ SYN6288E_SOUND_L
@ SYN6288E_SOUND_Y
@ SYN6288E_SOUND_V
@ SYN6288E_SOUND_H
@ SYN6288E_SOUND_R
@ SYN6288E_SOUND_A
uint8_t syn6288e_set_command(syn6288e_handle_t *handle, char *command)
send the command to the chip
syn6288e handle structure definition
uint8_t(* uart_flush)(void)
uint8_t(* uart_write)(uint8_t *buf, uint16_t len)
void(* delay_ms)(uint32_t ms)
uint8_t(* uart_deinit)(void)
void(* debug_print)(const char *const fmt,...)
uint16_t(* uart_read)(uint8_t *buf, uint16_t len)
uint8_t(* uart_init)(void)
syn6288e information structure definition
char manufacturer_name[32]