oc_pal.c File Reference
#include "oc_pal.h"
#include "oc_pal_cfg.h"
#include "interrupt_manager.h"
#include "oc_irq.h"

Go to the source code of this file.

Data Structures

struct  oc_pal_state_t
 The internal context structure. More...
 

Functions

static uint8_t ocAllocateState (bool *isAllocated, uint32_t *instanceMapping, uint32_t instance, uint8_t numberOfInstances)
 
static void ocFreeState (bool *isAllocated, uint32_t *instanceMapping, uint32_t instance, uint8_t numberOfInstances)
 
static uint8_t FindOcState (uint32_t instance)
 
status_t OC_Init (const oc_instance_t *const instance, const oc_config_t *const configPtr)
 Initializes the output compare mode. More...
 
status_t OC_Deinit (const oc_instance_t *const instance)
 De-initialize the output compare instance. More...
 
void OC_StartChannel (const oc_instance_t *const instance, const uint8_t channel)
 Start the counter. More...
 
void OC_StopChannel (const oc_instance_t *const instance, const uint8_t channel)
 Stop the counter. More...
 
status_t OC_SetOutputState (const oc_instance_t *const instance, const uint8_t channel, bool outputValue)
 Control the channel output by software. More...
 
status_t OC_SetOutputAction (const oc_instance_t *const instance, const uint8_t channel, oc_option_mode_t channelMode)
 Set the operation mode of channel output. More...
 
status_t OC_SetCompareValue (const oc_instance_t *const instance, const uint8_t channel, uint32_t nextCompareMatchValue, oc_option_update_t typeOfupdate)
 Update the match value on the channel. More...
 
void OC_EnableNotification (const oc_instance_t *const instance, const uint8_t channel)
 Enable channel notifications. More...
 
void OC_DisableNotification (const oc_instance_t *const instance, const uint8_t channel)
 Disable channel notifications. More...
 
void OC_IrqHandler (uint32_t instance, uint8_t channel)
 

Variables

static oc_pal_state_t g_ocPalStatePtr [NUMBER_OF_OC_PAL_INSTANCES]
 
static uint32_t ocStateInstanceMapping [NUMBER_OF_OC_PAL_INSTANCES]
 
static bool ocStateIsAllocated [NUMBER_OF_OC_PAL_INSTANCES]
 

Function Documentation

static uint8_t FindOcState ( uint32_t  instance)
static

Definition at line 194 of file oc_pal.c.

void OC_IrqHandler ( uint32_t  instance,
uint8_t  channel 
)

Definition at line 1194 of file oc_pal.c.

static uint8_t ocAllocateState ( bool *  isAllocated,
uint32_t *  instanceMapping,
uint32_t  instance,
uint8_t  numberOfInstances 
)
static

Definition at line 143 of file oc_pal.c.

static void ocFreeState ( bool *  isAllocated,
uint32_t *  instanceMapping,
uint32_t  instance,
uint8_t  numberOfInstances 
)
static

Definition at line 170 of file oc_pal.c.

Variable Documentation

oc_pal_state_t g_ocPalStatePtr[NUMBER_OF_OC_PAL_INSTANCES]
static

Definition at line 121 of file oc_pal.c.

uint32_t ocStateInstanceMapping[NUMBER_OF_OC_PAL_INSTANCES]
static

Definition at line 124 of file oc_pal.c.

bool ocStateIsAllocated[NUMBER_OF_OC_PAL_INSTANCES]
static

Definition at line 126 of file oc_pal.c.