diff options
Diffstat (limited to 'nuttx/arch/arm/src/lpc17xx/lpc17_dac.c')
-rw-r--r-- | nuttx/arch/arm/src/lpc17xx/lpc17_dac.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/nuttx/arch/arm/src/lpc17xx/lpc17_dac.c b/nuttx/arch/arm/src/lpc17xx/lpc17_dac.c index 87cc6a717..7c7c31311 100644 --- a/nuttx/arch/arm/src/lpc17xx/lpc17_dac.c +++ b/nuttx/arch/arm/src/lpc17xx/lpc17_dac.c @@ -7,7 +7,7 @@ * * This file is a part of NuttX: * - * Copyright (C) 2010 Gregory Nutt. All rights reserved. + * Copyright (C) 2010, 2014 Gregory Nutt. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -159,7 +159,11 @@ static void dac_txint(FAR struct dac_dev_s *dev, bool enable) static int dac_send(FAR struct dac_dev_s *dev, FAR struct dac_msg_s *msg) { - putreg32((msg->am_data>>16)&0xfffff,LPC17_DAC_CR); + /* adjust the binary value to the lpc1768's register format (plus high + * speed profile in bit 16) + */ + + putreg32(((((msg->am_data) << 6) | 0x10000) & 0xffff), LPC17_DAC_CR); dac_txdone(&g_dacdev); return 0; } |