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

# e_I2C_master_module.h File Reference

Manage I2C basics. More...

`#include "p30f6014A.h"`

## Defines
#define | START 1
#define | WRITE 2
#define | ACKNOWLEDGE 3
#define | READ 4
#define | STOP 5
#define | RESTART 6
#define | ERROR 10
#define | OPERATION_OK 0
## Functions
char | e_i2c_init (void)
| Initialize the microcontroller for I2C uses.
char | e_i2c_start (void)
| Make the start bit.
char | e_i2c_restart (void)
| Make the restart 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_stop (void)
| Make the stop bit.
char | e_i2c_write (char byte)
| Write on the I2C output register.
char | e_i2c_enable (void)
| Enable special I2C interrupt.
char | e_i2c_disable (void)
| Disable special I2C interrupt.
char | e_i2c_reset (void)
| Reset the microcontroller for I2C uses.

## Detailed Description

Manage I2C basics.

Author:
  Code: Davis Daidie
  Doc: Jonathan Besuchet

## Define Documentation

#define ACKNOWLEDGE 3

#define ERROR 10

#define OPERATION_OK 0

#define READ 4

#define RESTART 6

#define START 1

#define STOP 5

#define WRITE 2

## Function Documentation

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