Hello,
I want to send and receive hex bytes over Serial. I guess chIOPut sends uint8_t. Can anyone help me with this? Is there any way other than chIOPut and chIOGet to send and receive data in hex bytes?
I am using STM32F4 discovery board with ChibiOS 2.4.3
Hex bytes over Serial STM32f4 Discovery
Moderators: RoccoMarco, barthess
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: Hex bytes over Serial STM32f4 Discovery
I assume that for "hex bytes" you mean sending bytes as two ASCII characters, you can use chprintf() for that. Remember it is just ASCII data, handle it as such.
Giovanni
Giovanni
Re: Hex bytes over Serial STM32f4 Discovery
I dont want to deal with data in ascii. I want to send and receive data as single hex byte. for example I want to send only 0xC1 and receive 0xC1 as a hex byte.
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: Hex bytes over Serial STM32f4 Discovery
Bytes are bytes, there are not decimal bytes or hexadecimal bytes. Any function exchanging uin8_t data exchanges bytes.
Giovanni
Giovanni
Who is online
Users browsing this forum: No registered users and 15 guests