TWI.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. LUFA Library
  3. Copyright (C) Dean Camera, 2018.
  4. dean [at] fourwalledcubicle [dot] com
  5. www.lufa-lib.org
  6. */
  7. /*
  8. Copyright 2018 Dean Camera (dean [at] fourwalledcubicle [dot] com)
  9. Permission to use, copy, modify, distribute, and sell this
  10. software and its documentation for any purpose is hereby granted
  11. without fee, provided that the above copyright notice appear in
  12. all copies and that both that the copyright notice and this
  13. permission notice and warranty disclaimer appear in supporting
  14. documentation, and that the name of the author not be used in
  15. advertising or publicity pertaining to distribution of the
  16. software without specific, written prior permission.
  17. The author disclaims all warranties with regard to this
  18. software, including all implied warranties of merchantability
  19. and fitness. In no event shall the author be liable for any
  20. special, indirect or consequential damages or any damages
  21. whatsoever resulting from loss of use, data or profits, whether
  22. in an action of contract, negligence or other tortious action,
  23. arising out of or in connection with the use or performance of
  24. this software.
  25. */
  26. /** \file
  27. * \brief Hardware Two Wire Interface (I2C) driver.
  28. *
  29. * This file is the master dispatch header file for the device-specific SPI driver, for microcontrollers
  30. * containing a hardware TWI.
  31. *
  32. * User code should include this file, which will in turn include the correct TWI driver header file for the
  33. * currently selected architecture and microcontroller model.
  34. */
  35. /** \ingroup Group_PeripheralDrivers
  36. * \defgroup Group_TWI TWI Driver - LUFA/Drivers/Peripheral/TWI.h
  37. * \brief Hardware Two Wire Interface (I2C) driver.
  38. *
  39. * \section Sec_TWI_Dependencies Module Source Dependencies
  40. * The following files must be built with any user project that uses this module:
  41. * - LUFA/Drivers/Peripheral/<i>ARCH</i>/TWI_<i>ARCH</i>.c <i>(Makefile source module name: LUFA_SRC_TWI)</i>
  42. *
  43. * \section Sec_TWI_ModDescription Module Description
  44. * Hardware TWI driver. This module provides an easy to use driver for the setup and transfer of data over
  45. * the selected architecture and microcontroller model's TWI bus port.
  46. *
  47. * \note The exact API for this driver may vary depending on the target used - see
  48. * individual target module documentation for the API specific to your target processor.
  49. */
  50. #ifndef __TWI_H__
  51. #define __TWI_H__
  52. /* Macros: */
  53. #define __INCLUDE_FROM_TWI_H
  54. /* Includes: */
  55. #include "../../Common/Common.h"
  56. /* Includes: */
  57. #if (ARCH == ARCH_AVR8)
  58. #include "AVR8/TWI_AVR8.h"
  59. #elif (ARCH == ARCH_XMEGA)
  60. #include "XMEGA/TWI_XMEGA.h"
  61. #else
  62. #error The TWI peripheral driver is not currently available for your selected architecture.
  63. #endif
  64. #endif