The AT85C51SND3Bx is a low power single-chip highly-integrated digital audio
decoder/encoder for applications such as audio players, recorders, cell phones, toys…
The AT85C51SND3Bx MP3 Player firmware is part of the AT85DVK-07 development kit
or th e AT8 5 RF D- 07 ref er e nc e des i gn ded i ca te d to t he AT 8 5C 51 SN D3 Bx
microcontroller.
This document is the User’s Guide of the AT85C51SND3Bx MP3 Player firmware.
The topics covered are:
the functional features and options that the firmware brings
how the firmware source code files are organized
the firmware architecture
how to configure the firmware
the MMI layer
The AT85C51SND3Bx firmware described in this document has been developed to run
on the AT85DVK-07 as well as the AT85RFD-07.
For more information on the AT85DVK-07 development board, refer to the documents
“AT85DVK-07 Hardware User’s Guide” and “AT85DVK-07 Demonstration Firmware
User’s Manual”, available on the Atmel web site.
For more information on the AT85RFD-07 development board, refer to the documents
“AT85RFD-07 Hardware User’s Guide” and “AT85RFD-07 Demonstration Firmware
User’s Manual”, available on the Atmel web site.
AT85C51SND3Bx Firmware User’s Guide1-1
7691A–MP3–08/07
Section 2
Firmware Features
The following sections describe the AT85C51SND3Bx firmware features and options.
Some of the firmware options are not supported by the AT85DVK-07 (e.g. image viewer)
or by AT85RFD-07 (e.g. MMC support).
2.1MMI Manager
2.1.1FeaturesApplication management
2.1.2ConfigurationApplications names
2.2Device USB
2.2.1FeaturesUSB 2.0, High and Full Speed Transfer
This module allows customers to easily develop their own MMI applications.
– execute
– kill
Mailbox management
– send command to system drivers
– get event from system drivers or MMI applications
– forward event to MMI applications
Software timers
Animated icons
MMI events creation
This module is the USB mass-storage driver.
Class provide : Mass Storage, HID, CDC.
Mass Storage Class :
– rate performance :
typical, 10MB/s read - 8MB/s write on NandFlash
up to 12MB/s on MMC V4 / SD / SD HC
– Supported hosts : Win XP, Win 2K, Mac OSx, Linux
– Secure disk option content through password management
AT85C51SND3Bx Firmware User’s Guide2-3
7691A–MP3–08/07
Firmware Features
2.2.2ConfigurationConnection Speed
– authorize high or full speed (depending on the host)
– authorize only full speed
enable/disable USB Class used (Mass Storage, HID, CDC)
USB device information (vendor ID, product ID, manufacturer name, ...)
– product name
– serial number
Class description (Class name, ...)
enable/disable Disk Password Management (for Mass Storage Class)
2.3Host USB
This module is the USB host driver.
2.3.1FeaturesReduced host implementation
USB 2.0 full speed transfer with USB device
USB class provide:
– HUB
– Mass-storage (e.g. Udisk, multi-card reader)
– HID
– CDC
2.3.2Configurationenable/disable USB class supported
2.4Audio Player
This module allows the end-user to play some audio stream.
2.4.1FeaturesAudio stream
– MP1, MP2, MP3
– WMA
– WAV (PCM, G711, G726)
Stream management
– play
– pause
– stop
– next track
– previous track
– fast Forward
– fast Rewind
– repeat A/B
– speed Adjust (MP1, MP2, MP3 only)
2-4AT85C51SND3Bx Firmware User’s Guide
7691A–MP3–08/07
Stream Information
– synchronized play time
– bit rate
– sampling frequency
– number of channels
Tags
– ID3 v1.0, v1.1
– ID3 v2.2 and v2.3
Stereo volume control
Sound effects:
– bass boost
– spatial sound
Adjustable 3-band EQ
– Classic, Pop, Jazz, Rock…
2.4.2ConfigurationDAC Output Selection
– internal
– external
Firmware Features
External DAC interface
2.5Audio Recorder
2.5.1FeaturesRecording (codec G726)
2.5.2Configurationline in gains (analog & digital)
2.6Image Viewer
2.6.1FeaturesSupported Image Format:
2.6.2ConfigurationNone
This module allows the end-user to play and record audio streams.
Input line in and micro
micro gains (analog & digital)
This module allows the end-user to display images.
– BMP
– JPEG
Automatic Resize
2.7Settings
AT85C51SND3Bx Firmware User’s Guide2-5
This module allows the user to manage user data in the setting segment located in the
customer or reserved data area of the Nand Flash.
Code swap between SND3 and Nand Flash (use system area code)
Store a large constant data in the NandFlash (use system area font and display)
2.16.2ConfigurationMemory mapping
Banking code space
AT85C51SND3Bx Firmware User’s Guide2-9
7691A–MP3–08/07
3.1Directory Physical Structure
The AT85C51SND3Bx MP3 player firmware source code is composed of several files.
This section describes the directory organization of the firmware package.
Section 3
Source Files Organization
3.1.1snd3b-dvk-x_y_z
Directory
3.1.2_isp_modules
Directory
The snd3b-dvk-x_y_z directory contains the firmware package where x_y_z is the firmware version.
.................ISP files: codec, picture_, font
.............................................user’s system configuration files
.............................................user’s MMI peripherals high-level API source code
.............................................Include file to enable and put traces
Note:mcu_drv.h file defines a list of masks related to peripherals controller and provides a list
of macro-functions that maps SFR and pages.
The AT85C51SND3Bx implements a SFR pagination mechanism which allows mapping
of high number of peripherals in the SFR space. Four pages are accessible through the
PPCON register.
3.1.10Tools directoryThe tool directory contains the Atmel image converter as well as the project images.
.............MMI pictures and image converter tool
.............................................Windows® USB drive secure executable
3.2Directories
Logical
Organization
This purpose of this view is to show the logical links between the directories.
These source file directories can be grouped into two firmware parts:
– the customer MMI firmware
– the Atmel system firmware
The customer MMI firmware is the code source you have to develop and customize from
the software platform delivered with this package. Indeed, this layer is dedicated to interface the user with the high-level services provided by the Atmel core firmware and the
AT85C51SNDA chip. See Firmware Architecture Section 5.
The Atmel system firmware is the code source you should not modify since this layer
has been designed to provide full and high-performance services from a low cost chip.
Only the configuration files are to set in order to configure this layer to your application
requirements. See Firmware Configuration Section 6.
3-14AT85C51SND3Bx Firmware User’s Guide
7691A–MP3–08/07
Section 4
Code & Data Management
4.1Principle
4.1.1Custom memory
organisation
4.1.1.1Rulesxdata space size + code space size = 64KB – 512B
The SND3 chip permits:
to customise the memory organisation
to use a code swap feature (= code banking)
to store a large constant data in the NandFlash
Reminder: The C51 core use different memory space (code, data, xdata). The size of
data space is 256B. The size of code space is limited at 64KB and xdata space is limited
at 64KB.
The AT85C51SND3B chip uses a 64KB of RAM to store the data and code, this particularity permits to configure the memory size according to your needs.
code space size = code common size + code bank size*
AT85C51SND3Bx Firmware User’s Guide4-15
7691A–MP3–08/07
Code & Data Management
64KB RAM
data
reserved
xdata
bank code
common code
256B
256B
Customizable
Customizable
Customizable
xdata space size, code common size and code bank size* shall be a modulo 512B.
4.1.1.2How to configure You must change the configuration in the « option.h » header file by defining following
constants:
•XDATA_LENGTH
•CODE_BANKING
•BANK_START_ADDRESS
Note:There are no « code size » #define, because this one is automatically computed using
XDATA_LENGTH.
You must modify the UV2 project according to « option.h » header file;
Figure 4-2. options are in ‘Options for Target’ pop-up in Target tab
Figure 4-3. options are in ‘Options for Target’ pop-up in BL51 Misc tab (linker file
player.lin)
WARNING : At compile time, there are no automatic coherency check between « UV2
project option » and « option.h » (no error and no warning). The execution code may be
corrupted if a difference exists.
AT85C51SND3Bx Firmware User’s Guide4-17
7691A–MP3–08/07
Code & Data Management
64KB RAM
data
reserved
xdata
bank code
common code
Loading once at startup
system code area
bank N
bank N-1
...
bank 1
common code
of Nand Flash
bank 2
Loading for each
bank change
4.1.2Code swap
4.1.2.1PrincipleThe code load swap consists in the downloading of temporary codes in a part of the
microcontroller code section to be executed immediately. When this temporary code has
been completely run, the microcontroller automatically runs back on the permanent
code or a previous temporary code. This makes it possible to have a code memory
space share for temporary codes, expanding then the total code beyond the 64KBytes.
Indeed, the downloading of code with deciphering produces a non-insignificant overhead time (above 0.1s). The critical code section, that is the system part, must react as
quick as possible with the hardware layer. Also, the code load swap must be rarely executed to not load the CPU with overhead routines to the detriment of the system
reactivity.
Figure 4-4. Code load swap representation
4.1.2.2MechanismThe code load swap mechanism is based on the code banking frame available under
the en v ir o n me n t Ke i l µV is i on . I nd e ed , th e as s em b ly fi le “l i b_ s y st e m\ b an k ing\l51_bank.a51” has been deeply customized by Atmel to link code-load-swap
routines to the code banking frame. Also, the debugger has been reworked to support
the code load swap and the downloading of code banks will be transparent for you in
debugging mode in a future software delivery.
Thus, the code-load-swap mode is fully supported under the environment Keil µVision
4-18AT85C51SND3Bx Firmware User’s Guide
7691A–MP3–08/07
enabling you to develop software beyond the 64K of the code memory space without
difficulty.
Code & Data Management
4.1.2.3How to activate code
banking?
Code banking enable are in the ‘Option for Targets’ pop-up in the Target tab.
Figure 4-5. Keil µVision ‘Option for Target’ window
– Check the box “Code Banking” and select the maximum number of banks that
your application may have to support. For information, the banking frame code
size increases with the number of available banks. This number must be reported
in the file “lib_system\banking\l51_bank.a51” at the following definition
“?B_NBANKS EQU 4”.
– Check that the “Bank Area Start” value matches with the one defined in the file
“option.h” as follows: “#define BANK_START_ADDRESS 0xC800”. This value
defined in the file “option.h” should not be modified since this common code (not
banked) is mainly the one of the Atmel system firmware.
– Check that the “Bank Area End” value matches with the code range end address
defined in the tab “BL51 Locate”. This value, incremented by 1, must be also
reported in the file “option.h” at definition “#define XDATA_LENGTH …”.
The files building generates as many binary files as banks used with the following
extensions:
– B00, B01, B02, … for binary bank files
– H00, H01, H02, … for hex bank files
– All the binary bank files are created in a 64K code space including the duplicated
common code.
AT85C51SND3Bx Firmware User’s Guide4-19
7691A–MP3–08/07
Code & Data Management
4.1.2.4How store a file in a
bank ?
To store all routines from a C file in a bank , you must set a bank number in file options
in KEIL.
Figure 4-6. Banking a C file
Note:The bank #0 is not to be used, it is reserved for the proper working of the code load swap
mechanism. Indeed, it’s the MMI application “mmi_dummy” that takes up this bank
although the application does nothing. This configuration must not be modified.
If the constant code present in C file banked are used only in C file, then you can bank
the constant code in the same bank. Add the line “?CO?FILE_NAME” in the corresponding bank field in player.lin file, e.g. :
4.1.2.5How store a routine
in bank ?
4.1.2.6Banking
organisation in
ATMEL firmware
BANK7(?CO?FAT_UNUSUAL(0xBE00),?CO?SETTING)
Note:It is not autorized to bank constant code if the file is not banked.
To store a routines in a bank, add the line “?PR?ROUTINE?FILE_NAME” in a bank field
in player.lin file, e.g. :
BANK7(...(0xBE00),?PR?NAV_FILE_RENAME?NAVIGATION)
The Atmel firmware stores in the same bank all modules which are used for the same
mode.
e.g. :
in BANK 2, there are the file mmi_player.c, srv_player.c, player.c which are call only in
player mode. The player_task.c isn’t banked because is call always by scheduler in all
modes.
All MMI and service files are stored in bank space excepted the MMI files low level
which are dedicated to translate hardware or system events in actions or informations to
the other MMI applications that are in charge to supervise the functional modes (Ex.:
mmi_status, mmi_info, …).
If a routines or modules don’t correponding at a specific mode but there are few call or
never call, then ATMEL firmware store this one in a bank.
The AT85C51SND3Bx firmware is a software platform that provides full and high-level
easy to use services. The architecture was carefully designed for both quick chip configuration and easy customizing.
This achievement is due to the splitting of the firmware in two parts:
The Atmel core firmware:
– provides full and high-level services (USB management, power management,
The firmware system is driven by an endless scheduler which activates tasks, one at a
time, in a round robin manner. The scheduler loops on a static list. Refer to Section
6.2.12 for configuring the scheduler.
Note that each task executes “at will”, i.e. the duration of their execution is not limited.
Thus, in order to have the system running smoothly, each task should perform its duty
for the shortest amount of time.
Task is a generic entity that provides well-defined services to the Customer MMI layer. It
integrates the on-chip peripherals and the software layer that controls them and provides high-level information.
Figure 5-3. Inner task logic representation.
The Atmel demo firmware implements 8 tasks:
– MMI manager task
– Power task
– USB task
– Player task
5.3.3The Inter-Task
Communication
– Recorder task
– Viewer task
– Explorer task
– Update task
The bi-directional communication system between tasks is based on the management
of two kind of messages: “command” and “event”.
“command” is a request that a task does a specific action. The “command”
messages can be mailed by tasks or MMI applications. They are destined to all
tasks except the MMI manager task.
5-24AT85C51SND3Bx Firmware User’s Guide
7691A–MP3–08/07
Architecture
cm d _id
task_id
cm d _idcm d _id
15 8 7 0
par am
task _cm d_id
15 8 7 0
evt _id
7 0
evt
para m
15 8 7 0
“event” is an information dedicated to MMI applications, sent by a task to inform on
its status or to give feedback of a previously executed command.
These messages are mailed in two separate mailboxes, based on FIFO stacks.
The uni-directional communication system is the direct access at the public routines provide by modules.
5.3.3.1Message Format
Command and event messages are composed of 2 words:
– a unique ID
– an optional 16-bit parameter
Command message format
Figure 5-4. Command message format
The command message ID is composed of two bytes that define:
– the task to which this message is dedicated (“task_id”)
– the ID of one of the task commands to execute (“task_cmd_id”)
Command messages are defined in the file “lib_system\mailbox\mail_cmd.h”.
Event message format
Figure 5-5. Event message format
AT85C51SND3Bx Firmware User’s Guide5-25
The event message IDs are 8-bit values. One of the tasks are frozen and defined in the
file “lib_system\mailbox\mail_evt.h”.
Event messages can be defined by the customer to make possible specific communication s be tw e e n MM I appli c a t io n s. Th e s e mu s t be de f in e d i n th e cu st o m fil e
“mmi\common\com_evt.h”.
Message parameter
The optional “param” is a 16-bit argument being able to pass data of different types:
– one or two single bytes with the help of the macros LSB(), MSB():
LSB(param) = byte1; MSB(param) = byte2;
– the address of data, on 16 bits only although supplementary bits are required to
get the complete address of data. Thus, the memory type to which the data
belongs must be known at the delivering of this kind of message to point properly
the data.
// Preparation in message mailing
xdata U8 table[10];
param = U16( &table[0] );
// Message delivery
_MEM_TYPE_SLOW_ U8* ptr_table;
ptr_table = (xdata U8*) param;
7691A–MP3–08/07
Architecture
Command
mailbox
Event
mailbox
mail_send_event(
U8 evt_id, U16 param
);
mail_send_command(
U16 cmd_id, U16 param
);
mail_get_event(
U8 task_id, Msg *p_evt_msg
);
mail_send_command(
CMD_USB_START, 0
);
mail_get_command(
U8 task_id, Msg *p_cmd_msg
);
mail_get_command(
TASK_MASS, &cmd_msg
);
mail_get_event(
TASK_MASS, &evt_msg
);
mail_send_event(
EVT_USB_POWERED, 0
);
Command
mailbox
Event
mailbox
mail_send_event(
U8 evt_id, U16 param
);
mail_send_command(
U16 cmd_id, U16 param
);
mail_get_event(
U8 task_id, Msg *p_evt_msg
);
mail_send_command(
CMD_USB_START, 0
);
mail_get_command(
U8 task_id, Msg *p_cmd_msg
);
mail_get_command(
TASK_MASS, &cmd_msg
);
mail_get_event(
TASK_MASS, &evt_msg
);
mail_send_event(
EVT_USB_POWERED, 0
);
5.3.3.2Messages
Management
5.3.4MMI Manager task
The following functions located in file “lib_system\mailbox\mail.c” make it possible the
mailing and the delivery of messages.
Figure 5-6. Mailbox interface functions
These two mailboxes can store up to 8 messages according to the configuration done in
file “config.h”.
The MMI Manager task (also named “mmgr_kernel”) is dedicated in the management of
the MMI applications. It can be split into three processes:
– Keyboard management: filters key bouncing and mails event messages when
actions on keys
– Software timers: are 32-bit timers dedicated to MMI applications and mails event
messages when the timer overflows
– Application manager: manages the execution of MMI applications running at the
same time and mails some events
5.3.4.1Application Manager
Principles
5-26AT85C51SND3Bx Firmware User’s Guide
7691A–MP3–08/07
The management of MMI applications is based on a LIFO stack that keeps in memory
the applications launched and runs them in the order in which they have been launched.
Thus, the last application launched (being at the top of the stack) is the first executed to
treat the input event. If this event was not dedicated to the top application, it is forwarded
to the following one stacked. Thus, several applications can be launched and run independently at the same time, making easy and flexible the development of the custom
MMI layer. See Figure 5-7.
Figure 5-7. MMI manager principle
MMI_APPLI_STATUS
MMI_APPL_IDLE
MMI_APPLI_X
LIFO application
stack
evt
cmd
inout
customer
applications
MMI_APPLI_STATUS
MMI_APPLI_IDLE
...
MMI_APPLI_X
last launched
application is
placed at the top
highest
priority
lowest
priority
p
r
o
c
e
s
s
i
n
g
evt
mmi manager kernel
evt
Architecture
The MMI application “status” is loaded first in the application stack at the initialization of
the MMI manager task. So, it’s always the first MMI application executed since it temporarily manages the start-up and then is in charge of managing the status of hardware
devices commonly shared with the majority of MMI applications.
The MMI application “status” has also launched the application “idle”. Indeed, some
functions and macros make it possible to launch the MMI applications from other ones
and request their finalization.
AT85C51SND3Bx Firmware User’s Guide5-27
7691A–MP3–08/07
Architecture
5.4MMI Applications
5.4.1Application IDs
5.4.2Generic Modules
MMI applications are source code executed under the control of the MMI manager kerel.
To achieve this control and to offer flexibility, they organized in modules, are based on a
template and are associated to IDs. This one can be use a services MMI which include a
usual code sequence to use provided by ATMEL.
Two kinds of 8-bit ID are associated to MMI applications:
Module ID
ID making statically reference to a MMI application, defined by the customer. It’s with
the help of this ID that a MMI application can be executed.
Process ID
ID dynamically linked to a MMI application at the time of its pushing in the stack and kept
until it is terminated by an action. This ID enables an application to know if the launched
application is still activated or placed at the top of the stack. As the process ID is unique
contrary to the module ID, several applications of the same type can run at the same
time without problem of identity usurpation.
All MMI applications must integrate the following rules to keep the actual and new code
readable (“custom” is to replace with the functionality name of new MMI application to
develop):
Source code files
– named as “mmi_custom.c/h
– located in a new folder “mmi\custom”
– template available at location “mmi\_template”
Application module ID
– label definition with a unique value: #define MMI_APPLI_CUSTOM value
– located in “mmi\shared\com_appli.h”
– used to launch the application custom
Interface function with the MMI manager kernel
– prototype to declare in the common MMI application file
– reference to integrate in the switch-case of the function “call_mmi_appli()” in the
file “mmi\shared\com_appli.c”
Internal processing of the interface function
5-28AT85C51SND3Bx Firmware User’s Guide
7691A–MP3–08/07
Architecture
– a “switch-case” processes all in-coming events
Figure 5-8. internal switch-case processing
This minimal structure to respect is to get a proper control of all new MMI applications by
the MMI manager kernel.
5.4.3Useful Functions
and Macro-functions
Th e three basic system events “EVT_START_ A P PLI”, EVT_APPLI_K I L L E D ”,
EVT_BACK_TO_TOP” and others are defined in “lib_system\mailbox\mail_evt.h”.
A set of functions and macros enabling the MMI applications to interface to the MMI
manager kernel are listed in the two separate tables for requests and status.
Requests
The request table Table 5-1 gives precisely the running priority of the requests since
they are not executed in the order of their calls. Indeed, the MMI manager kernel translates all requests into events, treated with more or less delay according as they are
mailed or not.
A non-mailed event is executed immediately by the MMI manager kernel when it takes
control led by MMI applications.
A mailed event is a commonly treated after the scheduler has completed a cycle. It shall
be executed just after the all non-mailed events are treated in order to maintain the
event mailbox half empty before giving back control to the system firmware.
AT85C51SND3Bx Firmware User’s Guide5-29
7691A–MP3–08/07
Architecture
Table 5-1. Requests from MMI applications to MMI manager kernel
Functions or Macro-functionsDescription
mmgr_activate_mmi_appli(
U8 id_appli, U16 param )
Mmgr_krn_forward_current_event()Forwards the current event since not caught by the current
Mmgr_kill_this_mmi_appli()
Mmgr_kill_this_mmi_appli_with_ret
_val( U8 val )
Mmgr_krn_this_mmi_appli_is_full_s
creen()
Mmgr_set_id_appli_not_defined()Sets a custom variable containing the process id of a running
Launches an MMI application by pushing it in the application
stack with the help of two arguments:
- id_appli: the module id defined by the developper in file
“mmi\shared\com_appli.h”
- param: extra 16-bit parameter.
The application is normallyexecuted after a scheduler round.
Returns the associated unique id delivered by the application
stack.
application.
This immediately gives control to the following stacked
application with the help of this event.
Terminates the current application by popping the MMI
application out of the application stack.
This immediately gives control to the following stacked
application with the help of a specific non-mailed event
“EVT_APPLI_KILLED”.
Idem as “Mmgr_kill_this_mmi_appli()” but additional information
is stored in the 16-bit parameter of the event
“EVT_APPLI_KILLED”:
killed application process ID in the MSB
8-bit data in the LSB
Informs the MMI manager kernel that this current application has
a graphical full screen (Partial screen by default).
This information enables the MMI manager kernel to manage the
automatic screen refreshing.
This macro is to execute once in the “EVT_START_APPLI” code
section.
application to the value “MMI_APPLI_NOT_DEFINED” when this
application does not run anymore (not stacked).
Run
Prior.
3(4)
2
1
4(3)
2
-
2
-
Event
NameMailed
1
EVT_START_APPLIyes
Current event:
EVT_ …
EVT_APPLI_KILLED
EVT_BACK_TO_TOP
1
No event-
No event-
no
no
yes
Notes:1. Run priority between these two requests depends on the call order
2. No impact on MMI application execution order
Status
Table 5-2. Status on MMI applications being executed by the MMI manager kernel
Functions or Macro-FunctionsDescription
5.4.4Automatic Screen
Refreshing
Mmgr_is_this_appli_at_the_top()Macro called by a MMI application to test if is at the top in the
mmgr_is_appli_at_the_top(U8
id_process )
The automatic screen refreshing consists in the redrawing of application screens when
a top application has just been terminated. This mechanism is linked to the event
application stack. Mainly used for drawing.
Function with a parameter “id_process”, value only returned by
“mmgr_activate_mmi_appli()”. Called by MMI applications to know if
such an application is at the top or not. Mainly used for drawing.
EVT_BACK_TO_TOP.
The automatic screen refreshing is done in two steps:
– First, the first application that has the feature “full screen” is searched from the
top of the stack.
5-30AT85C51SND3Bx Firmware User’s Guide
7691A–MP3–08/07
Architecture
– Secondly, from this application up to the top one, their screens are redrawn one
after the others.
Thus, this mechanism makes it possible to redraw superimposed non-full-screen windows automatically.
5.4.5Automatic display
The automatic display module is charged with managing the display of time-related
graphical objects. It enables to make easily animations from pictures placed in a special
directory “tools\picture_maker\pictures_demo_default\Animations”. The basic pictures
composing a future animation picture must be named as follows:
animationpicturename__index.bmp
index can be digits and letters: it is useful to define the integration order.
The animation pictures are generated at the same time as the other ordinary pictures by
the picture maker tool. Make live animation pictures in the firmware with the following
functions and macros:
Table 5-3. Functions and macros controlling the automatic display
ad_start( U8 id )Starts the graphical object running
ad_pause( U8 id )Suspends the graphical object in running
ad_stop( U8 id )Stops the graphical object running and resets its state machine
ad_refresh( U8 id )Requests the display refresh of the graphical object
Ad_free( U8 id )Releases one of the graphical object and sets the variable storing the id to
Description
Allocates one of the graphical object slots still available and returns a 8-bit
ID. The ID is equal to “UNDEF_AD_OBJ” if failure in allocation.
If success, this ID is to store by the MMI application in order to control the
object with the help of the other functions and macros below.
Note:No risk of object identity usurpation after a cold reset since the
value of “UNDEF_AD_OBJ” is 0.
Parameters:
Only object type is currently supported: AD_ID_ANIMATION.
The parameter structure “Ad_p_prm _MEM_TYPE_SLOW_” configured
the object in its appearance and its behavior. As the only one object type
actually supported is animation, the structure “Ad_p_prm” is always
“Ad_prm_animation” as follows:
typedef struct
{
U8x; // x-coordinate
U8y; // y-coordinate
U32 IDP;// ID of the animation picture
U8time_10ms; // Time with 10ms granularity
U8mode;// Repeat: AD_SINGLE or AD_FOREVER
}Ad_prm_animation;
the value “UNDEF_AD_OBJ” in order to prevent from identity usurpation.
Note:Event EVT_ANIMATION with parameter ANIMATION_END is mailed when animation
stops in mode AD_SINGLE.
5.4.6Software Timers
The software timers are data structures integrating a 32-bit register. Their static values
are compared to the value of the tick counter every scheduler round. If the tick counter
value has reached a software timer time register, an overflow timer message is mailed
once.
AT85C51SND3Bx Firmware User’s Guide5-31
7691A–MP3–08/07
Architecture
T h e nu mb e r of a va i la bl e s of tw a re t im e rs i s se t t o 10 u si n g th e ma c ro
“NB_TIMER_SOFT”. The tick period is set to 2ms using the macro TICK_PERIOD.
These macros are defined in “config.h” and should not be modified.
The software timers are dedicated to MMI applications and dynamically attributed by the
software timer management. Some functions and macros enables the MMI applications
to control these kind of timers.
Table 5-4. Functions and macros controlling the software timers
Functions or macrosDescription
ts_alloc()Allocates one of the software timers still available and returns a 8-bit
ID. The ID is equal to “UNDEFINED_TIMER” if failure in allocation.
If success, this ID must be stored by the MMI application in order to
control its attributed timer(s) and to identify from which timers the
event comes from.
Note:No risk of timer identity usurpation after a cold reset since
the value of “UNDEFINED_TIMER” is 0.
ts_set_time(U8 id, U32 delay)Sets the 32-bit delay value, multiple of 2ms (tick period), with the id
of the software timer to configure.
ts_stop(U8 id)Stops the time comparison and the software timer. This prevents the
delivery of overflow events from this timer.
Can only be reactivated with the help of the function “ts_set_time()”.
Ts_free(id)Releases one of the software timers and sets the variable storing
the id to the value “UNDEFINED_TIMER” in order to prevent from
identity usurpation.
5.4.7Keyboard
Management
Table 5-5. Event returned from the software timers
EventDescription
EVT_TIMERReturns the 8-bit ID of the software timer that has just overflowed
The keyboard management is charged with the debouncing and the generation of
events from actions on keys. It is located in the file “mmi\kbd\keypad.c” and can be configured differently with the help of the file “conf\conf_kbd”.
Only one keyboard event is mailed “EVT_KEY_PRESSED” but its associated parameter
qualify the key actions:
– macro KEY_STATUS(param) gets the changing status of a key
(KBD_KEY_PRESSED, KBD_KEY_REPEAT, …).
– macro KEY_ID(param) identifies the key whose status has just changed (For key
definition, refer to Section 6.2.6).
Table 5-6. Keyboard messages
8-bit parameter valueDescription
KBD_KEY_PRESSEDKey has just been pressed
KBD_KEY_REPEATKey has been pressed long enough to enter in the repeat mode.
This message is periodically sent while this key stands pressed.
KBD_KEY_LONGPRESSEDKey has been pressed long enough to send this message once.
KBD_KEY_RELEASEDKey has just been released after a key pressed.
KBD_KEY_REPEAT_RELEASEDKey has just been released from a repeat mode.
5-32AT85C51SND3Bx Firmware User’s Guide
7691A–MP3–08/07
Figure 5-9 gives a graphical representation of the keypad behavior.
Key
Events
➀➀
➁
➊➋
➁
➊
➀
➀
➎
➂
➌ ➌➂➌➂➌
➂➌➂➌➂➌➂
➌
➍
➃
Timings Tags:
➀
KBD_DEBOUNCE_TIMING
➁
KBD_REPEAT_START_TIME
➂
KBD_REPEAT_CONT_TIME
➃
KBD_REPEAT_LONG_TIME
Events Tags:
➊
KBD_KEY_PRESSED
➋
KBD_KEY_RELEASED
➌
KBD_KEY_REPEAT
➍
KBD_KEY_LONGPRESSED
➎
KBD_KEY_REPEAT_RELEASED
Figure 5-9. Keyboard timings and events
Figure 5-10. Example of a key processing in MMI applications
Architecture
AT85C51SND3Bx Firmware User’s Guide5-33
7691A–MP3–08/07
Architecture
5.5Services
The services are provide by Atmel and include the usual MMI sequences. This one permits to reduce the code in MMI Applications.
5.5.1Player service
The player service provides a MACRO to start MMI_PLAYER with different options.
Table 5-7. Macro to start MMI_PLAYER
FonctionsDescription
Start_mmiplayer_resume()Restore last variables of player service, to play the last played item
Start_mmiplayer_from_saving_options()Restore all values of player service
Start_mmiplayer_on_disks()Restore all values of player service
Start_mmiplayer_on_disk()Restore all values of player service
Start_mmiplayer_on_dirsub()Restore all values of player service
Start_mmiplayer_on_dir()Restore all values of player service
Start_mmiplayer_one_file()Restore all values of player service
Start_mmiplayer_on_playlist()Restore all values of player service
Start_mmiplayer_on_playlist_at()Restore all values of player service
Change the explorer values to play the current music file selected
Change the explorer values to play all disks and start at the current position
Change the explorer values to play one disk and start at the current position
Change the explorer values to play the current dir with sub directory
Change the explorer values to play the current dir without sub directory
Change the explorer values to play the current file only
Change the explorer values to play the current play list
Change the explorer values to play the current play list at a specific position
Table 5-8. Player services
FonctionsDescription
srvplayer_restore()Copy player field from setting datas to the service variables
Note: it must be called before the other routines of player service.
srvplayer_save()Copy player field from service variables to the setting datas
srvplayer_explorer_init()Initialize the explorer module which permits to play many files in many modes (repeat, random).
Note: Don’t use this one, if you play a file include it in a specific list.
srvplayer_explorer_close()Close explorer module
srvplayer_switch_on()Turn ON the player modue
srvplayer_switch_off()Turn OFF the player modue
srvplayer_file_getinfos()Get static information about file (name, ID3)
srvplayer_play()Start play of current file selected at beginning or at specific time position
srvplayer_update_bitrate()Update bitrate information
Note: The codec type, channel type, sampling frequency, and bitrate informations are avialable only when
file is played.
srvplayer_gettime()Get current time play
srvplayer_stop()Stop play file
srvplayer_volume_send()Send at player module the volume value
Note: Change “srvplayer_g_arg.volume” value before
srvplayer_volume_change()Increment or decrement “srvplayer_g_arg.volume” value and send its.
5-34AT85C51SND3Bx Firmware User’s Guide
7691A–MP3–08/07
FonctionsDescription
srvplayer_set_eq()Send to player module the equalizer value
srvplayer_eq_modify_predef()Copy the predefine ambiance in the user ambiance definition
srvplayer_set_bassboost()Send toplayer module the bassboost state
srvplayer_set_vsurround()Send toplayer module the virtual surround state
srvplayer_set_speed()Send toplayer module the speed level
srvplayer_pause()Pause the play of current file
srvplayer_ffw()Start fast foward
srvplayer_frw()Start fast rewind
srvplayer_restart_play()Restart play after a pause/ffw/frw
srvplayer_set_marker_A()Set a marker A on current play
srvplayer_set_marker_B()Set a marker B on current play and start repeat AB
srvplayer_stop_repeatAB()Stop repeat AB
srvplayer_rqt_bargraph()Send a request to get a bargraph data
5.5.2Recorder Service
Architecture
Table 5-9. Recorder services
FonctionsDescription
srvrec_init()Initialize the source of record (micro or line-in)
srvrec_start()Create a file to record the sound (NandFlash\record\recordxxx.wav”)
Note: The fonction search a free name between record000.wav to record100.wav
Start record after file create
srvrec_stop()Stop the recording
5.5.3Explorer service
The explorer service provide a fonctions to manage a disk list or file list from a directory
with a extension filter. In this list, the fonctions manage a display list.
Table 5-10. Explorer services
FonctionsDescription
srvexp_init()This one initializes the list, It is the first function to call. Paramater is the filter extension of list, the size of
srvexp_list_init()Reinitialize the position of list at the current position of current navigator
srvexp_list_check()This fonction check if the disk of current list is always available.
srvexp_list_build()Force the list rebuild, so use this one after list modification (e.g. file delete)
srvexp_list_beguinning()Go to the begining of list. the DISPLAY list corresponding at the beginning of file list
srvexp_list_end()Go to the end of list. the DISPLAY list include the end of file list
srvexp_list_up()Move up the DISPLAY list in file list
srvexp_list_down()Move down the DISPLAY list in file list
srvexp_list_getname()Get a file name of file selected in DISPLAY list
DISPLAY list, and eventualy init the position of list at the current position of current navigator
If list no available then the fonction reinit the list with disk list.
AT85C51SND3Bx Firmware User’s Guide5-35
7691A–MP3–08/07
Architecture
FonctionsDescription
srvexp_list_getname_parent()Get the name of directory or disk correponding at file list
srvexp_enter()Enter in a disk/directory selected in DISPLAY list
Note: A new list is create and DISPLAY list corresponding at the beginning of list
srvexp_gotoparent()Go to parent directory/disk
Note: A new list is create and DISPLAY list include the previous parent dir
srvexp_format()Format the disk selected in DISPLAY list
srvexp_delete()Delete a directory/file selected in DISPLAY list
srvexp_playlist_default_exist()Ask if a default playlist exist
srvexp_playlist_select_in_list()The file selected in DISPLAY list is the new default playlist
srvexp_playlist_select()Select or create a new default playlist (“NandFlash\playlist\palylistxxx.mu3”)
srvexp_playlist_add()Add the directory/file selected in DISPLAY list
srvexp_copy()Select a file in DISPLAY list as source file for the futur paste action
srvexp_paste()Paste the file, selected by previous copy action, in directory corresponding at current list
srvexp_paste_abort()Abort paste
srvexp_select_pos()Update current file system navigator at the position selected in DISPLAY list
5.5.4Ebook service
The ebook service support the text file multilanguage (ASCII, UTF16LE, UTF16BE,
UTF8)
Table 5-11. Ebook services
FonctionsDescription
srvebk_open()Open the current file selected in current file system navigator
srvebk_read()Read the next line
srvebk_close()Stop the recording
5-36AT85C51SND3Bx Firmware User’s Guide
7691A–MP3–08/07
Architecture
5.6Modules
5.6.1USB Interface
Atmel provides the system modules which permit to use the SND3 chip feature.
The modules are USB, player, recorder, viewer, power, explorer and update.
The USB modules offers its services to the MMI applications with the help of commands/events or public routines. The following parts decribes the interfaces of each
module.
The USB module controls the USB device/host mode.
Table 5-12. USB commands
Command LabelDescription
CMD_USB_STARTEnable the USB controller
CMD_USB_STOPDisable the USB controller
CMD_DEVICE_STARTStart the device mode
CMD_DEVICE_STOPStop the device mode
CMD_HOST_STARTStart the Host mode
CMD_HOST_STOPStop the Host mode
CMD_USB_FORCE_HIGH_SPEEDForce high speed in USB device mode
Table 5-13. USB events
Event LabelDescription
EVT_USB_CTRL_POWEREDVoltage level on VBUS present
EVT_USB_CTRL_UNPOWEREDVoltage level on VBUS not present
EVT_USB_DEVICE_STARTUSB controller is entered in USB device mode
EVT_USB_DEVICE_STOPUSB controller is exit of USB device mode
EVT_USB_DEVICE_ENUM_HIGHUSB device mode enumerated in hight speed detected
EVT_USB_DEVICE_ENUM_FULLUSB device mode enumerated in full speed detected
EVT_USB_DEVICE_SUSPENDSuspended state has been detected on USB bus
EVT_USB_DEVICE_WAKE_UPWake-up state has been detected on USB bus
EVT_USB_DEVICE_RESUMEResume state has been detected on USB bus
EVT_USB_DEVICE_RESETReset state has been detected on USB bus
EVT_USB_DEVICE_SENDUSB device Class has sent data
EVT_USB_DEVICE_RECEIVUSB device Class has received data
EVT_USB_DEVICE_MS_STARTEDUSB device Class mass storage has started
EVT_USB_HOST_STARTUSB controller is entered in USB host mode
EVT_USB_HOST_EXITUSB controller is exit of USB host mode
EVT_USB_HOST_LIMITATION_HWUSB host module can’t install new device because a
hardware limitation is detected (product limitation).
EVT_USB_HOST_LIMITATION_SWUSB host module can’t install new device because a
software limitation is detected (change low configuration in
conf_usb.h).
EVT_USB_HOST_MS_CHANGEA Mass Storage device has been detected or disconnected.
EVT_USB_HOST_HUB_CHANGEA HUB device has been detected or disconnected.
EVT_USB_HOST_HID_CHANGEA HID device has been detected or disconnected.
EVT_USB_HOST_HID_MOUSE_BTN1USB host has receiv a event “clic bouton 1” via a HID device.
AT85C51SND3Bx Firmware User’s Guide5-37
7691A–MP3–08/07
Architecture
Event LabelDescription
EVT_USB_HOST_HID_MOUSE_BTN2USB host has received an event “clic bouton 2” via a HID
device.
EVT_USB_HOST_HID_MOUSE_BTN3USB host has received an event “clic bouton 3” via a HID
device.
EVT_USB_HOST_HID_MOUSE_MOVEUSB host has received an event “mouse move” via a HID
device.
EVT_USB_HOST_HID_KB_KEYUSB has received an event “key press” via a HID device.
EVT_USB_HOST_CDC_CHANGEA CDC device has been detected or disconnected.
The USB module does not include public routines.
5.6.2Player Interface
The Player module controls the audio features of the chip:
– it interfaces the audio processor
– it manages the playing of audio files (play, stop, pause, …)
In player module, only the bargraph feature can’t be immediatly executed, then this must
be executed via a command and event.
Table 5-14. Player commands
Command LabelDescription
CMD_PLAYER_GET_BARGRAPHAsk a bargraph data.
The result is sent by player task via a event.
The player task sends only one event “
EVT_PLAYER”
with differents arguments.
Table 5-15. Player event arguments
Arguments of “EVT_PLAYER”Description
PLAYER_BOFBeginning of the played file reached.
Note: player_task_stop() is automaticly executed.
PLAYER_EOFEnd of the played file reached, the player is stopped.
Note: player_task_stop() is automaticly executed.
PLAYER_ERROR_UNDERRUNUnder-run occurred but play continues
PLAYER_ERROR_SYNCHAudio processor synchronization lost but play continues
PLAYER_START_ABPlay of the AB track has restarted
PLAYER_EOF_ABEnd of the played AB track, start the research of A position
PLAYER_BARGRAPHBargraph resultat of command CMD_PLAYER_GET_BARGRAPH
5-38AT85C51SND3Bx Firmware User’s Guide
7691A–MP3–08/07
Architecture
Table 5-16. Player publics routines
RoutinesDescription
player_on()Turn the audio controller on
player_off()Turn the audio controller off
player_play_file()*Play the music file selected on current file system navigator
player_restart_play()*Restart playing at beginning
player_pause()*Pause the ongoing play
player_stop()*Stop a playing file and close file
player_fast_foward()*Fast-forward the ongoing play
player_fast_rwd()*Fast-rewind the ongoing play
player_set_marker_A()Set the marker A at the current position in the ongoing play
player_set_marker_B()Set the marker B at the current position in the ongoing play and start
player_stop_repeat_AB()*Stop playing the AB track
player_set_speed()Change the speed of the play (normal/slow)
player_linein_on()Enable ouput audio from line-in
player_linein_off()Disable ouput audio from line-in
player_set_volume()Change the output volume level
audio_surround()Set the virtual surround on/off
audio_bassboost()Set the bass boost on/off
audio_set_vol_equalizer()Set the bass/medium/treble band volume
player_get_time()Get the elapsed time of the ongoing play
player_get_timetotal()Get the total time of a song to play
player_channel_type()Get information channel type on the current stream.
player_sampling_freq()Get information sampling frequence on the current stream.
player_bitrate()Get information bitrate on the current stream.
player_get_codec_type()Get the codec type currently used.
player_task_start()Enable player task (it must be call after player_play_file() successfull)
player_task_stop()Disable player task (it must be call after player_stop() successfull)
AB repeat
Note:* If the resultof this routine is successful, then you must wait a confirmation via specific
routine player_evt().
5.6.3Recorder Interface
The Recorder module takes in charge the control of the audio recorder features of the
chip:
– it interfaces the audio processor
– it manages the recording of audio files (start, stop)
The recorder module does not include a command, but one event “
EVT_RECORDER”
with
different arguments.
Table 5-17. Recorder event arguments
Arguments of “EVT_RECORDER”Description
RECORD_EOFEnd of recording because of destination memory access fail.
Note: recorder_task_stop() is automaticly executed.
AT85C51SND3Bx Firmware User’s Guide5-39
7691A–MP3–08/07
Architecture
Table 5-18. Recorder public routines
RoutinesDescription
record_on()Initialize the record with:
- microphone or line-in as input.
- current file selected on current file system navigator.
record_off()Stop the recording and close file
record_start()Start the recording
record_gettime()Get the recording time
recorder_task_start()Enable recorder task (it must be call after record_start() successfull)
recorder_task_stop()Disable recorder task (it must be call after record_off() successfull)
5.6.4Viewer Interface
The Viewer module takes controls the picture decoder features of the chip:
– it interfaces the decoder processor
– it manages the decoding of picture files (start, stop)
The viewer module does not include a command.
Table 5-19. Viewer events
EventsDescription
EVT_VIEWER_EOFEnd of picture decoding.
Note: viewer_task_stop() is automaticly executed.
EVT_VIEWER_FAILError during picture decoding.
Note: viewer_task_stop() is automaticly executed.
EVT_VIEWER_ERR_ACCESS_FILEError during access file
Note: viewer_task_stop() is automaticly executed.
Table 5-20. Viewer public routines
RoutinesDescription
viewer_set_width()Set the width of the viewer display area.
Note: initialization mandatory before call viewer_on()
viewer_set_height()Set the height of the viewer display area.
Note: initialization mandatory before call viewer_on()
viewer_set_x0()Set the x0 of the viewer display area.
Note: initialization mandatory before call viewer_on()
viewer_set_y0()Set the y0 of the viewer display area.
Note: initialization mandatory before call viewer_on()
viewer_config()Config the viewer.
Note: initialization mandatory before call viewer_on()
viewer_on()Start the picture file decoding. Use the current file selected on current
file system navigator.
viewer_off()Stop the recording and close file
viewer_task_start()Enable viewer task (it must be call after viewer_on() successfull)
viewer_task_stop()Disable viewer task (it must be call after viewer_off() successfull)
5-40AT85C51SND3Bx Firmware User’s Guide
7691A–MP3–08/07
Architecture
5.6.5Power Interface
The Power module controls the power management of the device:
– automatically jumps in idle mode to reduce power consumption,
– provides battery level information,
– provides power-off control,
– provides alarm mechanism on a specified low battery level.
Table 5-21. Power commands
Command LabelDescriptionReturned Events
CMD_POWER_OFFTurn the power off (CPU and peripherals stopped). Exit from this
CMD_AUTO_POWER_OFF_ENABLEEnable to turn power off automatically when no key pressed during a
CMD_AUTO_POWER_OFF_DISABLEDisable the auto power off
•in case of code commun too large, you can comment the debug routines not use in
debug.c , e.g. :
/*
void trace_u32( )
{...}
*/
When you execute the firmware in OCD mode on KEIL, the trace are displayed in the
tab "Command" from "Output Window".
AT85C51SND3Bx Firmware User’s Guide5-43
7691A–MP3–08/07
Section 6
Firmware Configuration
6.1Overview
Several files have been implemented to help the software developer to quickly configure
the firmware.
The configuration files “conf_*.h” are all under the conf directory of the firmware package (see Section 3.1.1). There are four kinds of configuration files:
Files configuring the Customer MMI layer only
The file conf_mmi.h configures exclusively the Customer MMI layer and more precisely the MMI applications organized in modules (see Section 3.1.8).
Files configuring both the Customer MMI and the Atmel system layers
These files are the ones that configure the source code of custom MMI peripherals:
– conf_kbd.h: configures both the keyboard driver of the system firmware system
and the key affectation dedicated to the MMI modules using the keyboard.
– conf_lcd.h: configures the lcd driver of the system firmware system, the API of the
LCD driver and the mmi_manager module.
– conf_audio.h: configures both the custom audio firmware module for external
DAC implementation and the audio part of the player module.
– conf_update.h: configures both the application MMI update and the update
firmware module.
Files configuring the Atmel system layer only
– conf_access.h: enables the implementation of memory access interfaces only
required in your custom application. It mainly configures the source code files of
the control access firmware module.
– conf_clock.h: configures the oscillator frequency which depends all the lib_mcu
drivers: clock, lcd, timer, memory controllers, …
– conf_explorer.h: configures the file_system module and the playlist module.
– conf_nf.h: configures the nand_flash memory module and the Nand Flash
controller driver.
– conf_power.h: configures the power module, the audio module and the API of the
lcd driver.
– conf_scheduler.h: configures the scheduling of the system task.
– conf_usb.h: configures the USB controller driver (see Section 3.1.5), the USB
module and the SCSI decoder module.
AT85C51SND3Bx Firmware User’s Guide6-45
7691A–MP3–08/07
Firmware Configuration
Files configuring the global firmware
Two files are under the top-level directory of the firmware package:
– config.h: configures the system. Should not be modified.
– option.h: configures (de-)activation of peripherals. Also, defines compilation
switches.
6-46AT85C51SND3Bx Firmware User’s Guide
7691A–MP3–08/07
Firmware Configuration
6.2Configuration
Files
6.2.1Control Access
This section describes feature by feature the available configuration. In the following
tables, the default parameters values are marked in square brackets.
The “conf_access.h” file is used to configure the access control of all the system memories. The source code of each access interface and logical unit are compiled only if
enabled.
Table 6-1. Access interface configuration
Definition LabelDescriptionValues
ACCESS_CODECCodec input under control access[ENABLE]
ACCESS_DISPLAYDisplay input under control access[ENABLE]
DISABLE
DISABLE
Table 6-2. Logical unit configuration
Definition LabelDescriptionValues
MEM_NFNand Flash memory access[ENABLE]
MEM_MMCMMC memory accessENABLE
MEM_USBUSB memory access (available in USB host mode
only)
DISABLE
[DISABLE]
ENABLE
[DISABLE]
6.2.2Audio Features
Table 6-3. Global protection in writing of all memories (no implemented)
The “conf_clock.h” file is used to configure the clock that drives the chip.
Table 6-8. Clock settings
Definition LabelDescriptionValues
FOSCOscillator frequencyFrom [12000] up to 26000 (unit in KHz)
6.2.4File System
CLK_DRIVEOscillator type:
- Crystal connected on X1/X2 pins
- External oscillator drives X1 input
The “conf_explorer.h” file is used to configure the file system modules.
[CLK_CRYSTAL]
CLK_GENERATOR
Table 6-9. File System configuration
Definition LabelDescriptionValues
FS_FAT_1212-bit FAT support[ENABLED]
DISABLED
FS_FAT_1616-bit FAT support[ENABLED]
FS_FAT_3232-bit FAT support[ENABLED]
FS_ASCIIAscii file name support[ENABLED]
FS_UNICODEUnicode fiel name support[ENABLED]
FS_MULTI_PARTITIONMultiple partition support (no implemented)ENABLED
FS_NB_CACHE_CLUSLISTCache to increment the speed during navigation and open file, but use
more data space.
FS_LEVEL_FEATURESFile system features: implementation or not of some functions.
FSFEATURE_READ_COMPLET: all read functions
FSFEATURE_READ: all read functions except “getc()” and “eof()”
FSFEATURE_WRITE_NAV: “nav_formatdrive()” and “nav_delfile()”
available
FSFEATURE_WRITE_NAV_COMPLET: FSFEATURE_WRITE_NAV +
“nav_mkdir()” and “nav_rename()” available
FSFEATURE_WRITE_FILE: “file_create()”, “file_open(MODE_WRITE)”,
“file_write()”, “file_putc()” available
FSFEATURE_WRITE_FILE_COMPLET: FSFEATURE_WRITE_FILE +
“nav_set_date()”, “nav_set_attribut()”, file_getc() functions are available
FSFEATURE_ALL: all above features available.
FS_NB_NAVIGATORMaximum number of navigators used[3]
FS_NAV_ID_PLAYLISTID of the navigator dedicated to the playlist.
NB: the explorer always works with the navigator ID 0.
Could be set to 0 to have the same navigator than the explorer.
FS_NAV_ID_COPYFILEID of the navigator dedicated to the file copy.
“copy file” is opened with this ID but “paste file” is opened with the ID 0
FS_NAV_ID_KARAOKEID different than both explorer and playlist’s IDs[2]
FS_NAV_ID_ID3ID different than both explorer and playlist’s IDs[2]
FS_NAV_ID_UPDATEFILEID of the navigator dedicated to the update mode.
NB: the explorer always works with the navigator ID 0.
FS_NAV_ID_STATUSFILEID of the navigator dedicated to the update file status.[2]
PL_UNICODEFormat of playlist use (enable=UTF16BE, disable=ASCII)ENABLED
I/O pins mnemonics are defined
in mcu.h file (See Section 3.1.5).
POWER_VERY_LOW_VOLTAG
E
DISABLE
6.2.12Scheduler module
The “conf_scheduler.h” file is used to configure the system scheduler.
The firmware system holds 6 tasks:
MMI manager, power management, USB, player, explorer and update.
The scheduler module of the firmware is in charge of executing each of these tasks in a
token ring manner. Tasks could be added or removed with the help of this file that maps
or not their functions.
Task functions mapping:
The scheduler can manage up to 8 tasks. Each task should have both:
– one initialization function
– one task function
The scheduler controls the tasks by referring to them with the help of existing definition
labels implemented in the scheduler module:
– scheduler_task_?_init: definition label to associate the init function of a task to
implement
– scheduler_task_?: definition label to associate the main fuction of a task to
#define Scheduler_task_3usb_sch_task // Mass storage task
#define Scheduler_task_4player_task // Player task
#define Scheduler_task_5explorer_task// Explorer task
#define Scheduler_task_6update_task// Update task
AT85C51SND3Bx Firmware User’s Guide6-57
7691A–MP3–08/07
Firmware Configuration
Type of scheduler (SCHEDULER_TYPE): only SCHEDULER_FREE is actually
supported.
6.2.13USB Module
The “conf_usb.h” file is used to configure the USB module. There are two level of configuration HIGH (customer) and LOW (expert). This is the HIGH options of configuration :
1150 East Cheyenne Mtn. Blvd.
Colorado Springs, CO 80906
Tel: 1(719) 576-3300
Fax: 1(719) 540-1759
Biometrics/Imaging/Hi-Rel MPU/
High Speed Converters/RF Datacom
Avenue de Rochepleine
BP 123
38521 Saint-Egreve Cedex, France
Tel: (33) 4-76-58-30-00
Fax: (33) 4-76-58-34-80
e-mail
literature@atmel.com
Web Site
http://www.atmel.com
Disclaimer: The information in this docume nt is pro vided in connection with Atm el products. No license, express or implied, by estoppel or otherwise, to any
intellectual prop erty right is grant ed by this docume nt or in connection w ith t he sale of Atmel p rod ucts. EXCEPT AS SET FORTH IN ATMEL’S TERMS AND CONDI-
TIONS OF SALE LOCATED ON ATMEL’S WEB SITE, ATMEL ASSUMES NO LIABILITY WHATSOEVER AND DISCLAIMS ANY EXPRESS, IMPLIED OR STATUTORY
WARRANTY RELATING TO ITS PRODUCTS INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, OR NON-INFRINGEMENT. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE, SPECIAL OR INCIDENTAL DAMAGES (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF PROFITS, BUSINESS INTERRUPTION, OR LOSS OF INFORMATION) ARISING OUT
OF THE USE OR INABILITY TO USE THIS DOCUMENT, EVEN IF ATMEL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Atm el makes no
repr esentations o r warranties with resp ect to the accu rac y or com pleten ess of t he cont ents of this docume nt and rese rves th e right to make changes to specif ica tions
and product des cri ptions at any time without not ice . At mel does no t ma ke any commitment to u pdate the information contain ed herein. Unl ess specifical ly p rovidedotherwise, Atmel products are not suitable for, and shall not be used in, automotive applications. Atmel’s products are not intended, authorized, or warranted for use as components in applications intended to support or sustain life.