• Welcome to Andy's Workshop Forums. Please login or sign up.
 

How to set USART parameters outside of its constructor

Started by pratipm, January 31, 2015, 01:38:05 pm

Previous topic - Next topic

pratipm

I am struggling to grasp this whole new concept of variadic templates etc. and can't figure out how do I define a USART device as a class variable where the usart parameters are set out side the constructor of the usart. Something like this:

class MyClass {
public:
    Usart1<> usart1;

    void setBaudRate(int rate) { /* Set the baudrate of usart1 */ }

    void run() {
   
        setBaurate(9600);
    .....
    }
};

Any pointers?
Thanks.

-Pratip