eBoard
①⑧⑨
Written for SIA 2017/2018
Main Page
Pages
Tutorials
Namespaces
Classes
Files
File List
File Members
eagle_ShiftExt.h
Go to the documentation of this file.
1
#ifndef EAGLE_EBOARD_HELPLIB_SHIFTEXT
2
#define EAGLE_EBOARD_HELPLIB_SHIFTEXT
3
12
//=====================================================================================================================================================
13
// Shift extension
14
//=====================================================================================================================================================
15
16
//-------------------------------------------------------------------------------------------------------------------------------------------------
17
// variables
18
//-------------------------------------------------------------------------------------------------------------------------------------------------
19
23
long
store_bits
= 0L;
24
25
//-------------------------------------------------------------------------------------------------------------------------------------------------
26
// shift single
27
//-------------------------------------------------------------------------------------------------------------------------------------------------
28
37
void
shiftSingle
(
optVAL_t
idx,
bool
val);
38
39
//-------------------------------------------------------------------------------------------------------------------------------------------------
40
// shift all
41
//-------------------------------------------------------------------------------------------------------------------------------------------------
42
46
void
shiftAll
(
void
);
47
49
void
shiftSingle
(
optVAL_t
idx,
bool
val) {
50
bitWrite(
store_bits
,idx,val);
51
shiftAll
();
52
}
53
void
shiftAll
(
void
){
54
digitalWrite(
PIN_SHIFT_LAT
,LOW);
55
for
(
optVAL_t
c = 0; (c<32 && !
STOP
); c++){
56
digitalWrite(
PIN_SHIFT_CLK
,LOW);
57
shiftOut(
PIN_SHIFT_DAT
,
PIN_SHIFT_CLK
,MSBFIRST,bitRead(
store_bits
,c));
58
}
59
digitalWrite(
PIN_SHIFT_LAT
,LOW);
60
}
62
63
#endif
PIN_SHIFT_CLK
#define PIN_SHIFT_CLK
Definition:
eBoard.h:587
STOP
static bool STOP
Definition:
eBoard.h:123
PIN_SHIFT_LAT
#define PIN_SHIFT_LAT
Definition:
eBoard.h:599
store_bits
long store_bits
[SHIFT] Manipulate me to set Pins via bitSet operations
Definition:
eagle_ShiftExt.h:23
shiftAll
void shiftAll(void)
[SHIFT] Changes bits according to store_bits
shiftSingle
void shiftSingle(optVAL_t idx, bool val)
[SHIFT] Changes a single output Pin
optVAL_t
int optVAL_t
Definition:
eBoard.h:137
PIN_SHIFT_DAT
#define PIN_SHIFT_DAT
Definition:
eBoard.h:593
eBoard
source
eagle_ShiftExt.h
[WIP-510]
EagleoutIce
22.06.2018 00:28:45