mirror of
https://github.com/pvvx/RTL00MP3.git
synced 2025-07-31 12:41:06 +00:00
update
This commit is contained in:
parent
8c8b03208e
commit
8e26e8ec8d
24 changed files with 2592 additions and 2483 deletions
|
|
@ -67,7 +67,7 @@ void serial_break_clear(serial_t *obj);
|
|||
|
||||
void serial_pinout_tx(PinName tx);
|
||||
|
||||
void serial_set_flow_control(serial_t *obj, FlowControl type, PinName rxflow, PinName txflow);
|
||||
void serial_set_flow_control(serial_t *obj, FlowControl type); // , PinName rxflow, PinName txflow);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ int flash_set_extend_addr (flash_t * obj, uint32_t data);
|
|||
int flash_get_extend_addr (flash_t * obj);
|
||||
unsigned int flash_get_size (flash_t *obj);
|
||||
int flash_otp_read (flash_t *obj, uint32_t address, uint32_t Length, uint8_t * data);
|
||||
unsigned int flash_read_id (flash_t *obj);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
|
|
@ -589,6 +589,27 @@ unsigned int flash_get_size(flash_t *obj) {
|
|||
return flashchip_size;
|
||||
}
|
||||
|
||||
unsigned int flash_read_id(flash_t *obj)
|
||||
{
|
||||
flash_turnon();
|
||||
/* Disable SPI_FLASH User Mode */
|
||||
HAL_SPI_WRITE32(REG_SPIC_SSIENR, 0);
|
||||
|
||||
/* Set Ctrlr1; 1 byte data frames */
|
||||
HAL_SPI_WRITE32(REG_SPIC_CTRLR1, BIT_NDF(3));
|
||||
|
||||
/* Send flash RX command and read the data */
|
||||
SpicRxCmdRefinedRtl8195A(FLASH_CMD_RDID, obj->SpicInitPara);
|
||||
unsigned int ret = HAL_SPI_READ32(REG_SPIC_DR0);
|
||||
|
||||
/* Disable SPI_FLASH User Mode */
|
||||
HAL_SPI_WRITE32(REG_SPIC_SSIENR, 0);
|
||||
|
||||
SpicDisableRtl8195A();
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Read Flash OTP data
|
||||
*/
|
||||
|
|
@ -604,6 +625,7 @@ int flash_otp_read(flash_t *obj, uint32_t address, uint32_t Length,
|
|||
switch (flashobj.SpicInitPara.flashtype) {
|
||||
case FLASH_MXIC_4IO:
|
||||
case FLASH_MXIC: // Only 512 bits
|
||||
case FLASH_OTHERS:
|
||||
#if CONFIG_DEBUG_LOG > 4
|
||||
DBG_SPIF_INFO("MXIC: Only 512 bits!\n");
|
||||
#endif
|
||||
|
|
@ -629,9 +651,10 @@ int flash_otp_read(flash_t *obj, uint32_t address, uint32_t Length,
|
|||
ret = 0;
|
||||
break;
|
||||
default:
|
||||
DBG_8195A("Flash type?");
|
||||
DBG_8195A("Flash type [%06x]?\n", flash_read_id(&flashobj));
|
||||
ret = 0;
|
||||
}
|
||||
SpicDisableRtl8195A();
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -438,7 +438,7 @@ void serial_recv_comp_handler(serial_t *obj, void *handler, uint32_t id)
|
|||
pHalRuartAdapter->RxCompCbPara = (void*)id;
|
||||
}
|
||||
|
||||
void serial_set_flow_control(serial_t *obj, FlowControl type, PinName rxflow, PinName txflow)
|
||||
void serial_set_flow_control(serial_t *obj, FlowControl type) // , PinName rxflow, PinName txflow)
|
||||
{
|
||||
PHAL_RUART_ADAPTER pHalRuartAdapter;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue