RTEMS 7.0-rc1
Loading...
Searching...
No Matches
pwmout-defs.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: GPL-2.0+-with-RTEMS-exception */
2
11/*
12 * Copyright (c) 2014 Taller Technologies.
13 *
14 * @author Diaz Marcos (marcos.diaz@tallertechnologies.com)
15 *
16 * The license and distribution terms for this file may be
17 * found in the file LICENSE in this distribution or at
18 * http://www.rtems.org/license/LICENSE.
19 */
20
21#ifndef LPC176X_PWMOUT_DEFS_H
22#define LPC176X_PWMOUT_DEFS_H
23
24#include <bsp/lpc176x.h>
25#include <bsp/pwmout.h>
26
27#ifdef __cplusplus
28extern "C" {
29#endif /* __cplusplus */
30
31#define PWM_DEFAULT_PERIOD 20000u
32#define PWM_DEFAULT_PULSEWIDTH 0u
33
34#define PWM_PRESCALER_USECOND ( LPC176X_CCLK / 1000000 )
35#define PWM_MCR_RESET_ON_MATCH0 ( 1 << 1 )
36#define PWM_PCR_ENABLE_PWM( pwmout ) ( 1 << ( 9 + pwmout ) )
37#define PWM_TCR_RESET ( 1 << 1 )
38#define PWM_TCR_ENABLE ( 1u )
39#define PWM_TCR_PWM ( 1 << 3 )
40#define PWM_LER_LATCH_MATCH_0 1u
41#define PWM_LER_LATCH( match ) ( 1 << ( ( match ) + 1 ) )
42
46typedef struct {
47 volatile uint32_t IR;
48 volatile uint32_t TCR;
49 volatile uint32_t TC;
50 volatile uint32_t PR;
51 volatile uint32_t PC;
52 volatile uint32_t MCR;
53 volatile uint32_t MR0;
54 volatile uint32_t MR1;
55 volatile uint32_t MR2;
56 volatile uint32_t MR3;
57 volatile uint32_t CCR;
58 volatile uint32_t CR0;
59 volatile uint32_t CR1;
60 volatile uint32_t CR2;
61 volatile uint32_t CR3;
62 volatile uint32_t RESERVED0;
63 volatile uint32_t MR4;
64 volatile uint32_t MR5;
65 volatile uint32_t MR6;
66 volatile uint32_t PCR;
67 volatile uint32_t LER;
68 volatile uint32_t RESERVED1[ 7 ];
69 volatile uint32_t CTCR;
71
76typedef struct {
77 uint32_t pin_number;
78 lpc176x_pin_function pin_function;
80
84typedef enum {
85 PWMO_1,
86 PWMO_2,
87 PWMO_3,
88 PWMO_4,
89 PWMO_5,
90 PWMO_6,
91 PWM_OUTPUT_NUMBER
93
97typedef enum {
98 PWM_FIRST_PIN,
99 PWM_SECOND_PIN,
100 PWM_NUMBER_OF_PINS
102
103#ifdef __cplusplus
104}
105#endif /* __cplusplus */
106
107#endif
#define MCR
Modem Control Register.
Definition: uart.h:91
lpc176x_pin_function
Defines the functions according to the pin.
Definition: io-defs.h:70
Specific register definitions according to lpc176x family boards.
lpc176x_pwm_pin_number
A pin for each PWM output.
Definition: pwmout-defs.h:97
lpc176x_pwm_number
The PWM outputs of the board.
Definition: pwmout-defs.h:84
PWM-Out controller for the mbed lpc1768 board.
Definition: hexdump.h:39
The low-level PWM output device.
Definition: pwmout-defs.h:46
Represents one pin and the respective function to be set for each PWM output.
Definition: pwmout-defs.h:76