#ifndef _aplmt_hardware_devantech_sp03_reqapi_h_ #define _aplmt_hardware_devantech_sp03_reqapi_h_ /*---------------------------------------------------------------------------- ** SUMMARY: Client ITC Interface for controlling the Devantech LTD SP03 ** text-to-speech synthesizer (ITCREQDEVANSP03). ** ** ITC ** --- ** This interfaace has the following ITC requirements and/or features: ** o Imsg/Imbox interface ** o LARGE model ** o AplmtImsgData must be void* or AplSize_t ** o Syncrhonous ITC API provided ** ** ** CONFIGURATION ** ------------- ** COMPILE: none. ** ** APPLICATION: APLMT_OPTION_DEVAN_SP03_IMSG_OFFSET. ** ** PLATFORM: none. ** ----------------------------------------------------------------------------*/ #include "aplcfg.h" /* For: Application configuration */ #include "apl/types/types.h" /* For: basic types */ #ifdef __cplusplus extern "C" { #endif /*-------------- MACROS ----------------------------------------------------*/ /** Macro to build the payload for imsg: APLMT_DEVAN_SP03_IMSG_SET_CONFIG volume: 0 - 7, where 0=loudest pitch: 0 - 7, where 0=highest speed: 0 - 3, where 0=slowest */ #define APLMT_DEVAN_SP03_ENCODE_CONFIG(volume,pitch,speed) _APLMT_DEVAN_SP03_ENCODE_CONFIG(volume,pitch,speed) /** The following macros are used to decode an encode configuration 8Bit word. */ #define APLMT_DEVAN_SP03_DECODE_VOL(encodedConfig) _APLMT_DEVAN_SP03_DECODE_VOL(encodedConfig) #define APLMT_DEVAN_SP03_DECODE_PITCH(encodedConfig) _APLMT_DEVAN_SP03_DECODE_PTICH(encodedConfig) #define APLMT_DEVAN_SP03_DECODE_SPEED(encodedConfig) _APLMT_DEVAN_SP03_DECODE_SPEED(encodedConfig) /*-------------- CONSTANTS -------------------------------------------------*/ /** This offset is added to the SP03 IMSG message IDs. This offset allows a single IMBOX server to support multiple APIs. */ #ifndef APLMT_OPTION_DEVAN_SP03_IMSG_OFFSET #define APLMT_OPTION_DEVAN_SP03_IMSG_OFFSET 0 #endif /** Raw ITC Message IDs */ #define APLMT_DEVAN_SP03_IMSG_SPEAK_TEXT _APLMT_DEVAN_SP03_IMSG_SPEAK_TEXT #define APLMT_DEVAN_SP03_IMSG_SPEAK_INDEX _APLMT_DEVAN_SP03_IMSG_SPEAK_INDEX #define APLMT_DEVAN_SP03_IMSG_SET_CONFIG _APLMT_DEVAN_SP03_IMSG_SET_CONFIG #define APLMT_DEVAN_SP03_IMSG_GET_CONFIG _APLMT_DEVAN_SP03_IMSG_GET_CONFIG /*-------------- INLINE IMPLEMENTATION -------------------------------------*/ #include "aplmt/hardware/devantech/sp03/req.h" /* For: inline implementation */ /*-------------- PUBLIC/PUBLISHED API --------------------------------------*/ /** This method will send the specified text with the specified configuration to the SP03. The textToSpeak must be a null terminated string that is 81 bytes or less. This method will block until the SP03 has completed speaking the phrase. Prototype: void AplmtDevan_sp03Speak( const char* textToSpeak ); */ #define AplmtDevan_sp03Speak _AplmtDevan_sp03Speak /** This method will speak one of the 30 pre-defined phases stored int the SP03. The phase index ranges from 0 to 29. This method will block until the SP03 has completed speaking the phrase. Prototype: void AplmtDevan_sp03SpeakIndex( Apl8 phaseIndex ); */ #define AplmtDevan_sp03SpeakIndex _AplmtDevan_sp03SpeakIndex /** This method will set the defaults for volume, pitch, and speed parameters. See definitions above for valid range for the vol, pitch, and speed parameters. Prototype: void AplmtDevan_sp03SetConfig( Apl8 vol, Apl8 pitch, Apl8 speed ); */ #define AplmtDevan_sp03SetConfig _AplmtDevan_sp03SetConfig /** This method returns the current volume, pitch, and speed configuration values. The values are compacted into a single 16bit word that must be decoded. Use the macros above to decode the individual values. Prototype: Apl8u AplmtDevan_sp03GetConfig( void ); */ #define AplmtDevan_sp03GetConfig _AplmtDevan_sp03GetConfig /*-------------- PUBLIC/PUBLISHED API --------------------------------------*/ /** This macro is used to plant the specified text payload in the specified imsg. It also initializes the message ID to the proper value. Prototype: AplmtImsgHdl APLMT_DEVAN_BUILD_IMSG_TEXT( AplmtImsgHdl imsg, const char* text ); */ #define APLMT_DEVAN_BUILD_IMSG_TEXT(imsg,text) _APLMT_DEVAN_BUILD_IMSG_TEXT(imsg,text) /** This macro is used to plant the specified text payload in the specified imsg. It also initializes the message ID to the proper value. Prototype: AplmtImsgHdl APLMT_DEVAN_BUILD_IMSG_INDEX( AplmtImsgHdl imsg, Apl8 phraseIndex ); */ #define APLMT_DEVAN_BUILD_IMSG_INDEX(imsg,idx) _APLMT_DEVAN_BUILD_IMSG_INDEX(imsg,idx) /** This macro is used to plant the specified text payload in the specified imsg. It also initializes the message ID to the proper value. Prototype: AplmtImsgHdl APLMT_DEVAN_BUILD_IMSG_SETCFG( AplmtImsgHdl imsg, Apl8u encodedCfg ); */ #define APLMT_DEVAN_BUILD_IMSG_SETCFG(imsg,cfg) _APLMT_DEVAN_BUILD_IMSG_SETCFG(imsg,cfg) /** This macro initializes the message ID to the proper value. Prototype: AplmtImsgHdl APLMT_DEVAN_BUILD_IMSG_GETCFG( AplmtImsgHdl imsg ); */ #define APLMT_DEVAN_BUILD_IMSG_GETCFG(imsg) _APLMT_DEVAN_BUILD_IMSG_GETCFG(imsg) #ifdef __cplusplus } #endif /*--------------------------------------------------------------------------*/ #endif /* end _aplmt_hardware_devantech_sp03_reqapi_h_ */