aboutsummaryrefslogtreecommitdiff
path: root/src/drivers/boards/trifle/pwmconfig.c
blob: 1fec4acd68cce3dff26866ed8f6a92e40a38fa58 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include <nuttx/config.h>
#include <stdio.h>
#include <errno.h>
#include <chip.h>
#include <kinetis_ftm.h>
#include <kinetis_internal.h>
#include <up_arch.h>
#include <kinetis_sim.h>

#include <drivers/kinetis/drv_pwm_servo.h>


__EXPORT const struct  pwm_servo_timer pwm_servo_timers[PWM_SERVO_MAX_TIMERS] = {
  {
    .ftm_base = KINETIS_FTM0_BASE,
    .scgc = KINETIS_SIM_SCGC6,
    .scgc_enable = 1 << 24
  }
};

__EXPORT const struct pwm_servo_channel pwm_servo_channels[PWM_SERVO_MAX_CHANNELS] = {
  {
    .timer = &pwm_servo_timers[0],
    .ftm_channel = 1,
    .pinconfig = PIN_PORTC | PIN2 | PIN_ALT4_OUTPUT | PIN_ALT4_HIGHDRIVE
  },
  {
    .timer = &pwm_servo_timers[0],
    .ftm_channel = 0,
    .pinconfig = PIN_PORTC | PIN1 | PIN_ALT4_OUTPUT | PIN_ALT4_HIGHDRIVE
  },
  {
    .timer = &pwm_servo_timers[0],
    .ftm_channel = 6,
    .pinconfig = PIN_PORTD | PIN6 | PIN_ALT4_OUTPUT | PIN_ALT4_HIGHDRIVE
  },
  {
    .timer = &pwm_servo_timers[0],
    .ftm_channel = 5,
    .pinconfig = PIN_PORTD | PIN5 | PIN_ALT4_OUTPUT | PIN_ALT4_HIGHDRIVE
  },
    {
    .timer = &pwm_servo_timers[0],
    .ftm_channel = 2,
    .pinconfig = PIN_PORTC | PIN3 | PIN_ALT4_OUTPUT | PIN_ALT4_HIGHDRIVE
  },
  {
    .timer = &pwm_servo_timers[0],
    .ftm_channel = 3,
    .pinconfig = PIN_PORTC | PIN4 | PIN_ALT4_OUTPUT | PIN_ALT4_HIGHDRIVE
  }
};