message.h File Reference


Detailed Description

Message module C header file.

REVISION

Definition in file message.h.

#include "../feature.h"

Include dependency graph for message.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Data Structures

struct  st_MSG
 Message structure. More...

Enumerations

enum  SYS_MSG {
  SSHUT_DOWN, SUSB_PLUG, SUSB_UNPLUG, SUSB_START, SUSB_STOP, SSTATE_START,
  SSTATE_END, SMENUBROWSE, SDBBROWSE, SBROWSE, SENDOFMENU, SMSGBOX_CREATE,
  SMSGBOX_EXIT, SCSF_NULL, SSF_NULL, SPSF_NULL, SCREATETASK, SXIM_CREATE,
  SXIM_EXIT, SSTATE_END_ACK, SSTART2PLAY, SSTOPPLAY, SRESUMEPLAY, SAUDIOCTL,
  SAUDIOTIME_UPDT, SENDOFMUSIC, SCURRENTAUDIOFILE, SNEXTAUDIOFILE, SVOLWIN_CREATE, SSTARTRADIO,
  SSTART2RECORD, SSTART2HISI, SMEMBAR_UPDT, SPOWERUP, SDISKDBREADY, SPOWER_LOW,
  SPOWER_PLUG, SPOWER_UNPLUG, SSHUFFLECHANGED, SREPEATCHANGED, SMIFIMODECHANGED, SMIFIQUALITYCHANGED,
  SMEDIAFULL, SPRESET, SGO2PRESET, SRTC_UPDT, SMYMIXCHANGED, SMYFICHANNELWIN_CREATE,
  SMYFICHANNELCHANGED, SBATLEVEL_UPDT, SBATLOW_SHUTDOWN, SPOWERUP_SEQUENCEDONE, SHIDDENFEATURE, SPLAYQCHANGED,
  SFORCEOFF, SINITSTATUSBAR, SDIAGNOSIS
}
 System message definition. More...
enum  LCD_MSG { LUPDATE }
 LCD message definition. More...
enum  TIMER_MSG
 Timer message definition.

Functions

MSGQ_HDL MSG_createQ (int)
 Function creates a message queue and return a queue handle.
BOOL MSG_send (MSGQ_HDL, st_MSG *, USHORT)
 Function sends message to the specified queue.
void MSG_get (MSGQ_HDL, st_MSG *, USHORT)
 Function gets message out of the process queue.
BOOL MSG_send2 (MSGQ_HDL, MSG_ID, MSG_DATA, MSG_DATA, USHORT)
 Function sends message to the specified queue.


Enumeration Type Documentation

enum LCD_MSG
 

LCD message definition.

Enumeration values:
LUPDATE  0

Definition at line 121 of file message.h.

00122 {
00123     LUPDATE             
00124 } LCD_MSG;

enum SYS_MSG
 

System message definition.

Enumeration values:
SSHUT_DOWN  0
SUSB_PLUG  1
SUSB_UNPLUG  2
SUSB_START  3
SUSB_STOP  4
SSTATE_START  5
SSTATE_END  6
SMENUBROWSE  7 specific menu browse request.
SDBBROWSE  8 specific DB menu browse request.
SBROWSE  9 generic UI browse request.
SENDOFMENU  10
SMSGBOX_CREATE  11
SMSGBOX_EXIT  12
SCSF_NULL  13 child UI is idle.
SSF_NULL  14 UI is idle.
SPSF_NULL  15 parent UI is idle.
SCREATETASK  16
SXIM_CREATE  17
SXIM_EXIT  18
SSTATE_END_ACK  19
SSTART2PLAY  20 setup play to start.
SSTOPPLAY  21 stop play completely.
SRESUMEPLAY  22 resume play window.
SAUDIOCTL  23 audio interface control
SAUDIOTIME_UPDT  24 audio time update.
SENDOFMUSIC  25 end of track playback.
SCURRENTAUDIOFILE  26
SNEXTAUDIOFILE  27
SVOLWIN_CREATE  28 create volume window.
SSTARTRADIO  29 bring up FM radio.
SSTART2RECORD  30 start to record.
SSTART2HISI  31 start to HiSi record.
SMEMBAR_UPDT  32 update memory bar.
SPOWERUP  33 system power up.
SDISKDBREADY  34 disk/DB system is ready.
SPOWER_LOW  35 power low.
SPOWER_PLUG  36 power plugged.
SPOWER_UNPLUG  37 power unplugged.
SSHUFFLECHANGED  38 shuffle mode changed.
SREPEATCHANGED  39 repeat mode changed.
SMIFIMODECHANGED  40 MyFi mode changed.
SMIFIQUALITYCHANGED  41 MyFi mode changed.
SMEDIAFULL  42
SPRESET  43 preset current audio.
SGO2PRESET  44 bring up preset audio/radio.
SRTC_UPDT  45 real time clock time update.
SMYMIXCHANGED  46 Mymix contents changed.
SMYFICHANNELWIN_CREATE  47 Create myfi channel window.
SMYFICHANNELCHANGED  48 Myfi channel has been changed.
SBATLEVEL_UPDT  49 update battery level display.
SBATLOW_SHUTDOWN  50 auto shut down when power is low.
SPOWERUP_SEQUENCEDONE  51 Power up sequence completion notice.
SHIDDENFEATURE  52 system hidden feature.
SPLAYQCHANGED  53 play queue contents changed.
SFORCEOFF  54 force system to turn off.
SINITSTATUSBAR  55 initialize the status bar.
SDIAGNOSIS  999 bring up diagnosis menu.

Definition at line 56 of file message.h.

00057 {
00058     SSHUT_DOWN,         
00059     SUSB_PLUG,          
00060     SUSB_UNPLUG,        
00061     SUSB_START,         
00062     SUSB_STOP,          
00063     SSTATE_START,       
00064     SSTATE_END,         
00065     SMENUBROWSE,        
00066     SDBBROWSE,          
00067     SBROWSE,            
00068     SENDOFMENU,         
00069     SMSGBOX_CREATE,     
00070     SMSGBOX_EXIT,       
00071     SCSF_NULL,          
00072     SSF_NULL,           
00073     SPSF_NULL,          
00074     SCREATETASK,        
00075     SXIM_CREATE,        
00076     SXIM_EXIT,          
00077     SSTATE_END_ACK,     
00078     SSTART2PLAY,        
00079     SSTOPPLAY,          
00080     SRESUMEPLAY,        
00081     SAUDIOCTL,          
00082     SAUDIOTIME_UPDT,    
00083     SENDOFMUSIC,        
00084     SCURRENTAUDIOFILE,  
00085     SNEXTAUDIOFILE,     
00086     SVOLWIN_CREATE,     
00087     SSTARTRADIO,        
00088     SSTART2RECORD,      
00089     SSTART2HISI,        
00090     SMEMBAR_UPDT,       
00091     SPOWERUP,           
00092     SDISKDBREADY,       
00093     SPOWER_LOW,         
00094     SPOWER_PLUG,        
00095     SPOWER_UNPLUG,      
00096     SSHUFFLECHANGED,    
00097     SREPEATCHANGED,     
00098     SMIFIMODECHANGED,   
00099     SMIFIQUALITYCHANGED,
00100     SMEDIAFULL,         
00101     SPRESET,            
00102     SGO2PRESET,         
00103     SRTC_UPDT,          
00104     SMYMIXCHANGED,      
00105     SMYFICHANNELWIN_CREATE, 
00106     SMYFICHANNELCHANGED,
00107     SBATLEVEL_UPDT,     
00108     SBATLOW_SHUTDOWN,   
00109     SPOWERUP_SEQUENCEDONE,
00110     SHIDDENFEATURE,     
00111     SPLAYQCHANGED,      
00112     SFORCEOFF,          
00113     SINITSTATUSBAR,     
00114     
00115     SDIAGNOSIS,         
00116     xxxxxxxxxxx
00117 } SYS_MSG;


Function Documentation

MSGQ_HDL MSG_createQ int  length  ) 
 

Function creates a message queue and return a queue handle.

Parameters:
length Message queue length.
Returns:
A valid message queue handle if successfully created, otherwise MSGQ_INVALID_HDL.

Definition at line 84 of file MSG_main.c.

Referenced by SYS_main(), UI_main(), and UI_parent().

00085 {   
00086     int ii = MSGQ_MAX_HDL;
00087     
00088     while(ii--)
00089     {
00090         if( NULL == msgQ[ii] ) break;
00091     }   
00092     
00093     if( -1 == ii ) return MSGQ_INVALID_HDL;
00094     
00095     msgQ[ii++] = MBX_create(sizeof(st_MSG), length, NULL);
00096     
00097     return( (MSGQ_HDL)ii | ((~ii+1)<< 8) );
00098 }

void MSG_get MSGQ_HDL  q,
st_MSG msg,
USHORT  timeout
 

Function gets message out of the process queue.

If the queue is empty, process will get suspended by the operating system.

Parameters:
q Message queue.
msg Message pointer.
timeout return after this many system clock ticks.

Definition at line 189 of file MSG_main.c.

References st_MSG::id.

00190 {
00191     unsigned char t = q&0x0ff;
00192     if( ((~t+1)<<8) == (q&0x0ff00) )
00193     {
00194         t--;
00195         MBX_pend(msgQ[t], msg, timeout);
00196     }
00197     else msg->id = INVALID_MSG_ID;
00198 }

BOOL MSG_send MSGQ_HDL  q,
st_MSG msg,
USHORT  timeout
 

Function sends message to the specified queue.

If the queue is full, caller will get suspended by the operating system.

Parameters:
q Message queue.
msg Message pointer.
timeout return after this many system clock ticks.
Returns:
TRUE if message successfully sent, otherwise FALSE.

Definition at line 132 of file MSG_main.c.

Referenced by MSG_send2(), SYS_main(), SYS_SF_idle(), SYS_SF_waitIdle(), TMR_main(), UI_CSF_msgbox(), UI_CSF_myfiChannel(), UI_CSF_null(), UI_CSF_volume(), UI_CSF_xim(), UI_SF_autoscan(), UI_SF_dbmenu(), UI_SF_menu(), and UI_SF_null().

00133 {
00134     unsigned char t;
00135     
00136     if( (SYS_isWatchDogSlept(15))&&(0 == timeout)&&(lcdMsgQ != q) ) 
00137     {
00138         return FALSE;
00139     }
00140     
00141     t = q&0x0ff;
00142     if( ((~t+1)<<8) == (q&0x0ff00) )
00143     {
00144         t--;
00145         return MBX_post(msgQ[t], msg, timeout);
00146     }
00147     return FALSE;
00148 }

BOOL MSG_send2 MSGQ_HDL  q,
MSG_ID  mID,
MSG_DATA  d1,
MSG_DATA  d2,
USHORT  t
 

Function sends message to the specified queue.

If the queue is full, caller will get suspended by the operating system.

Parameters:
q Message queue.
mID Message ID.
d1 Message data word 1.
d2 Message data word 2.
t return after this many system clock ticks.
Returns:
TRUE if message successfully sent, otherwise FALSE.

Definition at line 168 of file MSG_main.c.

References st_MSG::d1, st_MSG::d2, st_MSG::id, and MSG_send().

00169 {
00170     st_MSG msgOUT;
00171     msgOUT.id = mID;
00172     msgOUT.d1 = d1;
00173     msgOUT.d2 = d2;
00174     return MSG_send(q, &msgOUT, t);
00175 }

Here is the call graph for this function:


Generated on Wed Jan 19 01:13:12 2005 for neuros-firmware by  doxygen 1.3.9.1