SdFat
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Classes | Functions | Variables
Fast Pin I/O

Classes

class  DigitalPin< PinNumber >
 Fast digital port I/O. More...
 
class  pin_map_t
 struct for mapping digital pins More...
 

Functions

static void badPinCheck (uint8_t pin)
 
void badPinNumber (void)
 
static void fastBitWriteSafe (volatile uint8_t *address, uint8_t bit, bool level)
 
static bool fastDigitalRead (uint8_t pin)
 
static void fastDigitalToggle (uint8_t pin)
 
static void fastDigitalWrite (uint8_t pin, bool level)
 
static void fastPinConfig (uint8_t pin, bool mode, bool level)
 
static void fastPinMode (uint8_t pin, bool mode)
 

Variables

static const uint8_t digitalPinCount = sizeof(pinMap)/sizeof(pin_map_t)
 

Detailed Description

Fast Digital I/O functions and template class.

Function Documentation

static void badPinCheck ( uint8_t  pin)
inlinestatic

Check for valid pin number

Parameters
[in]pinNumber of pin to be checked.
void badPinNumber ( void  )

generate bad pin number error

static void fastBitWriteSafe ( volatile uint8_t *  address,
uint8_t  bit,
bool  level 
)
inlinestatic

fast write helper

Parameters
[in]addressI/O register address
[in]bitbit number to write
[in]levelvalue for bit
static bool fastDigitalRead ( uint8_t  pin)
inlinestatic

read pin value

Parameters
[in]pinArduino pin number
Returns
value read
static void fastDigitalToggle ( uint8_t  pin)
inlinestatic

toggle a pin

Parameters
[in]pinArduino pin number

If the pin is in output mode toggle the pin level. If the pin is in input mode toggle the state of the 20K pull-up.

static void fastDigitalWrite ( uint8_t  pin,
bool  level 
)
inlinestatic

Set pin value

Parameters
[in]pinArduino pin number
[in]levelvalue to write
static void fastPinConfig ( uint8_t  pin,
bool  mode,
bool  level 
)
inlinestatic

set pin configuration

Parameters
[in]pinArduino pin number
[in]modeIf true set output mode else input mode
[in]levelIf mode is output, set level high/low. If mode is input, enable or disable the pin's 20K pull-up.
static void fastPinMode ( uint8_t  pin,
bool  mode 
)
inlinestatic

set pin mode

Parameters
[in]pinArduino pin number
[in]modeif true set output mode else input mode

fastPinMode does not enable or disable the 20K pull-up for input mode.

Variable Documentation

const uint8_t digitalPinCount = sizeof(pinMap)/sizeof(pin_map_t)
static

count of pins