GinoP 0 Posted April 29, 2019 Share Posted April 29, 2019 Hello everyone! I need editing Energia Library for more flexebility. For example, the msp430 launchpad only have one UART available if i use Energia. How can i configure other UARTs? I need at least 3 UART and I know that TivaCTM4C1294XL have 4 UARTs. Also I need an option for add a parity bit for serial communication. Thank you so much! Gino Quote Link to post Share on other sites
LiviuM 43 Posted April 29, 2019 Share Posted April 29, 2019 Hi Gino, try Serial2, Serial3... for the further serial ports (see energia/hardware/tivac/1.0.3/cores/tivac/HardwareSerial.h && .cpp files for details): extern HardwareSerial Serial; extern HardwareSerial Serial1; extern HardwareSerial Serial2; extern HardwareSerial Serial3; extern HardwareSerial Serial4; extern HardwareSerial Serial5; extern HardwareSerial Serial6; extern HardwareSerial Serial7; For parity I have no idea if it works, but in the energia/hardware/tivac/1.0.3/system/driverlib/uart.h && .c files there are some functions handling the parity: extern void UARTParityModeSet(uint32_t ui32Base, uint32_t ui32Parity); extern uint32_t UARTParityModeGet(uint32_t ui32Base); Best regards, Liviu Quote Link to post Share on other sites
GinoP 0 Posted May 3, 2019 Author Share Posted May 3, 2019 On 4/29/2019 at 8:06 PM, LiviuM said: Hi Gino, try Serial2, Serial3... for the further serial ports (see energia/hardware/tivac/1.0.3/cores/tivac/HardwareSerial.h && .cpp files for details): extern HardwareSerial Serial; extern HardwareSerial Serial1; extern HardwareSerial Serial2; extern HardwareSerial Serial3; extern HardwareSerial Serial4; extern HardwareSerial Serial5; extern HardwareSerial Serial6; extern HardwareSerial Serial7; For parity I have no idea if it works, but in the energia/hardware/tivac/1.0.3/system/driverlib/uart.h && .c files there are some functions handling the parity: extern void UARTParityModeSet(uint32_t ui32Base, uint32_t ui32Parity); extern uint32_t UARTParityModeGet(uint32_t ui32Base); Best regards, Liviu Thanks for reply, How can use it ? Sorry but i am new in this thing Quote Link to post Share on other sites
LiviuM 43 Posted May 10, 2019 Share Posted May 10, 2019 As I said, I haven't use them. Have a look in the (4) mentioned files at the comments to the functions. I suppose you should have something like following in your code: uint32_t readParity0 = UARTParityModeGet(UART0_BASE); // until uint32_t readParity7 = UARTParityModeGet(UART7_BASE); UARTParityModeSet(UART0_BASE, UART_CONFIG_PAR_NONE); //or UARTParityModeSet(UART0_BASE, UART_CONFIG_PAR_EVEN); //or UARTParityModeSet(UART0_BASE, UART_CONFIG_PAR_ODD); Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.