Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
gptimers.h File Reference
#include <linux/types.h>
#include <asm/blackfin.h>

Go to the source code of this file.

Data Structures

struct  bfin_gptimer_regs
 
struct  bfin_gptimer_group_regs
 

Macros

#define TIMER_GROUP1   0
 
#define MAX_BLACKFIN_GPTIMERS   3
 
#define TIMER0_GROUP_REG   TIMER_ENABLE
 
#define BLACKFIN_GPTIMER_IDMASK   ((1UL << MAX_BLACKFIN_GPTIMERS) - 1)
 
#define BFIN_TIMER_OCTET(x)   ((x) >> 3)
 
#define TIMER0bit   0x0001 /* 0001b */
 
#define TIMER1bit   0x0002 /* 0010b */
 
#define TIMER2bit   0x0004 /* 0100b */
 
#define TIMER3bit   0x0008
 
#define TIMER4bit   0x0010
 
#define TIMER5bit   0x0020
 
#define TIMER6bit   0x0040
 
#define TIMER7bit   0x0080
 
#define TIMER8bit   0x0100
 
#define TIMER9bit   0x0200
 
#define TIMER10bit   0x0400
 
#define TIMER11bit   0x0800
 
#define TIMER0_id   0
 
#define TIMER1_id   1
 
#define TIMER2_id   2
 
#define TIMER3_id   3
 
#define TIMER4_id   4
 
#define TIMER5_id   5
 
#define TIMER6_id   6
 
#define TIMER7_id   7
 
#define TIMER8_id   8
 
#define TIMER9_id   9
 
#define TIMER10_id   10
 
#define TIMER11_id   11
 
#define FS1_TIMER_ID   TIMER0_id
 
#define FS2_TIMER_ID   TIMER1_id
 
#define FS1_TIMER_BIT   TIMER0bit
 
#define FS2_TIMER_BIT   TIMER1bit
 
#define TIMER_ERR   0xC000
 
#define TIMER_ERR_OVFL   0x4000
 
#define TIMER_ERR_PROG_PER   0x8000
 
#define TIMER_ERR_PROG_PW   0xC000
 
#define TIMER_EMU_RUN   0x0200
 
#define TIMER_TOGGLE_HI   0x0100
 
#define TIMER_CLK_SEL   0x0080
 
#define TIMER_OUT_DIS   0x0040
 
#define TIMER_TIN_SEL   0x0020
 
#define TIMER_IRQ_ENA   0x0010
 
#define TIMER_PERIOD_CNT   0x0008
 
#define TIMER_PULSE_HI   0x0004
 
#define TIMER_MODE   0x0003
 
#define TIMER_MODE_PWM   0x0001
 
#define TIMER_MODE_WDTH   0x0002
 
#define TIMER_MODE_EXT_CLK   0x0003
 
#define TIMER_STATUS_TIMIL0   0x0001
 
#define TIMER_STATUS_TIMIL1   0x0002
 
#define TIMER_STATUS_TIMIL2   0x0004
 
#define TIMER_STATUS_TIMIL3   0x00000008
 
#define TIMER_STATUS_TIMIL4   0x00010000
 
#define TIMER_STATUS_TIMIL5   0x00020000
 
#define TIMER_STATUS_TIMIL6   0x00040000
 
#define TIMER_STATUS_TIMIL7   0x00080000
 
#define TIMER_STATUS_TIMIL8   0x0001
 
#define TIMER_STATUS_TIMIL9   0x0002
 
#define TIMER_STATUS_TIMIL10   0x0004
 
#define TIMER_STATUS_TIMIL11   0x0008
 
#define TIMER_STATUS_TOVF0   0x0010 /* timer 0 overflow error */
 
#define TIMER_STATUS_TOVF1   0x0020
 
#define TIMER_STATUS_TOVF2   0x0040
 
#define TIMER_STATUS_TOVF3   0x00000080
 
#define TIMER_STATUS_TOVF4   0x00100000
 
#define TIMER_STATUS_TOVF5   0x00200000
 
#define TIMER_STATUS_TOVF6   0x00400000
 
#define TIMER_STATUS_TOVF7   0x00800000
 
#define TIMER_STATUS_TOVF8   0x0010
 
#define TIMER_STATUS_TOVF9   0x0020
 
#define TIMER_STATUS_TOVF10   0x0040
 
#define TIMER_STATUS_TOVF11   0x0080
 
#define TIMER_STATUS_TRUN0   0x1000
 
#define TIMER_STATUS_TRUN1   0x2000
 
#define TIMER_STATUS_TRUN2   0x4000
 
#define TIMER_STATUS_TRUN3   0x00008000
 
#define TIMER_STATUS_TRUN4   0x10000000
 
#define TIMER_STATUS_TRUN5   0x20000000
 
#define TIMER_STATUS_TRUN6   0x40000000
 
#define TIMER_STATUS_TRUN7   0x80000000
 
#define TIMER_STATUS_TRUN   0xF000F000
 
#define TIMER_STATUS_TRUN8   0x1000
 
#define TIMER_STATUS_TRUN9   0x2000
 
#define TIMER_STATUS_TRUN10   0x4000
 
#define TIMER_STATUS_TRUN11   0x8000
 
#define __BFP(m)   u16 m; u16 __pad_##m
 

Functions

void set_gptimer_pwidth (unsigned int timer_id, uint32_t width)
 
uint32_t get_gptimer_pwidth (unsigned int timer_id)
 
void set_gptimer_period (unsigned int timer_id, uint32_t period)
 
uint32_t get_gptimer_period (unsigned int timer_id)
 
uint32_t get_gptimer_count (unsigned int timer_id)
 
int get_gptimer_intr (unsigned int timer_id)
 
void clear_gptimer_intr (unsigned int timer_id)
 
int get_gptimer_over (unsigned int timer_id)
 
void clear_gptimer_over (unsigned int timer_id)
 
void set_gptimer_config (unsigned int timer_id, uint16_t config)
 
uint16_t get_gptimer_config (unsigned int timer_id)
 
int get_gptimer_run (unsigned int timer_id)
 
void set_gptimer_pulse_hi (unsigned int timer_id)
 
void clear_gptimer_pulse_hi (unsigned int timer_id)
 
void enable_gptimers (uint16_t mask)
 
void disable_gptimers (uint16_t mask)
 
void disable_gptimers_sync (uint16_t mask)
 
uint16_t get_enabled_gptimers (void)
 
uint32_t get_gptimer_status (unsigned int group)
 
void set_gptimer_status (unsigned int group, uint32_t value)
 

Macro Definition Documentation

#define __BFP (   m)    u16 m; u16 __pad_##m

Definition at line 289 of file gptimers.h.

#define BFIN_TIMER_OCTET (   x)    ((x) >> 3)

Definition at line 63 of file gptimers.h.

#define BLACKFIN_GPTIMER_IDMASK   ((1UL << MAX_BLACKFIN_GPTIMERS) - 1)

Definition at line 62 of file gptimers.h.

#define FS1_TIMER_BIT   TIMER0bit

Definition at line 110 of file gptimers.h.

#define FS1_TIMER_ID   TIMER0_id

Definition at line 108 of file gptimers.h.

#define FS2_TIMER_BIT   TIMER1bit

Definition at line 111 of file gptimers.h.

#define FS2_TIMER_ID   TIMER1_id

Definition at line 109 of file gptimers.h.

#define MAX_BLACKFIN_GPTIMERS   3

Definition at line 58 of file gptimers.h.

#define TIMER0_GROUP_REG   TIMER_ENABLE

Definition at line 59 of file gptimers.h.

#define TIMER0_id   0

Definition at line 79 of file gptimers.h.

#define TIMER0bit   0x0001 /* 0001b */

Definition at line 66 of file gptimers.h.

#define TIMER10_id   10

Definition at line 89 of file gptimers.h.

#define TIMER10bit   0x0400

Definition at line 76 of file gptimers.h.

#define TIMER11_id   11

Definition at line 90 of file gptimers.h.

#define TIMER11bit   0x0800

Definition at line 77 of file gptimers.h.

#define TIMER1_id   1

Definition at line 80 of file gptimers.h.

#define TIMER1bit   0x0002 /* 0010b */

Definition at line 67 of file gptimers.h.

#define TIMER2_id   2

Definition at line 81 of file gptimers.h.

#define TIMER2bit   0x0004 /* 0100b */

Definition at line 68 of file gptimers.h.

#define TIMER3_id   3

Definition at line 82 of file gptimers.h.

#define TIMER3bit   0x0008

Definition at line 69 of file gptimers.h.

#define TIMER4_id   4

Definition at line 83 of file gptimers.h.

#define TIMER4bit   0x0010

Definition at line 70 of file gptimers.h.

#define TIMER5_id   5

Definition at line 84 of file gptimers.h.

#define TIMER5bit   0x0020

Definition at line 71 of file gptimers.h.

#define TIMER6_id   6

Definition at line 85 of file gptimers.h.

#define TIMER6bit   0x0040

Definition at line 72 of file gptimers.h.

#define TIMER7_id   7

Definition at line 86 of file gptimers.h.

#define TIMER7bit   0x0080

Definition at line 73 of file gptimers.h.

#define TIMER8_id   8

Definition at line 87 of file gptimers.h.

#define TIMER8bit   0x0100

Definition at line 74 of file gptimers.h.

#define TIMER9_id   9

Definition at line 88 of file gptimers.h.

#define TIMER9bit   0x0200

Definition at line 75 of file gptimers.h.

#define TIMER_CLK_SEL   0x0080

Definition at line 189 of file gptimers.h.

#define TIMER_EMU_RUN   0x0200

Definition at line 187 of file gptimers.h.

#define TIMER_ERR   0xC000

Definition at line 183 of file gptimers.h.

#define TIMER_ERR_OVFL   0x4000

Definition at line 184 of file gptimers.h.

#define TIMER_ERR_PROG_PER   0x8000

Definition at line 185 of file gptimers.h.

#define TIMER_ERR_PROG_PW   0xC000

Definition at line 186 of file gptimers.h.

#define TIMER_GROUP1   0

Definition at line 56 of file gptimers.h.

#define TIMER_IRQ_ENA   0x0010

Definition at line 192 of file gptimers.h.

#define TIMER_MODE   0x0003

Definition at line 195 of file gptimers.h.

#define TIMER_MODE_EXT_CLK   0x0003

Definition at line 198 of file gptimers.h.

#define TIMER_MODE_PWM   0x0001

Definition at line 196 of file gptimers.h.

#define TIMER_MODE_WDTH   0x0002

Definition at line 197 of file gptimers.h.

#define TIMER_OUT_DIS   0x0040

Definition at line 190 of file gptimers.h.

#define TIMER_PERIOD_CNT   0x0008

Definition at line 193 of file gptimers.h.

#define TIMER_PULSE_HI   0x0004

Definition at line 194 of file gptimers.h.

#define TIMER_STATUS_TIMIL0   0x0001

Definition at line 203 of file gptimers.h.

#define TIMER_STATUS_TIMIL1   0x0002

Definition at line 204 of file gptimers.h.

#define TIMER_STATUS_TIMIL10   0x0004

Definition at line 213 of file gptimers.h.

#define TIMER_STATUS_TIMIL11   0x0008

Definition at line 214 of file gptimers.h.

#define TIMER_STATUS_TIMIL2   0x0004

Definition at line 205 of file gptimers.h.

#define TIMER_STATUS_TIMIL3   0x00000008

Definition at line 206 of file gptimers.h.

#define TIMER_STATUS_TIMIL4   0x00010000

Definition at line 207 of file gptimers.h.

#define TIMER_STATUS_TIMIL5   0x00020000

Definition at line 208 of file gptimers.h.

#define TIMER_STATUS_TIMIL6   0x00040000

Definition at line 209 of file gptimers.h.

#define TIMER_STATUS_TIMIL7   0x00080000

Definition at line 210 of file gptimers.h.

#define TIMER_STATUS_TIMIL8   0x0001

Definition at line 211 of file gptimers.h.

#define TIMER_STATUS_TIMIL9   0x0002

Definition at line 212 of file gptimers.h.

#define TIMER_STATUS_TOVF0   0x0010 /* timer 0 overflow error */

Definition at line 216 of file gptimers.h.

#define TIMER_STATUS_TOVF1   0x0020

Definition at line 217 of file gptimers.h.

#define TIMER_STATUS_TOVF10   0x0040

Definition at line 226 of file gptimers.h.

#define TIMER_STATUS_TOVF11   0x0080

Definition at line 227 of file gptimers.h.

#define TIMER_STATUS_TOVF2   0x0040

Definition at line 218 of file gptimers.h.

#define TIMER_STATUS_TOVF3   0x00000080

Definition at line 219 of file gptimers.h.

#define TIMER_STATUS_TOVF4   0x00100000

Definition at line 220 of file gptimers.h.

#define TIMER_STATUS_TOVF5   0x00200000

Definition at line 221 of file gptimers.h.

#define TIMER_STATUS_TOVF6   0x00400000

Definition at line 222 of file gptimers.h.

#define TIMER_STATUS_TOVF7   0x00800000

Definition at line 223 of file gptimers.h.

#define TIMER_STATUS_TOVF8   0x0010

Definition at line 224 of file gptimers.h.

#define TIMER_STATUS_TOVF9   0x0020

Definition at line 225 of file gptimers.h.

#define TIMER_STATUS_TRUN   0xF000F000

Definition at line 240 of file gptimers.h.

#define TIMER_STATUS_TRUN0   0x1000

Definition at line 232 of file gptimers.h.

#define TIMER_STATUS_TRUN1   0x2000

Definition at line 233 of file gptimers.h.

#define TIMER_STATUS_TRUN10   0x4000

Definition at line 243 of file gptimers.h.

#define TIMER_STATUS_TRUN11   0x8000

Definition at line 244 of file gptimers.h.

#define TIMER_STATUS_TRUN2   0x4000

Definition at line 234 of file gptimers.h.

#define TIMER_STATUS_TRUN3   0x00008000

Definition at line 235 of file gptimers.h.

#define TIMER_STATUS_TRUN4   0x10000000

Definition at line 236 of file gptimers.h.

#define TIMER_STATUS_TRUN5   0x20000000

Definition at line 237 of file gptimers.h.

#define TIMER_STATUS_TRUN6   0x40000000

Definition at line 238 of file gptimers.h.

#define TIMER_STATUS_TRUN7   0x80000000

Definition at line 239 of file gptimers.h.

#define TIMER_STATUS_TRUN8   0x1000

Definition at line 241 of file gptimers.h.

#define TIMER_STATUS_TRUN9   0x2000

Definition at line 242 of file gptimers.h.

#define TIMER_TIN_SEL   0x0020

Definition at line 191 of file gptimers.h.

#define TIMER_TOGGLE_HI   0x0100

Definition at line 188 of file gptimers.h.

Function Documentation

void clear_gptimer_intr ( unsigned int  timer_id)

Definition at line 260 of file gptimers.c.

void clear_gptimer_over ( unsigned int  timer_id)

Definition at line 274 of file gptimers.c.

void clear_gptimer_pulse_hi ( unsigned int  timer_id)

Definition at line 363 of file gptimers.c.

void disable_gptimers ( uint16_t  mask)

Definition at line 333 of file gptimers.c.

void disable_gptimers_sync ( uint16_t  mask)

Definition at line 348 of file gptimers.c.

void enable_gptimers ( uint16_t  mask)

Definition at line 304 of file gptimers.c.

uint16_t get_enabled_gptimers ( void  )

Definition at line 371 of file gptimers.c.

uint16_t get_gptimer_config ( unsigned int  timer_id)

Definition at line 297 of file gptimers.c.

uint32_t get_gptimer_count ( unsigned int  timer_id)

Definition at line 158 of file gptimers.c.

int get_gptimer_intr ( unsigned int  timer_id)

Definition at line 253 of file gptimers.c.

int get_gptimer_over ( unsigned int  timer_id)

Definition at line 267 of file gptimers.c.

uint32_t get_gptimer_period ( unsigned int  timer_id)

Definition at line 151 of file gptimers.c.

uint32_t get_gptimer_pwidth ( unsigned int  timer_id)

Definition at line 136 of file gptimers.c.

int get_gptimer_run ( unsigned int  timer_id)

Definition at line 281 of file gptimers.c.

uint32_t get_gptimer_status ( unsigned int  group)

Definition at line 233 of file gptimers.c.

void set_gptimer_config ( unsigned int  timer_id,
uint16_t  config 
)

Definition at line 289 of file gptimers.c.

void set_gptimer_period ( unsigned int  timer_id,
uint32_t  period 
)

Definition at line 143 of file gptimers.c.

void set_gptimer_pulse_hi ( unsigned int  timer_id)

Definition at line 355 of file gptimers.c.

void set_gptimer_pwidth ( unsigned int  timer_id,
uint32_t  width 
)

Definition at line 128 of file gptimers.c.

void set_gptimer_status ( unsigned int  group,
uint32_t  value 
)

Definition at line 240 of file gptimers.c.