Jump to content
Sign in to follow this  
GinoP

Change/Editing Energia Library TivaC TM4C1294XL

Recommended Posts

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
 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

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); 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×