WebRadioApp  0.1
DeviceDriver
Collaboration diagram for DeviceDriver:

Modules

 DeviceDriver_Audio_Info_Variables
 
 DeviceDriver_Staions_Variables
 
 DeviceDriver_Station_Grid_Variables
 

Data Structures

struct  Cells
 

Functions

void HardButtonIsrCallback (int aButtonPresssed)
 Callback function for the hardware button. This function is called every time the hardware button is pressed or released. Please note, that this function is called from the interrupt service routine. More...
 
void DeviceDriver_Initialize (void)
 The function DeviceDriver_Initialize() initializes the module and prepares all necessary things to access or communicate with the real device. The function has to be called from your main module, after the initialization of your GUI application. More...
 
void DeviceDriver_Deinitialize (void)
 The function DeviceDriver_Deinitialize() deinitializes the module and finalizes the access or communication with the real device. The function has to be called from your main module, before the GUI application will be deinitialized. More...
 
int DeviceDriver_ProcessData (void)
 The function DeviceDriver_ProcessData() is called from the main UI loop, in order to process data and events from your particular device. This function is responisble to update properties within the device class if the corresponding state or value of the real device has changed. This function is also responsible to trigger system events if necessary. More...
 
void DeviceDriver_SetLedStatus (XInt32 aValue)
 This is a sample for a function called from the device class, when a property has changed. As a result, the corresponding value of the real device should be changed. In this implementation simply the LED is switched on or off. More...
 
void DeviceDriver_PrintMessage (XString aText)
 This is a sample for a function that is called directly from a 'Command' method of the device class. As a result, the corresponding action should happen. In this implementation the given message is printed via the console interface. More...
 
void DeviceDriver_SetTime (XUInt32 aTime)
 This is a sample for a function called from the device class, when the system time (RTC time) should be changed. More...
 
XString ReadInfo (int toRead)
 Read information. It could be radio, connection, meta or station information. More...
 
void UpdateVolume (int volume)
 Update Volume. More...
 
XString InitStations ()
 Initialize Stations. More...
 
int GetXCounter ()
 Get the x Counter of the station grid. More...
 
int GetYCounter ()
 Get the y Counter of the station grid. More...
 
int GetCurrentID ()
 Get the ID Counter of the station grid. More...
 
int getLxValue (XInt32 index)
 Get the Lx Value object. More...
 
int getLyValue (XInt32 index)
 Get the Ly Value object. More...
 
void FFTCalculations (XInt32 inx, XInt32 *x, XInt32 *ly, XInt32 ll, XInt32 *ry, XInt32 rr, XInt32 height, XInt32 FFTGraph)
 Calculate FFT to display the graphics. More...
 
void VUMeter (XFloat *angle_L, XFloat *angle_R)
 Volume unit meter. More...
 
void SelectStationToPlay (XString aText)
 Print something out from the device when a station is selected. More...
 

Variables

Mp3Playermp3PlayerInstance
 
volatile uint8_t metainfo_present_LCD
 

Audio Info Variables

volatile int items
 
char radioInfo [240]
 
char connectionInfo [240]
 
char stationInfo [160]
 
char metaInfo [240]
 
int currentVolume
 

Staions Variables

int xCounter
 
int yCounter
 
int currentID
 
int initGrid = 1
 
int16_t station_id
 

Station Grid Variables

enum  info { Radio, Connection, StationInfo, Meta }
 
typedef struct Cells Cell
 
Cell matrixStations [Num_Fields_X][Num_Fields_Y]
 
#define Grid_X0   260
 
#define Grid_Y0   200
 
#define Grid_Width   450
 
#define Grid_Height   240
 
#define Cell_Width   50
 
#define Cell_Height   40
 
#define Num_Fields_X   (Grid_Width / Cell_Width)
 
#define Num_Fields_Y   (Grid_Height / Cell_Height)
 

Detailed Description

Macro Definition Documentation

◆ Cell_Height

#define Cell_Height   40

◆ Cell_Width

#define Cell_Width   50

◆ Grid_Height

#define Grid_Height   240

◆ Grid_Width

#define Grid_Width   450

◆ Grid_X0

#define Grid_X0   260

◆ Grid_Y0

#define Grid_Y0   200

◆ Num_Fields_X

#define Num_Fields_X   (Grid_Width / Cell_Width)

◆ Num_Fields_Y

#define Num_Fields_Y   (Grid_Height / Cell_Height)

Typedef Documentation

◆ Cell

typedef struct Cells Cell

Enumeration Type Documentation

◆ info

enum info
Enumerator
Radio 
Connection 
StationInfo 
Meta 

Function Documentation

◆ DeviceDriver_Deinitialize()

void DeviceDriver_Deinitialize ( void  )

The function DeviceDriver_Deinitialize() deinitializes the module and finalizes the access or communication with the real device. The function has to be called from your main module, before the GUI application will be deinitialized.


References EwUnlockObject().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DeviceDriver_Initialize()

void DeviceDriver_Initialize ( void  )

The function DeviceDriver_Initialize() initializes the module and prepares all necessary things to access or communicate with the real device. The function has to be called from your main module, after the initialization of your GUI application.


References EwBspInOutInitButton(), EwBspInOutInitLed(), EwGetAutoObject(), EwLockObject(), and HardButtonIsrCallback().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DeviceDriver_PrintMessage()

void DeviceDriver_PrintMessage ( XString  aText)

This is a sample for a function that is called directly from a 'Command' method of the device class. As a result, the corresponding action should happen. In this implementation the given message is printed via the console interface.

Parameters
aText

References EwPrint().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DeviceDriver_ProcessData()

int DeviceDriver_ProcessData ( void  )

The function DeviceDriver_ProcessData() is called from the main UI loop, in order to process data and events from your particular device. This function is responisble to update properties within the device class if the corresponding state or value of the real device has changed. This function is also responsible to trigger system events if necessary.

Returns
int - The function returns a non-zero value if a property has changed or if a system event was triggered. If nothing happens, the function returns 0.

References ApplicationDeviceClass__InitRadioStations(), ApplicationDeviceClass__TriggerHardButtonEvent(), ApplicationDeviceClass__UpdateBufferValue(), ApplicationDeviceClass__UpdateConnectionInfo(), ApplicationDeviceClass__UpdateFFTDraw(), ApplicationDeviceClass__UpdateMetaInfo(), ApplicationDeviceClass__UpdateRadioInfo(), ApplicationDeviceClass__UpdateStationInfo(), ApplicationDeviceClass__UpdateVUMeterDraw(), currentID, Mp3Player::getEtherAndBuffer(), initGrid, items, metainfo_present_LCD, mp3PlayerInstance, Num_Fields_X, Num_Fields_Y, xCounter, and yCounter.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DeviceDriver_SetLedStatus()

void DeviceDriver_SetLedStatus ( XInt32  aValue)

This is a sample for a function called from the device class, when a property has changed. As a result, the corresponding value of the real device should be changed. In this implementation simply the LED is switched on or off.

Parameters
aValueOn/Off

References EwBspInOutLedOff(), and EwBspInOutLedOn().

Here is the call graph for this function:

◆ DeviceDriver_SetTime()

void DeviceDriver_SetTime ( XUInt32  aTime)

This is a sample for a function called from the device class, when the system time (RTC time) should be changed.

Parameters
aTime

References EwBspClockSetTime().

Here is the call graph for this function:

◆ FFTCalculations()

void FFTCalculations ( XInt32  inx,
XInt32 x,
XInt32 ly,
XInt32  ll,
XInt32 ry,
XInt32  rr,
XInt32  height,
XInt32  FFTGraph 
)

Calculate FFT to display the graphics.

Parameters
inx
x
ly
ll
ry
rr
height
FFTGraph

References Mp3Player::drawFTT(), and mp3PlayerInstance.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetCurrentID()

int GetCurrentID ( )

Get the ID Counter of the station grid.

Returns
int

References currentID.

Here is the caller graph for this function:

◆ getLxValue()

int getLxValue ( XInt32  index)

Get the Lx Value object.

Parameters
index
Returns
int

◆ getLyValue()

int getLyValue ( XInt32  index)

Get the Ly Value object.

Parameters
index
Returns
int

◆ GetXCounter()

int GetXCounter ( )

Get the x Counter of the station grid.

Returns
int

References xCounter.

Here is the caller graph for this function:

◆ GetYCounter()

int GetYCounter ( )

Get the y Counter of the station grid.

Returns
int

References yCounter.

Here is the caller graph for this function:

◆ HardButtonIsrCallback()

void HardButtonIsrCallback ( int  aButtonPresssed)

Callback function for the hardware button. This function is called every time the hardware button is pressed or released. Please note, that this function is called from the interrupt service routine.

Parameters
aButtonPresssedaButtonPresssed - 1, if hardware button is pressed and 0, if it is released.

Here is the caller graph for this function:

◆ InitStations()

XString InitStations ( )

Initialize Stations.

Returns
XString

References currentID, EwNewStringAnsi(), matrixStations, Num_Fields_X, Stationlist, value, xCounter, and yCounter.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadInfo()

XString ReadInfo ( int  toRead)

Read information. It could be radio, connection, meta or station information.

Parameters
toRead
Returns
XString

References Connection, connectionInfo, EwNewStringUtf8(), Meta, metaInfo, radioInfo, and stationInfo.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SelectStationToPlay()

void SelectStationToPlay ( XString  aText)

Print something out from the device when a station is selected.

Parameters
aText

References EwStringParseInt32(), and station_id.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateVolume()

void UpdateVolume ( int  volume)

Update Volume.

Parameters
volume

References currentVolume.

Here is the caller graph for this function:

◆ VUMeter()

void VUMeter ( XFloat angle_L,
XFloat angle_R 
)

Volume unit meter.

Parameters
angle_L
angle_R

References Mp3Player::drawVuMeter(), and mp3PlayerInstance.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ connectionInfo

char connectionInfo[240]

◆ currentID

int currentID

◆ currentVolume

int currentVolume

◆ initGrid

int initGrid = 1

◆ items

volatile int items

◆ matrixStations

Cell matrixStations[Num_Fields_X][Num_Fields_Y]

◆ metaInfo

char metaInfo[240]

◆ metainfo_present_LCD

volatile uint8_t metainfo_present_LCD

Metainfo variable

◆ mp3PlayerInstance

Mp3Player* mp3PlayerInstance

Mp3Player Variable

◆ radioInfo

char radioInfo[240]

◆ station_id

int16_t station_id

◆ stationInfo

char stationInfo[160]

◆ xCounter

int xCounter

◆ yCounter

int yCounter