Lines Matching refs:usart_periph
51 void usart_deinit(uint32_t usart_periph) in usart_deinit() argument
53 switch(usart_periph) { in usart_deinit()
98 void usart_baudrate_set(uint32_t usart_periph, uint32_t baudval) in usart_baudrate_set() argument
101 switch(usart_periph) { in usart_baudrate_set()
130 if(USART_CTL0(usart_periph) & USART_CTL0_OVSMOD) { in usart_baudrate_set()
135 USART_BAUD(usart_periph) = ((USART_BAUD_FRADIV | USART_BAUD_INTDIV) & (intdiv | fradiv)); in usart_baudrate_set()
141 USART_BAUD(usart_periph) = ((USART_BAUD_FRADIV | USART_BAUD_INTDIV) & (intdiv | fradiv)); in usart_baudrate_set()
156 void usart_parity_config(uint32_t usart_periph, uint32_t paritycfg) in usart_parity_config() argument
159 USART_CTL0(usart_periph) &= ~(USART_CTL0_PM | USART_CTL0_PCEN); in usart_parity_config()
161 USART_CTL0(usart_periph) |= paritycfg ; in usart_parity_config()
174 void usart_word_length_set(uint32_t usart_periph, uint32_t wlen) in usart_word_length_set() argument
177 USART_CTL0(usart_periph) &= ~USART_CTL0_WL; in usart_word_length_set()
179 USART_CTL0(usart_periph) |= wlen; in usart_word_length_set()
194 void usart_stop_bit_set(uint32_t usart_periph, uint32_t stblen) in usart_stop_bit_set() argument
197 USART_CTL1(usart_periph) &= ~USART_CTL1_STB; in usart_stop_bit_set()
199 USART_CTL1(usart_periph) |= stblen; in usart_stop_bit_set()
207 void usart_enable(uint32_t usart_periph) in usart_enable() argument
209 USART_CTL0(usart_periph) |= USART_CTL0_UEN; in usart_enable()
218 void usart_disable(uint32_t usart_periph) in usart_disable() argument
220 USART_CTL0(usart_periph) &= ~(USART_CTL0_UEN); in usart_disable()
233 void usart_transmit_config(uint32_t usart_periph, uint32_t txconfig) in usart_transmit_config() argument
237 ctl = USART_CTL0(usart_periph); in usart_transmit_config()
241 USART_CTL0(usart_periph) = ctl; in usart_transmit_config()
254 void usart_receive_config(uint32_t usart_periph, uint32_t rxconfig) in usart_receive_config() argument
258 ctl = USART_CTL0(usart_periph); in usart_receive_config()
262 USART_CTL0(usart_periph) = ctl; in usart_receive_config()
275 void usart_data_first_config(uint32_t usart_periph, uint32_t msbf) in usart_data_first_config() argument
279 ctl = USART_CTL3(usart_periph); in usart_data_first_config()
283 USART_CTL3(usart_periph) = ctl; in usart_data_first_config()
300 void usart_invert_config(uint32_t usart_periph, usart_invert_enum invertpara) in usart_invert_config() argument
305 USART_CTL3(usart_periph) |= USART_CTL3_DINV; in usart_invert_config()
308 USART_CTL3(usart_periph) |= USART_CTL3_TINV; in usart_invert_config()
311 USART_CTL3(usart_periph) |= USART_CTL3_RINV; in usart_invert_config()
314 USART_CTL3(usart_periph) &= ~(USART_CTL3_DINV); in usart_invert_config()
317 USART_CTL3(usart_periph) &= ~(USART_CTL3_TINV); in usart_invert_config()
320 USART_CTL3(usart_periph) &= ~(USART_CTL3_RINV); in usart_invert_config()
337 void usart_oversample_config(uint32_t usart_periph, uint32_t oversamp) in usart_oversample_config() argument
340 USART_CTL0(usart_periph) &= ~(USART_CTL0_OVSMOD); in usart_oversample_config()
341 USART_CTL0(usart_periph) |= oversamp; in usart_oversample_config()
354 void usart_sample_bit_config(uint32_t usart_periph, uint32_t obsm) in usart_sample_bit_config() argument
356 USART_CTL2(usart_periph) &= ~(USART_CTL2_OSB); in usart_sample_bit_config()
357 USART_CTL2(usart_periph) |= obsm; in usart_sample_bit_config()
366 void usart_receiver_timeout_enable(uint32_t usart_periph) in usart_receiver_timeout_enable() argument
368 USART_CTL3(usart_periph) |= USART_CTL3_RTEN; in usart_receiver_timeout_enable()
377 void usart_receiver_timeout_disable(uint32_t usart_periph) in usart_receiver_timeout_disable() argument
379 USART_CTL3(usart_periph) &= ~(USART_CTL3_RTEN); in usart_receiver_timeout_disable()
389 void usart_receiver_timeout_threshold_config(uint32_t usart_periph, uint32_t rtimeout) in usart_receiver_timeout_threshold_config() argument
391 USART_RT(usart_periph) &= ~(USART_RT_RT); in usart_receiver_timeout_threshold_config()
392 USART_RT(usart_periph) |= rtimeout; in usart_receiver_timeout_threshold_config()
402 void usart_data_transmit(uint32_t usart_periph, uint32_t data) in usart_data_transmit() argument
404 USART_DATA(usart_periph) = ((uint16_t)USART_DATA_DATA & data); in usart_data_transmit()
413 uint16_t usart_data_receive(uint32_t usart_periph) in usart_data_receive() argument
415 return (uint16_t)(GET_BITS(USART_DATA(usart_periph), 0U, 8U)); in usart_data_receive()
425 void usart_address_config(uint32_t usart_periph, uint8_t addr) in usart_address_config() argument
427 USART_CTL1(usart_periph) &= ~(USART_CTL1_ADDR); in usart_address_config()
428 USART_CTL1(usart_periph) |= (USART_CTL1_ADDR & addr); in usart_address_config()
437 void usart_mute_mode_enable(uint32_t usart_periph) in usart_mute_mode_enable() argument
439 USART_CTL0(usart_periph) |= USART_CTL0_RWU; in usart_mute_mode_enable()
448 void usart_mute_mode_disable(uint32_t usart_periph) in usart_mute_mode_disable() argument
450 USART_CTL0(usart_periph) &= ~(USART_CTL0_RWU); in usart_mute_mode_disable()
463 void usart_mute_mode_wakeup_config(uint32_t usart_periph, uint32_t wmehtod) in usart_mute_mode_wakeup_config() argument
465 USART_CTL0(usart_periph) &= ~(USART_CTL0_WM); in usart_mute_mode_wakeup_config()
466 USART_CTL0(usart_periph) |= wmehtod; in usart_mute_mode_wakeup_config()
475 void usart_lin_mode_enable(uint32_t usart_periph) in usart_lin_mode_enable() argument
477 USART_CTL1(usart_periph) |= USART_CTL1_LMEN; in usart_lin_mode_enable()
486 void usart_lin_mode_disable(uint32_t usart_periph) in usart_lin_mode_disable() argument
488 USART_CTL1(usart_periph) &= ~(USART_CTL1_LMEN); in usart_lin_mode_disable()
501 void usart_lin_break_detection_length_config(uint32_t usart_periph, uint32_t lblen) in usart_lin_break_detection_length_config() argument
503 USART_CTL1(usart_periph) &= ~(USART_CTL1_LBLEN); in usart_lin_break_detection_length_config()
504 USART_CTL1(usart_periph) |= (USART_CTL1_LBLEN & lblen); in usart_lin_break_detection_length_config()
513 void usart_send_break(uint32_t usart_periph) in usart_send_break() argument
515 USART_CTL0(usart_periph) |= USART_CTL0_SBKCMD; in usart_send_break()
524 void usart_halfduplex_enable(uint32_t usart_periph) in usart_halfduplex_enable() argument
526 USART_CTL2(usart_periph) |= USART_CTL2_HDEN; in usart_halfduplex_enable()
535 void usart_halfduplex_disable(uint32_t usart_periph) in usart_halfduplex_disable() argument
537 USART_CTL2(usart_periph) &= ~(USART_CTL2_HDEN); in usart_halfduplex_disable()
546 void usart_synchronous_clock_enable(uint32_t usart_periph) in usart_synchronous_clock_enable() argument
548 USART_CTL1(usart_periph) |= USART_CTL1_CKEN; in usart_synchronous_clock_enable()
557 void usart_synchronous_clock_disable(uint32_t usart_periph) in usart_synchronous_clock_disable() argument
559 USART_CTL1(usart_periph) &= ~(USART_CTL1_CKEN); in usart_synchronous_clock_disable()
580 void usart_synchronous_clock_config(uint32_t usart_periph, uint32_t clen, uint32_t cph, uint32_t cp… in usart_synchronous_clock_config() argument
585 ctl = USART_CTL1(usart_periph); in usart_synchronous_clock_config()
590 USART_CTL1(usart_periph) = ctl; in usart_synchronous_clock_config()
600 void usart_guard_time_config(uint32_t usart_periph, uint32_t guat) in usart_guard_time_config() argument
602 USART_GP(usart_periph) &= ~(USART_GP_GUAT); in usart_guard_time_config()
603 USART_GP(usart_periph) |= (USART_GP_GUAT & ((guat) << GP_GUAT_OFFSET)); in usart_guard_time_config()
612 void usart_smartcard_mode_enable(uint32_t usart_periph) in usart_smartcard_mode_enable() argument
614 USART_CTL2(usart_periph) |= USART_CTL2_SCEN; in usart_smartcard_mode_enable()
623 void usart_smartcard_mode_disable(uint32_t usart_periph) in usart_smartcard_mode_disable() argument
625 USART_CTL2(usart_periph) &= ~(USART_CTL2_SCEN); in usart_smartcard_mode_disable()
634 void usart_smartcard_mode_nack_enable(uint32_t usart_periph) in usart_smartcard_mode_nack_enable() argument
636 USART_CTL2(usart_periph) |= USART_CTL2_NKEN; in usart_smartcard_mode_nack_enable()
645 void usart_smartcard_mode_nack_disable(uint32_t usart_periph) in usart_smartcard_mode_nack_disable() argument
647 USART_CTL2(usart_periph) &= ~(USART_CTL2_NKEN); in usart_smartcard_mode_nack_disable()
657 void usart_smartcard_autoretry_config(uint32_t usart_periph, uint32_t scrtnum) in usart_smartcard_autoretry_config() argument
659 USART_CTL3(usart_periph) &= ~(USART_CTL3_SCRTNUM); in usart_smartcard_autoretry_config()
660 USART_CTL3(usart_periph) |= (USART_CTL3_SCRTNUM & ((scrtnum) << CTL3_SCRTNUM_OFFSET)); in usart_smartcard_autoretry_config()
670 void usart_block_length_config(uint32_t usart_periph, uint32_t bl) in usart_block_length_config() argument
672 USART_RT(usart_periph) &= ~(USART_RT_BL); in usart_block_length_config()
673 USART_RT(usart_periph) |= (USART_RT_BL & ((bl) << RT_BL_OFFSET)); in usart_block_length_config()
682 void usart_irda_mode_enable(uint32_t usart_periph) in usart_irda_mode_enable() argument
684 USART_CTL2(usart_periph) |= USART_CTL2_IREN; in usart_irda_mode_enable()
693 void usart_irda_mode_disable(uint32_t usart_periph) in usart_irda_mode_disable() argument
695 USART_CTL2(usart_periph) &= ~(USART_CTL2_IREN); in usart_irda_mode_disable()
705 void usart_prescaler_config(uint32_t usart_periph, uint8_t psc) in usart_prescaler_config() argument
707 USART_GP(usart_periph) &= ~(USART_GP_PSC); in usart_prescaler_config()
708 USART_GP(usart_periph) |= psc; in usart_prescaler_config()
721 void usart_irda_lowpower_config(uint32_t usart_periph, uint32_t irlp) in usart_irda_lowpower_config() argument
723 USART_CTL2(usart_periph) &= ~(USART_CTL2_IRLP); in usart_irda_lowpower_config()
724 USART_CTL2(usart_periph) |= (USART_CTL2_IRLP & irlp); in usart_irda_lowpower_config()
737 void usart_hardware_flow_rts_config(uint32_t usart_periph, uint32_t rtsconfig) in usart_hardware_flow_rts_config() argument
741 ctl = USART_CTL2(usart_periph); in usart_hardware_flow_rts_config()
745 USART_CTL2(usart_periph) = ctl; in usart_hardware_flow_rts_config()
758 void usart_hardware_flow_cts_config(uint32_t usart_periph, uint32_t ctsconfig) in usart_hardware_flow_cts_config() argument
762 ctl = USART_CTL2(usart_periph); in usart_hardware_flow_cts_config()
766 USART_CTL2(usart_periph) = ctl; in usart_hardware_flow_cts_config()
779 void usart_break_frame_coherence_config(uint32_t usart_periph, uint32_t bcm) in usart_break_frame_coherence_config() argument
781 USART_CHC(usart_periph) &= ~(USART_CHC_BCM); in usart_break_frame_coherence_config()
782 USART_CHC(usart_periph) |= (USART_CHC_BCM & bcm); in usart_break_frame_coherence_config()
795 void usart_parity_check_coherence_config(uint32_t usart_periph, uint32_t pcm) in usart_parity_check_coherence_config() argument
797 USART_CHC(usart_periph) &= ~(USART_CHC_PCM); in usart_parity_check_coherence_config()
798 USART_CHC(usart_periph) |= (USART_CHC_PCM & pcm); in usart_parity_check_coherence_config()
811 void usart_hardware_flow_coherence_config(uint32_t usart_periph, uint32_t hcm) in usart_hardware_flow_coherence_config() argument
813 USART_CHC(usart_periph) &= ~(USART_CHC_HCM); in usart_hardware_flow_coherence_config()
814 USART_CHC(usart_periph) |= (USART_CHC_HCM & hcm); in usart_hardware_flow_coherence_config()
827 void usart_dma_receive_config(uint32_t usart_periph, uint32_t dmacmd) in usart_dma_receive_config() argument
831 ctl = USART_CTL2(usart_periph); in usart_dma_receive_config()
835 USART_CTL2(usart_periph) = ctl; in usart_dma_receive_config()
848 void usart_dma_transmit_config(uint32_t usart_periph, uint32_t dmacmd) in usart_dma_transmit_config() argument
852 ctl = USART_CTL2(usart_periph); in usart_dma_transmit_config()
856 USART_CTL2(usart_periph) = ctl; in usart_dma_transmit_config()
881 FlagStatus usart_flag_get(uint32_t usart_periph, usart_flag_enum flag) in usart_flag_get() argument
883 if(RESET != (USART_REG_VAL(usart_periph, flag) & BIT(USART_BIT_POS(flag)))) { in usart_flag_get()
905 void usart_flag_clear(uint32_t usart_periph, usart_flag_enum flag) in usart_flag_clear() argument
907 USART_REG_VAL(usart_periph, flag) &= ~BIT(USART_BIT_POS(flag)); in usart_flag_clear()
928 void usart_interrupt_enable(uint32_t usart_periph, usart_interrupt_enum interrupt) in usart_interrupt_enable() argument
930 USART_REG_VAL(usart_periph, interrupt) |= BIT(USART_BIT_POS(interrupt)); in usart_interrupt_enable()
951 void usart_interrupt_disable(uint32_t usart_periph, usart_interrupt_enum interrupt) in usart_interrupt_disable() argument
953 USART_REG_VAL(usart_periph, interrupt) &= ~BIT(USART_BIT_POS(interrupt)); in usart_interrupt_disable()
977 FlagStatus usart_interrupt_flag_get(uint32_t usart_periph, usart_interrupt_flag_enum int_flag) in usart_interrupt_flag_get() argument
981 intenable = (USART_REG_VAL(usart_periph, int_flag) & BIT(USART_BIT_POS(int_flag))); in usart_interrupt_flag_get()
983 flagstatus = (USART_REG_VAL2(usart_periph, int_flag) & BIT(USART_BIT_POS2(int_flag))); in usart_interrupt_flag_get()
1006 void usart_interrupt_flag_clear(uint32_t usart_periph, usart_interrupt_flag_enum int_flag) in usart_interrupt_flag_clear() argument
1008 USART_REG_VAL2(usart_periph, int_flag) &= ~BIT(USART_BIT_POS2(int_flag)); in usart_interrupt_flag_clear()