BeRTOS
Functions
i2c_avr.c File Reference

Driver for the AVR ATMega TWI (implementation) More...

#include "cfg/cfg_i2c.h"
#include <hw/hw_cpufreq.h>
#include <cfg/log.h>
#include <cfg/debug.h>
#include <cfg/macros.h>
#include <cfg/module.h>
#include <cpu/detect.h>
#include <cpu/irq.h>
#include <drv/timer.h>
#include <drv/i2c.h>
#include <cpu/power.h>
#include <compat/twi.h>

Go to the source code of this file.

Functions

static bool i2c_builtin_start (void)
 Send START condition on the bus.
bool i2c_builtin_start_w (uint8_t id)
 Send START condition and select slave for write.
bool i2c_builtin_start_r (uint8_t id)
 Send START condition and select slave for read.
void i2c_builtin_stop (void)
 Send STOP condition.
bool i2c_builtin_put (const uint8_t data)
 Put a single byte in master transmitter mode to the selected slave device through the TWI bus.
int i2c_builtin_get (bool ack)
 Get 1 byte from slave in master transmitter mode to the selected slave device through the TWI bus.
bool i2c_hw_start (void)
 Send START condition on the bus.
void i2c_hw_stop (void)
 Send STOP condition.
void i2c_hw_init (I2c *i2c, int dev, uint32_t clock)
 Initialize I2C module.

Detailed Description

Driver for the AVR ATMega TWI (implementation)

Author:
Stefano Fedrigo <aleph@develer.com>
Bernie Innocenti <bernie@codewiz.org>
Daniele Basile <asterix@develer.com>

Definition in file i2c_avr.c.


Function Documentation

static bool i2c_builtin_start ( void  ) [static]

Send START condition on the bus.

Returns:
true on success, false otherwise.

Definition at line 73 of file i2c_avr.c.