The library for Shift Register (ex. 74595).
Dependents: 888LEDCUBE_RGB 888LEDCUBE_RGB
SPIShiftReg.h@0:9f0e9ea56740, 2015-07-22 (annotated)
- Committer:
- ztztno1
- Date:
- Wed Jul 22 13:36:52 2015 +0000
- Revision:
- 0:9f0e9ea56740
new Repo
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ztztno1 | 0:9f0e9ea56740 | 1 | /* |
ztztno1 | 0:9f0e9ea56740 | 2 | The MIT License (MIT) |
ztztno1 | 0:9f0e9ea56740 | 3 | |
ztztno1 | 0:9f0e9ea56740 | 4 | Copyright (c) 2015 雑学追究室ぐり |
ztztno1 | 0:9f0e9ea56740 | 5 | |
ztztno1 | 0:9f0e9ea56740 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy |
ztztno1 | 0:9f0e9ea56740 | 7 | of this software and associated documentation files (the "Software"), to deal |
ztztno1 | 0:9f0e9ea56740 | 8 | in the Software without restriction, including without limitation the rights |
ztztno1 | 0:9f0e9ea56740 | 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
ztztno1 | 0:9f0e9ea56740 | 10 | copies of the Software, and to permit persons to whom the Software is |
ztztno1 | 0:9f0e9ea56740 | 11 | furnished to do so, subject to the following conditions: |
ztztno1 | 0:9f0e9ea56740 | 12 | |
ztztno1 | 0:9f0e9ea56740 | 13 | The above copyright notice and this permission notice shall be included in all |
ztztno1 | 0:9f0e9ea56740 | 14 | copies or substantial portions of the Software. |
ztztno1 | 0:9f0e9ea56740 | 15 | |
ztztno1 | 0:9f0e9ea56740 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
ztztno1 | 0:9f0e9ea56740 | 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
ztztno1 | 0:9f0e9ea56740 | 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
ztztno1 | 0:9f0e9ea56740 | 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
ztztno1 | 0:9f0e9ea56740 | 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
ztztno1 | 0:9f0e9ea56740 | 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
ztztno1 | 0:9f0e9ea56740 | 22 | SOFTWARE. |
ztztno1 | 0:9f0e9ea56740 | 23 | */ |
ztztno1 | 0:9f0e9ea56740 | 24 | |
ztztno1 | 0:9f0e9ea56740 | 25 | |
ztztno1 | 0:9f0e9ea56740 | 26 | #ifndef _SPISHIFTREG_H_ |
ztztno1 | 0:9f0e9ea56740 | 27 | #define _SPISHIFTREG_H_ |
ztztno1 | 0:9f0e9ea56740 | 28 | #include "mbed.h" |
ztztno1 | 0:9f0e9ea56740 | 29 | |
ztztno1 | 0:9f0e9ea56740 | 30 | class SPIShiftReg{ |
ztztno1 | 0:9f0e9ea56740 | 31 | public: |
ztztno1 | 0:9f0e9ea56740 | 32 | SPIShiftReg(PinName data, PinName dclk, PinName rck, int freq = 1000000); |
ztztno1 | 0:9f0e9ea56740 | 33 | // ~SPIShiftReg(); |
ztztno1 | 0:9f0e9ea56740 | 34 | void write(char data[], int len); |
ztztno1 | 0:9f0e9ea56740 | 35 | |
ztztno1 | 0:9f0e9ea56740 | 36 | private: |
ztztno1 | 0:9f0e9ea56740 | 37 | SPI spi; |
ztztno1 | 0:9f0e9ea56740 | 38 | DigitalOut _rck; |
ztztno1 | 0:9f0e9ea56740 | 39 | }; |
ztztno1 | 0:9f0e9ea56740 | 40 | |
ztztno1 | 0:9f0e9ea56740 | 41 | |
ztztno1 | 0:9f0e9ea56740 | 42 | #endif |