誰でも、以下のコードにstatic volatile GPIO_Registers* const gpio[]
という行が何であるか説明できますか?c構造体ポインタを理解する
このブロック内の構文(volatile GPIO_Registers*)
は何をしますか?
// GPIO hardware registers
//
typedef struct
{
uint32_t MODE;
uint32_t TYPE;
uint32_t SPEED;
uint32_t PUSH_PULL;
uint32_t IDR;
uint32_t ODR;
uint32_t BSRR;
uint32_t LOCK;
uint32_t ALT_FN1;
uint32_t ALT_FN2;
} GPIO_Registers;
// Ports can be selected using an enumeration
// (Port) to index into this array.
// Port addresses can be calculated using the enum since
// all ports are at the same offset from each other.
//
static volatile GPIO_Registers* const gpio[] =
{
(volatile GPIO_Registers*)(GPIO_BASE_ADDR + (PORT_A << 10)),
(volatile GPIO_Registers*)(GPIO_BASE_ADDR + (PORT_B << 10)),
(volatile GPIO_Registers*)(GPIO_BASE_ADDR + (PORT_C << 10)),
(volatile GPIO_Registers*)(GPIO_BASE_ADDR + (PORT_D << 10)),
(volatile GPIO_Registers*)(GPIO_BASE_ADDR + (PORT_E << 10)),
(volatile GPIO_Registers*)(GPIO_BASE_ADDR + (PORT_F << 10))
};
あなたは何を考え出しましたか? **特に**あなたのC本で何を理解していないのですか? – Olaf