drivers: cat1: Updates to support latest version of HAL/PDL
- Refactoring to support latest versions of HAL/PDL Signed-off-by: Sreeram Tatapudi <sreeram.praveen@infineon.com>
This commit is contained in:
parent
044de03d57
commit
09a07e42c0
11 changed files with 89 additions and 73 deletions
|
@ -13,7 +13,7 @@
|
|||
|
||||
#include <zephyr/drivers/adc.h>
|
||||
#include <cyhal_adc.h>
|
||||
#include <cyhal_utils_psoc.h>
|
||||
#include <cyhal_utils_impl.h>
|
||||
|
||||
#define ADC_CONTEXT_USES_KERNEL_TIMER
|
||||
#include "adc_context.h"
|
||||
|
|
|
@ -104,8 +104,10 @@ static int gpio_cat1_configure(const struct device *dev,
|
|||
break;
|
||||
|
||||
case GPIO_DISCONNECTED:
|
||||
cyhal_gpio_free(gpio_pin);
|
||||
return 0;
|
||||
/* Handle this after calling cyhal_gpio_init(), otherwise it will cause an assert
|
||||
* from HAL for freeing an uninitialized pin
|
||||
*/
|
||||
break;
|
||||
|
||||
default:
|
||||
return -ENOTSUP;
|
||||
|
@ -121,7 +123,12 @@ static int gpio_cat1_configure(const struct device *dev,
|
|||
status = cyhal_gpio_init(gpio_pin, gpio_dir, gpio_mode, pin_val);
|
||||
}
|
||||
|
||||
if (flags & GPIO_DISCONNECTED) {
|
||||
cyhal_gpio_free(gpio_pin);
|
||||
}
|
||||
|
||||
return (status == CY_RSLT_SUCCESS) ? 0 : -EIO;
|
||||
|
||||
}
|
||||
|
||||
static int gpio_cat1_port_get_raw(const struct device *dev,
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
#include <zephyr/drivers/i2c.h>
|
||||
#include <zephyr/drivers/pinctrl.h>
|
||||
#include <cyhal_i2c.h>
|
||||
#include <cyhal_utils_psoc.h>
|
||||
#include <cyhal_utils_psoc.h>
|
||||
#include <cyhal_utils_impl.h>
|
||||
#include <cyhal_utils_impl.h>
|
||||
#include <cyhal_scb_common.h>
|
||||
|
||||
#include <zephyr/logging/log.h>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
#include <zephyr/drivers/uart.h>
|
||||
#include <zephyr/drivers/pinctrl.h>
|
||||
#include <cyhal_uart.h>
|
||||
#include <cyhal_utils_psoc.h>
|
||||
#include <cyhal_utils_impl.h>
|
||||
#include <cyhal_scb_common.h>
|
||||
|
||||
/* Data structure */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue