feat:luckfox_gpio_test support luckfox pico and luckfox pico plus

This commit is contained in:
eng33
2023-08-17 22:08:01 +08:00
parent 00aee4108a
commit 4b302ccef8
10 changed files with 375 additions and 309 deletions

View File

@ -34,15 +34,15 @@
#include <stdlib.h> //exit()
#include "luckfox_adc.h"
void Delay_ms(uint32_t xms) {
void Delay_ms(uint32_t xms)
{
uint32_t i;
for (i = 0; i < xms; i++) {
for (i = 0; i < xms; i++)
{
usleep(1000);
}
}
int main(int argc, char *argv[])
{
int adc_read_value[2];
@ -53,11 +53,10 @@ int main(int argc, char *argv[])
for (int cnt = 0; cnt < 2; cnt++)
{
adc_read_value[cnt] = luckfox_adc_get_value(luckfox_adc_get_devnum("ff3c0000.saradc"), cnt);
adc_voltage[cnt]= adc_read_value[cnt]*1.8/1024;
printf("ADC %d:raw data = %d,voltage = %.2f \r\n",cnt,adc_read_value[cnt],adc_voltage[cnt]);
adc_voltage[cnt] = adc_read_value[cnt] * 1.8 / 1024;
printf("ADC %d:raw data = %d,voltage = %.2f \r\n", cnt, adc_read_value[cnt], adc_voltage[cnt]);
}
Delay_ms(1000);
}
return 0;
}

View File

@ -35,18 +35,37 @@
#include <stdlib.h> //exit()
#include "luckfox_gpio.h"
#define GPIO_ALL_TEST 0
int GPIO_BEGIN_PIN, GPIO_END_PIN;
int *TEST_PIN;
#if GPIO_ALL_TEST
#define GPIO_BEGIN_PIN (2)
#define GPIO_END_PIN (21)
#else
#define GPIO_BEGIN_PIN (16)
#define GPIO_END_PIN (21)
#endif
int GPIOS[] = {
int PICO_PLUS_GPIOS[] = {
LUCKFOX_PICO_PLUS_GPIO0,
LUCKFOX_PICO_PLUS_GPIO1,
LUCKFOX_PICO_PLUS_GPIO2,
LUCKFOX_PICO_PLUS_GPIO3,
LUCKFOX_PICO_PLUS_GPIO4,
LUCKFOX_PICO_PLUS_GPIO5,
LUCKFOX_PICO_PLUS_GPIO6,
LUCKFOX_PICO_PLUS_GPIO7,
LUCKFOX_PICO_PLUS_GPIO8,
LUCKFOX_PICO_PLUS_GPIO9,
LUCKFOX_PICO_PLUS_GPIO10,
LUCKFOX_PICO_PLUS_GPIO11,
LUCKFOX_PICO_PLUS_GPIO12,
LUCKFOX_PICO_PLUS_GPIO13,
LUCKFOX_PICO_PLUS_GPIO14,
LUCKFOX_PICO_PLUS_GPIO15,
LUCKFOX_PICO_PLUS_GPIO16,
LUCKFOX_PICO_PLUS_GPIO17,
LUCKFOX_PICO_PLUS_GPIO18,
LUCKFOX_PICO_PLUS_GPIO19,
LUCKFOX_PICO_PLUS_GPIO20,
LUCKFOX_PICO_PLUS_GPIO21,
LUCKFOX_PICO_PLUS_GPIO22,
LUCKFOX_PICO_PLUS_GPIO26,
LUCKFOX_PICO_PLUS_GPIO27,
};
int PICO_GPIOS[] = {
LUCKFOX_PICO_GPIO0,
LUCKFOX_PICO_GPIO1,
LUCKFOX_PICO_GPIO2,
@ -69,9 +88,6 @@ int GPIOS[] = {
LUCKFOX_PICO_GPIO19,
LUCKFOX_PICO_GPIO20,
LUCKFOX_PICO_GPIO21,
#if LUCKFOX_PICO_PLUS
LUCKFOX_PICO_GPIO22, //
#endif
LUCKFOX_PICO_GPIO26,
LUCKFOX_PICO_GPIO27,
@ -92,20 +108,83 @@ void Handler(int signo)
printf("\r\nHandler:exit\r\n");
for (int x = GPIO_BEGIN_PIN; x <= GPIO_END_PIN; x++)
{
luckfox_gpio_set_value(GPIOS[x], 0);
luckfox_gpio_unexport(GPIOS[x]);
luckfox_gpio_set_value(TEST_PIN[x], 0);
luckfox_gpio_unexport(TEST_PIN[x]);
}
exit(0);
}
int main(int argc, char *argv[])
{
char input_char = '0';
int delay_time = 500;
signal(SIGINT, Handler);
printf("-----------------------------\r\n");
printf("----------GPIO TEST----------\r\n");
printf("-----------------------------\r\n");
printf("Please select your test borad\r\n");
printf("* 1. LUCKFOX PICO\r\n");
printf("* 2. LUCKFOX PICO PLUS\r\n");
printf("-----------------------------\r\n");
while (1)
{
printf("Which would you like? :");
input_char = getchar();
if (input_char >= '1' && input_char <= '2')
{
break;
}
}
if (input_char == '1')
{
GPIO_BEGIN_PIN = 16;
GPIO_END_PIN = 21;
TEST_PIN = PICO_GPIOS;
}
else if (input_char == '2')
{
GPIO_BEGIN_PIN = 16;
GPIO_END_PIN = 22;
TEST_PIN = PICO_PLUS_GPIOS;
}
else
{
exit(0);
}
printf("-----------------------------\r\n");
printf("Please select your test borad\r\n");
printf("* 1. Default part(GP%d-GP%d)\r\n", GPIO_BEGIN_PIN, GPIO_END_PIN);
printf("* 2. ALL(Except GP0 GP1)\r\n");
printf("-----------------------------\r\n");
while (1)
{
printf("Which would you like? :");
input_char = getchar();
if (input_char >= '1' && input_char <= '2')
{
break;
}
}
if (input_char == '1')
{
;
}
else if (input_char == '2')
{
GPIO_BEGIN_PIN = 2;
delay_time = 250;
}
else
{
exit(0);
}
for (int x = GPIO_BEGIN_PIN; x <= GPIO_END_PIN; x++)
{
luckfox_gpio_export_direction(GPIOS[x], GPIO_DIRECTION_OUTPUT);
luckfox_gpio_set_value(GPIOS[x], 0);
luckfox_gpio_export_direction(TEST_PIN[x], GPIO_DIRECTION_OUTPUT);
luckfox_gpio_set_value(TEST_PIN[x], 0);
}
while (1)
{
@ -113,16 +192,16 @@ int main(int argc, char *argv[])
for (int x = GPIO_BEGIN_PIN; x <= GPIO_END_PIN; x++)
{
luckfox_gpio_set_value(GPIOS[x], 1);
printf("GPIO%d set \r\n",GPIOS[x]);
Delay_ms(1000);
luckfox_gpio_set_value(TEST_PIN[x], 1);
printf("GP%d : GPIO%d set \r\n", x, TEST_PIN[x]);
Delay_ms(delay_time);
}
for (int x = GPIO_BEGIN_PIN; x <= GPIO_END_PIN; x++)
{
luckfox_gpio_set_value(GPIOS[x], 0);
printf("GPIO%d reset \r\n",GPIOS[x]);
Delay_ms(1000);
luckfox_gpio_set_value(TEST_PIN[x], 0);
printf("GP%d : GPIO%d reset \r\n", x, TEST_PIN[x]);
Delay_ms(delay_time);
}
}

View File

@ -62,10 +62,9 @@ int main(int argc, char *argv[])
printf("i2cdetect addr : ");
for (int x = 0; x < 0x7f; x++)
{
if (luckfox_i2c_write(fd, x,0,0) == 0)
if (luckfox_i2c_write(fd, x, 0, 0) == 0)
{
printf("0x%x,", x);
}
}
printf("\r\n");

View File

@ -34,12 +34,13 @@
#include <signal.h> //signal()
#include "luckfox_pwm.h"
int PWMS[] = { 0,1,10,11 };
int PWMS[] = {0, 1, 10, 11};
void Delay_ms(uint32_t xms) {
void Delay_ms(uint32_t xms)
{
uint32_t i;
for (i = 0; i < xms; i++) {
for (i = 0; i < xms; i++)
{
usleep(1000);
}
}
@ -50,8 +51,9 @@ void Handler(int signo)
printf("\r\nHandler:exit\r\n");
for (int x = 0; x < 4; x++)
{
luckfox_pwm_set_duty(PWMS[x], 0);
luckfox_pwm_deinit(PWMS[x]);
printf("PWM%dM0 deinit\r\n",PWMS[x]);
printf("PWM%dM0 deinit\r\n", PWMS[x]);
}
exit(0);
@ -60,13 +62,13 @@ void Handler(int signo)
int main(int argc, char *argv[])
{
signal(SIGINT, Handler);
for(int x = 0 ; x < 4;x++)
for (int x = 0; x < 4; x++)
{
luckfox_pwm_init(PWMS[x], 100000, 5000*(x+1), PWM_POLARITY_INVERSED);
luckfox_pwm_init(PWMS[x], 100000, 15000 * (x + 1), PWM_POLARITY_NORMAL);
luckfox_pwm_set_enable(PWMS[x], true);
printf("PWM%dM0 period=%d duty=%d\r\n",PWMS[x],luckfox_pwm_get_period(PWMS[x]),luckfox_pwm_get_duty(PWMS[x]));
printf("PWM%dM0 period=%d duty=%d\r\n", PWMS[x], luckfox_pwm_get_period(PWMS[x]), luckfox_pwm_get_duty(PWMS[x]));
}
while(1)
while (1)
{
Delay_ms(1000);
}

View File

@ -47,19 +47,19 @@ static uint32_t mode = SPI_MODE_2; // Used to save SPI mode
static uint8_t bits = 8; // Number of bits for receive and send data
static uint32_t speed = 500000; // Transfer speed
int main(int argc,char * argv[])
int main(int argc, char *argv[])
{
int ret;
uint16_t delay=10;
fd = luckfox_spi_init(spidev0_path,mode,bits,speed);
if( fd == -1 )
uint16_t delay = 10;
fd = luckfox_spi_init(spidev0_path, mode, bits, speed);
if (fd == -1)
{
printf("spi_init error\n");
exit(-1);
}
ret = luckfox_spi_transfer(fd, tx_buffer, rx_buffer, sizeof(tx_buffer),delay);
if (ret == -1 )
ret = luckfox_spi_transfer(fd, tx_buffer, rx_buffer, sizeof(tx_buffer), delay);
if (ret == -1)
{
printf("transfer error...\n");
exit(-1);

View File

@ -42,7 +42,6 @@ int uart_fd = 0;
char w_data[] = "Waveshare Hello World";
char r_data[256];
void Delay_ms(uint32_t xms)
{
uint32_t i;

View File

@ -75,44 +75,44 @@
#define PD7 31
#define GPIO(bank, pin) ((((bank) * 32) + (pin)))
#define LUCKFOX_PICO_PLUS 0
#if LUCKFOX_PICO_PLUS
/**********************************************/
#define LUCKFOX_PICO_GPIO0 GPIO(GPIO1,PB2)
#define LUCKFOX_PICO_GPIO1 GPIO(GPIO1,PB3)
#define LUCKFOX_PICO_GPIO2 GPIO(GPIO1,PC7)
#define LUCKFOX_PICO_GPIO3 GPIO(GPIO1,PC6)
#define LUCKFOX_PICO_GPIO4 GPIO(GPIO1,PC5)
#define LUCKFOX_PICO_GPIO5 GPIO(GPIO1,PC4)
#define LUCKFOX_PICO_GPIO6 GPIO(GPIO1,PD2)
#define LUCKFOX_PICO_GPIO7 GPIO(GPIO1,PD3)
#define LUCKFOX_PICO_GPIO8 GPIO(GPIO1,PA2)
#define LUCKFOX_PICO_GPIO9 GPIO(GPIO1,PC0)
#define LUCKFOX_PICO_GPIO10 GPIO(GPIO1,PC1)
#define LUCKFOX_PICO_GPIO11 GPIO(GPIO1,PC2)
#define LUCKFOX_PICO_GPIO12 GPIO(GPIO1,PC3)
#define LUCKFOX_PICO_GPIO13 GPIO(GPIO0,PA4)
#define LUCKFOX_PICO_GPIO14 GPIO(GPIO1,PD0)
#define LUCKFOX_PICO_GPIO15 GPIO(GPIO1,PD1)
/**********************************************/
#define LUCKFOX_PICO_GPIO27 GPIO(GPIO4,PC1)
#define LUCKFOX_PICO_GPIO26 GPIO(GPIO4,PC0)
#define LUCKFOX_PICO_PLUS_GPIO0 GPIO(GPIO1,PB2)
#define LUCKFOX_PICO_PLUS_GPIO1 GPIO(GPIO1,PB3)
#define LUCKFOX_PICO_GPIO22 GPIO(GPIO3,PA1)
#define LUCKFOX_PICO_PLUS_GPIO2 GPIO(GPIO1,PC7)
#define LUCKFOX_PICO_PLUS_GPIO3 GPIO(GPIO1,PC6)
#define LUCKFOX_PICO_PLUS_GPIO4 GPIO(GPIO1,PC5)
#define LUCKFOX_PICO_PLUS_GPIO5 GPIO(GPIO1,PC4)
#define LUCKFOX_PICO_PLUS_GPIO6 GPIO(GPIO1,PD2)
#define LUCKFOX_PICO_PLUS_GPIO7 GPIO(GPIO1,PD3)
#define LUCKFOX_PICO_PLUS_GPIO8 GPIO(GPIO1,PA2)
#define LUCKFOX_PICO_PLUS_GPIO9 GPIO(GPIO1,PC0)
#define LUCKFOX_PICO_PLUS_GPIO10 GPIO(GPIO1,PC1)
#define LUCKFOX_PICO_PLUS_GPIO11 GPIO(GPIO1,PC2)
#define LUCKFOX_PICO_PLUS_GPIO12 GPIO(GPIO1,PC3)
#define LUCKFOX_PICO_PLUS_GPIO13 GPIO(GPIO0,PA4)
#define LUCKFOX_PICO_PLUS_GPIO14 GPIO(GPIO1,PD0)
#define LUCKFOX_PICO_PLUS_GPIO15 GPIO(GPIO1,PD1)
/**********************************************/
#define LUCKFOX_PICO_PLUS_GPIO27 GPIO(GPIO4,PC1)
#define LUCKFOX_PICO_PLUS_GPIO26 GPIO(GPIO4,PC0)
#define LUCKFOX_PICO_PLUS_GPIO22 GPIO(GPIO3,PA1)
#define LUCKFOX_PICO_PLUS_GPIO21 GPIO(GPIO3,PA3)
#define LUCKFOX_PICO_PLUS_GPIO20 GPIO(GPIO3,PA2)
#define LUCKFOX_PICO_PLUS_GPIO19 GPIO(GPIO3,PA4)
#define LUCKFOX_PICO_PLUS_GPIO18 GPIO(GPIO3,PA5)
#define LUCKFOX_PICO_PLUS_GPIO17 GPIO(GPIO3,PA7)
#define LUCKFOX_PICO_PLUS_GPIO16 GPIO(GPIO3,PA6)
#define LUCKFOX_PICO_GPIO21 GPIO(GPIO3,PA3)
#define LUCKFOX_PICO_GPIO20 GPIO(GPIO3,PA2)
#define LUCKFOX_PICO_GPIO19 GPIO(GPIO3,PA4)
#define LUCKFOX_PICO_GPIO18 GPIO(GPIO3,PA5)
#define LUCKFOX_PICO_GPIO17 GPIO(GPIO3,PA7)
#define LUCKFOX_PICO_GPIO16 GPIO(GPIO3,PA6)
#else
/**********************************************/
#define LUCKFOX_PICO_GPIO0 GPIO(GPIO1,PB2)
#define LUCKFOX_PICO_GPIO1 GPIO(GPIO1,PB3)
@ -146,7 +146,7 @@
#define LUCKFOX_PICO_GPIO17 GPIO(GPIO4,PB0)
#define LUCKFOX_PICO_GPIO16 GPIO(GPIO4,PB1)
#endif
enum gpio_direction
{
GPIO_DIRECTION_OUTPUT = 0,

View File

@ -222,9 +222,9 @@
};
};
&pwm0 {
status = "okay";
};
//&pwm0 {
// status = "okay";
//};
&rkcif {
status = "okay";
@ -273,19 +273,19 @@
vref-supply = <&vcc_1v8>;
};
// &sfc {
//&sfc {
// status = "okay";
// flash@0 {
// compatible = "jedec,spi-nor";
// compatible = "spi-nand";
// reg = <0>;
// spi-max-frequency = <80000000>;
// spi-rx-bus-width = <4>;
// spi-tx-bus-width = <1>;
// };
// };
//};
// &sdmmc {
//&sdmmc {
// max-frequency = <50000000>;
// no-sdio;
// no-mmc;
@ -296,24 +296,10 @@
// pinctrl-names = "default";
// pinctrl-0 = <&sdmmc0_clk &sdmmc0_cmd &sdmmc0_det &sdmmc0_bus4>;
// status = "okay";
// };
//};
&tsadc {
status = "okay";
};
// &u2phy {
// status = "disabled";
// };
// &u2phy_otg {
// status = "disabled";
// };
// &usbdrd {
// status = "disabled";
// };
// &usbdrd_dwc3 {
// status = "disabled";
// };

View File

@ -12,106 +12,106 @@
/ {
model = "Luckfox Pico Plus";
compatible = "rockchip,rv1103g-38x38-ipc-v10", "rockchip,rv1103";
// gpio3pa1:gpio3pa1 {
// compatible = "regulator-fixed";
// pinctrl-names = "default";
// pinctrl-0 = <&gpio3_pa1>;
// regulator-name = "gpio3_pa1";
// regulator-always-on;
// };
gpio3pa1:gpio3pa1 {
compatible = "regulator-fixed";
pinctrl-names = "default";
pinctrl-0 = <&gpio3_pa1>;
regulator-name = "gpio3_pa1";
regulator-always-on;
};
// gpio3pa2:gpio3pa2 {
// compatible = "regulator-fixed";
// pinctrl-names = "default";
// pinctrl-0 = <&gpio3_pa2>;
// regulator-name = "gpio3_pa2";
// regulator-always-on;
// };
gpio3pa2:gpio3pa2 {
compatible = "regulator-fixed";
pinctrl-names = "default";
pinctrl-0 = <&gpio3_pa2>;
regulator-name = "gpio3_pa2";
regulator-always-on;
};
// gpio3pa3:gpio3pa3 {
// compatible = "regulator-fixed";
// pinctrl-names = "default";
// pinctrl-0 = <&gpio3_pa3>;
// regulator-name = "gpio3_pa3";
// regulator-always-on;
// };
gpio3pa3:gpio3pa3 {
compatible = "regulator-fixed";
pinctrl-names = "default";
pinctrl-0 = <&gpio3_pa3>;
regulator-name = "gpio3_pa3";
regulator-always-on;
};
// gpio3pa4:gpio3pa4 {
// compatible = "regulator-fixed";
// pinctrl-names = "default";
// pinctrl-0 = <&gpio3_pa4>;
// regulator-name = "gpio3_pa4";
// regulator-always-on;
// };
gpio3pa4:gpio3pa4 {
compatible = "regulator-fixed";
pinctrl-names = "default";
pinctrl-0 = <&gpio3_pa4>;
regulator-name = "gpio3_pa4";
regulator-always-on;
};
// gpio3pa5:gpio3pa5 {
// compatible = "regulator-fixed";
// pinctrl-names = "default";
// pinctrl-0 = <&gpio3_pa5>;
// regulator-name = "gpio3_pa5";
// regulator-always-on;
// };
gpio3pa5:gpio3pa5 {
compatible = "regulator-fixed";
pinctrl-names = "default";
pinctrl-0 = <&gpio3_pa5>;
regulator-name = "gpio3_pa5";
regulator-always-on;
};
// gpio3pa6:gpio3pa6 {
// compatible = "regulator-fixed";
// pinctrl-names = "default";
// pinctrl-0 = <&gpio3_pa6>;
// regulator-name = "gpio3_pa6";
// regulator-always-on;
// };
gpio3pa6:gpio3pa6 {
compatible = "regulator-fixed";
pinctrl-names = "default";
pinctrl-0 = <&gpio3_pa6>;
regulator-name = "gpio3_pa6";
regulator-always-on;
};
// gpio3pa7:gpio3pa7 {
// compatible = "regulator-fixed";
// pinctrl-names = "default";
// pinctrl-0 = <&gpio3_pa7>;
// regulator-name = "gpio3_pa7";
// regulator-always-on;
// };
gpio3pa7:gpio3pa7 {
compatible = "regulator-fixed";
pinctrl-names = "default";
pinctrl-0 = <&gpio3_pa7>;
regulator-name = "gpio3_pa7";
regulator-always-on;
};
};
/**********GPIO**********/
// &pinctrl {
// gpio3-pa1 {
// gpio3_pa1:gpio3-pa1 {
// rockchip,pins = <3 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>;
// };
// };
&pinctrl {
gpio3-pa1 {
gpio3_pa1:gpio3-pa1 {
rockchip,pins = <3 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>;
};
};
// gpio3-pa2 {
// gpio3_pa2:gpio3-pa2 {
// rockchip,pins = <3 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
// };
// };
gpio3-pa2 {
gpio3_pa2:gpio3-pa2 {
rockchip,pins = <3 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
};
};
// gpio3-pa3 {
// gpio3_pa3:gpio3-pa3 {
// rockchip,pins = <3 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>;
// };
// };
gpio3-pa3 {
gpio3_pa3:gpio3-pa3 {
rockchip,pins = <3 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>;
};
};
// gpio3-pa4 {
// gpio3_pa4:gpio3-pa4 {
// rockchip,pins = <3 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>;
// };
// };
gpio3-pa4 {
gpio3_pa4:gpio3-pa4 {
rockchip,pins = <3 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>;
};
};
// gpio3-pa5 {
// gpio3_pa5:gpio3-pa5 {
// rockchip,pins = <3 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>;
// };
// };
gpio3-pa5 {
gpio3_pa5:gpio3-pa5 {
rockchip,pins = <3 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>;
};
};
// gpio3-pa6 {
// gpio3_pa6:gpio3-pa6 {
// rockchip,pins = <3 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>;
// };
// };
gpio3-pa6 {
gpio3_pa6:gpio3-pa6 {
rockchip,pins = <3 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>;
};
};
// gpio3-pa7 {
// gpio3_pa7:gpio3-pa7 {
// rockchip,pins = <3 RK_PA7 RK_FUNC_GPIO &pcfg_pull_none>;
// };
// };
// };
gpio3-pa7 {
gpio3_pa7:gpio3-pa7 {
rockchip,pins = <3 RK_PA7 RK_FUNC_GPIO &pcfg_pull_none>;
};
};
};
&sfc {
status = "okay";
@ -125,30 +125,27 @@
};
};
&usbdrd_dwc3 {
dr_mode = "peripheral";
};
/**********ETH**********/
&gmac {
status = "okay";
};
/**********USB**********/
// &usbdrd {
//&usbdrd {
// status = "disabled";
// };
//};
// &usbdrd_dwc3 {
//&usbdrd_dwc3 {
// status = "disabled";
// };
//};
// &u2phy {
//&u2phy {
// status = "disabled";
// };
//};
// &u2phy_otg {
//&u2phy_otg {
// status = "disabled";
// };
//};
/**********I2C**********/
// &i2c0 {
@ -189,11 +186,11 @@
pinctrl-names = "default";
pinctrl-0 = <&uart4m1_xfer>;
};
// &uart5 {
//&uart5 {
// status = "okay";
// pinctrl-names = "default";
// pinctrl-0 = <&uart5m0_xfer>;
// };
//};
/**********PWM**********/
@ -210,48 +207,48 @@
// pinctrl-0 = <&pwm1m1_pins>;
};
// &pwm2 {
//&pwm2 {
// status = "okay";
// pinctrl-names = "active";
// pinctrl-0 = <&pwm2m2_pins>;
// };
// &pwm3 {
//};
//&pwm3 {
// status = "okay";
// pinctrl-names = "active";
// pinctrl-0 = <&pwm3m2_pins>;
// };
// &pwm4 {
//};
//&pwm4 {
// status = "okay";
// pinctrl-names = "active";
// pinctrl-0 = <&pwm4m2_pins>;
// };
// &pwm5 {
//};
//&pwm5 {
// status = "okay";
// pinctrl-names = "active";
// pinctrl-0 = <&pwm5m2_pins>;
// };
// &pwm6 {
//};
//&pwm6 {
// status = "okay";
// pinctrl-names = "active";
// pinctrl-0 = <&pwm6m2_pins>;
// };
// &pwm7 {
//};
//&pwm7 {
// status = "okay";
// pinctrl-names = "active";
// pinctrl-0 = <&pwm7m2_pins>;
// };
// &pwm8 {
//};
//&pwm8 {
// status = "okay";
// pinctrl-names = "active";
// // pinctrl-0 = <&pwm8m1_pins>;
// pinctrl-0 = <&pwm8m0_pins>;
// };
// &pwm9 {
//};
//&pwm9 {
// status = "okay";
// pinctrl-names = "active";
// // pinctrl-0 = <&pwm9m1_pins>;
// pinctrl-0 = <&pwm9m0_pins>;
// };
//};
&pwm10 {
status = "okay";

View File

@ -104,27 +104,32 @@
};
// &sfc {
// status = "okay";
// flash@0 {
// compatible = "spi-nand";
// reg = <0>;
// spi-max-frequency = <75000000>;
// spi-rx-bus-width = <4>;
// spi-tx-bus-width = <1>;
// };
// };
&usbdrd_dwc3 {
dr_mode = "peripheral";
};
/**********ETH**********/
&gmac {
status = "disabled";
};
/**********USB**********/
// &usbdrd {
// status = "disabled";
// };
// &usbdrd_dwc3 {
// status = "disabled";
// };
// &u2phy {
// status = "disabled";
// };
// &u2phy_otg {
// status = "disabled";
// };
/**********I2C**********/
// &i2c0 {
@ -138,7 +143,7 @@
clock-frequency = <100000>;
};
/**********SPI**********/
// /**********SPI**********/
&spi0 {
status = "okay";
pinctrl-names = "default";
@ -154,7 +159,7 @@
};
};
/**********UART**********/
// /**********UART**********/
&uart3 {
status = "okay";
pinctrl-names = "default";