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_UTILS_GET_RESOURCE(P2_4, cyhal_pin_map_tcpwm_line);
{
{
}
}
@ CYHAL_GPIO_DRIVE_STRONG
Strong output.
Definition: cyhal_gpio.h:162
cy_rslt_t cyhal_hwmgr_reserve(const cyhal_resource_inst_t *resource)
Reserve the specified resource.
Definition: cyhal_hwmgr.c:183
void cyhal_hwmgr_free(const cyhal_resource_inst_t *resource)
Free the specified resource to allow it to be reused.
Definition: cyhal_hwmgr.c:202
Represents a particular instance of a resource on the chip.
Definition: cyhal_hw_resources.h:183
Represents an association between a pin and a resource.
Definition: cyhal_pin_package.h:162
cy_rslt_t cyhal_connect_pin(const cyhal_resource_pin_mapping_t *pin_connection, uint32_t drive_mode)
Connect a pin to a peripheral terminal.
Definition: cyhal_interconnect.c:38
uint32_t cy_rslt_t
Provides the result of an operation as a structured bitfield.
Definition: cy_result.h:438
#define CY_RSLT_SUCCESS
cy_rslt_t return value indicating success
Definition: cy_result.h:465
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:248
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.
Definition: cyhal_dma.c:618
void cyhal_dma_free(cyhal_dma_t *obj)
Free the DMA object.
Definition: cyhal_dma.c:294
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.
Definition: cyhal_dma.c:634
#define cyhal_dma_init(obj, priority, direction)
Initialize the DMA peripheral.
Definition: cyhal_dma.h:313
cy_rslt_t cyhal_dma_configure(cyhal_dma_t *obj, const cyhal_dma_cfg_t *cfg)
Setup the DMA channel behavior.
Definition: cyhal_dma.c:310
@ CYHAL_DMA_TRANSFER_FULL
All bursts are triggered and a single CYHAL_DMA_TRANSFER_COMPLETE will occur at the end.
Definition: cyhal_dma.h:234
@ 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:198
Configuration of a DMA channel.
Definition: cyhal_dma.h:247
#define CYHAL_DMA_PRIORITY_DEFAULT
Default DMA channel priority.
Definition: cyhal_dma_impl.h:82
DMA object.
Definition: cyhal_hw_types.h:201
Timer object.
Definition: cyhal_hw_types.h:911
@ NC
No Connect/Invalid Pin.
Definition: cyhal_pin_package.h:54
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
uint32_t cyhal_source_t
Routable signal source.
Definition: cyhal_hw_types_template.h:273