From aadc76f41e39f84dbdcd6987ce89f6d8bcb87252 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 8 Jan 2015 13:44:10 -0600 Subject: Tiva Timer: Partial support for 16- and 32-bit, oneshot and periodic timer configurations --- nuttx/arch/arm/src/tiva/tiva_timer.h | 48 ++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'nuttx/arch/arm/src/tiva/tiva_timer.h') diff --git a/nuttx/arch/arm/src/tiva/tiva_timer.h b/nuttx/arch/arm/src/tiva/tiva_timer.h index 5ccd8b834..d2d270f9d 100644 --- a/nuttx/arch/arm/src/tiva/tiva_timer.h +++ b/nuttx/arch/arm/src/tiva/tiva_timer.h @@ -123,6 +123,24 @@ struct tiva_timer32config_s { bool down; /* False: Count up; True: Count down */ /* TODO: Add fields to support ADC trigger events */ + + /* Mode-specific parameters */ + + union + { + /* 32-bit programmable one-shot or periodic timer */ + + struct + { + uint32_t interval; /* Value for interval load register */ + } periodic; + + /* 32-bit RTC with external 32.768-KHz input */ + + struct + { + } rtc; + } u; }; /* This structure describes the configuration of one 16-bit timer A/B */ @@ -132,6 +150,36 @@ struct tiva_timer16config_s uint8_t mode; /* See enum tiva_timermode_e */ bool down; /* False: Count up; True: Count down */ /* TODO: Add fields to support ADC trigger events */ + + /* Mode-specific parameters */ + + union + { + /* 16-bit programmable one-shot or periodic timer */ + + struct + { + uint16_t interval; /* Value for interval load register */ + } periodic; + + /* 16-bit input edge-count capture mode w/8-bit prescaler */ + + struct + { + } count; + + /* 16-bit input time capture mode w/8-bit prescaler */ + + struct + { + } time; + + /* 16-bit PWM output mode w/8-bit prescaler */ + + struct + { + } pwm; + } u; }; /* This structure describes usage of both timers on a GPTIM module */ -- cgit v1.2.3