Logo Search packages:      
Sourcecode: odyssey version File versions

void IO::shift_bits_out ( uint32_t  bits,
int  numbits,
int  tset = 0,
int  thold = 0 
) [virtual, inherited]

Sends a stream of up to 32 bits on the data signal, clocked by the clock signal. The bits are sent LSB first and it is assumed that the device will latch the data on the falling edge of the clock.

bits The data bits to send out, starting at the LSB.
numbits The number of bits to send out.
tset Setup time for the data before the clock's falling edge (in microseconds).
thold The data hold time after the clock's falling edge (in microseconds).

Definition at line 110 of file IO.cxx.

References IO::set_clk(), IO::set_data(), IO::thld_stretch, IO::tset_stretch, and IO::usleep().

Referenced by Pic16f8xxDevice::bulk_erase(), Pic16f6xxDevice::bulk_erase(), Pic16Device::bulk_erase(), Pic16f8xxDevice::disable_codeprotect(), Pic16f87xADevice::disable_codeprotect(), Pic16Device::erase(), Pic16Device::program(), Pic18Device::program_wait(), Pic16Device::read(), PicDevice::write_command(), Pic18Device::write_command(), Pic18Device::write_command_read_data(), Pic16Device::write_ee_data(), and PicDevice::write_prog_data().

      while(numbits > 0) {
            this->set_data(bits & 0x01);
            this->usleep(tset + this->tset_stretch);/* Delay for data setup time */
            this->set_clk(false);                    /* Falling edge */
            this->usleep(thold + this->thld_stretch);/* Delay for data hold time */
            bits >>= 1;

Generated by  Doxygen 1.6.0   Back to index