Library to use my Photo MOS Relays Circuit having 16 or less channels.
Fork of PMRC4ch by
Diff: PMRC16ch.h
- Revision:
- 19:1112aeb5cddd
- Parent:
- 18:049283936e3f
- Child:
- 20:26972de3cf90
--- a/PMRC16ch.h Tue Jun 26 13:00:40 2018 +0000 +++ b/PMRC16ch.h Tue Jun 26 13:14:16 2018 +0000 @@ -59,11 +59,29 @@ PinName arg_RCK, PinName arg_SER, PinName arg_OUT - ); + ); // Const. - enum State {ALLGROUND = 0, CH1 = 1, CH2, CH3, CH4, CH5, CH6, CH7, CH8, - CH9, CH10, CH11, CH12, CH13, CH14, CH15, CH16, ALLHiZ = 9999}; + enum State { + ALLGROUND = 0, + CH1 = 0b/*1V*/1000/**/0000/**/0000/**/0000/**/0000/**/0000/**/0000/**/0000/*16G*/, + CH2 = 0b/*1V*/0010/**/0000/**/0000/**/0000/**/0000/**/0000/**/0000/**/0000/*16G*/, + CH3 = 0b/*1V*/0000/**/1000/**/0000/**/0000/**/0000/**/0000/**/0000/**/0000/*16G*/, + CH4 = 0b/*1V*/0000/**/0010/**/0000/**/0000/**/0000/**/0000/**/0000/**/0000/*16G*/, + CH5 = 0b/*1V*/0000/**/0000/**/1000/**/0000/**/0000/**/0000/**/0000/**/0000/*16G*/, + CH6 = 0b/*1V*/0000/**/0000/**/0010/**/0000/**/0000/**/0000/**/0000/**/0000/*16G*/, + CH7 = 0b/*1V*/0000/**/0000/**/0000/**/1000/**/0000/**/0000/**/0000/**/0000/*16G*/, + CH8 = 0b/*1V*/0000/**/0000/**/0000/**/0010/**/0000/**/0000/**/0000/**/0000/*16G*/, + CH9 = 0b/*1V*/0000/**/0000/**/0000/**/0000/**/1000/**/0000/**/0000/**/0000/*16G*/, + CH10= 0b/*1V*/0000/**/0000/**/0000/**/0000/**/0010/**/0000/**/0000/**/0000/*16G*/, + CH11= 0b/*1V*/0000/**/0000/**/0000/**/0000/**/0000/**/1000/**/0000/**/0000/*16G*/, + CH12= 0b/*1V*/0000/**/0000/**/0000/**/0000/**/0000/**/0010/**/0000/**/0000/*16G*/, + CH13= 0b/*1V*/0000/**/0000/**/0000/**/0000/**/0000/**/0000/**/1000/**/0000/*16G*/, + CH14= 0b/*1V*/0000/**/0000/**/0000/**/0000/**/0000/**/0000/**/0010/**/0000/*16G*/, + CH15= 0b/*1V*/0000/**/0000/**/0000/**/0000/**/0000/**/0000/**/0000/**/1000/*16G*/, + CH16= 0b/*1V*/0000/**/0000/**/0000/**/0000/**/0000/**/0000/**/0000/**/0010/*16G*/, + ALLHiZ = 9999 + }; enum Polarity {Anodic = 0, Cathodic = 1}; // // Function to set channel @@ -83,7 +101,7 @@ // // Sig var to controll PRM circuit // - uint8_t m_num_ch; // The number of channels to use + uint8_t m_num_ch; // The number of channels to use DigitalOut m_SCK; // Shift-resister's clock DigitalOut m_CLR; // To use when you want to clear shift-resister DigitalOut m_RCK; // FF's clock