- Main Page
- Modules
- Data Structures
- Files
- Directories

# e_I2C_master_module.c File Reference

Manage I2C basics. More...

`#include "e_I2C_master_module.h"`

## Functions
void | idle_i2c (void)
| Wait until I2C Bus is Inactive.
char | e_i2c_init (void)
| Initialize the microcontroller for I2C uses.
char | e_i2c_reset (void)
| Reset the microcontroller for I2C uses.
char | e_i2c_enable (void)
| Enable special I2C interrupt.
char | e_i2c_disable (void)
| Disable special I2C interrupt.
char | e_i2c_start (void)
| Make the start bit.
char | e_i2c_restart (void)
| Make the restart bit.
char | e_i2c_stop (void)
| Make the stop bit.
char | e_i2c_ack (void)
| Make the acknowledgement bit.
char | e_i2c_nack (void)
| Make the non-acknowledgement bit.
char | e_i2c_read (char *buf)
| Read the I2C input register.
char | e_i2c_write (char byte)
| Write on the I2C output register.
void | __attribute__ ((__interrupt__, auto_psv))
## Variables
char | e_i2c_mode
int | e_interrupts [3]

## Detailed Description

Manage I2C basics.

This module manage the I2C basics functions (low level I2C functions).
They are made to perform the basics tasks like:

- initializing the I2C on the microcontroller
- sending the Start bit (e_i2c_start)
- sending the Restart bit (e_i2c_restart)
- sending the Stop bit (e_i2c_stop)
- sending the acknowledgement bit (e_i2c_ack)
- writing or receiving a byte (e_i2c_write, e_i2c_read)
- ...

Author:
  Code: Davis Daidie
  Doc: Jonathan Besuchet

## Function Documentation

void __attribute__ | ( | (__interrupt__, auto_psv) |  | ) |

char e_i2c_ack | ( | void |  | ) |

Make the acknowledgement bit.

Returns:
  1 to confirme the oparation and 0 for an error

char e_i2c_disable | ( | void |  | ) |

Disable special I2C interrupt.

Returns:
  1 to confirme the oparation and 0 for an error

char e_i2c_enable | ( | void |  | ) |

Enable special I2C interrupt.

Returns:
  1 to confirme the oparation and 0 for an error

char e_i2c_init | ( | void |  | ) |

Initialize the microcontroller for I2C uses.

Returns:
  1 to confirme the oparation and 0 for an error

char e_i2c_nack | ( | void |  | ) |

Make the non-acknowledgement bit.

Returns:
  1 to confirme the oparation and 0 for an error

char e_i2c_read | ( | char * | buf | ) |

Read the I2C input register.

Parameters:

  | buf | A pointer to store the datas received

Returns:
  1 to confirme the oparation and 0 for an error

char e_i2c_reset | ( | void |  | ) |

Reset the microcontroller for I2C uses.

Returns:
  1 to confirme the oparation and 0 for an error

char e_i2c_restart | ( | void |  | ) |

Make the restart bit.

Returns:
  1 to confirme the oparation and 0 for an error

char e_i2c_start | ( | void |  | ) |

Make the start bit.

Returns:
  1 to confirme the oparation and 0 for an error

char e_i2c_stop | ( | void |  | ) |

Make the stop bit.

Returns:
  1 to confirme the oparation and 0 for an error

char e_i2c_write | ( | char | byte | ) |

Write on the I2C output register.

Parameters:

  | byte | What you want to send on I2C

Returns:
  1 to confirme the oparation and 0 for an error

void idle_i2c | ( | void |  | ) |

Wait until I2C Bus is Inactive.

## Variable Documentation

char e_i2c_mode

int e_interrupts[3]