1/* 2 * Copyright 2017, Data61 3 * Commonwealth Scientific and Industrial Research Organisation (CSIRO) 4 * ABN 41 687 119 230. 5 * 6 * This software may be distributed and modified according to the terms of 7 * the BSD 2-Clause license. Note that NO WARRANTY is provided. 8 * See "LICENSE_BSD2.txt" for details. 9 * 10 * @TAG(DATA61_BSD) 11 */ 12 13#pragma once 14 15#include <stdint.h> 16#include <platsupport/io.h> 17 18/* Initializes the XADC 19 * Returns 0 on success, -1 on error 20 */ 21int xadc_init(ps_io_ops_t* ops); 22 23/* Returns the contents of an XADC register. 24 * Only the least significant 6 bits of the 25 * address are used (as they define the range 26 * of valid addresses). 27 */ 28uint32_t xadc_read_register(uint32_t address); 29 30/* XADC Addresses */ 31#define XADC_ADDRESS_TEMPERATURE 0x00 32 33