HPM SDK
HPMicro Software Development Kit
hpm_sei_drv.h File Reference
#include "hpm_common.h"
#include "hpm_soc_feature.h"
#include "hpm_sei_regs.h"

Go to the source code of this file.

Data Structures

struct  sei_engine_config_t
 sei engine config structure More...
 
struct  sei_transceiver_synchronous_master_config_t
 sei transceiver synchronous master mode config structure More...
 
struct  sei_transceiver_synchronous_slave_config_t
 sei transceiver synchronous master mode config structure More...
 
struct  sei_transceiver_asynchronous_config_t
 sei transceiver asynchronous mode config structure More...
 
struct  sei_transceiver_config_t
 sei transceiver config structure More...
 
struct  sei_trigger_input_config_t
 sei trigger input config structure More...
 
struct  sei_trigger_output_config_t
 sei trigger output config structure More...
 
struct  sei_data_format_config_t
 sei data format config structure More...
 
struct  sei_command_table_config_t
 sei command table config structure More...
 
struct  sei_state_transition_config_t
 sei state transition config structure More...
 
struct  sei_state_transition_latch_config_t
 sei state transition latch config structure More...
 
struct  sei_sample_config_t
 sei sample config structure More...
 
struct  sei_update_config_t
 sei update config structure More...
 

Macros

#define SEI_SELECT_CMD   true
 sei select command or data More...
 
#define SEI_SELECT_DATA   false
 
#define SEI_DAT_CMD   (1UL)
 sei const data register index More...
 
#define SEI_DATA_CONST_0   (30UL)
 
#define SEI_DATA_CONST_1   (31UL)
 
#define SEI_INSTR_OP_HALT   0u
 sei instruction operation command More...
 
#define SEI_INSTR_OP_JUMP   1u
 
#define SEI_INSTR_OP_SEND_WDG   2u
 
#define SEI_INSTR_OP_SEND   3u
 
#define SEI_INSTR_OP_WAIT_WDG   4u
 
#define SEI_INSTR_OP_WAIT   5u
 
#define SEI_INSTR_OP_RECV_WDG   6u
 
#define SEI_INSTR_OP_RECV   7u
 
#define SEI_INSTR_M_CK_LOW   0u
 sei instruction synchronous master clock type More...
 
#define SEI_INSTR_M_CK_RISE_FALL   1u
 
#define SEI_INSTR_M_CK_FALL_RISE   2u
 
#define SEI_INSTR_M_CK_HIGH   3u
 
#define SEI_INSTR_S_CK_DEFAULT   0u
 sei instruction synchronous slave clock type More...
 
#define SEI_INSTR_S_CK_TRX_EXCH   1u
 
#define SEI_INSTR_S_CK_TIMEOUT_EN   2u
 
#define SEI_INSTR_S_CK_TRX_EXCH_TIMEOUT_EN   3u
 
#define SEI_SYNC_SLAVE_RX_TX_POINT_ON_RISE_EDGE   0x8002
 sei synchronous slave rx tx point select More...
 
#define SEI_SYNC_SLAVE_RX_TX_POINT_ON_FALL_EDGE   0x0002
 
#define SEI_JUMP_INIT_INSTR_IDX   0x00u
 sei instruction jump intructions index More...
 
#define SEI_JUMP_WDG_INSTR_IDX   0x01u
 
#define SEI_JUMP_CMD_TABLE_INSTR_IDX0   0x10u
 
#define SEI_JUMP_CMD_TABLE_INSTR_IDX1   0x11u
 
#define SEI_JUMP_CMD_TABLE_INSTR_IDX2   0x12u
 
#define SEI_JUMP_CMD_TABLE_INSTR_IDX3   0x13u
 
#define SEI_JUMP_CMD_TABLE_INSTR_IDX4   0x14u
 
#define SEI_JUMP_CMD_TABLE_INSTR_IDX5   0x15u
 
#define SEI_JUMP_CMD_TABLE_INSTR_IDX6   0x16u
 
#define SEI_JUMP_CMD_TABLE_INSTR_IDX7   0x17u
 
#define SEI_JUMP_CMD_TABLE_INSTR_IDX8   0x18u
 
#define SEI_JUMP_CMD_TABLE_INSTR_IDX9   0x19u
 
#define SEI_JUMP_CMD_TABLE_INSTR_IDX10   0x1Au
 
#define SEI_JUMP_CMD_TABLE_INSTR_IDX11   0x1Bu
 
#define SEI_JUMP_CMD_TABLE_INSTR_IDX12   0x1Cu
 
#define SEI_JUMP_CMD_TABLE_INSTR_IDX13   0x1Du
 
#define SEI_JUMP_CMD_TABLE_INSTR_IDX14   0x1Eu
 
#define SEI_JUMP_CMD_TABLE_INSTR_IDX15   0x1Fu
 

Enumerations

enum  sei_arming_mode_t { sei_arming_direct_exec = 0 , sei_arming_wait_trigger }
 sei arming action More...
 
enum  sei_wdg_action_t { sei_wdg_exec_next_instr = 0 , sei_wdg_exec_exception_instr }
 sei watchdog action More...
 
enum  sei_transceiver_mode_t { sei_synchronous_master_mode = 0 , sei_synchronous_slave_mode , sei_asynchronous_mode }
 sei transfer mode More...
 
enum  sei_asynchronous_parity_t { sei_asynchronous_parity_even = 0 , sei_asynchronous_parity_odd }
 sei asynchronous mode parity More...
 
enum  sei_idle_state_t { sei_idle_low_state = 0 , sei_idle_high_state }
 sei ilde state More...
 
enum  sei_data_mode_t { sei_data_mode = 0 , sei_check_mode , sei_crc_mode }
 sei data mode More...
 
enum  sei_data_bit_order_t { sei_bit_lsb_first = 0 , sei_bit_msb_first }
 sei data bit order More...
 
enum  sei_data_word_order_t { sei_word_nonreverse = 0 , sei_word_reverse }
 sei data word order More...
 
enum  sei_state_tran_condition_t { sei_state_tran_condition_high_match = 0 , sei_state_tran_condition_low_dismatch , sei_state_tran_condition_rise_entry , sei_state_tran_condition_fall_leave }
 sei state transition condition More...
 
enum  sei_trig_in_type_t { sei_trig_in0 = 0 , sei_trig_in1 , sei_trig_in_period , sei_trig_in_soft }
 sei trig in type More...
 
enum  sei_irq_event_t {
  sei_irq_stall_event = SEI_CTRL_IRQ_INT_FLAG_STALL_MASK , sei_irq_execpt_event = SEI_CTRL_IRQ_INT_FLAG_EXCEPT_MASK , sei_irq_wdog_event = SEI_CTRL_IRQ_INT_FLAG_WDOG_MASK , sei_irq_instr_ptr0_start_event = SEI_CTRL_IRQ_INT_FLAG_PTR0_ST_MASK ,
  sei_irq_instr_ptr1_start_event = SEI_CTRL_IRQ_INT_FLAG_PTR1_ST_MASK , sei_irq_instr_value0_start_event = SEI_CTRL_IRQ_INT_FLAG_INSTR0_ST_MASK , sei_irq_instr_value1_start_event = SEI_CTRL_IRQ_INT_FLAG_INSTR1_ST_MASK , sei_irq_instr_ptr0_end_event = SEI_CTRL_IRQ_INT_FLAG_PTR0_END_MASK ,
  sei_irq_instr_ptr1_end_event = SEI_CTRL_IRQ_INT_FLAG_PTR1_END_MASK , sei_irq_instr_value0_end_event = SEI_CTRL_IRQ_INT_FLAG_INSTR0_END_MASK , sei_irq_instr_value1_end_event = SEI_CTRL_IRQ_INT_FLAG_INSTR1_END_MASK , sei_irq_trx_err_event = SEI_CTRL_IRQ_INT_FLAG_TRX_ERR_MASK ,
  sei_irq_timeout_event = SEI_CTRL_IRQ_INT_FLAG_TIMEOUT_MASK , sei_irq_latch0_event = SEI_CTRL_IRQ_INT_FLAG_LATCH0_MASK , sei_irq_latch1_event = SEI_CTRL_IRQ_INT_FLAG_LATCH1_MASK , sei_irq_latch2_event = SEI_CTRL_IRQ_INT_FLAG_LATCH2_MASK ,
  sei_irq_latch3_event = SEI_CTRL_IRQ_INT_FLAG_LATCH3_MASK , sei_irq_sample_err_event = SEI_CTRL_IRQ_INT_FLAG_SMP_ERR_MASK , sei_irq_trig0_event = SEI_CTRL_IRQ_INT_FLAG_TRIGER0_MASK , sei_irq_trig1_event = SEI_CTRL_IRQ_INT_FLAG_TRIGER1_MASK ,
  sei_irq_trig2_event = SEI_CTRL_IRQ_INT_FLAG_TRIGER2_MASK , sei_irq_trig3_event = SEI_CTRL_IRQ_INT_FLAG_TRIGER3_MASK , sei_irq_trig0_err_event = SEI_CTRL_IRQ_INT_FLAG_TRG_ERR0_MASK , sei_irq_trig1_err_event = SEI_CTRL_IRQ_INT_FLAG_TRG_ERR1_MASK ,
  sei_irq_trig2_err_event = SEI_CTRL_IRQ_INT_FLAG_TRG_ERR2_MASK , sei_irq_trig3_err_event = SEI_CTRL_IRQ_INT_FLAG_TRG_ERR3_MASK
}
 sei irq event More...
 
enum  sei_dma_en_t {
  sei_dma_en_stall_event = SEI_CTRL_DMA_EN_STALL_MASK , sei_dma_en_execpt_event = SEI_CTRL_DMA_EN_EXCEPT_MASK , sei_dma_en_wdog_event = SEI_CTRL_DMA_EN_WDOG_MASK , sei_dma_en_instr_ptr0_start_event = SEI_CTRL_DMA_EN_PTR0_ST_MASK ,
  sei_dma_en_instr_ptr1_start_event = SEI_CTRL_DMA_EN_PTR1_ST_MASK , sei_dma_en_instr_value0_start_event = SEI_CTRL_DMA_EN_INSTR0_ST_MASK , sei_dma_en_instr_value1_start_event = SEI_CTRL_DMA_EN_INSTR1_ST_MASK , sei_dma_en_instr_ptr0_end_event = SEI_CTRL_DMA_EN_PTR0_END_MASK ,
  sei_dma_en_instr_ptr1_end_event = SEI_CTRL_DMA_EN_PTR1_END_MASK , sei_dma_en_instr_value0_end_event = SEI_CTRL_DMA_EN_INSTR0_END_MASK , sei_dma_en_instr_value1_end_event = SEI_CTRL_DMA_EN_INSTR1_END_MASK , sei_dma_en_trx_err_event = SEI_CTRL_DMA_EN_TRX_ERR_MASK ,
  sei_dma_en_timeout_event = SEI_CTRL_DMA_EN_TIMEOUT_MASK , sei_dma_en_latch0_event = SEI_CTRL_DMA_EN_LATCH0_MASK , sei_dma_en_latch1_event = SEI_CTRL_DMA_EN_LATCH1_MASK , sei_dma_en_latch2_event = SEI_CTRL_DMA_EN_LATCH2_MASK ,
  sei_dma_en_latch3_event = SEI_CTRL_DMA_EN_LATCH3_MASK , sei_dma_en_sample_err_event = SEI_CTRL_DMA_EN_SMP_ERR_MASK , sei_dma_en_trig0_event = SEI_CTRL_DMA_EN_TRIGER0_MASK , sei_dma_en_trig1_event = SEI_CTRL_DMA_EN_TRIGER1_MASK ,
  sei_dma_en_trig2_event = SEI_CTRL_DMA_EN_TRIGER2_MASK , sei_dma_en_trig3_event = SEI_CTRL_DMA_EN_TRIGER3_MASK , sei_dma_en_trig0_err_event = SEI_CTRL_DMA_EN_TRG_ERR0_MASK , sei_dma_en_trig1_err_event = SEI_CTRL_DMA_EN_TRG_ERR1_MASK ,
  sei_dma_en_trig2_err_event = SEI_CTRL_DMA_EN_TRG_ERR2_MASK , sei_dma_en_trig3_err_event = SEI_CTRL_DMA_EN_TRG_ERR3_MASK
}
 sei dma enable bit More...
 

Functions

static void sei_set_engine_enable (SEI_Type *ptr, uint8_t idx, bool enable)
 Set the SEI engine enable or disable. More...
 
static void sei_set_engine_rewind (SEI_Type *ptr, uint8_t idx)
 Rewind the SEI engine. More...
 
static void sei_set_engine_init_instr_idx (SEI_Type *ptr, uint8_t idx, uint8_t init_instr_idx)
 Set the SEI instruction index which engine start execution. More...
 
static void sei_set_engine_wdg_instr_idx (SEI_Type *ptr, uint8_t idx, uint8_t wdg_instr_idx)
 Set the SEI instruction index which engine execution when watchdog active. More...
 
static void sei_set_engine_data_base_idx (SEI_Type *ptr, uint8_t idx, uint8_t data_base_idx)
 Set the SEI bias for data register access. More...
 
static void sei_set_trig_input_in0_enable (SEI_Type *ptr, uint8_t idx, bool enable)
 Set the SEI trigger input trig in0 enable or disable. More...
 
static void sei_set_trig_input_in1_enable (SEI_Type *ptr, uint8_t idx, bool enable)
 Set the SEI trigger input trig in1 enable or disable. More...
 
static void sei_set_trig_input_period_enable (SEI_Type *ptr, uint8_t idx, bool enable)
 Set the SEI trigger input period enable or disable. More...
 
static void sei_set_trig_input_soft_enable (SEI_Type *ptr, uint8_t idx)
 Set the SEI trigger input soft enable or disable. More...
 
static void sei_set_trig_input_command_value (SEI_Type *ptr, uint8_t idx, sei_trig_in_type_t type, uint32_t data)
 Set the SEI trigger input command value. More...
 
static uint32_t sei_get_trig_input_time (SEI_Type *ptr, uint8_t idx, sei_trig_in_type_t type)
 Get the SEI trigger input time. More...
 
static uint32_t sei_get_latch_time (SEI_Type *ptr, uint8_t idx, uint8_t latch_idx)
 Get the SEI latch time. More...
 
static uint16_t sei_get_xcvr_baud_div (SEI_Type *ptr, uint8_t idx)
 Get the SEI transceiver baud div. More...
 
static void sei_set_xcvr_rx_point (SEI_Type *ptr, uint8_t idx, uint16_t point)
 Set the SEI transceiver rx point. More...
 
static void sei_set_xcvr_tx_point (SEI_Type *ptr, uint8_t idx, uint16_t point)
 Set the SEI transceiver tx point. More...
 
static void sei_set_xcvr_ck0_point (SEI_Type *ptr, uint8_t idx, uint16_t point)
 Set the SEI transceiver ck0 point. More...
 
static void sei_set_xcvr_ck1_point (SEI_Type *ptr, uint8_t idx, uint16_t point)
 Set the SEI transceiver ck1 point. More...
 
static uint16_t sei_get_xcvr_ck0_point (SEI_Type *ptr, uint8_t idx)
 Get the SEI transceiver ck0 point. More...
 
static uint16_t sei_get_xcvr_ck1_point (SEI_Type *ptr, uint8_t idx)
 Get the SEI transceiver ck1 point. More...
 
static uint32_t sei_get_command_value (SEI_Type *ptr, uint8_t idx)
 Get the SEI command value. More...
 
static void sei_set_command_rewind (SEI_Type *ptr, uint8_t idx)
 Rewind the SEI command. More...
 
static void sei_set_data_value (SEI_Type *ptr, uint8_t idx, uint32_t data)
 Set the SEI data value. More...
 
static uint32_t sei_get_data_value (SEI_Type *ptr, uint8_t idx)
 Get the SEI data value. More...
 
static void sei_set_data_rewind (SEI_Type *ptr, uint8_t idx)
 Rewind the SEI data. More...
 
static void sei_set_sample_pos_override_value (SEI_Type *ptr, uint8_t idx, uint32_t data)
 Set the SEI sample position (singleturn) override value. More...
 
static void sei_set_sample_rev_override_value (SEI_Type *ptr, uint8_t idx, uint32_t data)
 Set the SEI sample revolution (multiturn) override value. More...
 
static void sei_set_sample_spd_override_value (SEI_Type *ptr, uint8_t idx, uint32_t data)
 Set the SEI sample speed override value. More...
 
static void sei_set_sample_acc_override_value (SEI_Type *ptr, uint8_t idx, uint32_t data)
 Set the SEI sample acceleration override value. More...
 
static void sei_set_update_pos_override_value (SEI_Type *ptr, uint8_t idx, uint32_t data)
 Set the SEI update position (singleturn) override value. More...
 
static void sei_set_update_rev_override_value (SEI_Type *ptr, uint8_t idx, uint32_t data)
 Set the SEI update revolution (multiturn) override value. More...
 
static void sei_set_update_spd_override_value (SEI_Type *ptr, uint8_t idx, uint32_t data)
 Set the SEI update speed override value. More...
 
static void sei_set_update_acc_override_value (SEI_Type *ptr, uint8_t idx, uint32_t data)
 Set the SEI update acceleration override value. More...
 
static void sei_set_update_time_override_value (SEI_Type *ptr, uint8_t idx, uint32_t data)
 Set the SEI update time override value. More...
 
static void sei_set_irq_match_instr0_ptr (SEI_Type *ptr, uint8_t idx, uint8_t instr_idx)
 Set the SEI irq match pointer0. More...
 
static void sei_set_irq_match_instr1_ptr (SEI_Type *ptr, uint8_t idx, uint8_t instr_idx)
 Set the SEI irq match pointer1. More...
 
static void sei_set_irq_match_instr0_value (SEI_Type *ptr, uint8_t idx, uint32_t instr_value)
 Set the SEI irq match instr0. More...
 
static void sei_set_irq_match_instr1_value (SEI_Type *ptr, uint8_t idx, uint32_t instr_value)
 Set the SEI irq match instr1. More...
 
static void sei_set_irq_enable (SEI_Type *ptr, uint8_t idx, uint32_t irq_mask, bool enable)
 Set the SEI irq enable or disable. More...
 
static uint32_t sei_get_irq_enable_status (SEI_Type *ptr, uint8_t idx)
 Get the SEI irq enable status. More...
 
static bool sei_get_irq_status (SEI_Type *ptr, uint8_t idx, uint32_t irq_mask)
 Get the SEI irq status. More...
 
static uint32_t sei_get_irq_flag (SEI_Type *ptr, uint8_t idx)
 Get the SEI irq flag. More...
 
static void sei_clear_irq_flag (SEI_Type *ptr, uint8_t idx, uint32_t irq_mask)
 Clear the SEI irq flag. More...
 
static void sei_set_dma_req_enable (SEI_Type *ptr, uint8_t idx, uint32_t dma_en_mask, bool enable)
 Set the SEI DMA request enable or disable. More...
 
hpm_stat_t sei_transceiver_config_init (SEI_Type *ptr, uint8_t idx, sei_transceiver_config_t *config)
 Init SEI transceiver configuration. More...
 
hpm_stat_t sei_cmd_data_format_config_init (SEI_Type *ptr, bool cmd_data_select, uint8_t idx, sei_data_format_config_t *config)
 Init SEI command or data format configuration. More...
 
hpm_stat_t sei_cmd_table_config_init (SEI_Type *ptr, uint8_t idx, uint8_t table_idx, sei_command_table_config_t *config)
 Init SEI command table configuration. More...
 
hpm_stat_t sei_state_transition_config_init (SEI_Type *ptr, uint8_t idx, uint8_t latch_idx, uint8_t state, sei_state_transition_config_t *config)
 Init SEI state transition configuration. More...
 
hpm_stat_t sei_state_transition_latch_config_init (SEI_Type *ptr, uint8_t idx, uint8_t latch_idx, sei_state_transition_latch_config_t *config)
 Init SEI state transition latch configuration. More...
 
hpm_stat_t sei_sample_config_init (SEI_Type *ptr, uint8_t idx, sei_sample_config_t *config)
 Init SEI sample configuration. More...
 
hpm_stat_t sei_update_config_init (SEI_Type *ptr, uint8_t idx, sei_update_config_t *config)
 Init SEI update configuration. More...
 
hpm_stat_t sei_trigger_input_config_init (SEI_Type *ptr, uint8_t idx, sei_trigger_input_config_t *config)
 Init SEI trigger input configuration. More...
 
hpm_stat_t sei_trigger_output_config_init (SEI_Type *ptr, uint8_t idx, sei_trigger_output_config_t *config)
 Init SEI trigger output configuration. More...
 
hpm_stat_t sei_engine_config_init (SEI_Type *ptr, uint8_t idx, sei_engine_config_t *config)
 Init SEI engine configuration. More...
 
void sei_set_instr (SEI_Type *ptr, uint8_t idx, uint8_t op, uint8_t ck, uint8_t crc, uint8_t data, uint8_t opr)
 Set SEI Intsructions. More...
 
uint32_t sei_get_crc_value (SEI_Type *ptr, uint8_t idx)
 Get the SEI crc value. More...