text
stringlengths
1
9.98k
__index_level_0__
int64
0
4.17k
2) */ static inline void i2c_ll_set_scl_clk_timing(i2c_dev_t *hw, int high_period, int low_period, int wait_high_period) { hw->scl_low_period.scl_low_period = low_period; hw->scl_high_period.scl_high_period = high_period; hw->scl_high_period.scl_wait_high_period = wait_high_period; } /** */ static inlin...
636
end_detect_int_st) { *event = I2C_INTR_EVENT_END_DET; } else if (int_sts.trans_complete_int_st) { *event = I2C_INTR_EVENT_TRANS_DONE; } else { *event = I2C_INTR_EVENT_ERR; } } /** */ __attribute__((always_inline)) static inline void i2c_ll_slave_get_event(i2c_dev_t *hw, i2c_intr_ev...
636
val = UINT32_MAX; hw->int_ena.val = I2C_LL_MASTER_RX_INT; } /** */ static inline void i2c_ll_master_disable_tx_it(i2c_dev_t *hw) { hw->int_ena.val &= (~I2C_LL_MASTER_TX_INT); } /** */ __attribute__((always_inline)) static inline void i2c_ll_master_disable_rx_it(i2c_dev_t *hw) { hw->int_ena.val &= (~I2C_...
636
scl_high_period = hight_period - 10; hw->scl_high_period.scl_wait_high_period = hight_period - hw->scl_high_period.scl_high_period; } /** */ static inline void i2c_ll_get_data_mode(i2c_dev_t *hw, i2c_trans_mode_t *tx_mode, i2c_trans_mode_t *rx_mode) { *tx_mode = (i2c_trans_mode_t)(hw->ctr.tx_lsb_first); *...
636
/* */ #pragma once #include /* Required for NULL constant */ #include #include #include "hal/gdma_types.h" #include "soc/gdma_struct.h" #include "soc/gdma_reg.h" #include "soc/soc_etm_source.h" #include "soc/pcr_struct.h" #include "soc/retention_periph_defs.h" #ifdef __cplusplus extern "C" { #endif #define GDMA_...
637
ena.val &= ~mask; } } /** */ __attribute__((always_inline)) static inline void gdma_ll_rx_clear_interrupt_status(gdma_dev_t *dev, uint32_t channel, uint32_t mask) { dev->in_intr[channel].clr.val = mask; } /** */ static inline volatile void *gdma_ll_rx_get_interrupt_status_reg(gdma_dev_t *dev, uint32_t chann...
637
in.in_conf0.in_rst = 1; dev->channel[channel].in.in_conf0.in_rst = 0; } /** */ static inline bool gdma_ll_rx_is_fifo_full(gdma_dev_t *dev, uint32_t channel, uint32_t fifo_level) { return dev->channel[channel].in.infifo_status.val & 0x01; } /** */ static inline bool gdma_ll_rx_is_fifo_empty(gdma_dev_t *dev, ...
637
in.in_link.inlink_start = 1; } /** */ __attribute__((always_inline)) static inline void gdma_ll_rx_stop(gdma_dev_t *dev, uint32_t channel) { dev->channel[channel].in.in_link.inlink_stop = 1; } /** */ __attribute__((always_inline)) static inline void gdma_ll_rx_restart(gdma_dev_t *dev, uint32_t channel) { de...
637
in.in_err_eof_des_addr.val; } /** */ __attribute__((always_inline)) static inline uint32_t gdma_ll_rx_get_prefetched_desc_addr(gdma_dev_t *dev, uint32_t channel) { return dev->channel[channel].in.in_dscr.val; } /** */ static inline void gdma_ll_rx_set_priority(gdma_dev_t *dev, uint32_t channel, uint32_t prio) {...
637
in.in_conf0.in_etm_en = enable; } ///////////////////////////////////// TX ///////////////////////////////////////// /** */ __attribute__((always_inline)) static inline uint32_t gdma_ll_tx_get_interrupt_status(gdma_dev_t *dev, uint32_t channel, bool raw) { if (raw) { return dev->out_intr[channel].raw.val;...
637
out.out_conf1.out_check_owner = enable; } /** */ static inline void gdma_ll_tx_enable_data_burst(gdma_dev_t *dev, uint32_t channel, bool enable) { dev->channel[channel].out.out_conf0.out_data_burst_en = enable; } /** */ static inline void gdma_ll_tx_enable_descriptor_burst(gdma_dev_t *dev, uint32_t channel, boo...
637
out.outfifo_status.val & 0x01; } /** */ static inline bool gdma_ll_tx_is_fifo_empty(gdma_dev_t *dev, uint32_t channel, uint32_t fifo_level) { return dev->channel[channel].out.outfifo_status.val & 0x02; } /** */ static inline uint32_t gdma_ll_tx_get_fifo_bytes(gdma_dev_t *dev, uint32_t channel, uint32_t fifo_lev...
637
out.out_link.outlink_stop = 1; } /** */ __attribute__((always_inline)) static inline void gdma_ll_tx_restart(gdma_dev_t *dev, uint32_t channel) { dev->channel[channel].out.out_link.outlink_restart = 1; } /** */ static inline bool gdma_ll_tx_is_desc_fsm_idle(gdma_dev_t *dev, uint32_t channel) { return dev->c...
637
out.out_peri_sel.peri_out_sel = periph_id; } /** */ static inline void gdma_ll_tx_disconnect_from_periph(gdma_dev_t *dev, uint32_t channel) { dev->channel[channel].out.out_peri_sel.peri_out_sel = GDMA_LL_INVALID_PERIPH_ID; } /** */ static inline void gdma_ll_tx_enable_etm_task(gdma_dev_t *dev, uint32_t channel,...
637
/* */ #pragma once #include #include "hal/ieee802154_common_ll.h" #define IEEE802154_TXPOWER_VALUE_MAX 20 #define IEEE802154_TXPOWER_VALUE_MIN -15 #define IEEE802154_TXPOWER_INDEX_MIN 3 #define IEEE802154_RSSI_COMPENSATION_VALUE 0
638
/* */ // The LL layer of the USB-serial-jtag controller #pragma once #include #include "esp_attr.h" #include "soc/pcr_struct.h" #include "soc/usb_serial_jtag_reg.h" #include "soc/usb_serial_jtag_struct.h" #ifdef __cplusplus extern "C" { #endif //The in and out endpoints are this long. #define USB_SERIAL_JTAG_PACK...
639
int_ena.val |= mask; } /** */ static inline void usb_serial_jtag_ll_disable_intr_mask(uint32_t mask) { USB_SERIAL_JTAG.int_ena.val &= (~mask); } /** */ static inline uint32_t usb_serial_jtag_ll_get_intsts_mask(void) { return USB_SERIAL_JTAG.int_st.val; } /** */ static inline __attribute__((always_inline))...
639
USB_SERIAL_JTAG.ep1_conf.serial_in_ep_data_free) break; USB_SERIAL_JTAG.ep1.rdwr_byte = buf[i]; } return i; } /** */ static inline int usb_serial_jtag_ll_rxfifo_data_available(void) { return USB_SERIAL_JTAG.ep1_conf.serial_out_ep_data_avail; } /** */ static inline int usb_serial_jtag_ll_txfifo_w...
639
usb_device_clk_en = clk_en; } /** */ FORCE_INLINE_ATTR void usb_serial_jtag_ll_reset_register(void) { PCR.usb_device_conf.usb_device_rst_en = 1; PCR.usb_device_conf.usb_device_rst_en = 0; } /** */ FORCE_INLINE_ATTR bool usb_serial_jtag_ll_module_is_enabled(void) { return (PCR.usb_device_conf.usb_device_...
639
/* */ #pragma once #include #include #include "soc/soc_caps.h" #include "hal/efuse_ll.h" #include_next "hal/efuse_hal.h" #ifdef __cplusplus extern "C" { #endif /** */ uint32_t efuse_hal_get_chip_revision(void); /** */ void efuse_hal_set_timing(uint32_t apb_freq_hz); /** */ void efuse_hal_read(void); /** ...
640
/* */ / / // The Lowlevel layer for SPI Flash Encryption. #include #include #include "soc/hp_system_reg.h" #include "soc/xts_aes_reg.h" #include "soc/soc.h" #include "soc/soc_caps.h" #include "hal/assert.h" #ifdef __cplusplus extern "C" { #endif /// Choose type of chip you want to encrypt manully typedef enum ...
641
= 0x3) { } } /** */ static inline void spi_flash_encrypt_ll_destroy(void) { REG_SET_BIT(XTS_AES_DESTROY_REG(0), XTS_AES_DESTROY); } /** */ static inline bool spi_flash_encrypt_ll_check(uint32_t address, uint32_t length) { return ((address % length) == 0) ? true : false; } #ifdef __cplusplus } #endif
641
/* */ /** */ #pragma once #include #include #include "soc/soc.h" #include "soc/apb_saradc_struct.h" #ifdef __cplusplus extern "C" { #endif #define PWDET_LL_SAR_POWER_FORCE_BIT BIT(24) #define PWDET_LL_SAR_POWER_CNTL_BIT BIT(23) typedef enum { SAR_CTRL_LL_POWER_FSM, //SAR power controlled by FSM ...
642
saradc_ctrl.saradc_saradc2_pwdet_drv = force; } #ifdef __cplusplus } #endif
642
/* */ // Note that most of the register operations in this layer are non-atomic operations. #pragma once #include #include #include "hal/assert.h" #include "hal/misc.h" #include "hal/hal_utils.h" #include "soc/pcr_struct.h" #include "soc/parl_io_struct.h" #include "hal/parlio_types.h" #define PARLIO_LL_RX_MAX_BY...
643
parl_clk_rx_conf.parl_rx_rst_en = 1; PCR.parl_clk_rx_conf.parl_rx_rst_en = 0; } /** */ __attribute__((always_inline)) static inline void parlio_ll_rx_enable_clock(parl_io_dev_t *dev, bool en) { (void)dev; PCR.parl_clk_rx_conf.parl_clk_rx_en = en; } /** */ __attribute__((always_inline)) static inline voi...
643
end_inc) { submode += 1; } } if (!start_inc) { submode += step; } if (pulse_inv) { submode += 6; } dev->rx_cfg0.rx_smp_mode_sel = 1; dev->rx_cfg0.rx_pulse_submode_sel = submode; } /** */ __attribute__((always_inline)) static inline void parlio_ll_rx_set_...
643
rx_bus_wid_sel = width_sel; } /** */ __attribute__((always_inline)) static inline void parlio_ll_rx_reset_fifo(parl_io_dev_t *dev) { dev->rx_cfg0.rx_fifo_srst = 1; dev->rx_cfg0.rx_fifo_srst = 0; } /** */ __attribute__((always_inline)) static inline void parlio_ll_rx_treat_data_line_as_en(parl_io_dev_t *dev,...
643
parl_clk_tx_conf.parl_clk_tx_sel = clk_sel; } /** */ static inline void parlio_ll_tx_set_clock_div(parl_io_dev_t *dev, const hal_utils_clk_div_t *clk_div) { (void)dev; HAL_ASSERT(clk_div->integer > 0 && clk_div->integer integer - 1); } /** */ __attribute__((always_inline)) static inline void parlio_ll_tx_re...
643
tx_start = en; } /** */ static inline void parlio_ll_tx_treat_msb_as_valid(parl_io_dev_t *dev, bool en) { dev->tx_cfg0.tx_hw_valid_en = en; } /** */ static inline void parlio_ll_tx_set_sample_clock_edge(parl_io_dev_t *dev, parlio_sample_edge_t edge) { dev->tx_cfg0.tx_smp_edge_sel = edge; } /** */ static i...
643
tx_fifo_srst = 1; dev->tx_cfg0.tx_fifo_srst = 0; } /** */ __attribute__((always_inline)) static inline void parlio_ll_tx_set_idle_data_value(parl_io_dev_t *dev, uint32_t value) { HAL_FORCE_MODIFY_U32_REG_FIELD(dev->tx_cfg1, tx_idle_value, value); } /** */ __attribute__((always_inline)) static inline bool pa...
643
val & PARLIO_LL_EVENT_RX_MASK; } /** */ __attribute__((always_inline)) static inline void parlio_ll_clear_interrupt_status(parl_io_dev_t *dev, uint32_t mask) { dev->int_clr.val = mask; } /** */ static inline volatile void *parlio_ll_get_interrupt_status_reg(parl_io_dev_t *dev) { return &dev->int_st; } #ifd...
643
/* */ // The LL layer for RTC(LP) watchdog register operations. // Note that most of the register operations in this layer are non-atomic operations. #pragma once #ifdef __cplusplus extern "C" { #endif #include "hal/lpwdt_ll.h" typedef lp_wdt_dev_t rwdt_dev_t; #define RWDT_DEV_GET() &LP_WDT #define rwdt_ll_enabl...
644
/* */ // The LL layer for UART register operations. // Note that most of the register operations in this layer are non-atomic operations. #pragma once #include "esp_attr.h" #include "hal/misc.h" #include "hal/uart_types.h" #include "soc/uart_reg.h" #include "soc/uart_struct.h" #include "soc/lp_uart_reg.h" #include ...
645
uart0_##reg_suffix, uart0_##field_suffix, (val)) \ } else { \ HAL_FORCE_MODIFY_U32_REG_FIELD(PCR.uart1_##reg_suffix, uart1_##field_suffix, (val)) \ } #define UART_LL_PCR_REG_U32_GET(hw, reg_suffix, field_suffix) \ (((hw) == &UART0) ? \ HAL_FORCE_READ_U32_REG_FIELD(PCR.uart0_##reg_suffix, ua...
645
lpperi.lp_uart_clk_sel) { default: case 0: *source_clk = (soc_module_clk_t)LP_UART_SCLK_LP_FAST; break; case 1: *source_clk = (soc_module_clk_t)LP_UART_SCLK_XTAL_D2; break; } } /** */ static inline void lp_uart_ll_set_source_clk(uart_dev_t *hw, soc_periph_lp_uart_clk_sr...
645
clkdiv_int = clk_div >> 4; hw->clkdiv_sync.clkdiv_frag = clk_div & 0xf; HAL_FORCE_MODIFY_U32_REG_FIELD(hw->clk_conf, sclk_div_num, sclk_div - 1); uart_ll_update(hw); } /** */ static inline void lp_uart_ll_enable_bus_clock(int hw_id, bool enable) { (void)hw_id; LPPERI.clk_en.lp_uart_ck_en = enable;...
645
uart0_conf.uart0_clk_en && !PCR.uart0_conf.uart0_rst_en; case 1: return PCR.uart1_conf.uart1_clk_en && !PCR.uart1_conf.uart1_rst_en; case 2: // LP_UART return LPPERI.clk_en.lp_uart_ck_en && !LPPERI.reset_en.lp_uart_reset_en; default: // Unknown uart port number HAL_ASSERT(fal...
645
= &LP_UART) { UART_LL_PCR_REG_SET(hw, sclk_conf, sclk_en, 1); } else { // LP_UART clk_en shares the same register with other LP peripherals // Needs to be protected with a lock, therefore, it has its unique LL function abort(); } } /** */ FORCE_INLINE_ATTR void uart_ll_sclk_dis...
645
= &LP_UART) { switch (UART_LL_PCR_REG_GET(hw, sclk_conf, sclk_sel)) { default: case 1: *source_clk = (soc_module_clk_t)UART_SCLK_PLL_F80M; break; case 2: *source_clk = (soc_module_clk_t)UART_SCLK_RTC; break; case 3: *sou...
645
val = hw->clkdiv_sync.val; int sclk_div; if ((hw) == &LP_UART) { sclk_div = HAL_FORCE_READ_U32_REG_FIELD(hw->clk_conf, sclk_div_num) + 1; } else { sclk_div = UART_LL_PCR_REG_U32_GET(hw, sclk_conf, sclk_div_num) + 1; } return ((sclk_freq int_ena.val = hw->int_ena.val | mask; } /** *...
645
rxfifo_rd_byte; } } /** */ FORCE_INLINE_ATTR void uart_ll_write_txfifo(uart_dev_t *hw, const uint8_t *buf, uint32_t wr_len) { // Write to the FIFO should make sure only involve write operation, any read operation would cause data lost. // Non-32-bit access would lead to a read-modify-write operation to th...
645
LP_UART_LL_FIFO_DEF_LEN : UART_LL_FIFO_DEF_LEN; uint32_t txfifo_len = (hw->status.txfifo_cnt) >> UART_LL_REG_FIELD_BIT_SHIFT(hw); return (total_fifo_len - txfifo_len); } /** */ FORCE_INLINE_ATTR void uart_ll_set_stop_bits(uart_dev_t *hw, uart_stop_bits_t stop_bit) { hw->conf0_sync.stop_bit_num = stop_bit...
645
rxfifo_full_thrhd = full_thrhd conf1.txfifo_empty_thrhd = empty_thrhd idle_conf_sync.rx_idle_thrhd = rx_idle_thr; uart_ll_update(hw); } /** */ FORCE_INLINE_ATTR void uart_ll_set_tx_idle_num(uart_dev_t *hw, uint32_t idle_num) { hw->idle_conf_sync.tx_idle_num = idle_num; uart_ll_update(hw); } /** */ FORCE...
645
tx_flow_en = 1; } else { hw->conf0_sync.tx_flow_en = 0; } uart_ll_update(hw); } /** */ FORCE_INLINE_ATTR void uart_ll_get_hw_flow_ctrl(uart_dev_t *hw, uart_hw_flowcontrol_t *flow_ctrl) { *flow_ctrl = UART_HW_FLOWCTRL_DISABLE; if (hw->hwfc_conf_sync.rx_flow_en) { *flow_ctrl = (uart_...
645
sw_flow_con_en = 0; hw->swfc_conf0_sync.xonoff_del = 0; } uart_ll_update(hw); } /** */ FORCE_INLINE_ATTR void uart_ll_set_at_cmd_char(uart_dev_t *hw, uart_at_cmd_t *cmd_char) { HAL_FORCE_MODIFY_U32_REG_FIELD(hw->at_cmd_char_sync, data, cmd_char->cmd_char); HAL_FORCE_MODIFY_U32_REG_FIELD(hw->at...
645
sw_dtr = level & 0x1; } /** */ FORCE_INLINE_ATTR void uart_ll_set_wakeup_thrd(uart_dev_t *hw, uint32_t wakeup_thrd) { hw->sleep_conf2.active_threshold = wakeup_thrd - UART_LL_MIN_WAKEUP_THRESH; } /** */ FORCE_INLINE_ATTR void uart_ll_set_mode_normal(uart_dev_t *hw) { // This function is only for HP_UART use...
645
rs485rxby_tx_en = 1; hw->conf0_sync.irda_en = 0; hw->conf0_sync.sw_rts = 0; hw->conf0_sync.irda_en = 0; hw->rs485_conf_sync.dl0_en = 1; hw->rs485_conf_sync.dl1_en = 1; hw->rs485_conf_sync.rs485_en = 1; uart_ll_update(hw); } /** */ FORCE_INLINE_ATTR void uart_ll_set_mode_rs485_half_duplex(u...
645
dl1_en = 1; hw->rs485_conf_sync.rs485_en = 1; uart_ll_update(hw); } /** */ FORCE_INLINE_ATTR void uart_ll_set_mode_collision_detect(uart_dev_t *hw) { // This function is only for HP_UART use // LP_UART can only work in normal mode // lp_uart_dev_t has no following fields (reserved), but no harm si...
645
rs485_en = 0; hw->rs485_conf_sync.rs485tx_rx_en = 0; hw->rs485_conf_sync.rs485rxby_tx_en = 0; hw->conf0_sync.sw_rts = 0; hw->conf0_sync.irda_en = 1; uart_ll_update(hw); } /** */ FORCE_INLINE_ATTR void uart_ll_set_mode(uart_dev_t *hw, uart_mode_t mode) { switch (mode) { default: ...
645
active_threshold + UART_LL_MIN_WAKEUP_THRESH; } /** */ FORCE_INLINE_ATTR void uart_ll_get_data_bit_num(uart_dev_t *hw, uart_word_length_t *data_bit) { *data_bit = (uart_word_length_t)hw->conf0_sync.bit_num; } /** */ FORCE_INLINE_ATTR bool uart_ll_is_tx_idle(uart_dev_t *hw) { return ((((hw->status.txfifo_cnt...
645
val = hw->conf0_sync.val; conf0_reg.irda_tx_inv = (inv_mask & UART_SIGNAL_IRDA_TX_INV) ? 1 : 0; conf0_reg.irda_rx_inv = (inv_mask & UART_SIGNAL_IRDA_RX_INV) ? 1 : 0; conf0_reg.rxd_inv = (inv_mask & UART_SIGNAL_RXD_INV) ? 1 : 0; conf0_reg.txd_inv = (inv_mask & UART_SIGNAL_TXD_INV) ? 1 : 0; hw->conf0_...
645
rx_tout_en = 0; } uart_ll_update(hw); } /** */ FORCE_INLINE_ATTR uint16_t uart_ll_get_rx_tout_thr(uart_dev_t *hw) { uint16_t tout_thrd = 0; if (hw->tout_conf_sync.rx_tout_en > 0) { tout_thrd = hw->tout_conf_sync.rx_tout_thrhd; } return tout_thrd; } /** */ FORCE_INLINE_ATTR uint16_t u...
645
rxd_edge_cnt; } /** */ FORCE_INLINE_ATTR uint32_t uart_ll_get_pos_pulse_cnt(uart_dev_t *hw) { // LP_UART does not support this feature // lp_uart_dev_t has no following fields (reserved), but no harm since we map the LP_UART instance to the uart_dev_t struct return hw->pospulse.posedge_min_cnt; } /** *...
645
lowpulse_min_cnt; } /** */ FORCE_INLINE_ATTR void uart_ll_force_xoff(uart_port_t uart_num) { uart_dev_t *hw = UART_LL_GET_HW(uart_num); hw->swfc_conf0_sync.force_xon = 0; hw->swfc_conf0_sync.sw_flow_con_en = 1; hw->swfc_conf0_sync.force_xoff = 1; uart_ll_update(hw); } /** */ FORCE_INLINE_ATTR vo...
645
/* */ // The LL layer for ESP32-C6 MODEM SYSCON register operations #pragma once #include #include #include "soc/soc.h" #include "hal/assert.h" #include "modem/modem_syscon_struct.h" #include "hal/modem_clock_types.h" #ifdef __cplusplus extern "C" { #endif __attribute__((always_inline)) static inline void modem...
646
clk_zb_mac_en = en; } __attribute__((always_inline)) static inline void modem_syscon_ll_enable_modem_sec_clock(modem_syscon_dev_t *hw, bool en) { hw->clk_conf.clk_modem_sec_en = en; hw->clk_conf.clk_modem_sec_ecb_en = en; hw->clk_conf.clk_modem_sec_ccm_en = en; hw->clk_conf.clk_modem_sec_bah_en = en; ...
646
clk_zb_apb_fo = 1; } __attribute__((always_inline)) static inline void modem_syscon_ll_enable_ieee802154_mac_clock_force(modem_syscon_dev_t *hw) { hw->clk_conf_force_on.clk_zb_mac_fo = 1; } __attribute__((always_inline)) static inline void modem_syscon_ll_enable_modem_sec_force_clock(modem_syscon_dev_t *hw) { ...
646
clk_zb_st_map = bitmap; } __attribute__((always_inline)) static inline uint32_t modem_syscon_ll_get_fe_icg_bitmap(modem_syscon_dev_t *hw) { return hw->clk_conf_power_st.clk_fe_st_map; } __attribute__((always_inline)) static inline void modem_syscon_ll_set_fe_icg_bitmap(modem_syscon_dev_t *hw, uint32_t bitmap) { ...
646
clk_wifi_st_map = bitmap; } __attribute__((always_inline)) static inline uint32_t modem_syscon_ll_get_modem_periph_icg_bitmap(modem_syscon_dev_t *hw) { return hw->clk_conf_power_st.clk_modem_peri_st_map; } __attribute__((always_inline)) static inline void modem_syscon_ll_set_modem_periph_icg_bitmap(modem_syscon_d...
646
rst_wifimac = 1; hw->modem_rst_conf.rst_wifimac = 0; } __attribute__((always_inline)) static inline void modem_syscon_ll_reset_fe(modem_syscon_dev_t *hw) { hw->modem_rst_conf.rst_fe = 1; hw->modem_rst_conf.rst_fe = 0; } __attribute__((always_inline)) static inline void modem_syscon_ll_reset_btmac_apb(mode...
646
rst_etm = 1; hw->modem_rst_conf.rst_etm = 0; } __attribute__((always_inline)) static inline void modem_syscon_ll_reset_zbmac(modem_syscon_dev_t *hw) { hw->modem_rst_conf.rst_zbmac = 1; hw->modem_rst_conf.rst_zbmac = 0; } __attribute__((always_inline)) static inline void modem_syscon_ll_reset_modem_sec(mod...
646
rst_data_dump = 1; hw->modem_rst_conf.rst_data_dump = 0; } __attribute__((always_inline)) static inline void modem_syscon_ll_reset_all(modem_syscon_dev_t *hw) { hw->modem_rst_conf.val = 0xffffffff; hw->modem_rst_conf.val = 0; } __attribute__((always_inline)) static inline void modem_syscon_ll_clk_conf1_c...
646
clk_wifibb_22m_en = en; } __attribute__((always_inline)) static inline void modem_syscon_ll_enable_wifibb_40m_clock(modem_syscon_dev_t *hw, bool en) { hw->clk_conf1.clk_wifibb_40m_en = en; } __attribute__((always_inline)) static inline void modem_syscon_ll_enable_wifibb_44m_clock(modem_syscon_dev_t *hw, bool en) ...
646
clk_wifibb_40x1_en = en; } __attribute__((always_inline)) static inline void modem_syscon_ll_enable_wifibb_80x1_clock(modem_syscon_dev_t *hw, bool en) { hw->clk_conf1.clk_wifibb_80x1_en = en; } __attribute__((always_inline)) static inline void modem_syscon_ll_enable_wifibb_160x1_clock(modem_syscon_dev_t *hw, bool...
646
clk_fe_20m_en = en; } __attribute__((always_inline)) static inline void modem_syscon_ll_enable_fe_40m_clock(modem_syscon_dev_t *hw, bool en) { hw->clk_conf1.clk_fe_40m_en = en; } __attribute__((always_inline)) static inline void modem_syscon_ll_enable_fe_80m_clock(modem_syscon_dev_t *hw, bool en) { hw->clk_co...
646
clk_bt_en = en; } __attribute__((always_inline)) static inline void modem_syscon_ll_enable_fe_480m_clock(modem_syscon_dev_t *hw, bool en) { hw->clk_conf1.clk_fe_480m_en = en; } __attribute__((always_inline)) static inline void modem_syscon_ll_enable_fe_anamode_40m_clock(modem_syscon_dev_t *hw, bool en) { hw->...
646
clk_wifibb_40m_fo = en; } __attribute__((always_inline)) static inline void modem_syscon_ll_enable_wifibb_44m_force_clock(modem_syscon_dev_t *hw, bool en) { hw->clk_conf1_force_on.clk_wifibb_44m_fo = en; } __attribute__((always_inline)) static inline void modem_syscon_ll_enable_wifibb_80m_force_clock(modem_syscon...
646
clk_wifibb_80x1_fo = en; } __attribute__((always_inline)) static inline void modem_syscon_ll_enable_wifibb_160x1_force_clock(modem_syscon_dev_t *hw, bool en) { hw->clk_conf1_force_on.clk_wifibb_160x1_fo = en; } __attribute__((always_inline)) static inline void modem_syscon_ll_enable_wifibb_480m_force_clock(modem_...
646
clk_fe_40m_fo = en; } __attribute__((always_inline)) static inline void modem_syscon_ll_enable_fe_80m_force_clock(modem_syscon_dev_t *hw, bool en) { hw->clk_conf1_force_on.clk_fe_80m_fo = en; } __attribute__((always_inline)) static inline void modem_syscon_ll_enable_fe_160m_force_clock(modem_syscon_dev_t *hw, boo...
646
clk_bt_fo = en; } __attribute__((always_inline)) static inline void modem_syscon_ll_enable_fe_480m_force_clock(modem_syscon_dev_t *hw, bool en) { hw->clk_conf1_force_on.clk_fe_480m_fo = en; } __attribute__((always_inline)) static inline void modem_syscon_ll_enable_fe_anamode_40m_force_clock(modem_syscon_dev_t *hw...
646
/* */ / / // The LL layer for SPI register operations #pragma once #include //for abs() #include #include "esp_attr.h" #include "esp_types.h" #include "soc/spi_periph.h" #include "soc/spi_struct.h" #include "soc/lldesc.h" #include "hal/assert.h" #include "hal/misc.h" #include "hal/spi_types.h" #include "soc/pcr...
647
cs_hold_time = 0; //use all 64 bytes of the buffer hw->user.usr_miso_highpart = 0; hw->user.usr_mosi_highpart = 0; //Disable unneeded ints hw->slave.val = 0; hw->user.val = 0; PCR.spi2_clkm_conf.spi2_clkm_sel = 1; hw->dma_conf.val = 0; hw->dma_conf.slv_tx_seg_trans_clr_en = 1; ...
647
val &= ~SPI_LL_UNUSED_INT_MASK; } /** */ static inline void spi_ll_slave_hd_init(spi_dev_t *hw) { hw->clock.val = 0; hw->user.val = 0; hw->ctrl.val = 0; hw->user.doutdin = 0; hw->user.sio = 0; hw->slave.soft_reset = 1; hw->slave.soft_reset = 0; hw->slave.slave_mode = 1; } /** */ sta...
647
soft_reset = 0; } /** */ static inline void spi_ll_cpu_tx_fifo_reset(spi_dev_t *hw) { hw->dma_conf.buf_afifo_rst = 1; hw->dma_conf.buf_afifo_rst = 0; } /** */ static inline void spi_ll_cpu_rx_fifo_reset(spi_dev_t *hw) { hw->dma_conf.rx_afifo_rst = 1; hw->dma_conf.rx_afifo_rst = 0; } /** */ static ...
647
dma_tx_ena = enable; } /** */ static inline void spi_ll_dma_set_rx_eof_generation(spi_dev_t *hw, bool enable) { hw->dma_conf.rx_eof_en = enable; } /* **/ /** */ static inline void spi_ll_write_buffer(spi_dev_t *hw, const uint8_t *buffer_to_send, size_t bitlen) { for (int x = 0; x data_buf[(x / 32)].buf = w...
647
buf; int len = bitlen - x; if (len > 32) { len = 32; } memcpy(&buffer_to_rcv[x / 8], &word, (len + 7) / 8); } } /** */ static inline void spi_ll_read_buffer_byte(spi_dev_t *hw, int byte_id, uint8_t *out_data, int len) { while (len > 0) { uint32_t word = hw->...
647
ck_idle_edge = 0; hw->user.ck_out_edge = 0; } else if (mode == 1) { hw->misc.ck_idle_edge = 0; hw->user.ck_out_edge = 1; } else if (mode == 2) { hw->misc.ck_idle_edge = 1; hw->user.ck_out_edge = 1; } else if (mode == 3) { hw->misc.ck_idle_edge = 1; hw-...
647
rsck_i_edge = 0; hw->user.tsck_i_edge = 0; hw->slave.clk_mode_13 = 1; } hw->slave.rsck_data_out = 0; } /** */ static inline void spi_ll_set_half_duplex(spi_dev_t *hw, bool half_duplex) { hw->user.doutdin = !half_duplex; } /** */ static inline void spi_ll_set_sio_mode(spi_dev_t *hw, int s...
647
dma_slv_seg_trans_en = seg_trans; } /** */ static inline void spi_ll_master_select_cs(spi_dev_t *hw, int cs_id) { hw->misc.cs0_dis = (cs_id == 0) ? 0 : 1; hw->misc.cs1_dis = (cs_id == 1) ? 0 : 1; hw->misc.cs2_dis = (cs_id == 2) ? 0 : 1; hw->misc.cs3_dis = (cs_id == 3) ? 0 : 1; hw->misc.cs4_dis = (...
647
Value written to register is one lower than used value. if (hz > ((fapb / 4) * 3)) { //Using Fapb directly will give us the best result here. reg.clkcnt_l = 0; reg.clkcnt_h = 0; reg.clkcnt_n = 0; reg.clkdiv_pre = 0; reg.clk_equ_sysclk = 1; eff_clk = fapb; ...
647
cs_hold_time = hold; hw->user.cs_hold = hold ? 1 : 0; } /** */ static inline void spi_ll_master_set_cs_setup(spi_dev_t *hw, uint8_t setup) { hw->user1.cs_setup_time = setup - 1; hw->user.cs_setup = setup ? 1 : 0; } /* **/ /** */ static inline void spi_ll_set_mosi_bitlen(spi_dev_t *hw, size_t bitlen) { ...
647
usr_addr_bitlen = bitlen - 1; hw->user.usr_addr = bitlen ? 1 : 0; } /** */ static inline void spi_ll_set_address(spi_dev_t *hw, uint64_t addr, int addrlen, uint32_t lsbfirst) { if (lsbfirst) { /* The output address start from the LSB of the highest byte, i.e. */ addr = HAL_SWAP32(addr)...
647
usr_miso = enable; } /** */ static inline void spi_ll_enable_mosi(spi_dev_t *hw, int enable) { hw->user.usr_mosi = enable; } /** */ static inline uint32_t spi_ll_slave_get_rcv_bitlen(spi_dev_t *hw) { return hw->slave1.slv_data_bitlen; } /* **/ //helper macros to generate code for each interrupts #define F...
647
slv_rd_dma_done, dma_int_set.slv_rd_dma_done_int_set) \ item(SPI_LL_INTR_WRDMA, dma_int_ena.slv_wr_dma_done, dma_int_raw.slv_wr_dma_done, dma_int_clr.slv_wr_dma_done, dma_int_set.slv_wr_dma_done_int_set) \ item(SPI_LL_INTR_SEG_DONE, dma_int_ena.dma_seg_trans_done, dma_int_raw.dma_...
647
slv_cmda, dma_int_set.slv_cmda_int_set) static inline void spi_ll_enable_intr(spi_dev_t *hw, spi_ll_intr_t intr_mask) { #define ENA_INTR(intr_bit, en_reg, ...) if (intr_mask & (intr_bit)) hw->en_reg = 1; FOR_EACH_ITEM(ENA_INTR, INTR_LIST); #undef ENA_INTR } static inline void spi_ll_disable_intr(spi...
647
..) if (intr_mask & (intr_bit) && hw->st_reg) return true; FOR_EACH_ITEM(GET_INTR, INTR_LIST); return false; #undef GET_INTR } #undef FOR_EACH_ITEM #undef INTR_LIST /** */ static inline void spi_ll_disable_int(spi_dev_t *hw) { hw->dma_int_ena.trans_done = 0; } /** */ static inline void spi_ll_clear_int...
647
1 : 0; } static inline int spi_ll_slave_get_rx_byte_len(spi_dev_t *hw) { return hw->slave1.slv_data_bitlen / 8; } static inline uint32_t spi_ll_slave_hd_get_last_addr(spi_dev_t *hw) { return hw->slave1.slv_last_addr; } #undef SPI_LL_RST_MASK #undef SPI_LL_UNUSED_INT_MASK /** */ static inline uint8_t spi_l...
647
data_lines == 2) { if (line_mode.addr_lines == 2) { cmd_mod = 0x50; //CMD:1-bit, ADDR:2-bit, DATA:2-bit } else { cmd_mod = 0x10; //CMD:1-bit, ADDR:1-bit, DATA:2-bit } } else if (line_mode.data_lines == 4) { if (line_mode.addr_lines == 4) { cmd_mod ...
647
/* */ // Attention: Timer Group has 3 independent functions: General Purpose Timer, Watchdog Timer and Clock calibration. // This Low Level driver only serve the General Purpose Timer function. #pragma once #include #include "hal/assert.h" #include "hal/misc.h" #include "hal/timer_types.h" #include "soc...
648
config.tx_autoreload = en; } /** */ static inline void timer_ll_set_count_direction(timg_dev_t *hw, uint32_t timer_num, gptimer_count_direction_t direction) { hw->hw_timer[timer_num].config.tx_increase = (direction == GPTIMER_COUNT_UP); } /** */ __attribute__((always_inline)) static inline void timer_ll_enable_...
648
hi.tx_hi hw_timer[timer_num].lo.tx_lo); } /** */ __attribute__((always_inline)) static inline void timer_ll_set_alarm_value(timg_dev_t *hw, uint32_t timer_num, uint64_t alarm_value) { hw->hw_timer[timer_num].alarmhi.tx_alarm_hi = (uint32_t)(alarm_value >> 32); hw->hw_timer[timer_num].alarmlo.tx_alarm_lo = (ui...
648
load.tx_load = 1; } /** */ static inline void timer_ll_enable_etm(timg_dev_t *hw, bool en) { hw->regclk.etm_en = en; } /** */ __attribute__((always_inline)) static inline void timer_ll_enable_intr(timg_dev_t *hw, uint32_t mask, bool en) { if (en) { hw->int_ena_timers.val |= mask; } else { ...
648
/* */ #pragma once #include #include "soc/soc.h" #include "soc/clk_tree_defs.h" #include "soc/pcr_struct.h" #include "soc/lp_clkrst_struct.h" #include "soc/pmu_reg.h" #include "hal/regi2c_ctrl.h" #include "soc/regi2c_bbpll.h" #include "hal/assert.h" #include "hal/log.h" #include "esp32c6/rom/rtc.h" #include "hal/mi...
649
HP_ROOT_CLK ---(2)---> CPU_CLK // (1) not configurable for the target (HRO register field: PCR_HS_DIV_NUM) // Fixed at 3 for HS clock source // Corresponding register field value is PCR_HS_DIV_NUM=2 // (2) configurable // HS divider option: 1, 2, 4 (PCR_CPU_HS_DIV_NUM=0, 1, 3) HAL_ASSERT(divid...
649
cpu_freq_conf, cpu_ls_div_num, divider - 1); } /** */ static inline __attribute__((always_inline)) uint32_t clk_ll_cpu_get_hs_divider(void) { uint32_t force_120m = PCR.cpu_freq_conf.cpu_hs_120m_force; uint32_t cpu_hs_div = HAL_FORCE_READ_U32_REG_FIELD(PCR.cpu_freq_conf, cpu_hs_div_num); if (cpu_hs_div == ...
649
ahb_freq_conf, ahb_hs_div_num, (divider / 3) - 1); } /** */ static inline __attribute__((always_inline)) void clk_ll_ahb_set_ls_divider(uint32_t divider) { // SOC_ROOT_CLK ---(1)---> HP_ROOT_CLK ---(2)---> AHB_CLK // (1) not configurable for the target (HRO register field: PCR_LS_DIV_NUM) // Fixed at 1 fo...
649
ahb_freq_conf, ahb_ls_div_num); uint32_t hp_root_ls_div = HAL_FORCE_READ_U32_REG_FIELD(PCR.sysclk_conf, ls_div_num); return (hp_root_ls_div + 1) * (ahb_ls_div + 1); } /** */ static inline __attribute__((always_inline)) void clk_ll_apb_set_divider(uint32_t divider) { // AHB > APB // Divider option: 1, ...
649
mspi_clk_conf, mspi_fast_hs_div_num, div_num); } /** */ static inline __attribute__((always_inline)) void clk_ll_mspi_fast_set_ls_divider(uint32_t divider) { // SOC_ROOT_CLK > MSPI_FAST_CLK // LS divider option: 1, 2, 4 (PCR_MSPI_FAST_LS_DIV_NUM=0, 1, 2) uint32_t div_num = 0; switch (divider) { ca...
649
ctrl_32k_conf.clk_32k_sel = 2; break; default: // Unsupported 32K_SEL mux input abort(); } } /** */ static inline __attribute__((always_inline)) soc_rtc_slow_clk_src_t clk_ll_32k_calibration_get_target(void) { uint32_t clk_sel = PCR.ctrl_32k_conf.clk_32k_sel; switch (clk_sel) {...
649