8 years, 5 months ago.

How do we initialise an interrupt at the end of transmission from a serial port ?

Good afternoon guys,

finding the correct syntax for each function is difficult. by far it is the problem.

anyway,

I am currently using Serial.h it is all running well buffering under interrupts etc, but now I have this issue,

Please let me know how to enable the ' end of transmission ' interrupt from a serial port.

do we use the event callback ? what structure and syntax do we need ?

where is the example usage for this ?

int write (const uint16_t *buffer, int length, const event_callback_t &callback, int event=SERIAL_EVENT_TX_COMPLETE)

1 Answer

8 years, 5 months ago.

Nowhere: Those functions are only supported by a few Gecko devices. Their main goal seems to be to polute the documentation. So simply put: It does not work on your device.

You can simply enable a TX interrupt, but that fires after every character sent. Why exactly do you need this interrupt?

Hi, I am trying to disable the RS485 drive with an I/O pin from the interrupt. I am using the STM32F processors, I cannot find anything on the RTS/DE pin firmware / functionality or implementation :(

I dont understand this stuff... this is from the Standard Peripheral Library, (is this used in MBED?)

void USART_DECmd(USART_TypeDef* USARTx, FunctionalState NewState); void USART_DEPolarityConfig(USART_TypeDef* USARTx, uint32_t USART_DEPolarity); void USART_SetDEAssertionTime(USART_TypeDef* USARTx, uint32_t USART_DEAssertionTime); void USART_SetDEDeassertionTime(USART_TypeDef* USARTx, uint32_t USART_DEDeassertionTime); ??? not sure which way is best for MBed

posted by Nick Marsh 28 Oct 2015

Where can I see if my device supports those functions?

posted by Tolga Aras 12 Nov 2015

You can use those functions within mbed yes, but they are from the ST driver lib, they are included, and they are (partially) used to make the mbed functions work, but they are not the mbed functions themselves. You can also directly use register access.

To see what your device supports, I made an automatically generated table which can help (you can also work through the source code, but this was done by a script to generate the table): https://developer.mbed.org/forum/news-announcements/topic/16604/ (Functions which are not listed, like Serial, SPI, etc, are not listed because every device implements them).

posted by Erik - 12 Nov 2015