Home
last modified time | relevance | path

Searched refs:obj (Results 1 – 25 of 90) sorted by relevance

1234

/hal_infineon-3.7.0/mtb-hal-cat1/source/
Dcyhal_uart.c173 cyhal_uart_t* obj = (cyhal_uart_t*)_cyhal_uart_irq_obj; in _cyhal_uart_irq_handler() local
176 uint32_t txMasked = Cy_SCB_GetTxInterruptStatusMasked(obj->base); in _cyhal_uart_irq_handler()
177 uint32_t rxMasked = Cy_SCB_GetRxInterruptStatusMasked(obj->base); in _cyhal_uart_irq_handler()
180 Cy_SCB_UART_Interrupt(obj->base, &(obj->context)); in _cyhal_uart_irq_handler()
187 Cy_SCB_ClearTxInterrupt(obj->base, CY_SCB_UART_TX_OVERFLOW); in _cyhal_uart_irq_handler()
189 if (NULL != obj->context.cbEvents) in _cyhal_uart_irq_handler()
191 obj->context.cbEvents(CY_SCB_UART_TRANSMIT_ERR_EVENT); in _cyhal_uart_irq_handler()
200 Cy_SCB_ClearTxInterrupt(obj->base, CY_SCB_UART_TX_UNDERFLOW); in _cyhal_uart_irq_handler()
202 if (NULL != obj->context.cbEvents) in _cyhal_uart_irq_handler()
204 obj->context.cbEvents(CY_SCB_UART_TRANSMIT_ERR_EVENT); in _cyhal_uart_irq_handler()
[all …]
Dcyhal_spi.c135 static void _cyhal_ssel_switch_state(cyhal_spi_t *obj, uint8_t ssel_idx, bool ssel_activate);
137 static cy_rslt_t _cyhal_spi_int_frequency(cyhal_spi_t *obj, uint32_t hz, uint8_t *over_sample_val) in _cyhal_spi_int_frequency() argument
139 CY_ASSERT(NULL != obj); in _cyhal_spi_int_frequency()
150 uint32_t peri_freq = _cyhal_utils_get_peripheral_clock_frequency(&(obj->resource)); in _cyhal_spi_int_frequency()
151 if (!obj->is_slave) in _cyhal_spi_int_frequency()
165 divider_value = _cyhal_utils_divider_value(&(obj->resource), hz * oversample_value, 0); in _cyhal_spi_int_frequency()
167 if(!_cyhal_clock_is_divider_valid(&(obj->resource), divider_value)) in _cyhal_spi_int_frequency()
224 …l_utils_peri_pclk_disable_divider(_cyhal_scb_get_clock_index(obj->resource.block_num), &(obj->cloc… in _cyhal_spi_int_frequency()
225 …= _cyhal_utils_peri_pclk_set_freq(_cyhal_scb_get_clock_index(obj->resource.block_num), &(obj->cloc… in _cyhal_spi_int_frequency()
228 …al_utils_peri_pclk_enable_divider(_cyhal_scb_get_clock_index(obj->resource.block_num), &(obj->cloc… in _cyhal_spi_int_frequency()
[all …]
Dcyhal_i2c.c137 cyhal_i2c_t* obj = (cyhal_i2c_t*)_cyhal_i2c_irq_obj; in _cyhal_i2c_irq_handler() local
139 Cy_SCB_I2C_Interrupt(obj->base, &(obj->context)); in _cyhal_i2c_irq_handler()
141 if (obj->pending) in _cyhal_i2c_irq_handler()
145 if (0 == (Cy_SCB_I2C_MasterGetStatus(obj->base, &obj->context) & CY_SCB_I2C_MASTER_BUSY)) in _cyhal_i2c_irq_handler()
148 if (obj->pending == _CYHAL_I2C_PENDING_TX_RX) in _cyhal_i2c_irq_handler()
151 obj->pending = _CYHAL_I2C_PENDING_RX; in _cyhal_i2c_irq_handler()
152 Cy_SCB_I2C_MasterRead(obj->base, &obj->rx_config, &obj->context); in _cyhal_i2c_irq_handler()
157 obj->pending = _CYHAL_I2C_PENDING_NONE; in _cyhal_i2c_irq_handler()
188 cyhal_i2c_t *obj = (cyhal_i2c_t*)_cyhal_i2c_irq_obj; in _cyhal_i2c_cb_wrapper() local
189 …cyhal_i2c_event_t anded_events = (cyhal_i2c_event_t)(obj->irq_cause & (uint32_t)_cyhal_i2c_convert… in _cyhal_i2c_cb_wrapper()
[all …]
Dcyhal_pdmpcm.c324 static inline int16_t _cyhal_pdm_pcm_get_paired_channel(cyhal_pdm_pcm_t* obj, bool check_used) in _cyhal_pdm_pcm_get_paired_channel() argument
328 uint8_t channel_idx = obj->resource.channel_num; in _cyhal_pdm_pcm_get_paired_channel()
330 if(paired_channel < _cyhal_pdm_num_channels[obj->resource.block_num]) in _cyhal_pdm_pcm_get_paired_channel()
332 …if((false == check_used) || (obj == _cyhal_pdm_pcm_config_structs[obj->resource.block_num][paired_… in _cyhal_pdm_pcm_get_paired_channel()
338 CY_UNUSED_PARAMETER(obj); in _cyhal_pdm_pcm_get_paired_channel()
397 static inline void _cyhal_pdm_pcm_clear_interrupt(cyhal_pdm_pcm_t* obj, uint32_t interrupt) in _cyhal_pdm_pcm_clear_interrupt() argument
400 Cy_PDM_PCM_ClearInterrupt(obj->base, interrupt); in _cyhal_pdm_pcm_clear_interrupt()
402 Cy_PDM_PCM_Channel_ClearInterrupt(obj->base, obj->resource.channel_num, interrupt); in _cyhal_pdm_pcm_clear_interrupt()
406 static inline uint32_t _cyhal_pdm_pcm_get_interrupt_mask(cyhal_pdm_pcm_t* obj) in _cyhal_pdm_pcm_get_interrupt_mask() argument
409 return Cy_PDM_PCM_GetInterruptMask(obj->base); in _cyhal_pdm_pcm_get_interrupt_mask()
[all …]
Dcyhal_adc_mic.c72 #define _CYHAL_ADCMIC_NUM_CHANNELS(obj) (sizeof(obj->channel_config) / sizeof(obj->channel_config[0… argument
134 static void _cyhal_adcmic_find_next_channel(cyhal_adc_t* obj, uint8_t* current_idx, int32_t **buffe… in _cyhal_adcmic_find_next_channel() argument
139 if(NULL != obj->channel_config[*current_idx]) in _cyhal_adcmic_find_next_channel()
141 if(obj->channel_config[*current_idx]->enabled) in _cyhal_adcmic_find_next_channel()
149 *current_idx = (*current_idx + 1) % _CYHAL_ADCMIC_NUM_CHANNELS(obj); in _cyhal_adcmic_find_next_channel()
168 cyhal_adc_t* obj = _cyhal_adcmic_config_structs[block]; in _cyhal_adcmic_irq_handler() local
169 Cy_ADCMic_ClearInterrupt(obj->base, CY_ADCMIC_INTR_DC); in _cyhal_adcmic_irq_handler()
170 obj->conversion_complete = true; in _cyhal_adcmic_irq_handler()
172 if(obj->async_scans_remaining > 0) in _cyhal_adcmic_irq_handler()
174 int16_t dc_data = Cy_ADCMic_GetDcResult(obj->base); in _cyhal_adcmic_irq_handler()
[all …]
Dcyhal_audio_common.c73 …dioss_length_to_pdl(uint8_t user_length, cy_en_i2s_len_t *pdl_length, const _cyhal_audioss_t *obj);
250 …udioss_length_to_pdl(uint8_t user_length, cy_en_tdm_ws_t *pdl_length, const _cyhal_audioss_t *obj);
391 static void _cyhal_audioss_update_enabled_events(_cyhal_audioss_t* obj);
392 static void _cyhal_audioss_process_event(_cyhal_audioss_t *obj, uint32_t event);
394 static void _cyhal_audioss_update_rx_trigger_level(_cyhal_audioss_t* obj);
395 static uint32_t _cyhal_audioss_read_fifo(_cyhal_audioss_t *obj);
397 static cy_rslt_t _cyhal_audioss_dma_perform_rx(_cyhal_audioss_t *obj);
401 static uint32_t _cyhal_audioss_disable_events(_cyhal_audioss_t *obj, bool tx);
402 static void _cyhal_audioss_restore_events(_cyhal_audioss_t *obj, bool tx, uint32_t old_events);
404 static cy_rslt_t _cyhal_audioss_dma_perform_tx(_cyhal_audioss_t *obj);
[all …]
Dcyhal_dma.c62 …cyhal_dma_t *obj, cyhal_dma_src_t *src, cyhal_dma_dest_t *dest, cyhal_source_t *dest_source, uint8… in cyhal_dma_init_adv() argument
64 CY_ASSERT(NULL != obj); in cyhal_dma_init_adv()
66 memset(obj, 0u, sizeof(*obj)); in cyhal_dma_init_adv()
68 obj->direction = direction; in cyhal_dma_init_adv()
69 obj->callback_data.callback = NULL; in cyhal_dma_init_adv()
70 obj->callback_data.callback_arg = NULL; in cyhal_dma_init_adv()
71 obj->irq_cause = 0; in cyhal_dma_init_adv()
72 obj->source = CYHAL_TRIGGER_CPUSS_ZERO; in cyhal_dma_init_adv()
73 obj->owned_by_configurator = false; in cyhal_dma_init_adv()
81 rslt = _cyhal_dma_dw_init(obj, src_trigger, dest_trigger, priority); in cyhal_dma_init_adv()
[all …]
Dcyhal_dac.c138 static bool _cyhal_dac_is_output_buffered(const cyhal_dac_t *obj) in _cyhal_dac_is_output_buffered() argument
141 return (0u == (obj->base_dac->CTDAC_SW & CTDAC_CTDAC_SW_CTDO_CO6_Msk)); in _cyhal_dac_is_output_buffered()
145 static bool _cyhal_dac_is_external_reference(const cyhal_dac_t *obj) in _cyhal_dac_is_external_reference() argument
149 return (0u == (obj->base_dac->CTDAC_SW & CTDAC_CTDAC_SW_CTDD_CVD_Msk)); in _cyhal_dac_is_external_reference()
167 static cy_rslt_t _cyhal_dac_configure_oa0(cyhal_dac_t *obj, bool init) in _cyhal_dac_configure_oa0() argument
170 CY_ASSERT(false == obj->owned_by_configurator); in _cyhal_dac_configure_oa0()
171 if (init && (CYHAL_RSC_INVALID != obj->resource_opamp.type)) in _cyhal_dac_configure_oa0()
177 result = Cy_CTB_OpampInit(obj->base_opamp, CY_CTB_OPAMP_0, &config); in _cyhal_dac_configure_oa0()
178 …Cy_CTB_SetAnalogSwitch(obj->base_opamp, CY_CTB_SWITCH_OA0_SW, CY_CTB_SW_OA0_NEG_OUT_MASK | CY_CTB_… in _cyhal_dac_configure_oa0()
179 …Cy_CTB_SetAnalogSwitch(obj->base_opamp, CY_CTB_SWITCH_CTD_SW, CY_CTB_SW_CTD_OUT_CHOLD_MASK | CY_CT… in _cyhal_dac_configure_oa0()
[all …]
Dcyhal_lptimer.c280 cyhal_lptimer_t *obj = _cyhal_lptimer_config_structs[instance]; in _cyhal_lptimer_irq_handler() local
282 uint32_t c2_count = Cy_MCWDT_GetCount(obj->base, CY_MCWDT_COUNTER2); in _cyhal_lptimer_irq_handler()
284 Cy_MCWDT_ClearInterrupt(obj->base, (CY_MCWDT_CTR1 | CY_MCWDT_CTR2)); in _cyhal_lptimer_irq_handler()
286 Cy_MCWDT_ClearInterrupt(obj->base, (CY_MCWDT_CTR0 | CY_MCWDT_CTR1 | CY_MCWDT_CTR2)); in _cyhal_lptimer_irq_handler()
292 …Cy_MCWDT_SetInterruptMask(obj->base, Cy_MCWDT_GetInterruptMask(obj->base) & ~_cyhal_lptimer_counte… in _cyhal_lptimer_irq_handler()
295 if (obj->clear_int_mask) in _cyhal_lptimer_irq_handler()
298 Cy_MCWDT_SetInterruptMask(obj->base, 0); in _cyhal_lptimer_irq_handler()
300 Cy_WDC_InterruptDisable(obj->base, CY_WDC_COUNTER1); in _cyhal_lptimer_irq_handler()
304 if(obj->final_time - c2_count > 0 && obj->final_time > c2_count) in _cyhal_lptimer_irq_handler()
306 cyhal_lptimer_set_delay(obj, obj->final_time - c2_count); in _cyhal_lptimer_irq_handler()
[all …]
Dcyhal_timer.c106 cy_rslt_t _cyhal_timer_init_hw(cyhal_timer_t *obj, const cy_stc_tcpwm_counter_config_t *config, con… in _cyhal_timer_init_hw() argument
110 cyhal_resource_inst_t *timer = &obj->tcpwm.resource; in _cyhal_timer_init_hw()
111 obj->tcpwm.base = _CYHAL_TCPWM_DATA[_CYHAL_TCPWM_ADJUST_BLOCK_INDEX(timer->block_num)].base; in _cyhal_timer_init_hw()
117 obj->tcpwm.clock = *clk; in _cyhal_timer_init_hw()
118 obj->tcpwm.clock_hz = cyhal_clock_get_frequency(&obj->tcpwm.clock); in _cyhal_timer_init_hw()
119 if (CY_SYSCLK_SUCCESS != _cyhal_utils_peri_pclk_assign_divider(pclk, &(obj->tcpwm.clock))) in _cyhal_timer_init_hw()
124 …else if (CY_RSLT_SUCCESS == (result = _cyhal_utils_allocate_clock(&(obj->tcpwm.clock), timer, CYHA… in _cyhal_timer_init_hw()
126 obj->tcpwm.dedicated_clock = true; in _cyhal_timer_init_hw()
129 result = cyhal_timer_set_frequency(obj, CYHAL_TIMER_DEFAULT_FREQ * 3); in _cyhal_timer_init_hw()
131 result = cyhal_timer_set_frequency(obj, CYHAL_TIMER_DEFAULT_FREQ); in _cyhal_timer_init_hw()
[all …]
Dcyhal_usb_dev.c116 static cy_rslt_t _cyhal_usb_dev_hf_clock_setup(cyhal_usb_dev_t *obj);
117 static cy_rslt_t _cyhal_usb_dev_peri_clock_setup(cyhal_usb_dev_t *obj, const cyhal_clock_t *clk);
119 static cy_rslt_t _cyhal_usb_dev_pin_setup(cyhal_usb_dev_t *obj, cyhal_gpio_t dp, cyhal_gpio_t dm);
120 static void _cyhal_usb_dev_free_resources(cyhal_usb_dev_t *obj);
282 static cy_rslt_t _cyhal_usb_dev_hf_clock_setup(cyhal_usb_dev_t *obj) in _cyhal_usb_dev_hf_clock_setup() argument
319 result = _cyhal_usb_dev_reserve_pll(&(obj->pll_resource)); in _cyhal_usb_dev_hf_clock_setup()
324 …result = _cyhal_usb_dev_init_pll(clock, obj->pll_resource.block_num, _CYHAL_USB_DEV_USB_CLK_HF_FRE… in _cyhal_usb_dev_hf_clock_setup()
339 static cy_rslt_t _cyhal_usb_dev_peri_clock_setup(cyhal_usb_dev_t *obj, const cyhal_clock_t *clk) in _cyhal_usb_dev_peri_clock_setup() argument
346 obj->shared_clock = false; in _cyhal_usb_dev_peri_clock_setup()
349 …result = _cyhal_utils_allocate_clock(&(obj->clock), &(obj->resource), CYHAL_CLOCK_BLOCK_PERIPHERAL… in _cyhal_usb_dev_peri_clock_setup()
[all …]
Dcyhal_dma_dmac.c243 static inline uint8_t _cyhal_dma_dmac_get_cfg_offset(const cyhal_dma_t* obj) in _cyhal_dma_dmac_get_cfg_offset() argument
245 return (obj->resource.block_num * NUM_DMAC0_CHANNELS) + obj->resource.channel_num; in _cyhal_dma_dmac_get_cfg_offset()
249 static inline void _cyhal_dma_dmac_set_obj(cyhal_dma_t *obj) in _cyhal_dma_dmac_set_obj() argument
251 _cyhal_dma_dmac_config_structs[_cyhal_dma_dmac_get_cfg_offset(obj)] = obj; in _cyhal_dma_dmac_set_obj()
255 static inline void _cyhal_dma_dmac_free_obj(cyhal_dma_t *obj) in _cyhal_dma_dmac_free_obj() argument
257 _cyhal_dma_dmac_config_structs[_cyhal_dma_dmac_get_cfg_offset(obj)] = NULL; in _cyhal_dma_dmac_free_obj()
310 static inline _cyhal_system_irq_t _cyhal_dma_dmac_get_irqn(cyhal_dma_t *obj) in _cyhal_dma_dmac_get_irqn() argument
313 CY_UNUSED_PARAMETER(obj); in _cyhal_dma_dmac_get_irqn()
317 return (_cyhal_system_irq_t)((uint8_t)DMAC0_IRQn + _cyhal_dma_dmac_get_cfg_offset(obj)); in _cyhal_dma_dmac_get_irqn()
385 static inline cyhal_dma_event_t _cyhal_dma_dmac_convert_interrupt_cause(cyhal_dma_t *obj, uint32_t … in _cyhal_dma_dmac_convert_interrupt_cause() argument
[all …]
Dcyhal_ezi2c.c76 cyhal_ezi2c_t *obj = (cyhal_ezi2c_t*) _cyhal_scb_get_irq_obj(irqn); in _cyhal_ezi2c_irq_handler() local
78 cyhal_ezi2c_t *obj = (cyhal_ezi2c_t*) _cyhal_scb_get_irq_obj(); in _cyhal_ezi2c_irq_handler()
80 Cy_SCB_EZI2C_Interrupt(obj->base, &(obj->context)); in _cyhal_ezi2c_irq_handler()
83 …cyhal_ezi2c_event_callback_t callback = (cyhal_ezi2c_event_callback_t) obj->callback_data.callback; in _cyhal_ezi2c_irq_handler()
87 cyhal_ezi2c_status_t status = cyhal_ezi2c_get_activity_status(obj); in _cyhal_ezi2c_irq_handler()
88 if(status & obj->irq_cause) in _cyhal_ezi2c_irq_handler()
90 …(void) (callback) (obj->callback_data.callback_arg, (cyhal_ezi2c_status_t)(status & obj->irq_cause… in _cyhal_ezi2c_irq_handler()
116 cyhal_ezi2c_t *obj = (cyhal_ezi2c_t*)(obj_ptr); in _cyhal_ezi2c_pm_callback_instance() local
119 .base = (void *) (obj->base), in _cyhal_ezi2c_pm_callback_instance()
120 .context = (void *) &(obj->context) in _cyhal_ezi2c_pm_callback_instance()
[all …]
Dcyhal_adc_sar.c235 static uint8_t _cyhal_adc_last_enabled(const cyhal_adc_t* obj); /* Or last channel, if no channel i…
474 static uint8_t _cyhal_adc_first_enabled(const cyhal_adc_t* obj) /* Or first channel, if no channel … in _cyhal_adc_first_enabled() argument
479 if(NULL != obj->channel_config[i] && obj->base->CH[i].ENABLE) in _cyhal_adc_first_enabled()
489 static uint8_t _cyhal_adc_last_enabled(const cyhal_adc_t* obj) /* Or last channel, if no channel is… in _cyhal_adc_last_enabled() argument
495 if(NULL != obj->channel_config[i] && obj->base->CH[i].ENABLE) in _cyhal_adc_last_enabled()
505 static int32_t _cyhal_adc_counts_to_uvolts(cyhal_adc_t* obj, uint8_t channel, uint32_t counts) in _cyhal_adc_counts_to_uvolts() argument
507 CY_UNUSED_PARAMETER(obj); /* We're always single-ended with vneg set to vssa */ in _cyhal_adc_counts_to_uvolts()
512 return (int32_t)((counts * 900000.0f) / obj->vbg_last_value); in _cyhal_adc_counts_to_uvolts()
559 static void _cyhal_adc_update_intr_mask(const cyhal_adc_t* obj) in _cyhal_adc_update_intr_mask() argument
561 bool needs_eos = (obj->async_scans_remaining > 0) /* Async transfer in progress */ in _cyhal_adc_update_intr_mask()
[all …]
Dcyhal_opamp.c83 cy_rslt_t _cyhal_opamp_init_hw(cyhal_opamp_t *obj, const cy_stc_ctb_opamp_config_t* cfg) in _cyhal_opamp_init_hw() argument
85 obj->base = _cyhal_ctb_base[obj->resource.block_num]; in _cyhal_opamp_init_hw()
86 …cy_rslt_t result = Cy_CTB_OpampInit(obj->base, _cyhal_opamp_convert_sel(obj->resource.channel_num)… in _cyhal_opamp_init_hw()
89 obj->is_init_success = true; in _cyhal_opamp_init_hw()
91 cyhal_analog_ctb_init(obj->base); in _cyhal_opamp_init_hw()
96 cy_rslt_t cyhal_opamp_init(cyhal_opamp_t *obj, cyhal_gpio_t vin_p, cyhal_gpio_t vin_m, cyhal_gpio_t… in cyhal_opamp_init() argument
99 CY_ASSERT(NULL != obj); in cyhal_opamp_init()
103 memset(obj, 0, sizeof(cyhal_opamp_t)); in cyhal_opamp_init()
104 obj->base = NULL; in cyhal_opamp_init()
105 obj->resource.type = CYHAL_RSC_INVALID; in cyhal_opamp_init()
[all …]
Dcyhal_dma_dw.c145 static inline void _cyhal_dma_dw_set_obj(cyhal_dma_t *obj) in _cyhal_dma_dw_set_obj() argument
147 …_cyhal_dma_dw_config_structs[obj->resource.block_num * CPUSS_DW0_CH_NR + obj->resource.channel_num… in _cyhal_dma_dw_set_obj()
151 static inline void _cyhal_dma_dw_free_obj(cyhal_dma_t *obj) in _cyhal_dma_dw_free_obj() argument
153 …_cyhal_dma_dw_config_structs[obj->resource.block_num * CPUSS_DW0_CH_NR + obj->resource.channel_num… in _cyhal_dma_dw_free_obj()
224 static inline _cyhal_system_irq_t _cyhal_dma_dw_get_irqn(cyhal_dma_t *obj) in _cyhal_dma_dw_get_irqn() argument
228 … if (obj->resource.block_num == 0 && obj->resource.channel_num < CYHAL_DMA_DW0_MAX_CONTIGUOUS_IRQ) in _cyhal_dma_dw_get_irqn()
231 …return (_cyhal_system_irq_t)((uint8_t)m33syscpuss_interrupts_dw0_0_IRQn + obj->resource.channel_nu… in _cyhal_dma_dw_get_irqn()
233 … return (_cyhal_system_irq_t)((uint8_t)cpuss_interrupts_dw0_0_IRQn + obj->resource.channel_num); in _cyhal_dma_dw_get_irqn()
237 else if ((obj->resource.block_num == 0 && obj->resource.channel_num < CPUSS_DW0_CH_NR)) in _cyhal_dma_dw_get_irqn()
239 …(uint8_t)_CYHAL_DMA_GET_CPUSS_IRQN(0, CYHAL_DMA_DW0_MAX_CONTIGUOUS_IRQ) + (obj->resource.channel_n… in _cyhal_dma_dw_get_irqn()
[all …]
Dcyhal_pwm.c117 static cy_rslt_t cyhal_pwm_set_period_and_compare(cyhal_pwm_t *obj, uint32_t period, uint32_t compa… in cyhal_pwm_set_period_and_compare() argument
119 …eriod > (uint32_t)((1 << _CYHAL_TCPWM_DATA[_CYHAL_TCPWM_ADJUST_BLOCK_INDEX(obj->tcpwm.resource.blo… in cyhal_pwm_set_period_and_compare()
122 cyhal_gpio_t pin = obj->pin; in cyhal_pwm_set_period_and_compare()
123 cyhal_gpio_t pin_compl = obj->pin_compl; in cyhal_pwm_set_period_and_compare()
125 Cy_TCPWM_PWM_SetCompare0(obj->tcpwm.base, _CYHAL_TCPWM_CNT_NUMBER(obj->tcpwm.resource), 0u); in cyhal_pwm_set_period_and_compare()
126 …Cy_TCPWM_PWM_SetPeriod0(obj->tcpwm.base, _CYHAL_TCPWM_CNT_NUMBER(obj->tcpwm.resource), period - 1u… in cyhal_pwm_set_period_and_compare()
130 …(NC == pin || (_CYHAL_UTILS_GET_RESOURCE_INST(pin, cyhal_pin_map_tcpwm_line_compl, &obj->tcpwm.res… in cyhal_pwm_set_period_and_compare()
131 …l || (_CYHAL_UTILS_GET_RESOURCE_INST(pin_compl, cyhal_pin_map_tcpwm_line, &obj->tcpwm.resource) !=… in cyhal_pwm_set_period_and_compare()
139 …uint32_t pwm_ctrl_reg = TCPWM_GRP_CNT_TR_PWM_CTRL(obj->tcpwm.base, _CYHAL_TCPWM_GET_GRP(obj->tcpwm… in cyhal_pwm_set_period_and_compare()
140 _CYHAL_TCPWM_CNT_NUMBER(obj->tcpwm.resource)); in cyhal_pwm_set_period_and_compare()
[all …]
Dcyhal_comp_ctb.c114 static cyhal_comp_event_t _cyhal_comp_ctb_get_enabled_events(cyhal_comp_t * obj) in _cyhal_comp_ctb_get_enabled_events() argument
116 uint32_t edge_config_val = (0u == obj->resource.channel_num) in _cyhal_comp_ctb_get_enabled_events()
117 ? (CTBM_OA_RES0_CTRL(obj->base_ctb) & CTBM_OA_RES0_CTRL_OA0_COMPINT_Msk) in _cyhal_comp_ctb_get_enabled_events()
118 : (CTBM_OA_RES1_CTRL(obj->base_ctb) & CTBM_OA_RES1_CTRL_OA1_COMPINT_Msk); in _cyhal_comp_ctb_get_enabled_events()
156 cyhal_comp_t* obj = _cyhal_ctb_get_interrupt_source(); in _cyhal_comp_ctb_irq_handler() local
157 Cy_CTB_ClearInterrupt(obj->base_ctb, _cyhal_opamp_convert_sel(obj->resource.channel_num)); in _cyhal_comp_ctb_irq_handler()
158 cyhal_comp_event_callback_t callback = (cyhal_comp_event_callback_t)obj->callback_data.callback; in _cyhal_comp_ctb_irq_handler()
162 cyhal_comp_event_t event = _cyhal_comp_ctb_get_enabled_events(obj); in _cyhal_comp_ctb_irq_handler()
163 callback(obj->callback_data.callback_arg, event); in _cyhal_comp_ctb_irq_handler()
179 cy_rslt_t _cyhal_comp_ctb_init_hw(cyhal_comp_t *obj, const cy_stc_ctb_opamp_config_t* cfg) in _cyhal_comp_ctb_init_hw() argument
[all …]
Dcyhal_keyscan.c66 static cy_rslt_t _cyhal_keyscan_init_resources(cyhal_keyscan_t *obj, uint8_t num_columns, const cyh…
68 static cy_rslt_t _cyhal_keyscan_init_hw(cyhal_keyscan_t *obj, cy_stc_ks_config_t *cfg);
107 cyhal_keyscan_t *obj = _cyhal_keyscan_config_structs[0]; in _cyhal_keyscan_irq_handler() local
114 Cy_Keyscan_Interrupt_Handler(obj->base, &(obj->context)); in _cyhal_keyscan_irq_handler()
126 cyhal_keyscan_t *obj = _cyhal_keyscan_config_structs[0]; in _cyhal_keyscan_cb_wrapper() local
128 …((obj->context.curNumElements == obj->context.maxNumElements) ? CYHAL_KEYSCAN_EVENT_BUFFER_FULL : … in _cyhal_keyscan_cb_wrapper()
129 cyhal_keyscan_event_t anded_events = (cyhal_keyscan_event_t)(obj->irq_cause & hal_event); in _cyhal_keyscan_cb_wrapper()
132 …cyhal_keyscan_event_callback_t callback = (cyhal_keyscan_event_callback_t) obj->callback_data.call… in _cyhal_keyscan_cb_wrapper()
133 callback(obj->callback_data.callback_arg, anded_events); in _cyhal_keyscan_cb_wrapper()
143 cyhal_keyscan_t *obj = _cyhal_keyscan_config_structs[0]; in _cyhal_keyscan_pm_callback() local
[all …]
Dcyhal_comp_lp.c62 Cy_LPComp_Init((base), (channel), (config), &(obj->context))
65 Cy_LPComp_Enable((base), (channel), &(obj->context))
68 Cy_LPComp_Disable((base), (channel), &(obj->context))
71 Cy_LPComp_SetInterruptTriggerMode((base), (channel), (intType), &(obj->context))
154 static cyhal_comp_event_t _cyhal_comp_lp_get_enabled_events(cyhal_comp_t * obj) in _cyhal_comp_lp_get_enabled_events() argument
156 switch((cy_en_lpcomp_int_t)obj->irq_cause) in _cyhal_comp_lp_get_enabled_events()
196 cyhal_comp_t* obj = _cyhal_comp_lp_config_structs[(block * _CYHAL_COMP_PER_LP) + instance_num]; in _cyhal_comp_lp_irq_handler() local
197 if (NULL != obj) in _cyhal_comp_lp_irq_handler()
199 Cy_LPComp_ClearInterrupt(obj->base_lpcomp, (uint32_t) (1u << obj->resource.channel_num)); in _cyhal_comp_lp_irq_handler()
201 … cyhal_comp_event_callback_t callback = (cyhal_comp_event_callback_t)obj->callback_data.callback; in _cyhal_comp_lp_irq_handler()
[all …]
Dcyhal_quaddec.c74 #define _CYHAL_CNT_NUM _CYHAL_TCPWM_CNT_NUMBER(obj->tcpwm.resource)
216 static cy_rslt_t _cyhal_quaddec_pin_init(cyhal_quaddec_t *obj, cyhal_gpio_t pin, cyhal_gpio_t *obj_… in _cyhal_quaddec_pin_init() argument
245 rslt = cyhal_gpio_enable_output(pin, signal_type, &(obj->tcpwm.inputs[idx])); in _cyhal_quaddec_pin_init()
250 rslt = cyhal_quaddec_connect_digital(obj, obj->tcpwm.inputs[idx], input); in _cyhal_quaddec_pin_init()
253 obj->tcpwm.inputs[idx] = CYHAL_TRIGGER_CPUSS_ZERO; in _cyhal_quaddec_pin_init()
258 rslt = _cyhal_quaddec_connect_pin(input, pin, obj->tcpwm.base, in _cyhal_quaddec_pin_init()
259 obj->tcpwm.resource.channel_num); in _cyhal_quaddec_pin_init()
283 cy_rslt_t _cyhal_quaddec_init_hw(cyhal_quaddec_t *obj, const cy_stc_tcpwm_quaddec_config_t *config,… in _cyhal_quaddec_init_hw() argument
286obj->last_counter_value = 1 << (_CYHAL_TCPWM_DATA[_CYHAL_TCPWM_ADJUST_BLOCK_INDEX(obj->tcpwm.resou… in _cyhal_quaddec_init_hw()
288obj->tcpwm.base = _CYHAL_TCPWM_DATA[_CYHAL_TCPWM_ADJUST_BLOCK_INDEX(obj->tcpwm.resource.block_num)… in _cyhal_quaddec_init_hw()
[all …]
Dcyhal_qspi.c185 static void _cyhal_qspi_set_pins_frozen(cyhal_qspi_t* obj, bool freeze) in _cyhal_qspi_set_pins_frozen() argument
192 gpio = obj->pin_io[i]; in _cyhal_qspi_set_pins_frozen()
199 obj->saved_io_hsiom[i] = Cy_GPIO_GetHSIOM(port, pin); in _cyhal_qspi_set_pins_frozen()
205 Cy_GPIO_SetHSIOM(port, pin, obj->saved_io_hsiom[i]); in _cyhal_qspi_set_pins_frozen()
210 gpio = obj->pin_sclk; in _cyhal_qspi_set_pins_frozen()
217 obj->saved_sclk_hsiom = Cy_GPIO_GetHSIOM(port, pin); in _cyhal_qspi_set_pins_frozen()
223 Cy_GPIO_SetHSIOM(port, pin, obj->saved_sclk_hsiom); in _cyhal_qspi_set_pins_frozen()
229 gpio = obj->pin_ssel[i]; in _cyhal_qspi_set_pins_frozen()
236 obj->saved_ssel_hsiom[i] = Cy_GPIO_GetHSIOM(port, pin); in _cyhal_qspi_set_pins_frozen()
242 Cy_GPIO_SetHSIOM(port, pin, obj->saved_ssel_hsiom[i]); in _cyhal_qspi_set_pins_frozen()
[all …]
Dcyhal_udb_sdio.c162 cyhal_sdio_t *obj = (cyhal_sdio_t *)callback_arg; in _cyhal_sdio_ds_callback() local
163 CY_ASSERT(obj != NULL); in _cyhal_sdio_ds_callback()
187 obj->pm_transition_pending = true; in _cyhal_sdio_ds_callback()
204 if (obj->pm_transition_pending) in _cyhal_sdio_ds_callback()
213 obj->pm_transition_pending = false; in _cyhal_sdio_ds_callback()
252 cy_rslt_t cyhal_sdio_init(cyhal_sdio_t *obj, cyhal_gpio_t cmd, cyhal_gpio_t clk, cyhal_gpio_t data0… in cyhal_sdio_init() argument
254 CY_ASSERT(NULL != obj); in cyhal_sdio_init()
264 obj->resource.type = CYHAL_RSC_INVALID; in cyhal_sdio_init()
265 obj->pin_cmd = CYHAL_NC_PIN_VALUE; in cyhal_sdio_init()
266 obj->pin_clk = CYHAL_NC_PIN_VALUE; in cyhal_sdio_init()
[all …]
/hal_infineon-3.7.0/mtb-hal-cat1/include_pvt/
Dcyhal_i2s_impl.h38 #define cyhal_i2s_free(obj) (_cyhal_audioss_free((_cyhal_audioss_t *)(obj))) argument
40 #define cyhal_i2s_set_sample_rate(obj, sample_rate_hz) \ argument
41 _cyhal_audioss_set_sample_rate((_cyhal_audioss_t *)(obj), (sample_rate_hz))
43 #define cyhal_i2s_enable_event(obj, event, intr_priority, enable) \ argument
44 …_cyhal_audioss_enable_event((_cyhal_audioss_t *)(obj), (uint32_t)(event), (intr_priority), (enable…
46 #define cyhal_i2s_start_tx(obj) _cyhal_audioss_start_tx((_cyhal_audioss_t *)(obj)) argument
47 #define cyhal_i2s_stop_tx(obj) _cyhal_audioss_stop_tx((_cyhal_audioss_t *)(obj)) argument
48 #define cyhal_i2s_clear_tx(obj) _cyhal_audioss_clear_tx((_cyhal_audioss_t *)(obj)) argument
50 #define cyhal_i2s_start_rx(obj) _cyhal_audioss_start_rx((_cyhal_audioss_t *)(obj)) argument
51 #define cyhal_i2s_stop_rx(obj) _cyhal_audioss_stop_rx((_cyhal_audioss_t *)(obj)) argument
[all …]
Dcyhal_tdm_impl.h38 #define cyhal_tdm_free(obj) (_cyhal_audioss_free((_cyhal_audioss_t *)(obj))) argument
40 #define cyhal_tdm_set_sample_rate(obj, sample_rate_hz) \ argument
41 _cyhal_audioss_set_sample_rate((_cyhal_audioss_t *)(obj), (sample_rate_hz))
43 #define cyhal_tdm_enable_event(obj, event, intr_priority, enable) \ argument
44 …_cyhal_audioss_enable_event((_cyhal_audioss_t *)(obj), (uint32_t)(event), (intr_priority), (enable…
46 #define cyhal_tdm_start_tx(obj) _cyhal_audioss_start_tx((_cyhal_audioss_t *)(obj)) argument
47 #define cyhal_tdm_stop_tx(obj) _cyhal_audioss_stop_tx((_cyhal_audioss_t *)(obj)) argument
48 #define cyhal_tdm_clear_tx(obj) _cyhal_audioss_clear_tx((_cyhal_audioss_t *)(obj)) argument
50 #define cyhal_tdm_start_rx(obj) _cyhal_audioss_start_rx((_cyhal_audioss_t *)(obj)) argument
51 #define cyhal_tdm_stop_rx(obj) _cyhal_audioss_stop_rx((_cyhal_audioss_t *)(obj)) argument
[all …]

1234