изменился чипселект на новой схеме
This commit is contained in:
parent
65f17dc051
commit
1e0ea8d2cc
@ -28,27 +28,27 @@
|
||||
void Bl25cm1a_en(void)
|
||||
{
|
||||
volatile uint16_t empty;
|
||||
Gpio15outSPI_CS_BL25CM1A(0);
|
||||
Gpio_SPI_CS_BL25CM1A(0);
|
||||
transmitData(WREN);
|
||||
while(SpiRegs.SPIFFRX.bit.RXFFST != 1)
|
||||
{
|
||||
|
||||
}
|
||||
Gpio15outSPI_CS_BL25CM1A(1);
|
||||
Gpio_SPI_CS_BL25CM1A(1);
|
||||
empty = SpiRegs.SPIRXBUF;
|
||||
}
|
||||
|
||||
uint16_t Bl25cm1a_ReadStatus(void)
|
||||
{
|
||||
volatile uint16_t empty;
|
||||
Gpio15outSPI_CS_BL25CM1A(0);
|
||||
Gpio_SPI_CS_BL25CM1A(0);
|
||||
transmitData(RDSR);
|
||||
transmitData(0xFF);
|
||||
while(SpiRegs.SPIFFRX.bit.RXFFST != 2)
|
||||
{
|
||||
|
||||
}
|
||||
Gpio15outSPI_CS_BL25CM1A(1);
|
||||
Gpio_SPI_CS_BL25CM1A(1);
|
||||
empty = SpiRegs.SPIRXBUF;
|
||||
empty = SpiRegs.SPIRXBUF;
|
||||
return empty;
|
||||
@ -64,7 +64,7 @@ void Bl25cm1a_read_8_bytes(uint32_t Addr, uint16_t * read_data, uint16_t num_byt
|
||||
{
|
||||
Stat = Bl25cm1a_ReadStatus();
|
||||
}
|
||||
Gpio15outSPI_CS_BL25CM1A(0);
|
||||
Gpio_SPI_CS_BL25CM1A(0);
|
||||
transmitData(READ);
|
||||
transmitData(Addr>>16);
|
||||
transmitData(Addr>>8);
|
||||
@ -74,7 +74,7 @@ void Bl25cm1a_read_8_bytes(uint32_t Addr, uint16_t * read_data, uint16_t num_byt
|
||||
{
|
||||
|
||||
}
|
||||
Gpio15outSPI_CS_BL25CM1A(1);
|
||||
Gpio_SPI_CS_BL25CM1A(1);
|
||||
empty = SpiRegs.SPIRXBUF;
|
||||
empty = SpiRegs.SPIRXBUF;
|
||||
empty = SpiRegs.SPIRXBUF;
|
||||
@ -97,7 +97,7 @@ void Bl25cm1a_write_8_bytes(uint32_t Addr, uint16_t * write_data, uint16_t num_b
|
||||
}
|
||||
|
||||
Bl25cm1a_en();
|
||||
Gpio15outSPI_CS_BL25CM1A(0);
|
||||
Gpio_SPI_CS_BL25CM1A(0);
|
||||
transmitData(WRITE);
|
||||
transmitData(Addr>>16);
|
||||
transmitData(Addr>>8);
|
||||
@ -107,7 +107,7 @@ void Bl25cm1a_write_8_bytes(uint32_t Addr, uint16_t * write_data, uint16_t num_b
|
||||
{
|
||||
|
||||
}
|
||||
Gpio15outSPI_CS_BL25CM1A(1);
|
||||
Gpio_SPI_CS_BL25CM1A(1);
|
||||
empty = SpiRegs.SPIRXBUF;
|
||||
empty = SpiRegs.SPIRXBUF;
|
||||
empty = SpiRegs.SPIRXBUF;
|
||||
@ -129,7 +129,7 @@ uint16_t Bl25cm1a_verify_8_bytes(uint32_t Addr, uint16_t * verify_data, uint16_
|
||||
{
|
||||
Stat = Bl25cm1a_ReadStatus();
|
||||
}
|
||||
Gpio15outSPI_CS_BL25CM1A(0);
|
||||
Gpio_SPI_CS_BL25CM1A(0);
|
||||
transmitData(READ);
|
||||
transmitData(Addr>>16);
|
||||
transmitData(Addr>>8);
|
||||
@ -139,7 +139,7 @@ uint16_t Bl25cm1a_verify_8_bytes(uint32_t Addr, uint16_t * verify_data, uint16_
|
||||
{
|
||||
|
||||
}
|
||||
Gpio15outSPI_CS_BL25CM1A(1);
|
||||
Gpio_SPI_CS_BL25CM1A(1);
|
||||
empty = SpiRegs.SPIRXBUF;
|
||||
empty = SpiRegs.SPIRXBUF;
|
||||
empty = SpiRegs.SPIRXBUF;
|
||||
|
||||
@ -252,7 +252,7 @@ void getMessage_from_Cm_GD25Q16E(void)
|
||||
if((InAddr+InData) > (GD25Q16E_SIZE*2)) {IPC_sendCommand(IPC_CPU1_L_CM_R, WRONG_ADDR, GD25Q16E_16M_bit_SPI, 0, 0); return;}
|
||||
IPC_sendCommand(IPC_CPU1_L_CM_R, COMMAND_ACCEPTED, GD25Q16E_16M_bit_SPI, 0, 0);
|
||||
|
||||
Gpio15outSPI_CS_BL25CM1A(1);
|
||||
Gpio_SPI_CS_BL25CM1A(1);
|
||||
spi_TurnOnCS1_GD25Q16E();
|
||||
|
||||
switch(InCommand >> 16)
|
||||
|
||||
@ -7,6 +7,12 @@
|
||||
|
||||
#include "f28x_project.h"
|
||||
|
||||
#define SPI_PROGRAM_CS_GPAMUX1 GpioCtrlRegs.GPDMUX1.bit.GPIO98
|
||||
#define SPI_PROGRAM_CS_GPAGMUX1 GpioCtrlRegs.GPDGMUX1.bit.GPIO98
|
||||
#define SPI_PROGRAM_CS_GPADIR GpioCtrlRegs.GPDDIR.bit.GPIO98
|
||||
#define SPI_PROGRAM_CS_GPADAT GpioDataRegs.GPDDAT.bit.GPIO98
|
||||
|
||||
|
||||
__interrupt void spia_rx_isr(void);
|
||||
__interrupt void spia_tx_isr(void);
|
||||
|
||||
@ -113,10 +119,10 @@ void SpiAGpioInit(void)
|
||||
GpioCtrlRegs.GPBMUX1.bit.GPIO35 = 3; // Configure GPIO35 as SPISTEA
|
||||
|
||||
|
||||
GpioCtrlRegs.GPAMUX1.bit.GPIO15 = 0;//program CS for BL25CM1A
|
||||
GpioCtrlRegs.GPAGMUX1.bit.GPIO15 = 0;
|
||||
GpioCtrlRegs.GPADIR.bit.GPIO15 = 1;
|
||||
GpioDataRegs.GPADAT.bit.GPIO15 = 0;
|
||||
SPI_PROGRAM_CS_GPAMUX1 = 0;//program CS for BL25CM1A
|
||||
SPI_PROGRAM_CS_GPAGMUX1 = 0;
|
||||
SPI_PROGRAM_CS_GPADIR = 1;
|
||||
SPI_PROGRAM_CS_GPADAT = 0;
|
||||
|
||||
EDIS;
|
||||
}
|
||||
@ -137,10 +143,10 @@ void spi_TurnOffCS1_GD25Q16E(void)
|
||||
EDIS;
|
||||
}
|
||||
|
||||
void Gpio15outSPI_CS_BL25CM1A(uint16_t out_bit)
|
||||
void Gpio_SPI_CS_BL25CM1A(uint16_t out_bit)
|
||||
{
|
||||
EALLOW;
|
||||
GpioDataRegs.GPADAT.bit.GPIO15 = out_bit;
|
||||
SPI_PROGRAM_CS_GPADAT = out_bit;
|
||||
EDIS;
|
||||
}
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@ void SpiBGpioInit(void);
|
||||
void SpiBInit(void);
|
||||
void transmitBData(uint16_t a);
|
||||
|
||||
void Gpio15outSPI_CS_BL25CM1A(uint16_t out_bit);
|
||||
void Gpio_SPI_CS_BL25CM1A(uint16_t out_bit);
|
||||
void spi_TurnOnCS1_GD25Q16E(void);
|
||||
void spi_TurnOffCS1_GD25Q16E(void);
|
||||
|
||||
|
||||
@ -63,7 +63,7 @@ void InitPerif(void)
|
||||
//
|
||||
#ifdef CPU1
|
||||
GpioInit();
|
||||
Gpio15outSPI_CS_BL25CM1A(1);
|
||||
Gpio_SPI_CS_BL25CM1A(1);
|
||||
SpiInit();
|
||||
I2CMasterInit(I2C_OWN_ADDRESS,I2C_SLAVE_ADDRESS);
|
||||
#endif
|
||||
|
||||
Binary file not shown.
@ -1,6 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<launchConfiguration type="com.ti.ccstudio.debug.launchType.device.debugging">
|
||||
<stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_DEBUGGER_PROPERTIES.TMS320F28388D.ccxml.Texas Instruments XDS100v2 USB Debug Probe_0/Cortex_M4_0" value="<?xml version="1.0" encoding="UTF-8" standalone="no" ?> <PropertyValues> <property id="ConnectOnStartup"> <curValue>1</curValue> </property> <property id="EnableInstalledBreakpoint"> <curValue>1</curValue> </property> <property id="IgnoreSoftLaunchFailures"> <curValue>0</curValue> </property> </PropertyValues> "/>
|
||||
<setAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_HIDE_CONFIG_ELEMENT_TYPES">
|
||||
<setEntry value="BOARD"/>
|
||||
<setEntry value="BYPASSED_CPU"/>
|
||||
<setEntry value="BYPASSED_ROUTER"/>
|
||||
<setEntry value="CONNECTION"/>
|
||||
<setEntry value="DEVICE"/>
|
||||
<setEntry value="NON_DEBUG_CPU"/>
|
||||
<setEntry value="NO_DRIVER"/>
|
||||
<setEntry value="ROUTER"/>
|
||||
<setEntry value="SUBPATH"/>
|
||||
<setEntry value="SYSTEM"/>
|
||||
</setAttribute>
|
||||
<stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_PROGRAM.TMS320F28388D.ccxml.Texas Instruments XDS100v2 USB Debug Probe_0/Cortex_M4_0" value="${build_artifact:ipc_ex2_msgqueue_cm}"/>
|
||||
<stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_PROJECT.TMS320F28388D.ccxml.Texas Instruments XDS100v2 USB Debug Probe_0/Cortex_M4_0" value="ipc_ex2_msgqueue_cm"/>
|
||||
<stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_TARGET_CONFIG" value="${target_config_active_default:ipc_ex2_msgqueue_cm}"/>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user