memory elite
This commit is contained in:
+2
@@ -53,3 +53,5 @@ static void I2Cinit(){
|
||||
// PIN_setOutputValue(pin_handle,Board_GLED,1);
|
||||
// }
|
||||
}
|
||||
|
||||
#endif // ELITE_I2C
|
||||
|
||||
+45
-9
@@ -1,8 +1,42 @@
|
||||
|
||||
static void LED_spi_init();
|
||||
#ifndef ELITE_SPI
|
||||
#define ELITE_SPI
|
||||
|
||||
#include <ti/drivers/SPI.h>
|
||||
|
||||
/* system use SPI parameters */
|
||||
static SPI_Handle spiHandle0 = NULL; // SPI0 is for ADC and DAC
|
||||
static SPI_Handle spiHandle1 = NULL; // SPI1 is for LED
|
||||
static SPI_Params spiParams0;
|
||||
static SPI_Params spiParams1;
|
||||
static SPI_Transaction ADC_DAC_transaction;
|
||||
static SPI_Transaction LED_transaction;
|
||||
|
||||
|
||||
static void LED_spi_init() {
|
||||
|
||||
static void Elite_SPI_init(){
|
||||
ADC_DAC_SPI_init();
|
||||
LED_SPI_init();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
static void ADC_DAC_SPI_init() {
|
||||
SPI_init();
|
||||
|
||||
SPI_Params_init(&spiParams0);
|
||||
spiParams0.bitRate = 1200000; // 1.2M
|
||||
spiParams0.mode = SPI_MASTER;
|
||||
spiParams0.dataSize = 8;
|
||||
spiParams0.frameFormat = SPI_POL0_PHA0;
|
||||
|
||||
spiHandle0 = SPI_open(Board_SPI0, &spiParams0); // ADC and DAC
|
||||
SPI_mode = SPI_DAC;
|
||||
|
||||
}
|
||||
|
||||
static void LED_SPI_init() {
|
||||
SPI_init();
|
||||
|
||||
SPI_Params_init(&spiParams1);
|
||||
@@ -14,18 +48,20 @@ static void LED_spi_init() {
|
||||
spiHandle1 = SPI_open(Board_SPI1, &spiParams1); // LED SPI
|
||||
}
|
||||
|
||||
static void ZM_spi_transaction(uint8_t length, uint8_t *spi_txbuf, uint8_t *spi_rxbuf) {
|
||||
ZM_transaction.count = length;
|
||||
ZM_transaction.txBuf = spi_txbuf;
|
||||
ZM_transaction.rxBuf = spi_rxbuf;
|
||||
static void ADC_DAC_SPI(uint8_t length, uint8_t *spi_txbuf, uint8_t *spi_rxbuf) {
|
||||
ADC_DAC_transaction.count = length;
|
||||
ADC_DAC_transaction.txBuf = spi_txbuf;
|
||||
ADC_DAC_transaction.rxBuf = spi_rxbuf;
|
||||
|
||||
SPI_transfer(spiHandle0, &ZM_transaction);
|
||||
SPI_transfer(spiHandle0, &ADC_DAC_transaction);
|
||||
}
|
||||
|
||||
static void LED_ADC_SPI(uint8_t length, uint16_t *spi_txbuf, uint16_t *spi_rxbuf) {
|
||||
static void LED_SPI(uint8_t length, uint16_t *spi_txbuf, uint16_t *spi_rxbuf) {
|
||||
LED_transaction.count = length;
|
||||
LED_transaction.txBuf = spi_txbuf;
|
||||
LED_transaction.rxBuf = spi_rxbuf;
|
||||
|
||||
SPI_transfer(spiHandle1, &LED_transaction);
|
||||
}
|
||||
}
|
||||
|
||||
#endif // ELITE_SPI
|
||||
+1
@@ -391,6 +391,7 @@ characteristic change event
|
||||
#include <ti/sysbios/knl/Queue.h>
|
||||
#include <EliteI2C.h>
|
||||
|
||||
|
||||
#ifdef USE_ICALL
|
||||
#include <icall.h>
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user