Andy's Workshop Forums

General Category => stm32plus C++ library => Topic started by: pratipm on January 31, 2015, 01:38:05 pm

Title: How to set USART parameters outside of its constructor
Post by: pratipm on January 31, 2015, 01:38:05 pm
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