API Documentation
Software_Controlled_IO_IO004 App
void IO004_Init (void)
#define IO004_ReadPin(Handle)   (((Handle.PortRegs->IN) >> Handle.PortPin) & 1U)
#define IO004_SetPin(Handle)   ((Handle.PortRegs->OMR) |= (1U << Handle.PortPin))
#define IO004_SetOutputValue(Handle, Value)   (Handle.PortRegs->OMR |= Value ? (1U << Handle.PortPin):(0x10000UL << Handle.PortPin))
#define IO004_ResetPin(Handle)   ((Handle.PortRegs->OMR) |= (0x10000UL << Handle.PortPin))
#define IO004_TogglePin(Handle)   ((Handle.PortRegs->OMR) |= (0x10001UL << Handle.PortPin))
void IO004_DisableOutputDriver (const IO004_HandleType *Handle, IO004_InputModeType Mode)
void IO004_EnableOutputDriver (const IO004_HandleType *Handle, IO004_OutputModeType Mode)

Define Documentation

#define IO004_ReadPin (   Handle)    (((Handle.PortRegs->IN) >> Handle.PortPin) & 1U)

This macro reads value at portpin.

Parameters:
[in]Handleto Port Pin App Instance
Returns:
Value at Pin

Reentrant: NO


Example:

 #include <DAVE3.h>

  int main(void)
  {
    bool Value = 0;
    DAVE_Init(); // IO004_Init() is called within DAVE_Init()
    Value = IO004_ReadPin(IO004_Handle0);
    return 0;
  }


<<<DD_IO004_API_2>>>

#define IO004_ResetPin (   Handle)    ((Handle.PortRegs->OMR) |= (0x10000UL << Handle.PortPin))

This macro sets the chosen portpin to '0'.

Parameters:
[in]Handleto Port Pin App Instance
Returns:
None

Reentrant: NO


Example:

 #include <DAVE3.h>

  int main(void)
  {
    DAVE_Init(); // IO004_Init() is called within DAVE_Init()
    IO004_ResetPin(IO004_Handle0);
    return 0;
  }


<<<DD_IO004_API_4>>>

#define IO004_SetOutputValue (   Handle,
  Value 
)    (Handle.PortRegs->OMR |= Value ? (1U << Handle.PortPin):(0x10000UL << Handle.PortPin))

This macro sets the chosen portpin with the boolean value provided.

Parameters:
[in]Handleto Port Pin App Instance
Returns:
None

Reentrant: NO


Example:

 #include <DAVE3.h>

  int main(void)
  {
    DAVE_Init(); // IO002_Init() is called within DAVE_Init()
    IO004_SetOutputValue(IO004_Handle0,1);
    return 0;
  }


#define IO004_SetPin (   Handle)    ((Handle.PortRegs->OMR) |= (1U << Handle.PortPin))

This macro sets the chosen portpin to '1'.

Parameters:
[in]Handleto Port Pin App Instance
Returns:
None

Reentrant: NO


Example:

 #include <DAVE3.h>

  int main(void)
  {
    DAVE_Init(); // IO004_Init() is called within DAVE_Init()
    IO004_SetPin(IO004_Handle0);
    return 0;
  }


<<<DD_IO004_API_3>>>

#define IO004_TogglePin (   Handle)    ((Handle.PortRegs->OMR) |= (0x10001UL << Handle.PortPin))

This macro toggles the chosen portpin.

Parameters:
[in]Handleto Port Pin App Instance
Returns:
None

Reentrant: NO


Example:

 #include <DAVE3.h>

  int main(void)
  {
    DAVE_Init(); // IO004_Init() is called within DAVE_Init()
    IO004_TogglePin(IO004_Handle0);
    return 0;
  }


<<<DD_IO004_API_6>>>


Function Documentation

void IO004_DisableOutputDriver ( const IO004_HandleType Handle,
IO004_InputModeType  Mode 
)

The chosen portpin is configured as input. The following definitions for Mode are available:
IO004_TRISTATE (no pull device connected)
IO004_PULL_DOWN_DEVICE (pull-down device connected)
IO004_PULL_UP_DEVICE (pull-up device connected)
IO004_CONT_POLLING (Pn_OUTx continuously samples input value)
IO004_INV_TRISTATE (Inverted no pull device connected)
IO004_INV_PULL_DOWN_DEVICE (Inverted pull-down device connected)
IO004_INV_IO004_PULL_UP_DEVICE(Inverted pull-up device connected)
IO004_INV_CONT_POLLING (Pn_OUTx continuously samples input value)

Parameters:
[in]Handleto Port Pin App Instance
[in]ModeInput selection(Pull-Down,Pull-Up,Inv-Pull-Down,Inv-Pull-Up) for chosen port pin
Returns:
None

Reentrant: NO


Example:

 #include <DAVE3.h>

  int main(void)
  {
    DAVE_Init(); // IO004_Init() is called within DAVE_Init()
    IO004_DisableOutputDriver(&IO004_Handle0,IO004_PULL_UP_DEVICE);
    return 0;
  }


void IO004_EnableOutputDriver ( const IO004_HandleType Handle,
IO004_OutputModeType  Mode 
)

The chosen portpin is configured as output. The following definitions for Mode are available: IO004_PUSHPULL (push-pull mode) IO004_OPENDRAIN (open drain mode)

Parameters:
[in]Handleto Port Pin App Instance
[in]Mode- Output Characteristic(Push-Pull,Open-Drain)for chosen port Pin
Returns:
None

Reentrant: NO


Example:

 #include <DAVE3.h>

  int main(void)
  {
    DAVE_Init(); // IO004_Init() is called within DAVE_Init()
    IO004_EnableOutputDriver(&IO004_Handle0,IO004_OPENDRAIN);
    return 0;
  }


void IO004_Init ( void  )

Initializes all the App instances based on user configuration

Returns:
None

Reentrant: NO


Example:

 #include <DAVE3.h>

  int main(void)
  {
    DAVE_Init();  // IO004_Init() is called within DAVE_Init()
    return 0;
  }


Inclusion of header file