diff --git a/drivers/power/adp1050/adp1050.c b/drivers/power/adp1050/adp1050.c index d44b20e9ad6..96727aaed5b 100644 --- a/drivers/power/adp1050/adp1050.c +++ b/drivers/power/adp1050/adp1050.c @@ -1350,4 +1350,4 @@ int adp1050_remove(struct adp1050_desc *desc) no_os_free(desc); return 0; -} \ No newline at end of file +} diff --git a/projects/adp1050/Makefile b/projects/adp1050/Makefile index ea22697a376..03726052cb6 100644 --- a/projects/adp1050/Makefile +++ b/projects/adp1050/Makefile @@ -6,4 +6,4 @@ include ../../tools/scripts/generic_variables.mk include src.mk -include ../../tools/scripts/generic.mk +include ../../tools/scripts/generic.mk \ No newline at end of file diff --git a/projects/adp1050/README.rst b/projects/adp1050/README.rst index dc98850bcc8..79ae8be95b0 100644 --- a/projects/adp1050/README.rst +++ b/projects/adp1050/README.rst @@ -1,5 +1,5 @@ -ADP1050 no-OS Example Project -============================= +Evaluating the ADP1050 +====================== .. contents:: :depth: 3 diff --git a/projects/adp1050/src/common/common_data.c b/projects/adp1050/src/common/common_data.c index dcd49f60e99..1425893a84c 100644 --- a/projects/adp1050/src/common/common_data.c +++ b/projects/adp1050/src/common/common_data.c @@ -64,4 +64,5 @@ struct adp1050_init_param adp1050_ip = { .flgi_param = NULL, .syni_param = NULL, .on_off_config = ADP1050_ON_OFF_DEFAULT_CFG, + .device_id = ID_ADP1051, }; diff --git a/projects/adp1050/src/examples/basic/basic_example.c b/projects/adp1050/src/examples/basic/basic_example.c index 18a938a5d64..49d144702ed 100644 --- a/projects/adp1050/src/examples/basic/basic_example.c +++ b/projects/adp1050/src/examples/basic/basic_example.c @@ -47,7 +47,7 @@ int basic_example_main() uint8_t data = 120; uint8_t data2[2]; uint16_t vout; - + ret = adp1050_init(&adp1050_desc, &adp1050_ip); if (ret) goto exit; @@ -62,12 +62,12 @@ int basic_example_main() ADP1050_EEPROM_PASS); if (ret) goto exit; - + ret = adp1050_unlock_pass(adp1050_desc, ADP1050_TRIM_DEFAULT_PASS, ADP1050_TRIM_PASS); if (ret) goto exit; - + ret = adp1050_set_close_loop(adp1050_desc); if (ret) goto exit; @@ -75,47 +75,56 @@ int basic_example_main() ret = adp1050_vout_tr(adp1050_desc, ADP1050_VOUT_TR_200UV_US); if (ret) goto exit; - + ret = adp1050_vout_scale(adp1050_desc, -12, 341); if (ret) goto exit; - + ret = adp1050_vout_value(adp1050_desc, 0x3000, 0x5000); if (ret) goto exit; - + ret = adp1050_pwm_duty_cycle(adp1050_desc, 0x00DE, 0x000E, ADP1050_OUTA); if (ret) goto exit; - + ret = adp1050_set_pwm(adp1050_desc, ADP1050_OUTA, ADP1050_49KHZ); if (ret) goto exit; - + ret = adp1050_read_value(adp1050_desc, &vout, &data, ADP1050_DUTY_CYCLE); if (ret) goto exit; - + /* Checking statuses. */ ret = adp1050_read(adp1050_desc, ADP1050_STATUS_VOUT, &data, 1); if (ret) goto exit; - + ret = adp1050_read(adp1050_desc, ADP1050_STATUS_INPUT, &data, 1); if (ret) goto exit; - + ret = adp1050_read(adp1050_desc, ADP1050_STATUS_CML, &data, 1); if (ret) goto exit; - + ret = adp1050_read(adp1050_desc, ADP1050_STATUS_WORD, data2, 2); if (ret) goto exit; + + ret = adp1051_llm_dllm_comm_setting(adp1050_desc, ADP1051_82US_7B, + ADP1051_41US_6B_AVG, ADP1051_3LSB); + if (ret) + goto exit; + + ret = adp1051_llm_dllm_setting(adp1050_desc, ADP1051_0MS, ADP1051_0mv, 1); + if (ret) + goto exit; exit: if (ret) pr_info("Error!\n"); adp1050_remove(adp1050_desc); return ret; -} +} \ No newline at end of file diff --git a/projects/adp1050/src/examples/examples_src.mk b/projects/adp1050/src/examples/examples_src.mk index cd3bef49b0a..830a887c024 100644 --- a/projects/adp1050/src/examples/examples_src.mk +++ b/projects/adp1050/src/examples/examples_src.mk @@ -1,12 +1,12 @@ ifeq (y,$(strip $(IIO_EXAMPLE))) IIOD=y -CFLAGS += -DIIO_EXAMPLE +CFLAGS += -DIIO_EXAMPLE=1 SRCS += $(PROJECT)/src/examples/iio_example/iio_example.c INCS += $(PROJECT)/src/examples/iio_example/iio_example.h endif ifeq (y,$(strip $(BASIC_EXAMPLE))) -CFLAGS += -DBASIC_EXAMPLE +CFLAGS += -DBASIC_EXAMPLE=1 SRCS += $(PROJECT)/src/examples/basic/basic_example.c INCS += $(PROJECT)/src/examples/basic/basic_example.h endif diff --git a/projects/adp1050/src/platform/maxim/main.c b/projects/adp1050/src/platform/maxim/main.c index 98a193918df..577aef29e8b 100644 --- a/projects/adp1050/src/platform/maxim/main.c +++ b/projects/adp1050/src/platform/maxim/main.c @@ -69,4 +69,4 @@ Please enable only one example and rebuild the project. #endif return ret; -} +} \ No newline at end of file diff --git a/projects/adp1050/src/platform/maxim/parameters.h b/projects/adp1050/src/platform/maxim/parameters.h index d6c0363ffa7..3d51ffba55e 100644 --- a/projects/adp1050/src/platform/maxim/parameters.h +++ b/projects/adp1050/src/platform/maxim/parameters.h @@ -43,13 +43,13 @@ #define INTC_DEVICE_ID 0 #endif -#define UART_DEVICE_ID 0 +#define UART_DEVICE_ID 2 #define UART_BAUDRATE 57600 #define UART_OPS &max_uart_ops #define UART_EXTRA &adp1050_uart_extra #define GPIO_PG_ALT_PORT 0 -#define GPIO_PG_ALT_PIN 24 +#define GPIO_PG_ALT_PIN 9 #define GPIO_OPS &max_gpio_ops #define GPIO_EXTRA &adp1050_pg_alt_extra