Files
OpenCellular/firmware/ec/inc/common/spibus.h
swateeshrivastava 46c03244de Alert code for FW
2019-03-13 15:59:11 +05:30

41 lines
1.5 KiB
C

/**
* Copyright (c) 2017-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#ifndef INC_COMMON_SPIBUS_H_
#define INC_COMMON_SPIBUS_H_
/*****************************************************************************
* HEADER FILES
*****************************************************************************/
#include "drivers/OcGpio.h"
#include "inc/common/global_header.h"
#include <stdint.h>
#include <stdbool.h>
#include <ti/drivers/SPI.h>
#include <ti/sysbios/gates/GateMutex.h>
typedef struct SPI_Dev {
unsigned int bus;
OcGpio_Pin *chip_select;
} SPI_Dev;
/*****************************************************************************
* FUNCTION DECLARATIONS
*****************************************************************************/
SPI_Handle spi_get_handle(uint32_t index);
ReturnStatus spi_reg_read(SPI_Handle spiHandle, OcGpio_Pin *chip_select,
void *regAddress, uint8_t *data, uint32_t data_size,
uint32_t byte, uint8_t numofBytes);
ReturnStatus spi_reg_write(SPI_Handle spiHandle, OcGpio_Pin *chip_select,
void *regAddress, uint8_t *data, uint32_t data_size,
uint32_t byte, uint8_t numofBytes);
#endif /* INC_COMMON_SPIBUS_H_ */