NXP DAL  v05.02.00
Driver Abstraction Layer (DAL)

This component implements hardware drivers that are necessary for RdLib software modules. More...

Data Structures

struct  phDriver_Pin_Config_t
 Port/GPIO PIN configuration. More...
 

Macros

#define PH_COMP_DRIVER   0xF100U
 DRIVER component code. More...
 
#define PH_COMP_MASK   0xFF00U
 Component Mask for status code and component ID. More...
 
#define PH_COMPID_MASK   0x00FFU
 ID Mask for component ID. More...
 
#define PH_ERR_MASK   0x00FFU
 Error Mask for status code. More...
 
#define PH_COMP_GENERIC   0x0000U
 Generic Component Code. More...
 
#define PH_DRIVER_SUCCESS   0x0000
 Generic Status codes. More...
 
#define PH_DRIVER_TIMEOUT   0x0001
 No reply received, e.g. More...
 
#define PH_DRIVER_ABORTED   0x0012
 Used when HAL ShutDown is called. More...
 
#define PH_DRIVER_ERROR   0x0080
 Invalid Parameter, buffer overflow or other configuration error. More...
 
#define PH_DRIVER_FAILURE   0x0081
 Failed to perform the requested operation. More...
 
#define PH_DRIVER_PULL_DOWN   0x00
 Pin pull-up and pull-down settings. More...
 
#define PH_DRIVER_PULL_UP   0x01
 Pull-up selected. More...
 

Typedefs

typedef uint16_t phStatus_t
 phStatus_t is a signed short value, using the positive range. More...
 
typedef void(* pphDriver_InterruptCallBck_t) (void)
 Interrupt callback interface which will be called when interrupt is triggered on IRQ Pin. More...
 
typedef void(* pphDriver_TimerCallBck_t) (void)
 Timer callback interface which will be called when timer expires. More...
 

Enumerations

enum  phDriver_Pin_Func_t { PH_DRIVER_PINFUNC_INPUT = 0x01, PH_DRIVER_PINFUNC_OUTPUT, PH_DRIVER_PINFUNC_BIDIR, PH_DRIVER_PINFUNC_INTERRUPT }
 Port/GPIO PIN functionality. More...
 
enum  phDriver_Interrupt_Config_t {
  PH_DRIVER_INTERRUPT_LEVELZERO = 0x01, PH_DRIVER_INTERRUPT_LEVELONE, PH_DRIVER_INTERRUPT_RISINGEDGE, PH_DRIVER_INTERRUPT_FALLINGEDGE,
  PH_DRIVER_INTERRUPT_EITHEREDGE
}
 PIN Interrupt configuration. More...
 
enum  phDriver_Timer_Unit_t { PH_DRIVER_TIMER_SECS = 1, PH_DRIVER_TIMER_MILLI_SECS = 1000, PH_DRIVER_TIMER_MICRO_SECS = 1000000 }
 Timer units. More...
 

Functions

phStatus_t phDriver_PinConfig (uint32_t dwPinNumber, phDriver_Pin_Func_t ePinFunc, phDriver_Pin_Config_t *pPinConfig)
 Configures the Gpio/Port pin for the specified configuration. More...
 
uint8_t phDriver_PinRead (uint32_t dwPinNumber, phDriver_Pin_Func_t ePinFunc)
 Read the state of the Gpio pin, in case of interrupt pin it will return interrupt status. More...
 
void phDriver_PinWrite (uint32_t dwPinNumber, uint8_t bValue)
 Write to the Gpio/Port pin. More...
 
void phDriver_PinClearIntStatus (uint32_t dwPinNumber)
 Clear interrupt status. More...
 
phStatus_t phDriver_TimerStart (phDriver_Timer_Unit_t eTimerUnit, uint32_t dwTimePeriod, pphDriver_TimerCallBck_t pTimerCallBack)
 Creates and triggers a single shot Timer for the specified time. More...
 
phStatus_t phDriver_TimerStop (void)
 Stops the running Timer. More...
 

Floating-Point Types

typedef float float32_t
 32 bit floating point
 
#define __float32_t_defined
 

Detailed Description

This component implements hardware drivers that are necessary for RdLib software modules.

Macro Definition Documentation

§ PH_COMP_DRIVER

#define PH_COMP_DRIVER   0xF100U

DRIVER component code.

§ PH_COMP_MASK

#define PH_COMP_MASK   0xFF00U

Component Mask for status code and component ID.

§ PH_COMPID_MASK

#define PH_COMPID_MASK   0x00FFU

ID Mask for component ID.

§ PH_ERR_MASK

#define PH_ERR_MASK   0x00FFU

Error Mask for status code.

§ PH_COMP_GENERIC

#define PH_COMP_GENERIC   0x0000U

Generic Component Code.

§ PH_DRIVER_SUCCESS

#define PH_DRIVER_SUCCESS   0x0000

Generic Status codes.

All functions within the phDriver use these macro values as return codes.Function executed successfully.

§ PH_DRIVER_TIMEOUT

#define PH_DRIVER_TIMEOUT   0x0001

No reply received, e.g.

PICC removal.

§ PH_DRIVER_ABORTED

#define PH_DRIVER_ABORTED   0x0012

Used when HAL ShutDown is called.

§ PH_DRIVER_ERROR

#define PH_DRIVER_ERROR   0x0080

Invalid Parameter, buffer overflow or other configuration error.

§ PH_DRIVER_FAILURE

#define PH_DRIVER_FAILURE   0x0081

Failed to perform the requested operation.

§ PH_DRIVER_PULL_DOWN

#define PH_DRIVER_PULL_DOWN   0x00

Pin pull-up and pull-down settings.

Pull-down selected.

§ PH_DRIVER_PULL_UP

#define PH_DRIVER_PULL_UP   0x01

Pull-up selected.

Typedef Documentation

§ phStatus_t

typedef uint16_t phStatus_t

phStatus_t is a signed short value, using the positive range.

High byte: Category (group) Identifier.
Low byte : Error Specifier.

§ pphDriver_InterruptCallBck_t

typedef void(* pphDriver_InterruptCallBck_t) (void)

Interrupt callback interface which will be called when interrupt is triggered on IRQ Pin.

Return values
None

§ pphDriver_TimerCallBck_t

typedef void(* pphDriver_TimerCallBck_t) (void)

Timer callback interface which will be called when timer expires.

Return values
None

Enumeration Type Documentation

§ phDriver_Pin_Func_t

Port/GPIO PIN functionality.

Enumerator
PH_DRIVER_PINFUNC_INPUT 

Input pinpad.

PH_DRIVER_PINFUNC_OUTPUT 

Output pinpad.

PH_DRIVER_PINFUNC_BIDIR 

Bidirectional pinpad.

PH_DRIVER_PINFUNC_INTERRUPT 

Interrupt pin.

§ phDriver_Interrupt_Config_t

PIN Interrupt configuration.

Enumerator
PH_DRIVER_INTERRUPT_LEVELZERO 

Interrupt when level zero.

PH_DRIVER_INTERRUPT_LEVELONE 

Interrupt when level one.

PH_DRIVER_INTERRUPT_RISINGEDGE 

Interrupt on rising edge.

PH_DRIVER_INTERRUPT_FALLINGEDGE 

Interrupt on falling edge.

PH_DRIVER_INTERRUPT_EITHEREDGE 

Interrupt on either edge.

§ phDriver_Timer_Unit_t

Timer units.

Enumerator
PH_DRIVER_TIMER_SECS 

Seconds timer.

PH_DRIVER_TIMER_MILLI_SECS 

Milliseconds timer.

PH_DRIVER_TIMER_MICRO_SECS 

Microseconds timer.

Function Documentation

§ phDriver_PinConfig()

phStatus_t phDriver_PinConfig ( uint32_t  dwPinNumber,
phDriver_Pin_Func_t  ePinFunc,
phDriver_Pin_Config_t pPinConfig 
)

Configures the Gpio/Port pin for the specified configuration.

Parameters
[in]dwPinNumberGpio/Port pin number that needs to be configured.
[in]ePinFuncWhether Gpio/Port Pin needs to be configured as Input/Output/Interrupt pin.
[in]pPinConfigPin configurations.
Returns
Status of the API
Return values
PH_DRIVER_SUCCESSOperation successful.

§ phDriver_PinRead()

uint8_t phDriver_PinRead ( uint32_t  dwPinNumber,
phDriver_Pin_Func_t  ePinFunc 
)

Read the state of the Gpio pin, in case of interrupt pin it will return interrupt status.

Parameters
[in]dwPinNumberGpio/Port pin number to read.
[in]ePinFuncWhether Gpio/Port Pin that needs to be read is Output or Interrupt pin.
Returns
Status of the Gpio/Interrupt status either 1 or 0.

§ phDriver_PinWrite()

void phDriver_PinWrite ( uint32_t  dwPinNumber,
uint8_t  bValue 
)

Write to the Gpio/Port pin.

Parameters
[in]dwPinNumberGpio/Port pin number to write.
[in]bValueEither 1 or 0 to write to Gpio/Port pin .
Returns
Nothing

§ phDriver_PinClearIntStatus()

void phDriver_PinClearIntStatus ( uint32_t  dwPinNumber)

Clear interrupt status.

Parameters
[in]dwPinNumberInterrupt Pin number to clear interrupt status.
Returns
Nothing

§ phDriver_TimerStart()

phStatus_t phDriver_TimerStart ( phDriver_Timer_Unit_t  eTimerUnit,
uint32_t  dwTimePeriod,
pphDriver_TimerCallBck_t  pTimerCallBack 
)

Creates and triggers a single shot Timer for the specified time.

Parameters
[in]eTimerUnitRepresents timer unit i.e. seconds, milliseconds or microseconds..
[in]dwTimePeriodTimer Timeout in units
[in]pTimerCallBackTimer callback function in case of timeout. If pTimerCallBack is NULL then phDriver_TimerStart will be a blocking call and will return upon Timer Timeout.
Returns
Status of the API
Return values
PH_DRIVER_SUCCESSOperation successful.

§ phDriver_TimerStop()

phStatus_t phDriver_TimerStop ( void  )

Stops the running Timer.

Returns
Status of the API
Return values
PH_DRIVER_SUCCESSOperation successful.