Logo Search packages:      
Sourcecode: odyssey version File versions

void Pic18Device::load_write_buffer ( DataBuffer buf,
unsigned int  panel,
unsigned int  offset,
bool  last 
) [protected, virtual]

Loads the write buffer for a panel and optionally begins the write sequence.

Parameters:
buf The DataBuffer from which to retrieve data.
panel The panel number whose buffer to fill.
offset The offset into the panel to write the data.
last A boolean value indicating if this is the last panel buffer to be loaded. If so, the write is initiated after this panel buffer is written.
Postcondition:
The progress_count is incremented by the number of words written to the write buffer. On success this is 4.

If last is true, a call to program_wait() or the equivalent must be made so the write is properly timed.

Definition at line 463 of file Pic18Device.cxx.

References COMMAND_TABLE_WRITE_POSTINC, COMMAND_TABLE_WRITE_START, Device::progress_count, set_tblptr(), and write_command().

Referenced by write_id_memory(), and write_program_memory().

                                  {
      unsigned long addr;
      int i;

      addr = (panel << PANEL_SHIFT) + offset;
      set_tblptr(addr);
      for(i=0; i<3; i++) {          /* Write 3 words */
            write_command(COMMAND_TABLE_WRITE_POSTINC, buf[(addr / 2) + i]);
            this->progress_count++;
      }
      if(last) {
            /* Do the final word write which also starts the programming */
            write_command(COMMAND_TABLE_WRITE_START, buf[(addr / 2) + 3]);
      } else {
            /* Just another load */
            write_command(COMMAND_TABLE_WRITE_POSTINC, buf[(addr / 2) + 3]);
      }
      this->progress_count++;
}


Generated by  Doxygen 1.6.0   Back to index