mirror of https://github.com/ARMmbed/mbed-os.git
parent
b1d999178a
commit
dbcd36f242
|
@ -38,10 +38,10 @@ void analogin_init (analogin_t *obj, PinName pin){
|
|||
|
||||
HAL_ADC_INIT_DAT HalADCInitDataTmp;
|
||||
PHAL_ADC_INIT_DAT pHalADCInitDataTmp = &HalADCInitDataTmp;
|
||||
|
||||
/* To backup user config first */
|
||||
_memcpy(pHalADCInitDataTmp, &(obj->HalADCInitData), sizeof(HAL_ADC_INIT_DAT));
|
||||
|
||||
_memset(&(obj->HalADCInitData), 0, sizeof(HAL_ADC_INIT_DAT));
|
||||
_memcpy(pHalADCInitDataTmp, &(obj->HalADCInitData), sizeof(HAL_ADC_INIT_DAT));
|
||||
_memset(obj, 0x00, sizeof(analogin_t));
|
||||
|
||||
ConfigDebugErr &= (~(_DBG_ADC_|_DBG_GDMA_));
|
||||
|
@ -135,7 +135,7 @@ float analogin_read(analogin_t *obj){
|
|||
uint32_t AnaloginDatMsk = 0xFFFF;
|
||||
uint8_t AnaloginIdx = 0;
|
||||
uint32_t AnalogDat = 0;
|
||||
uint32_t Offset = 0x2C00;
|
||||
uint32_t Offset = 0x2980;//0x2C00;
|
||||
uint32_t AnalogDatFull = 0xAA00;
|
||||
|
||||
PSAL_ADC_MNGT_ADPT pSalADCMngtAdpt = NULL;
|
||||
|
|
|
@ -81,6 +81,7 @@ void analogout_init(dac_t *obj, PinName pin) {
|
|||
|
||||
pHalDacInitData->DACEn = DAC_ENABLE;
|
||||
HalDACEnableRtl8195a(pHalDacInitData);
|
||||
osDelay(10);
|
||||
}
|
||||
|
||||
/** \brief analogout_free:\n
|
||||
|
|
|
@ -45,6 +45,7 @@ void gpio_irq_free(gpio_irq_t *obj)
|
|||
|
||||
void gpio_irq_set(gpio_irq_t *obj, gpio_irq_event event, uint32_t enable)
|
||||
{
|
||||
HAL_GPIO_MaskIrq(&obj->hal_pin);
|
||||
switch((uint32_t)event) {
|
||||
case IRQ_RISE:
|
||||
obj->hal_pin.pin_mode = INT_RISING;
|
||||
|
@ -73,6 +74,12 @@ void gpio_irq_set(gpio_irq_t *obj, gpio_irq_event event, uint32_t enable)
|
|||
HAL_GPIO_Init_8195a(&obj->hal_pin);
|
||||
|
||||
HAL_GPIO_IntCtrl(&obj->hal_pin, enable);
|
||||
if(enable){
|
||||
HAL_GPIO_UnMaskIrq(&obj->hal_pin);
|
||||
}
|
||||
else{
|
||||
HAL_GPIO_MaskIrq(&obj->hal_pin);
|
||||
}
|
||||
}
|
||||
|
||||
void gpio_irq_enable(gpio_irq_t *obj)
|
||||
|
|
|
@ -247,6 +247,7 @@ int i2c_read(i2c_t *obj, int address, char *data, int length, int stop) {
|
|||
u32 InStartCount = 0;
|
||||
pSalI2CMngtAdpt = &(obj->SalI2CMngtAdpt);
|
||||
pSalI2CHND = &(pSalI2CMngtAdpt->pSalHndPriv->SalI2CHndPriv);
|
||||
address = (address & 0xFE ) >>1;
|
||||
|
||||
if (i2c_target_addr[pSalI2CHND->DevNum] != address) {
|
||||
pSalI2CHND->pInitDat->I2CAckAddr = address;
|
||||
|
@ -316,6 +317,7 @@ int i2c_write(i2c_t *obj, int address, const char *data, int length, int stop) {
|
|||
|
||||
pSalI2CMngtAdpt = &(obj->SalI2CMngtAdpt);
|
||||
pSalI2CHND = &(pSalI2CMngtAdpt->pSalHndPriv->SalI2CHndPriv);
|
||||
address = (address & 0xFE ) >>1;
|
||||
|
||||
if (i2c_target_addr[pSalI2CHND->DevNum] != address) {
|
||||
pSalI2CHND->pInitDat->I2CAckAddr = address;
|
||||
|
@ -559,6 +561,7 @@ void i2c_slave_address(i2c_t *obj, int idx, uint32_t address, uint32_t mask) {
|
|||
PSAL_I2C_HND pSalI2CHND = NULL;
|
||||
pSalI2CMngtAdpt = &(obj->SalI2CMngtAdpt);
|
||||
pSalI2CHND = &(pSalI2CMngtAdpt->pSalHndPriv->SalI2CHndPriv);
|
||||
address = (address & 0xFE ) >>1;
|
||||
|
||||
uint16_t i2c_default_addr = (uint16_t) pSalI2CHND->I2CAckAddr;
|
||||
uint16_t i2c_user_addr = (uint16_t) address;
|
||||
|
|
|
@ -103,12 +103,14 @@ enum dot11AuthAlgrthmNum {
|
|||
};
|
||||
|
||||
// Scan type including active and passive scan.
|
||||
typedef enum _RT_SCAN_TYPE
|
||||
enum _RT_SCAN_TYPE
|
||||
{
|
||||
SCAN_PASSIVE,
|
||||
SCAN_ACTIVE,
|
||||
SCAN_MIX,
|
||||
} RT_SCAN_TYPE, *PRT_SCAN_TYPE;
|
||||
};
|
||||
typedef uint32_t RT_SCAN_TYPE;
|
||||
typedef uint32_t *PRT_SCAN_TYPE;
|
||||
|
||||
/*
|
||||
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -44,17 +44,24 @@ typedef struct _HAL_TIMER_OP_ {
|
|||
u32 (*HalGetTimerId)(u32 *TimerId);
|
||||
BOOL (*HalTimerInit)(VOID *Data);
|
||||
u32 (*HalTimerReadCount)(u32 TimerId);
|
||||
VOID (*HalTimerIrqEn)(u32 TimerId);
|
||||
//VOID (*HalTimerIrqEn)(u32 TimerId);
|
||||
VOID (*HalTimerIrqClear)(u32 TimerId);
|
||||
VOID (*HalTimerDis)(u32 TimerId);
|
||||
VOID (*HalTimerEn)(u32 TimerId);
|
||||
VOID (*HalTimerDumpReg)(u32 TimerId);
|
||||
VOID (*HalTimerReLoad)(u32 TimerId, u32 LoadUs);
|
||||
//VOID (*HalTimerReLoad)(u32 TimerId, u32 LoadUs);
|
||||
}HAL_TIMER_OP, *PHAL_TIMER_OP;
|
||||
|
||||
typedef struct _HAL_TIMER_OP_EXT_ {
|
||||
PHAL_TIMER_OP phal_timer_op_rom;
|
||||
VOID (*HalTimerIrqEn)(u32 TimerId);
|
||||
VOID (*HalTimerReLoad)(u32 TimerId, u32 LoadUs);
|
||||
}HAL_TIMER_OP_EXT, *PHAL_TIMER_OP_EXT;
|
||||
|
||||
#ifdef CONFIG_TIMER_MODULE
|
||||
// This variable declared in ROM code
|
||||
extern HAL_TIMER_OP HalTimerOp;
|
||||
extern HAL_TIMER_OP_EXT HalTimerOpExt;
|
||||
#endif
|
||||
|
||||
VOID HalTimerOpInit_Patch(
|
||||
|
|
|
@ -145,6 +145,7 @@ void spi_init (spi_t *obj, PinName mosi, PinName miso, PinName sclk, PinName sse
|
|||
pHalSsiAdaptor->HaveRxChannel = 0;
|
||||
#endif
|
||||
#endif
|
||||
osDelay(1);
|
||||
}
|
||||
|
||||
void spi_free (spi_t *obj)
|
||||
|
|
|
@ -27,6 +27,7 @@ static int us_ticker_inited = 0;
|
|||
static TIMER_ADAPTER TimerAdapter;
|
||||
|
||||
extern HAL_TIMER_OP HalTimerOp;
|
||||
extern HAL_TIMER_OP_EXT HalTimerOpExt;
|
||||
|
||||
VOID _us_ticker_irq_handler(IN VOID *Data)
|
||||
{
|
||||
|
@ -126,8 +127,8 @@ void us_ticker_set_interrupt(timestamp_t timestamp)
|
|||
time_def = TIMER_TICK_US; // at least 1 tick
|
||||
}
|
||||
HalTimerOp.HalTimerDis((u32)TimerAdapter.TimerId);
|
||||
HalTimerOp.HalTimerReLoad((u32)TimerAdapter.TimerId, time_def);
|
||||
HalTimerOp.HalTimerIrqEn((u32)TimerAdapter.TimerId);
|
||||
HalTimerOpExt.HalTimerReLoad((u32)TimerAdapter.TimerId, time_def);
|
||||
HalTimerOpExt.HalTimerIrqEn((u32)TimerAdapter.TimerId);
|
||||
HalTimerOp.HalTimerEn((u32)TimerAdapter.TimerId);
|
||||
//printf("us_ticker_set_interrupt %d\r\n",timestamp);
|
||||
|
||||
|
|
Loading…
Reference in New Issue