Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
LpcGpioPin< PORT, PIN > Struct Template Reference

Static GPIO implementation for the NXP LPC microcontrollers. More...

#include <Lpc17xx40xxGPIO.hxx>

Static Public Member Functions

static constexpr uint8_t port ()
 
static constexpr uint8_t pin ()
 
static void set (bool value)
 Sets the output pin to a given level.
 
static void toggle ()
 Toggles the output pin level.
 
static bool get ()
 
static constexpr const Gpioinstance ()
 
static bool is_output ()
 

Static Protected Member Functions

static void set_output ()
 Configures pin as output.
 
static void set_input ()
 Configures pin as input.
 

Detailed Description

template<uint8_t PORT, uint8_t PIN>
struct LpcGpioPin< PORT, PIN >

Static GPIO implementation for the NXP LPC microcontrollers.

Parameters
PORTis the port number (like 0, 1, 2). E.g. for P1.12 this is 1.
PINis the number of th epin in the port. E.g. for P1.12 this is 12.

Definition at line 49 of file Lpc17xx40xxGPIO.hxx.

Member Function Documentation

◆ get()

template<uint8_t PORT, uint8_t PIN>
static bool LpcGpioPin< PORT, PIN >::get ( )
inlinestatic
Returns
true if the pin is currently seeing HIGH input level, otherwiae false.

Definition at line 73 of file Lpc17xx40xxGPIO.hxx.

◆ instance()

template<uint8_t PORT, uint8_t PIN>
static constexpr const Gpio * LpcGpioPin< PORT, PIN >::instance ( )
inlinestaticconstexpr
Returns
an os-indepentent Gpio abstraction instance for use in libraries.

Definition at line 80 of file Lpc17xx40xxGPIO.hxx.

◆ is_output()

template<uint8_t PORT, uint8_t PIN>
static bool LpcGpioPin< PORT, PIN >::is_output ( )
inlinestatic
Returns
true if the pin is configured as an output.

Definition at line 86 of file Lpc17xx40xxGPIO.hxx.

◆ pin()

template<uint8_t PORT, uint8_t PIN>
static constexpr uint8_t LpcGpioPin< PORT, PIN >::pin ( )
inlinestaticconstexpr
Returns
the pin number on the LPC17xx (e.g. 12 for pin P0_12).

Definition at line 57 of file Lpc17xx40xxGPIO.hxx.

◆ port()

template<uint8_t PORT, uint8_t PIN>
static constexpr uint8_t LpcGpioPin< PORT, PIN >::port ( )
inlinestaticconstexpr
Returns
the port number on the LPC17xx (e.g. 0 for pin P0_12).

Definition at line 52 of file Lpc17xx40xxGPIO.hxx.

◆ set()

template<uint8_t PORT, uint8_t PIN>
static void LpcGpioPin< PORT, PIN >::set ( bool  value)
inlinestatic

Sets the output pin to a given level.

Definition at line 62 of file Lpc17xx40xxGPIO.hxx.

◆ set_input()

template<uint8_t PORT, uint8_t PIN>
static void LpcGpioPin< PORT, PIN >::set_input ( )
inlinestaticprotected

Configures pin as input.

Definition at line 98 of file Lpc17xx40xxGPIO.hxx.

◆ set_output()

template<uint8_t PORT, uint8_t PIN>
static void LpcGpioPin< PORT, PIN >::set_output ( )
inlinestaticprotected

Configures pin as output.

Definition at line 93 of file Lpc17xx40xxGPIO.hxx.

◆ toggle()

template<uint8_t PORT, uint8_t PIN>
static void LpcGpioPin< PORT, PIN >::toggle ( )
inlinestatic

Toggles the output pin level.

Definition at line 67 of file Lpc17xx40xxGPIO.hxx.


The documentation for this struct was generated from the following file: