High level interface to the Infineon digital routing.
Facilities for runtime manipulation of the on chip routing. The following types of connections are supported:
The following code snippet demonstrates connecting a GPIO pin to an active TCPWM block on a device using the cyhal_connect_pin. It is assumed that the TCPWM is already configured and active.
{
{
}
}
@ CYHAL_GPIO_DRIVE_STRONG
Strong output.
Definition: cyhal_gpio.h:158
cy_rslt_t cyhal_hwmgr_reserve(const cyhal_resource_inst_t *obj)
Reserve the specified resource.
Definition: cyhal_hwmgr.c:177
void cyhal_hwmgr_free(const cyhal_resource_inst_t *obj)
Free the specified resource to allow it to be reused.
Definition: cyhal_hwmgr.c:196
Represents a particular instance of a resource on the chip.
Definition: cyhal_hw_resources.h:588
const cyhal_resource_pin_mapping_t cyhal_pin_map_tcpwm_line[68]
List of valid pin to peripheral connections for the tcpwm_line signal.
Represents an association between a pin and a resource.
Definition: cyhal_psoc6_01_104_m_csp_ble.h:143
@ P2_4
Port 2 Pin 4.
Definition: cyhal_psoc6_01_124_bga.h:73
cy_rslt_t cyhal_connect_pin(const cyhal_resource_pin_mapping_t *pin_connection, uint8_t drive_mode)
Connect a pin to a peripheral terminal.
Definition: cyhal_interconnect.c:502
uint32_t cy_rslt_t
Provides the result of an operation as a structured bitfield.
Definition: cy_result.h:426
#define CY_RSLT_SUCCESS
cy_rslt_t return value indicating success
Definition: cy_result.h:453
The following code snippet demonstrates configuring and connecting a Timer which will overflow every 2 seconds and, in doing so, trigger a DMA channel start.
uint32_t src_arr[] = { 100, 200 };
uint32_t dst_arr[] = { 0, 0 };
{
.period = 20000,
.is_compare = false,
.is_continuous = true,
.value = 0
};
{
.src_increment = 1,
.dst_addr = (uint32_t)dst_arr,
.dst_increment = 1,
.transfer_width = 32,
.length = 2,
.burst_size = 0,
};
uint32_t src_addr
Source address. Some devices can apply special requirements for user data arrays. Please refer to imp...
Definition: cyhal_dma.h:246
cy_rslt_t cyhal_dma_connect_digital(cyhal_dma_t *obj, cyhal_source_t source, cyhal_dma_input_t input)
Connects a source signal and enables the specified input to the DMA channel.
void cyhal_dma_free(cyhal_dma_t *obj)
Free the DMA object.
cy_rslt_t cyhal_dma_disconnect_digital(cyhal_dma_t *obj, cyhal_source_t source, cyhal_dma_input_t input)
Disconnects a source signal and disables the specified input to the DMA channel.
#define cyhal_dma_init(obj, priority, direction)
Initialize the DMA peripheral.
Definition: cyhal_dma.h:311
cy_rslt_t cyhal_dma_configure(cyhal_dma_t *obj, const cyhal_dma_cfg_t *cfg)
Setup the DMA channel behavior.
@ CYHAL_DMA_TRANSFER_FULL
All bursts are triggered and a single CYHAL_DMA_TRANSFER_COMPLETE will occur at the end.
Definition: cyhal_dma.h:232
@ CYHAL_DMA_DIRECTION_MEM2MEM
Memory to memory.
Definition: cyhal_dma.h:167
@ CYHAL_DMA_INPUT_TRIGGER_ALL_ELEMENTS
Transfer all elements when an input signal is received.
Definition: cyhal_dma.h:196
Configuration of a DMA channel.
Definition: cyhal_dma.h:245
#define CYHAL_DMA_PRIORITY_DEFAULT
Default DMA channel priority.
Definition: cyhal_dma_impl.h:66
DMA object.
Definition: cyhal_hw_types.h:216
Timer object.
Definition: cyhal_hw_types.h:1478
@ NC
No Connect/Invalid Pin.
Definition: cyhal_psoc6_01_104_m_csp_ble.h:53
cyhal_trigger_source_psoc6_01_t
Name of each input trigger.
Definition: cyhal_triggers_psoc6_01.h:355
uint32_t compare_value
Timer/counter comparison value.
Definition: cyhal_timer.h:178
cy_rslt_t cyhal_timer_configure(cyhal_timer_t *obj, const cyhal_timer_cfg_t *cfg)
Updates the configuration and counter value of the timer/counter object.
cy_rslt_t cyhal_timer_enable_output(cyhal_timer_t *obj, cyhal_timer_output_t signal, cyhal_source_t *source)
Enables the specified output signal from a tcpwm that will be triggered when the corresponding event ...
cy_rslt_t cyhal_timer_set_frequency(cyhal_timer_t *obj, uint32_t hz)
Configures the timer frequency.
cy_rslt_t cyhal_timer_disable_output(cyhal_timer_t *obj, cyhal_timer_output_t signal)
Disables the specified output signal from a timer.
void cyhal_timer_free(cyhal_timer_t *obj)
Deinitialize the timer/counter object.
cy_rslt_t cyhal_timer_init(cyhal_timer_t *obj, cyhal_gpio_t pin, const cyhal_clock_t *clk)
Initialize the timer/counter peripheral and configure the pin.
cy_rslt_t cyhal_timer_start(cyhal_timer_t *obj)
Starts the timer/counter with the pre-set configuration from cyhal_timer_configure.
@ CYHAL_TIMER_OUTPUT_OVERFLOW
Overflow signal.
Definition: cyhal_timer.h:156
@ CYHAL_TIMER_DIR_UP
Counts up.
Definition: cyhal_timer.h:130
Describes the current configuration of a timer/counter.
Definition: cyhal_timer.h:168