17.02.2015 Views

CCS C Compiler Manual PCB / PCM / PCH

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Sets up the d/a mode e.g. Right enable, clock divisor<br />

Writes the 16-bit value to the specified channel<br />

Relevant Preprocessor:<br />

Relevant Interrupts:<br />

None<br />

#USE DELAY(clock=20M, Aux: crystal=6M, clock=3M)<br />

Relevant Include Files:<br />

None, all functions built-in<br />

Relevant getenv()<br />

parameters:<br />

None<br />

int8 i=0;<br />

setup_dac (DAC_VSS_VDD);<br />

while (TRUE) {<br />

itt;<br />

dac_write(i);<br />

}<br />

Data Eeprom<br />

The data eeprom memory is readable and writable in some chips. These options lets the user<br />

read and write to the data eeprom memory. These functions are only available in flash chips.<br />

Relevant Functions:<br />

(8 bit or 16 bit depending on the<br />

device)<br />

read_eeprom(address)<br />

write_eeprom(address, value)<br />

Reads the data EEPROM memory location<br />

Erases and writes value to data EEPROM location address.<br />

Reads N bytes of data EEPROM starting at memory location<br />

address. The maximum return size is int64.<br />

Reads from EEPROM to fill variable starting at address<br />

Reads N bytes, starting at address, to pointer<br />

Writes value to EEPROM address<br />

50

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!