BusInOut_Arduino 0.1.0
Temperature sensor device operation sample code for Arduino
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Private Attributes | List of all members
BusInOut Class Reference

#include <BusInOut.h>

Public Member Functions

 BusInOut (uint8_t bit0=nc, uint8_t bit1=nc, uint8_t bit2=nc, uint8_t bit3=nc, uint8_t bit4=nc, uint8_t bit5=nc, uint8_t bit6=nc, uint8_t bit7=nc)
 
uint8_t config (int conf)
 
void value (uint8_t v)
 
uint8_t value (void)
 
BusInOutoperator= (uint8_t v)
 
BusInOutoperator= (BusInOut &rhs)
 
 operator int ()
 

Static Public Attributes

static constexpr uint8_t nc = 0xFF
 

Private Attributes

uint8_t _bits [8]
 
uint8_t _width
 
uint8_t _mode
 

Detailed Description

BusInOut library for Arduino

Author
Tedd OKANO

Released under the MIT license License BusInOut class

Definition at line 19 of file BusInOut.h.

Constructor & Destructor Documentation

◆ BusInOut()

BusInOut::BusInOut ( uint8_t bit0 = nc,
uint8_t bit1 = nc,
uint8_t bit2 = nc,
uint8_t bit3 = nc,
uint8_t bit4 = nc,
uint8_t bit5 = nc,
uint8_t bit6 = nc,
uint8_t bit7 = nc )

Create a BusInOut instance with specified pins

Parameters
bit<n>pin number to connect bus bit<n> (0-13, nc)
Note
define pins from lower to upper. No need to define upper bits if those are not be used

Definition at line 3 of file BusInOut.cpp.

Member Function Documentation

◆ config()

uint8_t BusInOut::config ( int conf)

Configure BusInOut IO direction

Parameters
confINPUT or OUTPUT (defined in Arduino.h)

Definition at line 26 of file BusInOut.cpp.

Referenced by BusInOut().

◆ operator int()

BusInOut::operator int ( )

A short hand for reading pins

Definition at line 82 of file BusInOut.cpp.

◆ operator=() [1/2]

BusInOut & BusInOut::operator= ( BusInOut & rhs)

Definition at line 77 of file BusInOut.cpp.

◆ operator=() [2/2]

BusInOut & BusInOut::operator= ( uint8_t v)

A short hand for setting pins

Definition at line 71 of file BusInOut.cpp.

◆ value() [1/2]

void BusInOut::value ( uint8_t v)

Output a value to BusInOut pins

Parameters
vvalue to be set to pins

Definition at line 45 of file BusInOut.cpp.

◆ value() [2/2]

uint8_t BusInOut::value ( void )

Input a value from BusInOut pins

Returns
value read from pins

Definition at line 56 of file BusInOut.cpp.

Referenced by operator=().

Member Data Documentation

◆ _bits

uint8_t BusInOut::_bits[8]
private

Definition at line 69 of file BusInOut.h.

Referenced by BusInOut(), config(), value(), and value().

◆ _mode

uint8_t BusInOut::_mode
private

Definition at line 71 of file BusInOut.h.

Referenced by config().

◆ _width

uint8_t BusInOut::_width
private

Definition at line 70 of file BusInOut.h.

Referenced by config(), value(), and value().

◆ nc

constexpr uint8_t BusInOut::nc = 0xFF
staticconstexpr

To define non-connected pin, use BusInOut::nc

Definition at line 22 of file BusInOut.h.

Referenced by config(), value(), and value().


The documentation for this class was generated from the following files: