diff options
author | Bdale Garbee <bdale@gag.com> | 2014-05-08 16:09:11 -0600 |
---|---|---|
committer | Bdale Garbee <bdale@gag.com> | 2014-05-08 16:09:11 -0600 |
commit | acaad70e3db8f0b6ae45ca8309833db57bdf5ca2 (patch) | |
tree | 8c3cee1045ba63e310467e40ab15f508eb0840b1 /src/usbrelay-v0.1/ao_serial_lpc.h | |
parent | 2dfc4bc92b11252f17103f28198a702a3fdc2b2d (diff) |
first cut of usbrelay-v0.1 support .. LEDs wiggle, not switching relay yet
Diffstat (limited to 'src/usbrelay-v0.1/ao_serial_lpc.h')
-rw-r--r-- | src/usbrelay-v0.1/ao_serial_lpc.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/usbrelay-v0.1/ao_serial_lpc.h b/src/usbrelay-v0.1/ao_serial_lpc.h new file mode 100644 index 00000000..a95b6af1 --- /dev/null +++ b/src/usbrelay-v0.1/ao_serial_lpc.h @@ -0,0 +1,33 @@ +#define AO_LPC_USARTCLK 12000000 + +static const struct { + uint16_t dl; + uint8_t divaddval; + uint8_t mulval; +} ao_usart_speeds[] = { + [AO_SERIAL_SPEED_4800] = { /* actual = 4800.00 */ + .dl = 125, + .divaddval = 1, + .mulval = 4 + }, + [AO_SERIAL_SPEED_9600] = { /* actual = 9603.07 */ + .dl = 71, + .divaddval = 1, + .mulval = 10 + }, + [AO_SERIAL_SPEED_19200] = { /* actual = 19181.59 */ + .dl = 23, + .divaddval = 7, + .mulval = 10 + }, + [AO_SERIAL_SPEED_57600] = { /* actual = 57692.31 */ + .dl = 7, + .divaddval = 6, + .mulval = 7 + }, + [AO_SERIAL_SPEED_115200] = { /* actual = 115384.6 */ + .dl = 4, + .divaddval = 5, + .mulval = 8 + }, +}; |