mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-03 15:58:53 +08:00
imxrt io_timer: remove some fields from io_timers_t and split out channel indexes
IOMUX uses different enumeration from GPIO pin + port, so we cannot use .gpio_out, and add a .gpio_portpin.
This commit is contained in:
@@ -86,26 +86,37 @@
|
||||
__EXPORT const io_timers_t io_timers[MAX_IO_TIMERS] = {
|
||||
{
|
||||
.base = IMXRT_FLEXPWM2_BASE,
|
||||
.first_channel_index = 0,
|
||||
.last_channel_index = 3,
|
||||
},
|
||||
|
||||
{
|
||||
.base = IMXRT_FLEXPWM3_BASE,
|
||||
.first_channel_index = 4,
|
||||
.last_channel_index = 5,
|
||||
},
|
||||
{
|
||||
.base = IMXRT_FLEXPWM4_BASE,
|
||||
.first_channel_index = 6,
|
||||
.last_channel_index = 7,
|
||||
},
|
||||
};
|
||||
|
||||
__EXPORT const io_timers_channel_mapping_t io_timers_channel_mapping = {
|
||||
.element = {
|
||||
{
|
||||
.first_channel_index = 0,
|
||||
.channel_count = 4,
|
||||
},
|
||||
{
|
||||
.first_channel_index = 4,
|
||||
.channel_count = 2,
|
||||
},
|
||||
{
|
||||
.first_channel_index = 6,
|
||||
.channel_count = 2,
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
__EXPORT const timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = {
|
||||
{
|
||||
/* FMU_CH1 : GPIO_B0_06 GPIO2 Pin 6 FLEXPWM2_PWMA0 */
|
||||
.gpio_out = PIN_FLEXPWM2_PWMA00,
|
||||
.gpio_portpin = GPIO_PORT2 | GPIO_PIN6,
|
||||
.timer_index = 0,
|
||||
.val_offset = PWMA_VAL,
|
||||
.sub_module = SM0,
|
||||
@@ -115,6 +126,7 @@ __EXPORT const timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = {
|
||||
{
|
||||
/* FMU_CH2 : GPIO_EMC_08 GPIO4 Pin 8 FLEXPWM2_PWMA1 */
|
||||
.gpio_out = PIN_FLEXPWM2_PWMA01,
|
||||
.gpio_portpin = GPIO_PORT4 | GPIO_PIN8,
|
||||
.timer_index = 0,
|
||||
.val_offset = PWMA_VAL,
|
||||
.sub_module = SM1,
|
||||
@@ -124,6 +136,7 @@ __EXPORT const timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = {
|
||||
{
|
||||
/* FMU_CH3 : GPIO_EMC_10 GPIO4 Pin 10 FLEXPWM2_PWMA2 */
|
||||
.gpio_out = PIN_FLEXPWM2_PWMA02,
|
||||
.gpio_portpin = GPIO_PORT4 | GPIO_PIN10,
|
||||
.timer_index = 0,
|
||||
.val_offset = PWMA_VAL,
|
||||
.sub_module = SM2,
|
||||
@@ -133,6 +146,7 @@ __EXPORT const timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = {
|
||||
{
|
||||
/* FMU_CH4 : GPIO_AD_B0_09 GPIO1 Pin 9 FLEXPWM2_PWMA3 */
|
||||
.gpio_out = PIN_FLEXPWM2_PWMA03,
|
||||
.gpio_portpin = GPIO_PORT1 | GPIO_PIN9,
|
||||
.timer_index = 0,
|
||||
.val_offset = PWMA_VAL,
|
||||
.sub_module = SM3,
|
||||
@@ -142,6 +156,7 @@ __EXPORT const timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = {
|
||||
{
|
||||
/* FMU_CH5 : GPIO_EMC_33 GPIO3 Pin 19 FLEXPWM3_PWMA2 */
|
||||
.gpio_out = PIN_FLEXPWM3_PWMA02,
|
||||
.gpio_portpin = GPIO_PORT3 | GPIO_PIN19,
|
||||
.timer_index = 1,
|
||||
.val_offset = PWMA_VAL,
|
||||
.sub_module = SM2,
|
||||
@@ -150,6 +165,7 @@ __EXPORT const timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = {
|
||||
{
|
||||
/* FMU_CH6 : GPIO_EMC_30 GPIO4 Pin 30 FLEXPWM3_PWMB0 */
|
||||
.gpio_out = PIN_FLEXPWM3_PWMB00,
|
||||
.gpio_portpin = GPIO_PORT4 | GPIO_PIN30,
|
||||
.timer_index = 1,
|
||||
.val_offset = PWMB_VAL,
|
||||
.sub_module = SM0,
|
||||
@@ -160,6 +176,7 @@ __EXPORT const timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = {
|
||||
{
|
||||
/* FMU_CH7 : GPIO_EMC_04 GPIO4 Pin 4 FLEXPWM4_PWMA2 */
|
||||
.gpio_out = PIN_FLEXPWM4_PWMA02,
|
||||
.gpio_portpin = GPIO_PORT4 | GPIO_PIN4,
|
||||
.timer_index = 2,
|
||||
.val_offset = PWMA_VAL,
|
||||
.sub_module = SM2,
|
||||
@@ -169,6 +186,7 @@ __EXPORT const timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = {
|
||||
{
|
||||
/* FMU_CH8 : GPIO_EMC_01 GPIO4 Pin 1 FLEXPWM4_PWMB0 */
|
||||
.gpio_out = PIN_FLEXPWM4_PWMB00,
|
||||
.gpio_portpin = GPIO_PORT4 | GPIO_PIN1,
|
||||
.timer_index = 2,
|
||||
.val_offset = PWMB_VAL,
|
||||
.sub_module = SM0,
|
||||
|
||||
Reference in New Issue
Block a user