Choco OS  V.0.16.9.0
Join to the chocolate world
oc_channels.h File Reference

The file with interface for Channel module. More...

#include <oc_1word.h>
#include <oc_channels_defs.h>
#include <oc_ba.h>
#include <oc_rmaps.h>
#include <oc_registers.h>
#include <oc_interrupts.h>

Go to the source code of this file.

Data Structures

struct  oC_ChannelData_t
 stores data for channel More...
 

Macros

#define oC_ChannelMask
 mask for channel type width More...
 
#define oC_Channel_(CHANNEL_NAME, ...)
 returns channel for oC_Channel_t type
 
#define oC_ChannelModule_(CHANNEL_NAME, ...)
 returns module index of channel with the given name
 
#define oC_ChannelStartIndex_(MODULE_NAME, ...)
 returns start channel index for module More...
 
#define oC_ChannelEndIndex_(MODULE_NAME, ...)
 returns end channel index for module More...
 
#define oC_ModuleChannel_(MODULE_NAME, CHANNEL_NAME, ...)
 returns channel of module More...
 
#define oC_Channel_InterruptHandlerName(INTERRUPT_TYPE_NAME)
 returns name of interrupt handler More...
 
#define oC_Channel_InterruptHandlerPrototype(INTERRUPT_TYPE_NAME, ChannelVariableName)
 Prototype for channels interrupt. More...
 
#define oC_Make_ModuleWithChannels(MODULE_NAME)
 makes module with channels. Not for user usage.
 
#define oC_Make_ChannelForModule(CHANNEL_NAME, ...)
 makes module with channels. Not for user usage.
 
#define oC_Make_InterruptHandlerForChannel(CHANNEL_NAME, BASE_NAME, ...)
 makes handler of interrupt for channel. Not for user usage.
 
#define oC_ChannelData_(CHANNEL_NAME)
 returns pointer to channel's data More...
 
#define oC_Channel_IsModuleDefined(MODULE_NAME)
 macro for checking if module is defined More...
 
#define oC_Channel_GetData(Channel)
 returns data of channel More...
 
#define oC_Channel_IsCorrect(MODULE_NAME, Channel)
 checks if channel is correct More...
 
#define oC_Channel_ToIndex(MODULE_NAME, Channel)
 returns index in module according to channel More...
 
#define oC_Channel_FromIndex(MODULE_NAME, ChannelIndex)
 returns channel according to index in module More...
 
#define oC_Channel_GetBaseAddress(Channel)
 returns base address assigned to the channel More...
 
#define oC_Channel_GetPowerBaseAddress(Channel)
 returns base address of power register More...
 
#define oC_Channel_GetPowerOffset(Channel)
 returns offset of power register More...
 
#define oC_Channel_GetPowerBitIndex(Channel)
 returns index of bit for power register More...
 
#define oC_Channel_GetRegisterMap(Channel)
 returns index of register map More...
 
#define oC_Channel_GetName(Channel)
 returns name of channel More...
 
#define oC_Channel_Register(Channel, REGISTER_NAME)
 checks if base address of power register exist More...
 
#define oC_ModuleChannel_NumberOfElements(MODULE_NAME)
 Number of elements in module channel. More...
 
#define oC_Channel_Foreach(MODULE_NAME, Channel)
 loop for each module channel More...
 
#define oC_Channel_InterruptHandler(ChannelVariableName)
 creates common interrupt handler for channel More...
 
#define oC_ModuleChannel_DefineType
 defines module channel type More...
 

Typedefs

typedef oC_Channel_t oC_ChannelIndex_t
 stores index of channel More...
 
typedef void(* oC_ChannelInterruptHandler_t) (oC_Channel_t Channel)
 stores pointer of channel interrupt function More...
 

Enumerations

Functions

bool oC_Channel_SetInterruptPriorityFunction (oC_Channel_t Channel, oC_InterruptType_t InterruptType, oC_InterruptPriotity_t Priority)
 set interrupt priority according to channel and type More...
 
bool oC_Channel_EnableInterruptFunction (oC_Channel_t Channel, oC_InterruptType_t InterruptType)
 enables interrupt according to channel and type More...
 
bool oC_Channel_DisableInterruptFunction (oC_Channel_t Channel, oC_InterruptType_t InterruptType)
 disables interrupt according to channel and type More...
 
bool oC_Channel_IsInterruptEnabledFunction (oC_Channel_t Channel, oC_InterruptType_t InterruptType)
 checks if interrupt is enabled according to channel and type More...
 

Variables

const oC_ChannelData_t oC_ChannelsData []
 stores data of channels More...
 

Detailed Description


Author
Patryk Kubiak
Note
Copyright (C) 2015 Patryk Kubiak patry.nosp@m.k.ku.nosp@m.biak9.nosp@m.0@gm.nosp@m.ail.c.nosp@m.om

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

Definition in file oc_channels.h.

Function Documentation

bool oC_Channel_DisableInterruptFunction ( oC_Channel_t  Channel,
oC_InterruptType_t  InterruptType 
)

The function is for disabling interrupt according to dynamic channel and interrupt type.

See also
oC_Channel_DisableInterrupt
Parameters
ChannelChannel of the interrupt to disable
InterruptTypeType of interrupt (peripheral interrupt for example)
Returns
true if success

Definition at line 120 of file oc_channels.c.

bool oC_Channel_EnableInterruptFunction ( oC_Channel_t  Channel,
oC_InterruptType_t  InterruptType 
)

The function is for enabling interrupt according to dynamic channel and interrupt type.

See also
oC_Channel_EnableInterrupt
Parameters
ChannelChannel of the interrupt to enable
InterruptTypeType of interrupt (peripheral interrupt for example)
Returns
true if success

Definition at line 93 of file oc_channels.c.

bool oC_Channel_IsInterruptEnabledFunction ( oC_Channel_t  Channel,
oC_InterruptType_t  InterruptType 
)

The function is for checking if interrupt is enabled according to dynamic channel and interrupt type.

See also
oC_Channel_EnableInterrupt
Parameters
ChannelChannel of the interrupt
InterruptTypeType of interrupt (peripheral interrupt for example)
Returns
true if interrupt enabled

Definition at line 147 of file oc_channels.c.

bool oC_Channel_SetInterruptPriorityFunction ( oC_Channel_t  Channel,
oC_InterruptType_t  InterruptType,
oC_InterruptPriotity_t  Priority 
)

The function is for setting interrupt priority according to dynamic channel and interrupt type.

See also
oC_Channel_SetInterruptPriority
Parameters
ChannelChannel of the interrupt to enable
InterruptPriorityInterrupt priority
Returns
true if success

Definition at line 67 of file oc_channels.c.