Skip to content

HardwareSerial: add other configs than 8N1 #117

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 25, 2015
Merged

Conversation

thomasfla
Copy link
Contributor

the register configurations has been computed like this:

#include <stdio.h>
int main(int argc, char **argv)
{
    char t[24][4]={"5N1","6N1","7N1","8N1","5N2","6N2","7N2","8N2","5E1","6E1","7E1","8E1","5E2","6E2","7E2","8E2","5O1","6O1","7O1","8O1","5O2","6O2","7O2","8O2"};
    char c;
    int i;
    for (i=0;i<24;i++)
    {
        c=0;
        if (t[i][0]=='5') c+=0<<2;
        if (t[i][0]=='6') c+=1<<2;
        if (t[i][0]=='7') c+=2<<2;
        if (t[i][0]=='8') c+=3<<2;

        if (t[i][1]=='E') c+=2<<0;
        if (t[i][1]=='O') c+=3<<0;
        if (t[i][1]=='N') c+=0<<0;

        if (t[i][2]=='1') c+=1<<4;
        if (t[i][2]=='2') c+=3<<4;

        printf("#define SERIAL_%s 0x%x\n", t[i],c);
    }
    return 0;
}

igrr added a commit that referenced this pull request Apr 25, 2015
HardwareSerial: add other configs than 8N1
@igrr igrr merged commit 9cca8e8 into esp8266:esp8266 Apr 25, 2015
igrr added a commit that referenced this pull request Oct 29, 2015
HardwareSerial: add other configs than 8N1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants