Ai-Thinker-Open / GPRS_C_SDK

Ai-Thinker A9/A9G GPRS (with GPS(A9G)) module C development SDK
https://ai-thinker-open.github.io/GPRS_C_SDK_DOC
MIT License
447 stars 233 forks source link

GPIO in A9G #448

Open shmusb1999 opened 4 years ago

shmusb1999 commented 4 years ago

Hi I'm working on A9G. I have two questions:

  1. after activating all the IO pins, I see that the voltage of all IO pins are 2.8V while we expect IO8~IO24 have to be 1.9V! why does this happen?

  2. I don't understand the functions of OS_SetUserMainHandle and OS_CreateTask completely. why OS_SetUserMainHandle should not be used after OS_CreateTask sometimes?

ZakKemble commented 4 years ago
  1. The docs do say that IO8 - 24 are 1.9V, but it's wrong, all pins are 2.8V.
  2. OS_SetUserMainHandle() sets the task that receives system events, like API_EVENT_ID_POWER_ON and API_EVENT_ID_SIGNAL_QUALITY. https://ai-thinker-open.github.io/GPRS_C_SDK_DOC/en/c-sdk/function-api/os.html#ossetusermainhandle
shmusb1999 commented 3 years ago
  1. The docs do say that IO8 - 24 are 1.9V, but it's wrong, all pins are 2.8V.
  2. OS_SetUserMainHandle() sets the task that receives system events, like API_EVENT_ID_POWER_ON and API_EVENT_ID_SIGNAL_QUALITY. https://ai-thinker-open.github.io/GPRS_C_SDK_DOC/en/c-sdk/function-api/os.html#ossetusermainhandle

Thanks so much

I had studied the link you send before but I steel cannot understand. In some codes, there is OS_SetUserMainHandle() once and OS_CreateTask() more than once. why does this happen?

ZakKemble commented 3 years ago

There can be multiple tasks running at the same time (from OS_CreateTask(), kind of like a thread), but only one of those tasks can be the main task.