i2c: adds driver for Atmel SAM3

Adds the driver to utilize the I2C/TWI interface on Atmel SAM3
family processors for I2C communication.

Note that this currently only supports master mode. Limited
testing has been done using the Fujitsu FRAM sample app.

Change-Id: Ibdb8277e47dd9450b49a66a95421eb1ffb1c4eb4
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
Daniel Leung 2016-02-03 13:28:31 -08:00 committed by Anas Nashif
commit 8d48828b3c
8 changed files with 877 additions and 0 deletions

View file

@ -211,5 +211,28 @@ struct __supc {
uint32_t sr; /* 0x14 Status */
};
/* Two-wire Interface (TWI), aka I2C */
struct __twi {
uint32_t cr; /* 0x00 Control */
uint32_t mmr; /* 0x04 Master Mode */
uint32_t smr; /* 0x08 Slave Mode */
uint32_t iadr; /* 0x0C Internal Address */
uint32_t cwgr; /* 0x10 Clock Waveform Generator */
uint32_t rev0[3]; /* 0x14-0x1C reserved */
uint32_t sr; /* 0x20 Status */
uint32_t ier; /* 0x24 Interrupt Enable */
uint32_t idr; /* 0x28 Interrupt Disable */
uint32_t imr; /* 0x2C Interrupt Mask */
uint32_t rhr; /* 0x30 Receive Holding */
uint32_t thr; /* 0x34 Transmit Holding */
uint32_t rev1[50]; /* 0x38-0xFC Reserved */
struct __pdc pdc; /* 0x100 - 0x124 PDC */
};
#endif /* _ATMEL_SAM3_SOC_REGS_H_ */