twibus_at91.h 1021 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #ifndef _DEV_TWIBUS_AT91_H_
  2. #define _DEV_TWIBUS_AT91_H_
  3. #include <sys/types.h>
  4. #include <cfg/arch.h>
  5. typedef struct _NUTTWIICB NUTTWIICB;
  6. /*
  7. * Runtime Data container.
  8. * This is installed in heap at initializaton
  9. * of a bus.
  10. */
  11. struct _NUTTWIICB {
  12. /********** Master mode *********/
  13. /*! \brief Bus slave address.
  14. */
  15. volatile uint_fast16_t tw_mm_sla;
  16. /*! \brief Bus current error condition.
  17. */
  18. volatile int_fast8_t tw_mm_err;
  19. /*! \brief Bus last error condition.
  20. */
  21. volatile int_fast8_t tw_mm_error;
  22. /*! \brief Bus transmission data buffer pointer.
  23. */
  24. uint8_t *tw_mm_buf;
  25. /*! \brief Bus transmission data block length.
  26. */
  27. volatile uint_fast16_t tw_mm_len;
  28. /*! \brief Bus transmissinn position.
  29. */
  30. volatile uint_fast16_t tw_mm_idx;
  31. /*! \brief Transmission Ongoing Mutex.
  32. */
  33. HANDLE tw_mm_mtx;
  34. };
  35. extern NUTTWIBUS At91TwiBus;
  36. #ifndef DEF_TWIBUS
  37. #define DEF_TWIBUS At91TwiBus
  38. #endif
  39. #endif /* _DEV_TWIBUS_AT91_H_ */