Lines Matching refs:usart_periph

50 void usart_deinit(uint32_t usart_periph)  in usart_deinit()  argument
52 switch(usart_periph){ in usart_deinit()
90 void usart_baudrate_set(uint32_t usart_periph, uint32_t baudval) in usart_baudrate_set() argument
93 switch(usart_periph){ in usart_baudrate_set()
122 USART_BAUD(usart_periph) = ((USART_BAUD_FRADIV | USART_BAUD_INTDIV) & (intdiv | fradiv)); in usart_baudrate_set()
136 void usart_parity_config(uint32_t usart_periph, uint32_t paritycfg) in usart_parity_config() argument
139 USART_CTL0(usart_periph) &= ~(USART_CTL0_PM | USART_CTL0_PCEN); in usart_parity_config()
141 USART_CTL0(usart_periph) |= paritycfg ; in usart_parity_config()
154 void usart_word_length_set(uint32_t usart_periph, uint32_t wlen) in usart_word_length_set() argument
157 USART_CTL0(usart_periph) &= ~USART_CTL0_WL; in usart_word_length_set()
159 USART_CTL0(usart_periph) |= wlen; in usart_word_length_set()
174 void usart_stop_bit_set(uint32_t usart_periph, uint32_t stblen) in usart_stop_bit_set() argument
177 USART_CTL1(usart_periph) &= ~USART_CTL1_STB; in usart_stop_bit_set()
179 USART_CTL1(usart_periph) |= stblen; in usart_stop_bit_set()
187 void usart_enable(uint32_t usart_periph) in usart_enable() argument
189 USART_CTL0(usart_periph) |= USART_CTL0_UEN; in usart_enable()
198 void usart_disable(uint32_t usart_periph) in usart_disable() argument
200 USART_CTL0(usart_periph) &= ~(USART_CTL0_UEN); in usart_disable()
213 void usart_transmit_config(uint32_t usart_periph, uint32_t txconfig) in usart_transmit_config() argument
217 ctl = USART_CTL0(usart_periph); in usart_transmit_config()
221 USART_CTL0(usart_periph) = ctl; in usart_transmit_config()
234 void usart_receive_config(uint32_t usart_periph, uint32_t rxconfig) in usart_receive_config() argument
238 ctl = USART_CTL0(usart_periph); in usart_receive_config()
242 USART_CTL0(usart_periph) = ctl; in usart_receive_config()
255 void usart_data_first_config(uint32_t usart_periph, uint32_t msbf) in usart_data_first_config() argument
257 USART_CTL3(usart_periph) &= ~(USART_CTL3_MSBF); in usart_data_first_config()
258 USART_CTL3(usart_periph) |= msbf; in usart_data_first_config()
275 void usart_invert_config(uint32_t usart_periph, usart_invert_enum invertpara) in usart_invert_config() argument
281 USART_CTL3(usart_periph) |= USART_CTL3_DINV; in usart_invert_config()
285 USART_CTL3(usart_periph) |= USART_CTL3_TINV; in usart_invert_config()
289 USART_CTL3(usart_periph) |= USART_CTL3_RINV; in usart_invert_config()
293 USART_CTL3(usart_periph) &= ~(USART_CTL3_DINV); in usart_invert_config()
297 USART_CTL3(usart_periph) &= ~(USART_CTL3_TINV); in usart_invert_config()
301 USART_CTL3(usart_periph) &= ~(USART_CTL3_RINV); in usart_invert_config()
314 void usart_receiver_timeout_enable(uint32_t usart_periph) in usart_receiver_timeout_enable() argument
316 USART_CTL3(usart_periph) |= USART_CTL3_RTEN; in usart_receiver_timeout_enable()
325 void usart_receiver_timeout_disable(uint32_t usart_periph) in usart_receiver_timeout_disable() argument
327 USART_CTL3(usart_periph) &= ~(USART_CTL3_RTEN); in usart_receiver_timeout_disable()
337 void usart_receiver_timeout_threshold_config(uint32_t usart_periph, uint32_t rtimeout) in usart_receiver_timeout_threshold_config() argument
339 USART_RT(usart_periph) &= ~(USART_RT_RT); in usart_receiver_timeout_threshold_config()
340 USART_RT(usart_periph) |= rtimeout; in usart_receiver_timeout_threshold_config()
350 void usart_data_transmit(uint32_t usart_periph, uint32_t data) in usart_data_transmit() argument
352 USART_DATA(usart_periph) = ((uint16_t)USART_DATA_DATA & data); in usart_data_transmit()
361 uint16_t usart_data_receive(uint32_t usart_periph) in usart_data_receive() argument
363 return (uint16_t)(GET_BITS(USART_DATA(usart_periph), 0U, 8U)); in usart_data_receive()
373 void usart_address_config(uint32_t usart_periph, uint8_t addr) in usart_address_config() argument
375 USART_CTL1(usart_periph) &= ~(USART_CTL1_ADDR); in usart_address_config()
376 USART_CTL1(usart_periph) |= (USART_CTL1_ADDR & addr); in usart_address_config()
385 void usart_mute_mode_enable(uint32_t usart_periph) in usart_mute_mode_enable() argument
387 USART_CTL0(usart_periph) |= USART_CTL0_RWU; in usart_mute_mode_enable()
396 void usart_mute_mode_disable(uint32_t usart_periph) in usart_mute_mode_disable() argument
398 USART_CTL0(usart_periph) &= ~(USART_CTL0_RWU); in usart_mute_mode_disable()
411 void usart_mute_mode_wakeup_config(uint32_t usart_periph, uint32_t wmethod) in usart_mute_mode_wakeup_config() argument
413 USART_CTL0(usart_periph) &= ~(USART_CTL0_WM); in usart_mute_mode_wakeup_config()
414 USART_CTL0(usart_periph) |= wmethod; in usart_mute_mode_wakeup_config()
423 void usart_lin_mode_enable(uint32_t usart_periph) in usart_lin_mode_enable() argument
425 USART_CTL1(usart_periph) |= USART_CTL1_LMEN; in usart_lin_mode_enable()
434 void usart_lin_mode_disable(uint32_t usart_periph) in usart_lin_mode_disable() argument
436 USART_CTL1(usart_periph) &= ~(USART_CTL1_LMEN); in usart_lin_mode_disable()
449 void usart_lin_break_detection_length_config(uint32_t usart_periph, uint32_t lblen) in usart_lin_break_detection_length_config() argument
451 USART_CTL1(usart_periph) &= ~(USART_CTL1_LBLEN); in usart_lin_break_detection_length_config()
452 USART_CTL1(usart_periph) |= (USART_CTL1_LBLEN & lblen); in usart_lin_break_detection_length_config()
461 void usart_send_break(uint32_t usart_periph) in usart_send_break() argument
463 USART_CTL0(usart_periph) |= USART_CTL0_SBKCMD; in usart_send_break()
472 void usart_halfduplex_enable(uint32_t usart_periph) in usart_halfduplex_enable() argument
474 USART_CTL2(usart_periph) |= USART_CTL2_HDEN; in usart_halfduplex_enable()
483 void usart_halfduplex_disable(uint32_t usart_periph) in usart_halfduplex_disable() argument
485 USART_CTL2(usart_periph) &= ~(USART_CTL2_HDEN); in usart_halfduplex_disable()
494 void usart_synchronous_clock_enable(uint32_t usart_periph) in usart_synchronous_clock_enable() argument
496 USART_CTL1(usart_periph) |= USART_CTL1_CKEN; in usart_synchronous_clock_enable()
505 void usart_synchronous_clock_disable(uint32_t usart_periph) in usart_synchronous_clock_disable() argument
507 USART_CTL1(usart_periph) &= ~(USART_CTL1_CKEN); in usart_synchronous_clock_disable()
528 void usart_synchronous_clock_config(uint32_t usart_periph, uint32_t clen, uint32_t cph, uint32_t cp… in usart_synchronous_clock_config() argument
533 ctl = USART_CTL1(usart_periph); in usart_synchronous_clock_config()
538 USART_CTL1(usart_periph) = ctl; in usart_synchronous_clock_config()
548 void usart_guard_time_config(uint32_t usart_periph,uint32_t guat) in usart_guard_time_config() argument
550 USART_GP(usart_periph) &= ~(USART_GP_GUAT); in usart_guard_time_config()
551 USART_GP(usart_periph) |= (USART_GP_GUAT & ((guat)<<GP_GUAT_OFFSET)); in usart_guard_time_config()
560 void usart_smartcard_mode_enable(uint32_t usart_periph) in usart_smartcard_mode_enable() argument
562 USART_CTL2(usart_periph) |= USART_CTL2_SCEN; in usart_smartcard_mode_enable()
571 void usart_smartcard_mode_disable(uint32_t usart_periph) in usart_smartcard_mode_disable() argument
573 USART_CTL2(usart_periph) &= ~(USART_CTL2_SCEN); in usart_smartcard_mode_disable()
582 void usart_smartcard_mode_nack_enable(uint32_t usart_periph) in usart_smartcard_mode_nack_enable() argument
584 USART_CTL2(usart_periph) |= USART_CTL2_NKEN; in usart_smartcard_mode_nack_enable()
593 void usart_smartcard_mode_nack_disable(uint32_t usart_periph) in usart_smartcard_mode_nack_disable() argument
595 USART_CTL2(usart_periph) &= ~(USART_CTL2_NKEN); in usart_smartcard_mode_nack_disable()
605 void usart_smartcard_autoretry_config(uint32_t usart_periph, uint32_t scrtnum) in usart_smartcard_autoretry_config() argument
607 USART_CTL3(usart_periph) &= ~(USART_CTL3_SCRTNUM); in usart_smartcard_autoretry_config()
608 USART_CTL3(usart_periph) |= (USART_CTL3_SCRTNUM & ((scrtnum)<<CTL3_SCRTNUM_OFFSET)); in usart_smartcard_autoretry_config()
618 void usart_block_length_config(uint32_t usart_periph, uint32_t bl) in usart_block_length_config() argument
620 USART_RT(usart_periph) &= ~(USART_RT_BL); in usart_block_length_config()
621 USART_RT(usart_periph) |= (USART_RT_BL & ((bl)<<RT_BL_OFFSET)); in usart_block_length_config()
630 void usart_irda_mode_enable(uint32_t usart_periph) in usart_irda_mode_enable() argument
632 USART_CTL2(usart_periph) |= USART_CTL2_IREN; in usart_irda_mode_enable()
641 void usart_irda_mode_disable(uint32_t usart_periph) in usart_irda_mode_disable() argument
643 USART_CTL2(usart_periph) &= ~(USART_CTL2_IREN); in usart_irda_mode_disable()
653 void usart_prescaler_config(uint32_t usart_periph, uint8_t psc) in usart_prescaler_config() argument
655 USART_GP(usart_periph) &= ~(USART_GP_PSC); in usart_prescaler_config()
656 USART_GP(usart_periph) |= psc; in usart_prescaler_config()
669 void usart_irda_lowpower_config(uint32_t usart_periph, uint32_t irlp) in usart_irda_lowpower_config() argument
671 USART_CTL2(usart_periph) &= ~(USART_CTL2_IRLP); in usart_irda_lowpower_config()
672 USART_CTL2(usart_periph) |= (USART_CTL2_IRLP & irlp); in usart_irda_lowpower_config()
685 void usart_hardware_flow_rts_config(uint32_t usart_periph, uint32_t rtsconfig) in usart_hardware_flow_rts_config() argument
689 ctl = USART_CTL2(usart_periph); in usart_hardware_flow_rts_config()
693 USART_CTL2(usart_periph) = ctl; in usart_hardware_flow_rts_config()
706 void usart_hardware_flow_cts_config(uint32_t usart_periph, uint32_t ctsconfig) in usart_hardware_flow_cts_config() argument
710 ctl = USART_CTL2(usart_periph); in usart_hardware_flow_cts_config()
714 USART_CTL2(usart_periph) = ctl; in usart_hardware_flow_cts_config()
727 void usart_dma_receive_config(uint32_t usart_periph, uint32_t dmacmd) in usart_dma_receive_config() argument
731 ctl = USART_CTL2(usart_periph); in usart_dma_receive_config()
735 USART_CTL2(usart_periph) = ctl; in usart_dma_receive_config()
748 void usart_dma_transmit_config(uint32_t usart_periph, uint32_t dmacmd) in usart_dma_transmit_config() argument
752 ctl = USART_CTL2(usart_periph); in usart_dma_transmit_config()
756 USART_CTL2(usart_periph) = ctl; in usart_dma_transmit_config()
780 FlagStatus usart_flag_get(uint32_t usart_periph, usart_flag_enum flag) in usart_flag_get() argument
782 if(RESET != (USART_REG_VAL(usart_periph, flag) & BIT(USART_BIT_POS(flag)))){ in usart_flag_get()
803 void usart_flag_clear(uint32_t usart_periph, usart_flag_enum flag) in usart_flag_clear() argument
805 USART_REG_VAL(usart_periph, flag) &= ~BIT(USART_BIT_POS(flag)); in usart_flag_clear()
826 void usart_interrupt_enable(uint32_t usart_periph, usart_interrupt_enum interrupt) in usart_interrupt_enable() argument
828 USART_REG_VAL(usart_periph, interrupt) |= BIT(USART_BIT_POS(interrupt)); in usart_interrupt_enable()
849 void usart_interrupt_disable(uint32_t usart_periph, usart_interrupt_enum interrupt) in usart_interrupt_disable() argument
851 USART_REG_VAL(usart_periph, interrupt) &= ~BIT(USART_BIT_POS(interrupt)); in usart_interrupt_disable()
875 FlagStatus usart_interrupt_flag_get(uint32_t usart_periph, usart_interrupt_flag_enum int_flag) in usart_interrupt_flag_get() argument
879 intenable = (USART_REG_VAL(usart_periph, int_flag) & BIT(USART_BIT_POS(int_flag))); in usart_interrupt_flag_get()
881 flagstatus = (USART_REG_VAL2(usart_periph, int_flag) & BIT(USART_BIT_POS2(int_flag))); in usart_interrupt_flag_get()
904 void usart_interrupt_flag_clear(uint32_t usart_periph, usart_interrupt_flag_enum int_flag) in usart_interrupt_flag_clear() argument
906 USART_REG_VAL2(usart_periph, int_flag) &= ~BIT(USART_BIT_POS2(int_flag)); in usart_interrupt_flag_clear()