X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=drv%2Ftc520.c;h=615a94e08f3c88c818b26b75a394f9cc857493ad;hb=faf2f6bfd5933ff75e6cc01e3d48f9277f731d8f;hp=16df61589ba873cd3ff2ff348548c0a73afbd613;hpb=d4f65018d471c77efa674bf30d5b5938fe6ca3a3;p=bertos.git diff --git a/drv/tc520.c b/drv/tc520.c old mode 100755 new mode 100644 index 16df6158..615a94e0 --- a/drv/tc520.c +++ b/drv/tc520.c @@ -1,6 +1,31 @@ /** * \file * * @@ -19,7 +44,6 @@ #include #include -#include #include #include @@ -31,10 +55,14 @@ static Serial *spi_ser; /** * Start an AD conversion and return result. + * * To start a conversion first we must pull down CE pin. * The ADC starts a convertion and keeps the DV pin high until the end. * At this point, we can read the conversion value by SPI. * The convertion result is yield in 3 bytes. + * + * \verbatim + * * First byte: * bit | Value * ----|------- @@ -51,8 +79,10 @@ static Serial *spi_ser; * 6 | data bit 0 * 5:0 | '0' * + * \endverbatim + * * So, to get the result we must shift and recompose the bits. - * \Note Ovverrange bit is handled as the 17th data bit. + * \note Overrange bit is handled as the 17th data bit. */ tc520_data_t tc520_read(void) {