Jump to content
43oh

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
 

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

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

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...