This is a library to use HV507 boards as a switching circuitry which is a module used with an electrical stimulator made by kaji-lab.
Diff: KajiLabHV507B.h
- Revision:
- 3:ac9dea7bfe0a
- Parent:
- 2:1c2e272dc40f
- Child:
- 4:ecc4655a337b
--- a/KajiLabHV507B.h Tue Nov 27 21:43:00 2018 +0000 +++ b/KajiLabHV507B.h Tue Nov 27 22:02:28 2018 +0000 @@ -47,22 +47,39 @@ class HV507 { public: - /** Construction + /** Constructor * - * \Pram arg_num_of_board the number of Hv507 board. + * \Param arg_num_of_board the number of Hv507 board. */ HV507(const int arg_num_board = 1); /** HV507 initialization + * + * This is curried in constructor. + * In this function, all output pins are set as L (ALL GROUND), + * and Porarity (POL) is set to 1 (nomal mode; in other words, + * data in latches of HV507 is reflected to output as is. + * If POL = 0, the output is inverted data (inverse mode). */ void init(); + /** Set a stim bit. + * + * Set one high bit (1) this is regarded as stim bit. + */ void setHtoSR(); + + /** Set a ground bit + * + * Set one low bit (0) this is regarded as ground bit. + * If shifting the register many times, it is recommended to use + * shiftSRBits_by(). + */ void setLtoSR(); /** Function to shift data only index-incresing-direction * - * \Pram arg_ch stimulation point + * \Param arg_ch stimulation point */ void shiftSRBits_by(int arg_num_shifting); @@ -70,9 +87,19 @@ */ void clearSR(); + /** Function to define ONE stimulation point + * + * \param arg_ch the pin number supposed to be a stim pin. + */ void setCh(const int arg_ch); + /** Function to store data in shift register to latches. + * + * This is called in setCh. But if you need to use other function to deal + * the shift rester, you should call this function to output the data. + */ void updateLatches(); + void DEBUG_ALLPIN_ON(); void DEBUG_ALLPIN_OFF(); @@ -94,6 +121,7 @@ */ //enum :int {HV507_NUM_PINS = 64}; static const int HV507_NUM_PINS = 64; + /** The variable expressing the postion of stimulation point * * - 0 : No stimulationpoint