![]() |
Definition in file etpu_util.c.
#include "etpu_util.h"
Go to the source code of this file.
Functions | |
uint32_t | fs_etpu_init (struct etpu_config_t p_etpu_config, uint32_t *code, uint32_t code_size, uint32_t *globals, uint32_t globals_size) |
This function initializes the eTPU module. | |
uint32_t | fs_etpu2_init (struct etpu_config_t p_etpu_config, uint32_t engine_mem_size) |
This function initializes the eTPU2-only setting of an eTPU2 module. | |
uint32_t * | fs_etpu_chan_init (uint8_t channel, uint8_t function, uint8_t mode, uint8_t hsr, uint8_t num_param, uint32_t config, uint32_t *func_frame) |
This function initializes an eTPU channel. | |
uint32_t * | fs_etpu_data_ram (uint8_t channel) |
This function returns a pointer to the start of the data RAM for the specified channel. | |
void | fs_etpu_set_hsr (uint8_t channel, uint8_t hsr) |
This function sets the Host Service Request (HSR) register of the specified eTPU channel. | |
uint8_t | fs_etpu_get_hsr (uint8_t channel) |
This function returns the current value of the Host Service Request (HSR) register of the specified eTPU channel. | |
void | fs_etpu_enable (uint8_t channel, uint8_t priority) |
This function enables or changes the priority of an eTPU channel. | |
void | fs_etpu_disable (uint8_t channel) |
This function disables an eTPU channel. | |
void | fs_etpu_interrupt_enable (uint8_t channel) |
This function enables an eTPU channel to generate interrupts. | |
void | fs_etpu_interrupt_disable (uint8_t channel) |
This function disables an eTPU channel from generating interrupts. | |
void | fs_etpu_dma_enable (uint8_t channel) |
This function enables an eTPU channel to request DMA service. | |
void | fs_etpu_dma_disable (uint8_t channel) |
This function disables an eTPU channel from generating DMA requests. | |
void | fs_timer_start (void) |
This function starts the timebases. | |
uint32_t * | fs_etpu_malloc (uint16_t num_bytes) |
This function allocates DATA RAM (parameter RAM) for a channel. | |
uint32_t * | fs_etpu_malloc2 (uint8_t channel, uint16_t num_bytes) |
This function allocates DATA RAM for a channel if it has not been allocated before. | |
void | fs_etpu_set_chan_local_32 (uint8_t channel, uint32_t offset, uint32_t value) |
This function sets a 32-bit parameter for an eTPU channel. | |
void | fs_etpu_set_chan_local_24 (uint8_t channel, uint32_t offset, uint24_t value) |
This function sets a 24-bit parameter for an eTPU channel. | |
void | fs_etpu_set_chan_local_16 (uint8_t channel, uint32_t offset, uint16_t value) |
This function sets a 16-bit parameter for an eTPU channel. | |
void | fs_etpu_set_chan_local_8 (uint8_t channel, uint32_t offset, uint8_t value) |
This function sets an 8-bit parameter for an eTPU channel. | |
uint32_t | fs_etpu_get_chan_local_32 (uint8_t channel, uint32_t offset) |
This function reads a 32-bit parameter from an eTPU channel.. | |
int24_t | fs_etpu_get_chan_local_24s (uint8_t channel, uint32_t offset) |
This function reads a signed 24-bit parameter from an eTPU channel. | |
uint24_t | fs_etpu_get_chan_local_24 (uint8_t channel, uint32_t offset) |
This function reads a unsigned 24-bit parameter from an eTPU channel. | |
uint16_t | fs_etpu_get_chan_local_16 (uint8_t channel, uint32_t offset) |
This function reads a 16-bit parameter from an eTPU channel. | |
uint8_t | fs_etpu_get_chan_local_8 (uint8_t channel, uint32_t offset) |
This function reads an 8-bit parameter from an eTPU channel. | |
void | fs_etpu_set_global_32 (uint32_t offset, uint32_t value) |
This function writes to a 32-bit global variable. | |
void | fs_etpu_set_global_24 (uint32_t offset, uint24_t value) |
This function writes to a 24-bit global variable. | |
void | fs_etpu_set_global_16 (uint32_t offset, uint16_t value) |
This function writes to a 16-bit global variable. | |
void | fs_etpu_set_global_8 (uint32_t offset, uint8_t value) |
This function writes to an 8-bit global variable. | |
uint32_t | fs_etpu_get_global_32 (uint32_t offset) |
This function reads a 32-bit global variable. | |
int24_t | fs_etpu_get_global_24s (uint32_t offset) |
This function reads a signed 24-bit global variable. | |
uint24_t | fs_etpu_get_global_24 (uint32_t offset) |
This function reads an unsigned 24-bit global variable. | |
uint16_t | fs_etpu_get_global_16 (uint32_t offset) |
This function reads a 16-bit global variable. | |
uint8_t | fs_etpu_get_global_8 (uint32_t offset) |
This function reads an 8-bit global variable. | |
uint32_t * | fs_memcpy32 (uint32_t *dest, uint32_t *source, uint32_t size) |
This function is similar to the standard C memset() function however it sets 32-bit words rather than bytes. | |
void | fs_memset32 (uint32_t *start, uint32_t value, int32_t size) |
This function is similar to the standard C memcpy() function however it copies 32-bit words rather than bytes. | |
void | fs_etpu_set_interrupt_mask_a (uint32_t mask) |
This function enables or disables channel interrupt for each engine A channel according to the given mask. | |
void | fs_etpu_set_interrupt_mask_b (uint32_t mask) |
This function enables or disables channel interrupt for each engine B channel according to the given mask. | |
void | fs_etpu_set_dma_mask_a (uint32_t mask) |
This function enables or disables channel DMA request for each engine A channel according to the given mask. | |
void | fs_etpu_set_dma_mask_b (uint32_t mask) |
This function enables or disables channel DMA request for each engine B channel according to the given mask. | |
void | fs_etpu_set_output_disable_mask_a (uint32_t mask, uint32_t polarity) |
This function enables or disables the channel "output disable" feature for each engine A channel according to the given mask and polarity. | |
void | fs_etpu_set_output_disable_mask_b (uint32_t mask, uint32_t polarity) |
This function enables or disables the channel "output disable" feature for each engine B channel according to the given mask and polarity. | |
uint8_t | fs_etpu_get_chan_interrupt_flag (uint8_t channel) |
This function returns the current value of the Channel Interrupt Status bit of the specified eTPU channel. | |
void | fs_etpu_clear_chan_interrupt_flag (uint8_t channel) |
This function clears the channel interrupt flag. | |
uint8_t | fs_etpu_get_chan_interrupt_oveflow_flag (uint8_t channel) |
This function returns the current value of the Channel Interrupt Overflow Status bit of the specified eTPU channel. | |
void | fs_etpu_clear_chan_interrupt_overflow_flag (uint8_t channel) |
This function clears the channel interrupt oveflow flag. | |
uint8_t | fs_etpu_get_chan_dma_flag (uint8_t channel) |
This function returns the current value of the Data Transfer Request Status bit of the specified eTPU channel. | |
void | fs_etpu_clear_chan_dma_flag (uint8_t channel) |
This function clears the channel data transfer request flag. | |
uint8_t | fs_etpu_get_chan_dma_oveflow_flag (uint8_t channel) |
This function returns the current value of the Data Transfer Request Oveflow Status bit of the specified eTPU channel. | |
void | fs_etpu_clear_chan_dma_oveflow_flag (uint8_t channel) |
This function clears the channel data transfer request oveflow flag. | |
uint32_t | fs_etpu_get_global_exceptions (void) |
This function returns the global exception flags. | |
void | fs_etpu_clear_global_exceptions (void) |
This function clears all eTPU global exceptions. | |
uint32_t | fs_etpu_get_global_error (void) |
This function reads the Global Error value from eTPU DATA RAM, which is used by Freescale eTPU functions to reports unhandled events. | |
uint24_t | fs_etpu_get_idle_cnt_a (void) |
This function returns the current value of engine A Idle Count Register. | |
uint24_t | fs_etpu_get_idle_cnt_b (void) |
This function returns the current value of engine B Idle Count Register. | |
void | fs_etpu_clear_idle_cnt_a (void) |
This function clears the engine A Idle Count Register. | |
void | fs_etpu_clear_idle_cnt_b (void) |
This function clears the engine B Idle Count Register. | |
uint32_t | fs_etpu_coherent_read_24 (uint8_t channel, uint32_t offset1, uint32_t offset2, int32_t *value1, int32_t *value2) |
This function coherently reads two 24-bit variables from the eTPU DATA RAM, using the Coherent Dual-Parameter Controller (CDC). | |
uint32_t | fs_etpu_coherent_read_32 (uint8_t channel, uint32_t offset1, uint32_t offset2, uint32_t *value1, uint32_t *value2) |
This function coherently reads two 32-bit variables from the eTPU DATA RAM, using the Coherent Dual-Parameter Controller (CDC). | |
uint32_t | fs_etpu_coherent_write_24 (uint8_t channel, uint32_t offset1, uint32_t offset2, int32_t value1, int32_t value2) |
This function coherently writes two 24-bit variables into the eTPU DATA RAM, using the Coherent Dual-Parameter Controller (CDC). | |
uint32_t | fs_etpu_coherent_write_32 (uint8_t channel, uint32_t offset1, uint32_t offset2, uint32_t value1, uint32_t value2) |
This function coherently writes two 32-bit variables into the eTPU DATA RAM, using the Coherent Dual-Parameter Controller (CDC). | |
Variables | |
uint32_t | fs_etpu_code_start |
uint32_t | fs_etpu_data_ram_start |
uint32_t | fs_etpu_data_ram_end |
uint32_t | fs_etpu_data_ram_ext |
|
This function initializes the eTPU2-only setting of an eTPU2 module.
Definition at line 193 of file etpu_util.c. References eTPU_struct::ECR_A, eTPU_struct::ECR_B, eTPU, fs_etpu_data_ram_end, FS_ETPU_ERROR_MALLOC, fs_free_param, fs_memset32(), eTPU_struct::WDTR_A, etpu_config_t::wdtr_a, eTPU_struct::WDTR_B, and etpu_config_t::wdtr_b. |
|
This function initializes an eTPU channel.
Definition at line 258 of file etpu_util.c. References eTPU_struct::CHAN, eTPU, fs_etpu_data_ram_start, FS_ETPU_ERROR_MALLOC, and fs_etpu_malloc(). |
|
This function clears the channel data transfer request flag.
Definition at line 1124 of file etpu_util.c. References eTPU_struct::CDTRSR_A, eTPU_struct::CDTRSR_B, and eTPU. |
|
This function clears the channel data transfer request oveflow flag.
Definition at line 1160 of file etpu_util.c. References eTPU_struct::CDTROSR_A, eTPU_struct::CDTROSR_B, and eTPU. |
|
This function clears the channel interrupt flag.
Definition at line 1052 of file etpu_util.c. References eTPU_struct::CISR_A, eTPU_struct::CISR_B, and eTPU. |
|
This function clears the channel interrupt oveflow flag.
Definition at line 1088 of file etpu_util.c. References eTPU_struct::CIOSR_A, eTPU_struct::CIOSR_B, and eTPU. |
|
This function clears all eTPU global exceptions.
Definition at line 1214 of file etpu_util.c. References eTPU, and eTPU_struct::MCR. |
|
This function clears the engine A Idle Count Register.
Definition at line 1288 of file etpu_util.c. References eTPU, and eTPU_struct::IDLE_A. |
|
This function clears the engine B Idle Count Register.
Definition at line 1300 of file etpu_util.c. References eTPU, and eTPU_struct::IDLE_B. |
|
This function coherently reads two 24-bit variables from the eTPU DATA RAM, using the Coherent Dual-Parameter Controller (CDC).
Definition at line 1323 of file etpu_util.c. References eTPU_struct::CDCR, eTPU_struct::CHAN, eTPU, fs_etpu_data_ram_end, fs_etpu_data_ram_start, FS_ETPU_ERROR_ADDRESS, FS_ETPU_ERROR_MALLOC, and fs_free_param. |
|
This function coherently reads two 32-bit variables from the eTPU DATA RAM, using the Coherent Dual-Parameter Controller (CDC).
Definition at line 1395 of file etpu_util.c. References eTPU_struct::CDCR, eTPU_struct::CHAN, eTPU, fs_etpu_data_ram_end, fs_etpu_data_ram_start, FS_ETPU_ERROR_ADDRESS, FS_ETPU_ERROR_MALLOC, and fs_free_param. |
|
This function coherently writes two 24-bit variables into the eTPU DATA RAM, using the Coherent Dual-Parameter Controller (CDC).
Definition at line 1467 of file etpu_util.c. References eTPU_struct::CDCR, eTPU_struct::CHAN, eTPU, fs_etpu_data_ram_end, fs_etpu_data_ram_start, FS_ETPU_ERROR_ADDRESS, FS_ETPU_ERROR_MALLOC, and fs_free_param. |
|
This function coherently writes two 32-bit variables into the eTPU DATA RAM, using the Coherent Dual-Parameter Controller (CDC).
Definition at line 1540 of file etpu_util.c. References eTPU_struct::CDCR, eTPU_struct::CHAN, eTPU, fs_etpu_data_ram_end, fs_etpu_data_ram_start, FS_ETPU_ERROR_ADDRESS, FS_ETPU_ERROR_MALLOC, and fs_free_param. |
|
This function returns a pointer to the start of the data RAM for the specified channel.
Definition at line 292 of file etpu_util.c. References eTPU_struct::CHAN, eTPU, and fs_etpu_data_ram_start. Referenced by fs_etpu_malloc2(). |
|
This function disables an eTPU channel.
Definition at line 363 of file etpu_util.c. References eTPU_struct::CHAN, eTPU, and FS_ETPU_PRIORITY_DISABLE. |
|
This function disables an eTPU channel from generating DMA requests.
Definition at line 428 of file etpu_util.c. References eTPU_struct::CHAN, eTPU, and FALSE. |
|
This function enables an eTPU channel to request DMA service.
Definition at line 412 of file etpu_util.c. References eTPU_struct::CHAN, eTPU, and TRUE. |
|
This function enables or changes the priority of an eTPU channel.
Definition at line 346 of file etpu_util.c. References eTPU_struct::CHAN, and eTPU. |
|
This function returns the current value of the Data Transfer Request Status bit of the specified eTPU channel.
Definition at line 1111 of file etpu_util.c. References eTPU_struct::CHAN, and eTPU. |
|
This function returns the current value of the Data Transfer Request Oveflow Status bit of the specified eTPU channel.
Definition at line 1147 of file etpu_util.c. References eTPU_struct::CHAN, and eTPU. |
|
This function returns the current value of the Channel Interrupt Status bit of the specified eTPU channel.
Definition at line 1039 of file etpu_util.c. References eTPU_struct::CHAN, and eTPU. |
|
This function returns the current value of the Channel Interrupt Overflow Status bit of the specified eTPU channel.
Definition at line 1075 of file etpu_util.c. References eTPU_struct::CHAN, and eTPU. |
|
This function reads a 16-bit parameter from an eTPU channel.
Definition at line 667 of file etpu_util.c. References eTPU_struct::CHAN, eTPU, and fs_etpu_data_ram_start. |
|
This function reads a unsigned 24-bit parameter from an eTPU channel.
Definition at line 649 of file etpu_util.c. References eTPU_struct::CHAN, eTPU, and fs_etpu_data_ram_start. |
|
This function reads a signed 24-bit parameter from an eTPU channel.
Definition at line 631 of file etpu_util.c. References eTPU_struct::CHAN, eTPU, and fs_etpu_data_ram_ext. |
|
This function reads a 32-bit parameter from an eTPU channel..
Definition at line 611 of file etpu_util.c. References eTPU_struct::CHAN, eTPU, and fs_etpu_data_ram_start. |
|
This function reads an 8-bit parameter from an eTPU channel.
Definition at line 685 of file etpu_util.c. References eTPU_struct::CHAN, eTPU, and fs_etpu_data_ram_start. |
|
This function reads a 16-bit global variable.
Definition at line 818 of file etpu_util.c. References fs_etpu_data_ram_start. |
|
This function reads an unsigned 24-bit global variable.
Definition at line 802 of file etpu_util.c. References fs_etpu_data_ram_start. |
|
This function reads a signed 24-bit global variable.
Definition at line 786 of file etpu_util.c. References fs_etpu_data_ram_ext. |
|
This function reads a 32-bit global variable.
Definition at line 768 of file etpu_util.c. References fs_etpu_data_ram_start. |
|
This function reads an 8-bit global variable.
Definition at line 834 of file etpu_util.c. References fs_etpu_data_ram_start. |
|
This function reads the Global Error value from eTPU DATA RAM, which is used by Freescale eTPU functions to reports unhandled events.
Definition at line 1242 of file etpu_util.c. References fs_etpu_data_ram_start. |
|
This function returns the global exception flags.
Definition at line 1195 of file etpu_util.c. References eTPU, FS_ETPU_ILLEGAL_INSTRUCTION_A, FS_ETPU_ILLEGAL_INSTRUCTION_B, FS_ETPU_MICROCODE_GLOBAL_EX_A, FS_ETPU_MICROCODE_GLOBAL_EX_B, FS_ETPU_SCM_MISC_FLAG, FS_ETPU_SCM_READ_ERROR, FS_ETPU_SDM_READ_ERROR, FS_ETPU_SHARED_SUBSYS_ACC_ERR, FS_ETPU_WATCHDOG_TIMEOUT_A, FS_ETPU_WATCHDOG_TIMEOUT_B, and eTPU_struct::MCR. |
|
This function returns the current value of the Host Service Request (HSR) register of the specified eTPU channel.
Definition at line 328 of file etpu_util.c. References eTPU_struct::CHAN, and eTPU. |
|
This function returns the current value of engine A Idle Count Register.
Definition at line 1261 of file etpu_util.c. References eTPU, and eTPU_struct::IDLE_A. |
|
This function returns the current value of engine B Idle Count Register.
Definition at line 1276 of file etpu_util.c. References eTPU, and eTPU_struct::IDLE_B. |
|
This function initializes the eTPU module.
Definition at line 106 of file etpu_util.c. References eTPU_struct::ECR_A, etpu_config_t::ecr_a, eTPU_struct::ECR_B, etpu_config_t::ecr_b, eTPU, fs_etpu_code_start, fs_etpu_data_ram_start, FS_ETPU_ERROR_CODESIZE, FS_ETPU_ERROR_VIS_BIT_NOT_SET, fs_free_param, fs_memcpy32(), fs_memset32(), eTPU_struct::MCR, etpu_config_t::mcr, etpu_config_t::misc, eTPU_struct::MISCCMPR, eTPU_struct::REDCR_A, eTPU_struct::REDCR_B, etpu_config_t::stacr_a, etpu_config_t::stacr_b, eTPU_struct::TBCR_A, etpu_config_t::tbcr_a, eTPU_struct::TBCR_B, and etpu_config_t::tbcr_b. |
|
This function disables an eTPU channel from generating interrupts.
Definition at line 396 of file etpu_util.c. References eTPU_struct::CHAN, eTPU, and FALSE. |
|
This function enables an eTPU channel to generate interrupts.
Definition at line 380 of file etpu_util.c. References eTPU_struct::CHAN, eTPU, and TRUE. |
|
This function allocates DATA RAM (parameter RAM) for a channel.
Definition at line 464 of file etpu_util.c. References fs_etpu_data_ram_end, and fs_free_param. Referenced by fs_etpu_chan_init(). |
|
This function allocates DATA RAM for a channel if it has not been allocated before.
Definition at line 499 of file etpu_util.c. References eTPU_struct::CHAN, eTPU, fs_etpu_data_ram(), fs_etpu_data_ram_end, and fs_free_param. |
|
This function sets a 16-bit parameter for an eTPU channel.
Definition at line 573 of file etpu_util.c. References eTPU_struct::CHAN, eTPU, and fs_etpu_data_ram_start. |
|
This function sets a 24-bit parameter for an eTPU channel.
Definition at line 555 of file etpu_util.c. References eTPU_struct::CHAN, eTPU, and fs_etpu_data_ram_ext. |
|
This function sets a 32-bit parameter for an eTPU channel.
Definition at line 532 of file etpu_util.c. References eTPU_struct::CHAN, eTPU, and fs_etpu_data_ram_start. |
|
This function sets an 8-bit parameter for an eTPU channel.
Definition at line 591 of file etpu_util.c. References eTPU_struct::CHAN, eTPU, and fs_etpu_data_ram_start. |
|
This function enables or disables channel DMA request for each engine A channel according to the given mask.
Definition at line 949 of file etpu_util.c. References eTPU_struct::CDTRER_A, and eTPU. |
|
This function enables or disables channel DMA request for each engine B channel according to the given mask.
Definition at line 965 of file etpu_util.c. References eTPU_struct::CDTRER_B, and eTPU. |
|
This function writes to a 16-bit global variable.
Definition at line 734 of file etpu_util.c. References fs_etpu_data_ram_start. |
|
This function writes to a 24-bit global variable.
Definition at line 718 of file etpu_util.c. References fs_etpu_data_ram_ext. |
|
This function writes to a 32-bit global variable.
Definition at line 702 of file etpu_util.c. References fs_etpu_data_ram_start. |
|
This function writes to an 8-bit global variable.
Definition at line 750 of file etpu_util.c. References fs_etpu_data_ram_start. |
|
This function sets the Host Service Request (HSR) register of the specified eTPU channel.
Definition at line 311 of file etpu_util.c. References eTPU_struct::CHAN, and eTPU. |
|
This function enables or disables channel interrupt for each engine A channel according to the given mask.
Definition at line 917 of file etpu_util.c. References eTPU_struct::CIER_A, and eTPU. |
|
This function enables or disables channel interrupt for each engine B channel according to the given mask.
Definition at line 933 of file etpu_util.c. References eTPU_struct::CIER_B, and eTPU. |
|
This function enables or disables the channel "output disable" feature for each engine A channel according to the given mask and polarity.
Definition at line 985 of file etpu_util.c. References eTPU_struct::CHAN, and eTPU. |
|
This function enables or disables the channel "output disable" feature for each engine B channel according to the given mask and polarity.
Definition at line 1014 of file etpu_util.c. References eTPU_struct::CHAN, and eTPU. |
|
This function is similar to the standard C memset() function however it sets 32-bit words rather than bytes.
Definition at line 858 of file etpu_util.c. Referenced by fs_etpu_init(). |
|
This function is similar to the standard C memcpy() function however it copies 32-bit words rather than bytes.
Definition at line 892 of file etpu_util.c. Referenced by fs_etpu2_init(), and fs_etpu_init(). |
|
This function starts the timebases.
Definition at line 444 of file etpu_util.c. References eTPU, eTPU_struct::MCR, and TRUE. |
|
Referenced by fs_etpu_init(). |
|
Referenced by fs_etpu2_init(), fs_etpu_coherent_read_24(), fs_etpu_coherent_read_32(), fs_etpu_coherent_write_24(), fs_etpu_coherent_write_32(), fs_etpu_malloc(), and fs_etpu_malloc2(). |
|
Referenced by fs_etpu_get_chan_local_24s(), fs_etpu_get_global_24s(), fs_etpu_set_chan_local_24(), and fs_etpu_set_global_24(). |
|
Generated by ![]() |
© Freescale Semiconductor Inc. 2004 - 2012. All Rights Reserved. |