| Wheelchair Control MCU firmware

- Main Page
- Modules
- Data Structures
- Files

All Data Structures Files Functions Variables Enumerations Groups Pages
Files
SRF08 ultrasonic range finders.

## Files
file | SRF08.c
void | I2C_Init (void)
void | I2C_Stop (void)
uint8_t | I2C_Start (uint8_t addr)
uint8_t | I2C_Write (uint8_t data)
uint8_t | I2C_ReadAck (void)
uint8_t | I2C_ReadNak (void)
uint8_t | SRF08_Write (uint8_t address, uint8_t reg, uint8_t data)
uint8_t | SRF08_Read (uint8_t address, uint8_t reg)

## Detailed Description

Library functions for handling SRF08 range finders.

## Function Documentation

void I2C_Init | ( | void |  | ) |

Initializes I2C.

Definition at line 15 of file SRF08.c.

uint8_t I2C_ReadAck | ( | void |  | ) |

Reads data from the previously addressed device, generates ACK bit.

Definition at line 69 of file SRF08.c.

uint8_t I2C_ReadNak | ( | void |  | ) |

Reads data from the previously addressed device, generates NACK bit.

Definition at line 78 of file SRF08.c.

uint8_t I2C_Start | ( | uint8_t | addr | ) |

Sends start sequence and addresses device.

Definition at line 21 of file SRF08.c.

void I2C_Stop | ( | void |  | ) |

Sends stop sequence.

Definition at line 46 of file SRF08.c.

uint8_t I2C_Write | ( | uint8_t | data | ) |

Writes data to the previously addressed device.

Definition at line 53 of file SRF08.c.

uint8_t SRF08_Read | ( | uint8_t | address,
|  | uint8_t | reg
| ) |  |

Reads data from the register of the assigned device.

Parameters

  address | Device address.
  reg | Device register to read from.

Returns
  Data from the register / 0 on error.

Definition at line 115 of file SRF08.c.

uint8_t SRF08_Write | ( | uint8_t | address,
|  | uint8_t | reg,
|  | uint8_t | data
| ) |  |

Writes data to the register of the assigned device.

Parameters

  address | Device address.
  reg | Device register to write to.
  data | 1 byte of data to write.

Returns
  FALSE if write is successful / TRUE if write fails.

Definition at line 87 of file SRF08.c.