Pond Electronics - Home of the µFlash876 & µFlash876B embedded controllers, µStack & µConnect Bus.

ucon Module

Low level support for I2C protocol on the µConnect bus.

uc_enable_pullups

void uc_enable_pullups(void);

Enable the internal pullups on the uSCL and uSDA pins, this allows direct connection of these pins to an I2C peripheral without the use of external pull up resistors. Note that this function should not be used if the uSCL and uSDA lines are already connected to a µConnect buffer (as in the case of the µCore carrier board).

uc_wstart

void uc_wstart(BYTE x);

Starts a write cycle on the µConnect bus to a peripheral located at I2C address x. See uc_write for an example.

uc_write

void uc_write(BYTE c);

Write a single byte to the µConnect bus using I2C protocol.

uc_wstart(0x23);   // start a write to I2C address 0x23   
ux_write(0x01);    // write data 0x01
uc_write(0x34);    // write data 0x34
uc_stop();         // terminate write cycle

uc_rstart

#include void uc_rstart(BYTE x);

Starts a read cycle on the µConnect bus from a peripheral located at I2C address x. See uc_read for an example.

uc_read

BYTE uc_read(BYTE more);

Returns a single byte read from I2C device addressed in the current read cycle. uc_read takes a parameter to indicate if any further reads are pending, the last read in a sequence should always have more=0, other reads should have more!=0.

BYTE d[3];              // buffer for read data

uc_rstart(0x42);        // address I2C device at address 0x42   
d[0]=uc_read(1);        // read first byte from device
d[1]=uc_read(1);        // read second byte
d[3]=uc_read(0);        // read last byte
uc_stop();              // terminate read cycle

uc_stop

void uc_stop(void);

Terminate an I2C read or write cycle on the µConnect bus.


Home | Products | Technical Info | How to Order | Contact Us | Links